work on non editable approval workflow steps view
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {Module} from ".";
|
||||
import { CorporateUser, MasterCorporateUser, TeacherUser, userTypeLabels } from "./user";
|
||||
|
||||
export interface ApprovalWorkflow {
|
||||
id: string,
|
||||
@@ -10,20 +11,30 @@ export interface ApprovalWorkflow {
|
||||
|
||||
export type StepType = "form-intake" | "approval-by";
|
||||
|
||||
type AssigneesType = TeacherUser["type"] | CorporateUser["type"] | MasterCorporateUser["type"];
|
||||
|
||||
export interface WorkflowStep {
|
||||
key?: number,
|
||||
stepType: StepType,
|
||||
stepType?: StepType,
|
||||
stepNumber: number,
|
||||
completed: boolean,
|
||||
completed?: boolean,
|
||||
completedBy?: string,
|
||||
assignees?: string[],
|
||||
assigneesType?: AssigneesType,
|
||||
editView?: boolean,
|
||||
firstStep?: boolean,
|
||||
currentStep?: boolean,
|
||||
finalStep?: boolean,
|
||||
isSelected?: boolean,
|
||||
selected?: boolean,
|
||||
requestedBy?: string,
|
||||
//requestedBy: TeacherUser | CorporateUser | MasterCorporateUser,
|
||||
onDelete?: () => void;
|
||||
onClick?: React.MouseEventHandler<HTMLDivElement>
|
||||
}
|
||||
|
||||
export function getUserTypeLabel(type: AssigneesType | undefined): string {
|
||||
if (type) return userTypeLabels[type];
|
||||
return '';
|
||||
}
|
||||
|
||||
export type ApprovalWorkflowStatus = "approved" | "pending" | "rejected";
|
||||
|
||||
@@ -170,4 +170,14 @@ export interface Code {
|
||||
export type Type = "student" | "teacher" | "corporate" | "admin" | "developer" | "agent" | "mastercorporate";
|
||||
export const userTypes: Type[] = ["student", "teacher", "corporate", "admin", "developer", "agent", "mastercorporate"];
|
||||
|
||||
export const userTypeLabels: Record<Type, string> = {
|
||||
student: "Student",
|
||||
teacher: "Teacher",
|
||||
corporate: "Corporate",
|
||||
admin: "Admin",
|
||||
developer: "Developer",
|
||||
agent: "Agent",
|
||||
mastercorporate: "Master Corporate",
|
||||
};
|
||||
|
||||
export type WithUser<T> = T extends { participants: string[] } ? Omit<T, "participants"> & { participants: User[] } : T;
|
||||
|
||||
Reference in New Issue
Block a user