implement edit workflow
This commit is contained in:
@@ -242,15 +242,15 @@ export default function ApprovalWorkflows({ user, workflows, workflowsAssignees,
|
||||
);
|
||||
},
|
||||
}),
|
||||
{
|
||||
columnHelper.accessor("steps", {
|
||||
header: "ACTIONS",
|
||||
id: "actions",
|
||||
cell: ({ row }: { row: { original: ApprovalWorkflow } }) => {
|
||||
cell: ({ row }) => {
|
||||
const steps = row.original.steps;
|
||||
const currentStep = steps.find((step) => !step.completed);
|
||||
|
||||
return (
|
||||
<div className="flex gap-4">
|
||||
<Link onClick={(e) => e.stopPropagation()} data-tip="Edit" href={`/approval-workflows/${row.original.id}/edit`} className="cursor-pointer tooltip">
|
||||
<FaRegEdit className="hover:text-mti-purple-light transition ease-in-out duration-300" />
|
||||
</Link>
|
||||
<button
|
||||
data-tip="Delete"
|
||||
className="cursor-pointer tooltip"
|
||||
@@ -261,10 +261,21 @@ export default function ApprovalWorkflows({ user, workflows, workflowsAssignees,
|
||||
>
|
||||
<BsTrash className="hover:text-mti-purple-light transition ease-in-out duration-300" />
|
||||
</button>
|
||||
|
||||
{currentStep && (
|
||||
<Link
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
data-tip="Edit"
|
||||
href={`/approval-workflows/${row.original.id}/edit`}
|
||||
className="cursor-pointer tooltip"
|
||||
>
|
||||
<FaRegEdit className="hover:text-mti-purple-light transition ease-in-out duration-300" />
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
})
|
||||
];
|
||||
|
||||
const table = useReactTable({
|
||||
|
||||
Reference in New Issue
Block a user