- fix assignees bug after editing active workflow

- only allow corporate+ to configure workflows
- give admins and devs permissions to approve and reject steps even when they are not assigned to them.
- small fixes
This commit is contained in:
Joao Correia
2025-02-05 16:50:09 +00:00
parent 845a5aa9dc
commit f0849b9b42
6 changed files with 25 additions and 19 deletions

View File

@@ -36,7 +36,7 @@ export const getServerSideProps = withIronSessionSsr(async ({ req, res }) => {
if (shouldRedirectHome(user) || !["admin", "developer", "teacher", "corporate", "mastercorporate"].includes(user.type))
return redirect("/")
const workflows = await getApprovalWorkflows("configured-workflows");
const workflows = await getApprovalWorkflows("active-workflows");
const allAssigneeIds: string[] = [
...new Set(
@@ -97,8 +97,6 @@ export default function ApprovalWorkflows({ user, initialWorkflows, workflowsAss
const {workflows, reload} = useApprovalWorkflows();
const currentWorkflows = workflows || initialWorkflows;
console.log(currentWorkflows);
const [filteredWorkflows, setFilteredWorkflows] = useState<ApprovalWorkflow[]>([]);
const [statusFilter, setStatusFilter] = useState<CustomStatus>(undefined);