@@ -638,14 +638,6 @@ function ControlViewContent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
toast({
|
|
||||||
title: "Task updated",
|
|
||||||
description: `Task has been ${
|
|
||||||
newState === "DONE" ? "completed" : "reopened"
|
|
||||||
}.`,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Update the selected task state if it's the current task
|
|
||||||
if (selectedTask && selectedTask.id === taskId) {
|
if (selectedTask && selectedTask.id === taskId) {
|
||||||
setSelectedTask({
|
setSelectedTask({
|
||||||
...selectedTask,
|
...selectedTask,
|
||||||
@@ -797,11 +789,6 @@ function ControlViewContent({
|
|||||||
"input.file": file,
|
"input.file": file,
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
toast({
|
|
||||||
title: "Document added",
|
|
||||||
description: "Document evidence has been added successfully.",
|
|
||||||
variant: "default",
|
|
||||||
});
|
|
||||||
setTaskForEvidence(null);
|
setTaskForEvidence(null);
|
||||||
// Reset the file input
|
// Reset the file input
|
||||||
if (hiddenFileInputRef.current) {
|
if (hiddenFileInputRef.current) {
|
||||||
@@ -843,13 +830,6 @@ function ControlViewContent({
|
|||||||
// Description is now optional for link evidence
|
// Description is now optional for link evidence
|
||||||
// Remove the validation check for empty description
|
// Remove the validation check for empty description
|
||||||
|
|
||||||
// Show toast for add started
|
|
||||||
toast({
|
|
||||||
title: "Adding link evidence",
|
|
||||||
description: `Adding ${linkEvidenceName}...`,
|
|
||||||
variant: "default",
|
|
||||||
});
|
|
||||||
|
|
||||||
// Get the evidence connection ID for this task
|
// Get the evidence connection ID for this task
|
||||||
const evidenceConnectionId = getEvidenceConnectionId(taskForEvidence.id);
|
const evidenceConnectionId = getEvidenceConnectionId(taskForEvidence.id);
|
||||||
|
|
||||||
@@ -870,11 +850,6 @@ function ControlViewContent({
|
|||||||
connections: evidenceConnectionId ? [evidenceConnectionId] : [],
|
connections: evidenceConnectionId ? [evidenceConnectionId] : [],
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
toast({
|
|
||||||
title: "Link evidence added",
|
|
||||||
description: "Link evidence has been added successfully.",
|
|
||||||
variant: "default",
|
|
||||||
});
|
|
||||||
setTaskForEvidence(null);
|
setTaskForEvidence(null);
|
||||||
setEvidenceDialogOpen(false);
|
setEvidenceDialogOpen(false);
|
||||||
// Reset form fields
|
// Reset form fields
|
||||||
@@ -1070,10 +1045,6 @@ function ControlViewContent({
|
|||||||
connections: evidenceConnectionId ? [evidenceConnectionId] : [],
|
connections: evidenceConnectionId ? [evidenceConnectionId] : [],
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
toast({
|
|
||||||
title: "Evidence deleted",
|
|
||||||
description: "Evidence has been deleted successfully.",
|
|
||||||
});
|
|
||||||
setIsDeleteEvidenceOpen(false);
|
setIsDeleteEvidenceOpen(false);
|
||||||
setEvidenceToDelete(null);
|
setEvidenceToDelete(null);
|
||||||
},
|
},
|
||||||
@@ -1097,11 +1068,6 @@ function ControlViewContent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
toast({
|
|
||||||
title: "Task assigned",
|
|
||||||
description: "Task has been assigned successfully.",
|
|
||||||
});
|
|
||||||
// Close the popover
|
|
||||||
setPeoplePopoverOpen((prev) => ({ ...prev, [taskId]: false }));
|
setPeoplePopoverOpen((prev) => ({ ...prev, [taskId]: false }));
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
@@ -1122,12 +1088,6 @@ function ControlViewContent({
|
|||||||
taskId,
|
taskId,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
|
||||||
toast({
|
|
||||||
title: "Task unassigned",
|
|
||||||
description: "Task has been unassigned successfully.",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
toast({
|
toast({
|
||||||
title: "Error unassigning task",
|
title: "Error unassigning task",
|
||||||
@@ -1250,10 +1210,6 @@ function ControlViewContent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
toast({
|
|
||||||
title: "Task updated",
|
|
||||||
description: "Time estimate has been updated successfully.",
|
|
||||||
});
|
|
||||||
setIsEditingDuration(false);
|
setIsEditingDuration(false);
|
||||||
|
|
||||||
// Update the selected task state if it's the current task
|
// Update the selected task state if it's the current task
|
||||||
|
|||||||
@@ -16,9 +16,15 @@ import {
|
|||||||
import { Suspense, useEffect, useState, useCallback } from "react";
|
import { Suspense, useEffect, useState, useCallback } from "react";
|
||||||
import type { PeopleViewQuery as PeopleViewQueryType } from "./__generated__/PeopleViewQuery.graphql";
|
import type { PeopleViewQuery as PeopleViewQueryType } from "./__generated__/PeopleViewQuery.graphql";
|
||||||
import { useParams } from "react-router";
|
import { useParams } from "react-router";
|
||||||
import { cn } from "@/lib/utils";
|
|
||||||
import { PageTemplate } from "@/components/PageTemplate";
|
import { PageTemplate } from "@/components/PageTemplate";
|
||||||
import { PeopleViewSkeleton } from "./PeoplePage";
|
import { PeopleViewSkeleton } from "./PeoplePage";
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from "@/components/ui/select";
|
||||||
|
|
||||||
const peopleViewQuery = graphql`
|
const peopleViewQuery = graphql`
|
||||||
query PeopleViewQuery($peopleId: ID!) {
|
query PeopleViewQuery($peopleId: ID!) {
|
||||||
@@ -237,63 +243,40 @@ function PeopleViewContent({
|
|||||||
<HelpCircle className="h-4 w-4 text-gray-400" />
|
<HelpCircle className="h-4 w-4 text-gray-400" />
|
||||||
<Label className="text-sm">Kind</Label>
|
<Label className="text-sm">Kind</Label>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-2">
|
<Select
|
||||||
<button
|
value={formData.kind}
|
||||||
onClick={() => handleFieldChange("kind", "EMPLOYEE")}
|
onValueChange={(value) => handleFieldChange("kind", value)}
|
||||||
className={cn(
|
>
|
||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
<SelectTrigger className="w-full">
|
||||||
formData.kind === "EMPLOYEE"
|
<SelectValue placeholder="Select kind" />
|
||||||
? "bg-blue-100 text-blue-900 ring-2 ring-blue-600 ring-offset-2"
|
</SelectTrigger>
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
<SelectContent>
|
||||||
)}
|
<SelectItem value="EMPLOYEE">Employee</SelectItem>
|
||||||
>
|
<SelectItem value="CONTRACTOR">Contractor</SelectItem>
|
||||||
Employee
|
<SelectItem value="SERVICE_ACCOUNT">
|
||||||
</button>
|
Service Account
|
||||||
<button
|
</SelectItem>
|
||||||
onClick={() => handleFieldChange("kind", "CONTRACTOR")}
|
</SelectContent>
|
||||||
className={cn(
|
</Select>
|
||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
|
||||||
formData.kind === "CONTRACTOR"
|
|
||||||
? "bg-purple-100 text-purple-900 ring-2 ring-purple-600 ring-offset-2"
|
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
Contractor
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={() =>
|
|
||||||
handleFieldChange("kind", "SERVICE_ACCOUNT")
|
|
||||||
}
|
|
||||||
className={cn(
|
|
||||||
"rounded-full px-4 py-1 text-sm transition-colors",
|
|
||||||
formData.kind === "SERVICE_ACCOUNT"
|
|
||||||
? "bg-green-100 text-green-900 ring-2 ring-green-600 ring-offset-2"
|
|
||||||
: "bg-gray-100 text-gray-900 hover:bg-gray-200"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
Service Account
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
<div className="mt-6 flex justify-end gap-2">
|
||||||
|
<Button variant="outline" onClick={handleCancel}>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={handleSave}
|
||||||
|
className="bg-primary text-primary-foreground hover:bg-primary/90"
|
||||||
|
disabled={!hasChanges}
|
||||||
|
>
|
||||||
|
Save Changes
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{hasChanges && (
|
|
||||||
<div className="fixed bottom-6 right-6 flex gap-2">
|
|
||||||
<Button variant="outline" onClick={handleCancel}>
|
|
||||||
Cancel
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
onClick={handleSave}
|
|
||||||
className="bg-primary text-primary-foreground hover:bg-primary/90"
|
|
||||||
>
|
|
||||||
Save Changes
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</PageTemplate>
|
</PageTemplate>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,21 +373,19 @@ function VendorViewContent({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
<div className="mt-6 flex justify-end gap-2">
|
||||||
|
|
||||||
{hasChanges && (
|
|
||||||
<div className="fixed bottom-6 right-6 flex gap-2">
|
|
||||||
<Button variant="outline" onClick={handleCancel}>
|
<Button variant="outline" onClick={handleCancel}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
className="bg-primary text-primary-foreground hover:bg-primary/90"
|
className="bg-primary text-primary-foreground hover:bg-primary/90"
|
||||||
|
disabled={!hasChanges}
|
||||||
>
|
>
|
||||||
Save Changes
|
Save Changes
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
</PageTemplate>
|
</PageTemplate>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user