@masterteam/workflow 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-workflow.mjs","sources":["../../../../packages/masterteam/workflow/src/store/workflow/workflow.actions.ts","../../../../packages/masterteam/workflow/src/store/utils/state-helpers.ts","../../../../packages/masterteam/workflow/src/store/workflow/workflow.state.ts","../../../../packages/masterteam/workflow/src/store/workflow/workflow.facade.ts","../../../../packages/masterteam/workflow/src/store/workflow/api.model.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-app-action-config.utils.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-step.utils.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-form-drawer/workflow-form-drawer.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-form-drawer/workflow-form-drawer.html","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-notifications-drawer/workflow-notifications-drawer.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-notifications-drawer/workflow-notifications-drawer.html","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-builder.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-builder.html","../../../../packages/masterteam/workflow/src/store/app.state.ts","../../../../packages/masterteam/workflow/src/store/index.ts","../../../../packages/masterteam/workflow/src/public-api.ts","../../../../packages/masterteam/workflow/src/masterteam-workflow.ts"],"sourcesContent":["import type { ConnectionPayload, StepPayload } from './workflow.model';\r\n\r\nexport class SetModuleInfo {\r\n static readonly type = '[Workflow] Set Module Info';\r\n\r\n constructor(\r\n public readonly moduleType: string,\r\n public readonly moduleId: string | number,\r\n public readonly parentModuleType?: string,\r\n public readonly parentModuleId?: string | number,\r\n public readonly parentPath?: string,\r\n ) {}\r\n}\r\n\r\nexport class GetWorkflows {\r\n static readonly type = '[Workflow] Get Workflows';\r\n}\r\n\r\nexport class GetWorkflow {\r\n static readonly type = '[Workflow] Get Workflow';\r\n\r\n constructor(public readonly workflowId: string | number) {}\r\n}\r\n\r\nexport class GetFormulaProperties {\r\n static readonly type = '[Workflow] Get Formula Properties';\r\n}\r\n\r\nexport class GetGroups {\r\n static readonly type = '[Workflow] Get Groups';\r\n}\r\n\r\nexport class GetRolesForModule {\r\n static readonly type = '[Workflow] Get Roles For Module';\r\n}\r\n\r\nexport class GetAppActions {\r\n static readonly type = '[Workflow] Get App Actions';\r\n}\r\n\r\nexport class GetAppActionDetail {\r\n static readonly type = '[Workflow] Get App Action Detail';\r\n\r\n constructor(public readonly actionKey: string) {}\r\n}\r\n\r\nexport class GetStep {\r\n static readonly type = '[Workflow] Get Step';\r\n\r\n constructor(public readonly stepId: string | number) {}\r\n}\r\n\r\nexport class ValidateFlow {\r\n static readonly type = '[Workflow] Validate Flow';\r\n}\r\n\r\nexport class CreateStep {\r\n static readonly type = '[Workflow] Create Step';\r\n\r\n constructor(public readonly payload: StepPayload) {}\r\n}\r\n\r\nexport class UpdateStep {\r\n static readonly type = '[Workflow] Update Step';\r\n\r\n constructor(\r\n public readonly stepId: string | number,\r\n public readonly payload: StepPayload,\r\n public readonly isInitial?: boolean,\r\n ) {}\r\n}\r\n\r\nexport class CreateConnection {\r\n static readonly type = '[Workflow] Create Connection';\r\n\r\n constructor(public readonly payload: ConnectionPayload) {}\r\n}\r\n\r\nexport class UpdateConnection {\r\n static readonly type = '[Workflow] Update Connection';\r\n\r\n constructor(\r\n public readonly connectionId: string | number,\r\n public readonly payload: ConnectionPayload,\r\n ) {}\r\n}\r\n\r\nexport class PublishWorkflow {\r\n static readonly type = '[Workflow] Publish Workflow';\r\n\r\n constructor(public readonly isPublished: boolean) {}\r\n}\r\n\r\nexport class DeleteStep {\r\n static readonly type = '[Workflow] Delete Step';\r\n\r\n constructor(public readonly stepId: string | number) {}\r\n}\r\n\r\nexport class DeleteConnection {\r\n static readonly type = '[Workflow] Delete Connection';\r\n\r\n constructor(public readonly connectionId: string | number) {}\r\n}\r\n","import type { StateContext } from '@ngxs/store';\n\nexport interface LoadingStateShape<L extends string = string> {\n loadingActive: L[];\n errors: Partial<Record<L, string>>;\n}\n\ntype LoadingName<T extends LoadingStateShape<string>> =\n T['loadingActive'][number];\n\nexport function startLoading<T extends LoadingStateShape<string>>(\n ctx: StateContext<T>,\n loadingName: LoadingName<T>,\n): void {\n const { loadingActive, errors } = ctx.getState();\n\n if (!loadingActive.includes(loadingName)) {\n ctx.patchState({\n loadingActive: [...loadingActive, loadingName],\n } as Partial<T>);\n }\n\n if (errors && errors[loadingName]) {\n const { [loadingName]: _removed, ...rest } = errors;\n ctx.patchState({ errors: rest } as Partial<T>);\n }\n}\n\nexport function endLoading<T extends LoadingStateShape<string>>(\n ctx: StateContext<T>,\n loadingName: LoadingName<T>,\n): void {\n const { loadingActive } = ctx.getState();\n\n ctx.patchState({\n loadingActive: loadingActive.filter((name) => name !== loadingName),\n } as Partial<T>);\n}\n\nexport function setLoadingError<T extends LoadingStateShape<string>>(\n ctx: StateContext<T>,\n loadingName: LoadingName<T>,\n message: string,\n): void {\n const { errors } = ctx.getState();\n ctx.patchState({\n errors: { ...errors, [loadingName]: message },\n } as Partial<T>);\n}\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\r\nimport { of } from 'rxjs';\r\nimport { catchError, finalize, tap } from 'rxjs/operators';\r\n\r\nimport {\r\n endLoading,\r\n setLoadingError,\r\n startLoading,\r\n} from '../utils/state-helpers';\r\n\r\nimport type {\r\n ConnectionResponse,\r\n FormulaProperty,\r\n GroupDefinition,\r\n RoleGroupDefinition,\r\n PublishResponse,\r\n RoleDefinition,\r\n StepResponse,\r\n StepSchema,\r\n WorkflowAppAction,\r\n WorkflowAppActionDescriptor,\r\n WorkflowConnection,\r\n WorkflowListItem,\r\n WorkflowLoadingName,\r\n WorkflowSchema,\r\n WorkflowStateModel,\r\n WorkflowStepType,\r\n WorkflowStepSchema,\r\n} from './workflow.model';\r\nimport {\r\n CreateConnection,\r\n CreateStep,\r\n DeleteConnection,\r\n DeleteStep,\r\n GetAppActionDetail,\r\n GetAppActions,\r\n GetFormulaProperties,\r\n GetGroups,\r\n GetRolesForModule,\r\n GetStep,\r\n GetWorkflow,\r\n GetWorkflows,\r\n PublishWorkflow,\r\n SetModuleInfo,\r\n UpdateConnection,\r\n UpdateStep,\r\n ValidateFlow,\r\n} from './workflow.actions';\r\nimport { Response } from './api.model';\r\n\r\nconst DEFAULT_STATE: WorkflowStateModel = {\r\n workflowId: null,\r\n moduleType: null,\r\n moduleId: null,\r\n workflows: [],\r\n workflow: null,\r\n formulaProperties: [],\r\n groups: [],\r\n roles: [],\r\n appActionDescriptors: [],\r\n selectedAppActionDescriptor: null,\r\n selectedStep: null,\r\n isFlowValid: null,\r\n loadingActive: [],\r\n errors: {},\r\n};\r\n\r\n@State<WorkflowStateModel>({\r\n name: 'workflow',\r\n defaults: DEFAULT_STATE,\r\n})\r\n@Injectable()\r\nexport class WorkflowState {\r\n private readonly http = inject(HttpClient);\r\n private readonly baseUrl = 'ProcessBuilder';\r\n private readonly groupsUrl = 'identity/Groups';\r\n private readonly rolesUrl = 'identity/roles/scopes';\r\n private readonly workflowAppActionsUrl = 'workflow-app-actions';\r\n\r\n @Selector()\r\n static workflowId(state: WorkflowStateModel): string | number | null {\r\n return state.workflowId;\r\n }\r\n\r\n @Selector()\r\n static moduleType(state: WorkflowStateModel): string | null {\r\n return state.moduleType;\r\n }\r\n\r\n @Selector()\r\n static moduleId(state: WorkflowStateModel): string | number | null {\r\n return state.moduleId;\r\n }\r\n\r\n @Selector()\r\n static workflows(state: WorkflowStateModel) {\r\n return state.workflows;\r\n }\r\n\r\n @Selector()\r\n static workflow(state: WorkflowStateModel): WorkflowSchema | null {\r\n return state.workflow;\r\n }\r\n\r\n @Selector()\r\n static formulaProperties(state: WorkflowStateModel): FormulaProperty[] {\r\n return state.formulaProperties;\r\n }\r\n\r\n @Selector()\r\n static groups(state: WorkflowStateModel): GroupDefinition[] {\r\n return state.groups;\r\n }\r\n\r\n @Selector()\r\n static roles(\r\n state: WorkflowStateModel,\r\n ): Array<RoleDefinition | RoleGroupDefinition> {\r\n return state.roles;\r\n }\r\n\r\n @Selector()\r\n static appActionDescriptors(\r\n state: WorkflowStateModel,\r\n ): WorkflowAppActionDescriptor[] {\r\n return state.appActionDescriptors;\r\n }\r\n\r\n @Selector()\r\n static selectedAppActionDescriptor(\r\n state: WorkflowStateModel,\r\n ): WorkflowAppActionDescriptor | null {\r\n return state.selectedAppActionDescriptor;\r\n }\r\n\r\n @Selector()\r\n static selectedStep(state: WorkflowStateModel): StepSchema | null {\r\n return state.selectedStep;\r\n }\r\n\r\n @Selector()\r\n static isFlowValid(state: WorkflowStateModel): boolean | null {\r\n return state.isFlowValid;\r\n }\r\n\r\n @Selector()\r\n static stepsSchema(state: WorkflowStateModel): WorkflowStepSchema[] {\r\n return state.workflow?.stepsSchema ?? [];\r\n }\r\n\r\n @Selector()\r\n static connections(state: WorkflowStateModel): WorkflowConnection[] {\r\n return state.workflow?.connections ?? [];\r\n }\r\n\r\n @Selector()\r\n static isLoadingFactory(state: WorkflowStateModel) {\r\n return (loadingName: WorkflowLoadingName) =>\r\n state.loadingActive.includes(loadingName);\r\n }\r\n\r\n @Selector()\r\n static errorFactory(state: WorkflowStateModel) {\r\n return (loadingName: WorkflowLoadingName) =>\r\n state.errors?.[loadingName] ?? null;\r\n }\r\n\r\n @Action(SetModuleInfo)\r\n setModuleInfo(ctx: StateContext<WorkflowStateModel>, action: SetModuleInfo) {\r\n let parentPath = '';\r\n if (action.parentModuleType && action.parentModuleId) {\r\n parentPath = `/${action.parentModuleType}/${action.parentModuleId}`;\r\n } else if (action.parentPath) {\r\n parentPath = action.parentPath;\r\n }\r\n ctx.patchState({\r\n moduleType: action.moduleType,\r\n moduleId: action.moduleId,\r\n parentModuleType: action.parentModuleType ?? null,\r\n parentModuleId: action.parentModuleId ?? null,\r\n parentPath: parentPath ?? '',\r\n });\r\n }\r\n\r\n @Action(GetWorkflows)\r\n getWorkflows(ctx: StateContext<WorkflowStateModel>, _action: GetWorkflows) {\r\n startLoading(ctx, 'getWorkflows');\r\n\r\n const state = ctx.getState();\r\n const { moduleId, parentPath, moduleType } = state;\r\n\r\n if (!moduleId) {\r\n const message = 'Module ID is not set';\r\n setLoadingError(ctx, 'getWorkflows', message);\r\n endLoading(ctx, 'getWorkflows');\r\n return of(null);\r\n }\r\n\r\n return this.http\r\n .get<\r\n Response<WorkflowListItem[]>\r\n >(`${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/requestSchema`)\r\n .pipe(\r\n tap((response) => {\r\n const workflows = response?.data ?? [];\r\n ctx.patchState({ workflows });\r\n\r\n // Auto-select and load first workflow if available\r\n if (workflows.length > 0) {\r\n const firstWorkflow = workflows[0];\r\n ctx.patchState({ workflowId: firstWorkflow.id });\r\n ctx.dispatch(new GetWorkflow(firstWorkflow.id));\r\n }\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load workflows';\r\n setLoadingError(ctx, 'getWorkflows', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'getWorkflows')),\r\n );\r\n }\r\n\r\n @Action(GetWorkflow)\r\n getWorkflow(ctx: StateContext<WorkflowStateModel>, action: GetWorkflow) {\r\n startLoading(ctx, 'getWorkflow');\r\n\r\n const state = ctx.getState();\r\n const workflowId = action.workflowId;\r\n const { moduleId, parentPath, moduleType } = state;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'getWorkflow', message);\r\n endLoading(ctx, 'getWorkflow');\r\n return of(null);\r\n }\r\n\r\n // Set the workflowId in state\r\n ctx.patchState({ workflowId });\r\n\r\n return this.http\r\n .get<Response<WorkflowSchema>>(\r\n `${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/requestSchema/${workflowId}`,\r\n {\r\n params: { Mode: 'edit' },\r\n },\r\n )\r\n .pipe(\r\n tap((response) => {\r\n const workflow = response?.data\r\n ? normalizeWorkflowSchema(response.data)\r\n : null;\r\n ctx.patchState({\r\n workflow,\r\n isFlowValid: workflow?.isValid ?? null,\r\n });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load workflow';\r\n setLoadingError(ctx, 'getWorkflow', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'getWorkflow')),\r\n );\r\n }\r\n\r\n @Action(GetFormulaProperties)\r\n getFormulaProperties(\r\n ctx: StateContext<WorkflowStateModel>,\r\n _action: GetFormulaProperties,\r\n ) {\r\n startLoading(ctx, 'getFormulaProperties');\r\n\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'getFormulaProperties', message);\r\n endLoading(ctx, 'getFormulaProperties');\r\n return of(null);\r\n }\r\n\r\n return this.http\r\n .get<\r\n Response<FormulaProperty[]>\r\n >(`${this.baseUrl}/processFormulaProperties/${workflowId}`)\r\n .pipe(\r\n tap((response) => {\r\n const formulaProperties = Array.isArray(response?.data)\r\n ? response.data\r\n : [];\r\n ctx.patchState({ formulaProperties });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load formula properties';\r\n setLoadingError(ctx, 'getFormulaProperties', message);\r\n return of([]);\r\n }),\r\n finalize(() => endLoading(ctx, 'getFormulaProperties')),\r\n );\r\n }\r\n\r\n @Action(GetGroups)\r\n getGroups(ctx: StateContext<WorkflowStateModel>, _action: GetGroups) {\r\n const state = ctx.getState();\r\n if (state.groups.length) {\r\n return of(state.groups);\r\n }\r\n\r\n startLoading(ctx, 'getGroups');\r\n\r\n return this.http.get<Response<GroupDefinition[]>>(this.groupsUrl).pipe(\r\n tap((response) => {\r\n const groups = Array.isArray(response?.data) ? response.data : [];\r\n ctx.patchState({ groups });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to load groups';\r\n setLoadingError(ctx, 'getGroups', message);\r\n return of([]);\r\n }),\r\n finalize(() => endLoading(ctx, 'getGroups')),\r\n );\r\n }\r\n\r\n @Action(GetRolesForModule)\r\n getRolesForModule(\r\n ctx: StateContext<WorkflowStateModel>,\r\n _action: GetRolesForModule,\r\n ) {\r\n const state = ctx.getState();\r\n const { moduleType, moduleId, parentPath } = state;\r\n\r\n if (!moduleType || !moduleId) {\r\n const message = 'Module type and module ID must be set';\r\n setLoadingError(ctx, 'getRolesForModule', message);\r\n return of([]);\r\n }\r\n\r\n startLoading(ctx, 'getRolesForModule');\r\n\r\n return this.http\r\n .get<Response<unknown[]>>(\r\n `${parentPath ? this.rolesUrl.replace('/scopes', '') : this.rolesUrl}${parentPath}/${moduleType}/${moduleId}`,\r\n parentPath\r\n ? undefined\r\n : {\r\n params: { inherited: 'true' },\r\n },\r\n )\r\n .pipe(\r\n tap((response) => {\r\n const roles = normalizeWorkflowRoles(response?.data);\r\n ctx.patchState({ roles });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to load roles';\r\n setLoadingError(ctx, 'getRolesForModule', message);\r\n return of([]);\r\n }),\r\n finalize(() => endLoading(ctx, 'getRolesForModule')),\r\n );\r\n }\r\n\r\n @Action(GetAppActions)\r\n getAppActions(ctx: StateContext<WorkflowStateModel>, _action: GetAppActions) {\r\n const state = ctx.getState();\r\n if (state.appActionDescriptors.length) {\r\n return of(state.appActionDescriptors);\r\n }\r\n\r\n startLoading(ctx, 'getAppActions');\r\n\r\n return this.http\r\n .get<Response<unknown>>(`${this.workflowAppActionsUrl}/actions`)\r\n .pipe(\r\n tap((response) => {\r\n const descriptors = normalizeWorkflowAppActionDescriptors(\r\n response?.data,\r\n );\r\n ctx.patchState({\r\n appActionDescriptors: descriptors,\r\n });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load app actions';\r\n setLoadingError(ctx, 'getAppActions', message);\r\n return of([]);\r\n }),\r\n finalize(() => endLoading(ctx, 'getAppActions')),\r\n );\r\n }\r\n\r\n @Action(GetAppActionDetail)\r\n getAppActionDetail(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: GetAppActionDetail,\r\n ) {\r\n const state = ctx.getState();\r\n const cachedDescriptor = state.appActionDescriptors.find(\r\n (descriptor) =>\r\n descriptor.actionKey === action.actionKey &&\r\n !!descriptor.configSchemaJson,\r\n );\r\n\r\n if (cachedDescriptor) {\r\n ctx.patchState({\r\n selectedAppActionDescriptor: cachedDescriptor,\r\n });\r\n return of(cachedDescriptor);\r\n }\r\n\r\n startLoading(ctx, 'getAppActionDetail');\r\n\r\n return this.http\r\n .get<\r\n Response<unknown>\r\n >(`${this.workflowAppActionsUrl}/actions/${encodeURIComponent(action.actionKey)}`)\r\n .pipe(\r\n tap((response) => {\r\n const descriptor = normalizeWorkflowAppActionDescriptor(\r\n response?.data,\r\n );\r\n const currentState = ctx.getState();\r\n const descriptors = upsertWorkflowAppActionDescriptor(\r\n currentState.appActionDescriptors,\r\n descriptor,\r\n );\r\n\r\n ctx.patchState({\r\n appActionDescriptors: descriptors,\r\n selectedAppActionDescriptor: descriptor,\r\n });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load app action details';\r\n setLoadingError(ctx, 'getAppActionDetail', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'getAppActionDetail')),\r\n );\r\n }\r\n\r\n @Action(GetStep)\r\n getStep(ctx: StateContext<WorkflowStateModel>, action: GetStep) {\r\n startLoading(ctx, 'getStep');\r\n\r\n return this.http\r\n .get<Response<StepSchema>>(\r\n `${this.baseUrl}/stepSchema/${action.stepId}`,\r\n {\r\n params: { Mode: 'edit' },\r\n },\r\n )\r\n .pipe(\r\n tap((response) => {\r\n const selectedStep = response?.data\r\n ? normalizeWorkflowStepDetail(response.data)\r\n : null;\r\n ctx.patchState({ selectedStep });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to load step';\r\n setLoadingError(ctx, 'getStep', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'getStep')),\r\n );\r\n }\r\n\r\n @Action(ValidateFlow)\r\n validateFlow(ctx: StateContext<WorkflowStateModel>, _action: ValidateFlow) {\r\n startLoading(ctx, 'validateFlow');\r\n\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'validateFlow', message);\r\n endLoading(ctx, 'validateFlow');\r\n return of(null);\r\n }\r\n\r\n return this.http\r\n .get<\r\n Response<boolean>\r\n >(`${this.baseUrl}/requestSchema/${workflowId}/validity`)\r\n .pipe(\r\n tap((response) => {\r\n const isFlowValid = response?.data ?? null;\r\n ctx.patchState({ isFlowValid });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to validate flow';\r\n setLoadingError(ctx, 'validateFlow', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'validateFlow')),\r\n );\r\n }\r\n\r\n @Action(CreateStep)\r\n createStep(ctx: StateContext<WorkflowStateModel>, action: CreateStep) {\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'createStep', message);\r\n return of(null);\r\n }\r\n\r\n const tempId = -Date.now();\r\n const tempStep = normalizeWorkflowStepSchema({\r\n ...action.payload,\r\n id: tempId,\r\n loading: true,\r\n });\r\n\r\n if (state.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n stepsSchema: [...state.workflow.stepsSchema, tempStep],\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'createStep');\r\n\r\n return this.http\r\n .post<\r\n Response<StepResponse>\r\n >(`${this.baseUrl}/requestSchema/${workflowId}/stepSchema`, action.payload)\r\n .pipe(\r\n tap((response) => {\r\n const createdStep = response?.data\r\n ? normalizeWorkflowStepSchema({\r\n ...tempStep,\r\n ...response.data,\r\n loading: false,\r\n })\r\n : null;\r\n const currentState = ctx.getState();\r\n if (createdStep && currentState.workflow) {\r\n const updatedSteps = currentState.workflow.stepsSchema.map(\r\n (step) => (step.id === tempId ? createdStep : step),\r\n );\r\n\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: updatedSteps,\r\n },\r\n });\r\n }\r\n // Validate flow after creating step\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const filteredSteps = currentState.workflow.stepsSchema.filter(\r\n (step) => step.id !== tempId,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: filteredSteps,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to create step';\r\n setLoadingError(ctx, 'createStep', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'createStep')),\r\n );\r\n }\r\n\r\n @Action(UpdateStep)\r\n updateStep(ctx: StateContext<WorkflowStateModel>, action: UpdateStep) {\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'updateStep', message);\r\n return of(null);\r\n }\r\n\r\n if (state.workflow) {\r\n const updatedSteps = state.workflow.stepsSchema.map((step) =>\r\n step.id === action.stepId ? { ...step, loading: true } : step,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n stepsSchema: updatedSteps,\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'updateStep');\r\n\r\n const endpoint = action.isInitial ? 'initialStepSchema' : 'stepSchema';\r\n\r\n return this.http\r\n .put<\r\n Response<StepResponse>\r\n >(`${this.baseUrl}/${endpoint}/${action.stepId}`, action.payload)\r\n .pipe(\r\n tap((response) => {\r\n const currentState = ctx.getState();\r\n const existingStep =\r\n currentState.workflow?.stepsSchema.find(\r\n (step) => step.id === action.stepId,\r\n ) ?? null;\r\n const updatedStep = response?.data\r\n ? normalizeWorkflowStepSchema({\r\n ...existingStep,\r\n ...response.data,\r\n loading: false,\r\n })\r\n : null;\r\n if (updatedStep && currentState.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: currentState.workflow.stepsSchema.map((step) =>\r\n step.id === updatedStep.id ? updatedStep : step,\r\n ),\r\n },\r\n });\r\n }\r\n // Validate flow after updating step\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const errorSteps = currentState.workflow.stepsSchema.map((step) =>\r\n step.id === action.stepId ? { ...step, loading: false } : step,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: errorSteps,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to update step';\r\n setLoadingError(ctx, 'updateStep', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'updateStep')),\r\n );\r\n }\r\n\r\n @Action(CreateConnection)\r\n createConnection(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: CreateConnection,\r\n ) {\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'createConnection', message);\r\n return of(null);\r\n }\r\n\r\n const tempId = -Date.now();\r\n const tempConnection: any = {\r\n ...action.payload,\r\n id: tempId,\r\n loading: true,\r\n source: action.payload.sourceStepId,\r\n target: action.payload.targetStepId,\r\n };\r\n\r\n if (state.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n connections: [...state.workflow.connections, tempConnection],\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'createConnection');\r\n\r\n return this.http\r\n .post<\r\n Response<ConnectionResponse>\r\n >(`${this.baseUrl}/requestSchema/${workflowId}/connection`, action.payload)\r\n .pipe(\r\n tap((response) => {\r\n const createdConnection = response?.data;\r\n const currentState = ctx.getState();\r\n if (createdConnection && currentState.workflow) {\r\n const updatedConnections = currentState.workflow.connections.map(\r\n (conn) =>\r\n conn.id === tempId\r\n ? { ...createdConnection, loading: false }\r\n : conn,\r\n );\r\n\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: updatedConnections,\r\n },\r\n });\r\n }\r\n // Validate flow after creating connection\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const filteredConnections =\r\n currentState.workflow.connections.filter(\r\n (conn) => conn.id !== tempId,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: filteredConnections,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to create connection';\r\n setLoadingError(ctx, 'createConnection', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'createConnection')),\r\n );\r\n }\r\n\r\n @Action(UpdateConnection)\r\n updateConnection(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: UpdateConnection,\r\n ) {\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'updateConnection', message);\r\n return of(null);\r\n }\r\n\r\n if (state.workflow) {\r\n const updatedConnections = state.workflow.connections.map((conn) =>\r\n conn.id === action.connectionId ? { ...conn, loading: true } : conn,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n connections: updatedConnections,\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'updateConnection');\r\n\r\n return this.http\r\n .put<\r\n Response<ConnectionResponse>\r\n >(`${this.baseUrl}/stepSchemaConnection/${action.connectionId}`, action.payload)\r\n .pipe(\r\n tap((response) => {\r\n const updatedConnection = response?.data;\r\n const currentState = ctx.getState();\r\n if (updatedConnection && currentState.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: currentState.workflow.connections.map((conn) =>\r\n conn.id === updatedConnection.id\r\n ? { ...updatedConnection, loading: false }\r\n : conn,\r\n ),\r\n },\r\n });\r\n }\r\n // Validate flow after updating connection\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const errorConnections = currentState.workflow.connections.map(\r\n (conn) =>\r\n conn.id === action.connectionId\r\n ? { ...conn, loading: false }\r\n : conn,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: errorConnections,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to update connection';\r\n setLoadingError(ctx, 'updateConnection', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'updateConnection')),\r\n );\r\n }\r\n\r\n @Action(PublishWorkflow)\r\n publishWorkflow(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: PublishWorkflow,\r\n ) {\r\n startLoading(ctx, 'publishWorkflow');\r\n\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'publishWorkflow', message);\r\n endLoading(ctx, 'publishWorkflow');\r\n return of(null);\r\n }\r\n\r\n return this.http\r\n .put<\r\n Response<PublishResponse>\r\n >(`${this.baseUrl}/requestSchema/${workflowId}/publish`, { IsPublished: action.isPublished })\r\n .pipe(\r\n tap((response) => {\r\n const publishedData = response?.data;\r\n if (publishedData && state.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n isPublished: publishedData.isPublished,\r\n isValid: publishedData.isValid,\r\n },\r\n });\r\n }\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to publish workflow';\r\n setLoadingError(ctx, 'publishWorkflow', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'publishWorkflow')),\r\n );\r\n }\r\n\r\n @Action(DeleteStep)\r\n deleteStep(ctx: StateContext<WorkflowStateModel>, action: DeleteStep) {\r\n const state = ctx.getState();\r\n\r\n if (state.workflow) {\r\n // Mark step as loading\r\n const updatedSteps = state.workflow.stepsSchema.map((step) =>\r\n step.id == action.stepId ? { ...step, loading: true } : step,\r\n );\r\n\r\n // Filter out all connections related to this step\r\n const updatedConnections = state.workflow.connections.filter(\r\n (conn) => conn.source != action.stepId && conn.target != action.stepId,\r\n );\r\n\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n stepsSchema: updatedSteps,\r\n connections: updatedConnections,\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'deleteStep');\r\n\r\n return this.http\r\n .delete<Response<boolean>>(`${this.baseUrl}/stepSchema/${action.stepId}`)\r\n .pipe(\r\n tap(() => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: currentState.workflow.stepsSchema.filter(\r\n (step) => step.id != action.stepId,\r\n ),\r\n },\r\n });\r\n }\r\n // Validate flow after deleting step\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n // Restore step loading state\r\n const errorSteps = currentState.workflow.stepsSchema.map((step) =>\r\n step.id == action.stepId ? { ...step, loading: false } : step,\r\n );\r\n\r\n // Restore connections related to this step from original state\r\n const relatedConnections =\r\n state.workflow?.connections.filter(\r\n (conn) =>\r\n conn.source == action.stepId || conn.target == action.stepId,\r\n ) || [];\r\n\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: errorSteps,\r\n connections: [\r\n ...currentState.workflow.connections,\r\n ...relatedConnections,\r\n ],\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to delete step';\r\n setLoadingError(ctx, 'deleteStep', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'deleteStep')),\r\n );\r\n }\r\n\r\n @Action(DeleteConnection)\r\n deleteConnection(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: DeleteConnection,\r\n ) {\r\n const state = ctx.getState();\r\n\r\n if (state.workflow) {\r\n const updatedConnections = state.workflow.connections.map((conn) =>\r\n conn.id == action.connectionId ? { ...conn, loading: true } : conn,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n connections: updatedConnections,\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'deleteConnection');\r\n\r\n return this.http\r\n .delete<\r\n Response<boolean>\r\n >(`${this.baseUrl}/stepSchemaConnection/${action.connectionId}`)\r\n .pipe(\r\n tap(() => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: currentState.workflow.connections.filter(\r\n (conn) => conn.id != action.connectionId,\r\n ),\r\n },\r\n });\r\n }\r\n // Validate flow after deleting connection\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const errorConnections = currentState.workflow.connections.map(\r\n (conn) =>\r\n conn.id == action.connectionId\r\n ? { ...conn, loading: false }\r\n : conn,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: errorConnections,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to delete connection';\r\n setLoadingError(ctx, 'deleteConnection', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'deleteConnection')),\r\n );\r\n }\r\n}\r\n\r\nfunction normalizeWorkflowRoles(\r\n data: unknown,\r\n): Array<RoleDefinition | RoleGroupDefinition> {\r\n if (!Array.isArray(data)) {\r\n return [];\r\n }\r\n\r\n if (data.some((item: any) => Array.isArray(item?.roles))) {\r\n return data\r\n .map((group: any) => ({\r\n label: resolveWorkflowRoleGroupLabel(group),\r\n items: Array.isArray(group?.roles)\r\n ? group.roles.map(normalizeWorkflowRole).filter(Boolean)\r\n : [],\r\n }))\r\n .filter((group) => group.items.length > 0);\r\n }\r\n\r\n return data.map(normalizeWorkflowRole).filter(Boolean);\r\n}\r\n\r\nfunction normalizeWorkflowSchema(input: any): WorkflowSchema {\r\n return {\r\n ...input,\r\n stepsSchema: Array.isArray(input?.stepsSchema)\r\n ? input.stepsSchema.map(normalizeWorkflowStepSchema)\r\n : [],\r\n connections: Array.isArray(input?.connections) ? input.connections : [],\r\n properties: Array.isArray(input?.properties) ? input.properties : [],\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowStepSchema(input: any): WorkflowStepSchema {\r\n const type = normalizeWorkflowStepType(input?.type);\r\n const appAction = normalizeWorkflowAppAction(input, type);\r\n\r\n return {\r\n ...input,\r\n id: Number(input?.id ?? 0),\r\n name: normalizeWorkflowStepName(input?.name),\r\n sla: Number(input?.sla ?? 0),\r\n isInitial: !!input?.isInitial,\r\n type,\r\n targetType: input?.targetType ?? undefined,\r\n targetValue:\r\n input?.targetValue === null || input?.targetValue === undefined\r\n ? undefined\r\n : String(input.targetValue),\r\n appAction,\r\n loading: !!input?.loading,\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowStepDetail(input: any): StepSchema {\r\n const type = normalizeWorkflowStepType(input?.type);\r\n const appAction = normalizeWorkflowAppAction(input, type);\r\n\r\n return {\r\n ...input,\r\n id: Number(input?.id ?? 0),\r\n name: normalizeWorkflowRecordName(input?.name),\r\n sla: Number(input?.sla ?? 0),\r\n isInitial: !!input?.isInitial,\r\n type,\r\n targetType: input?.targetType ?? undefined,\r\n targetValue:\r\n input?.targetValue === null || input?.targetValue === undefined\r\n ? undefined\r\n : String(input.targetValue),\r\n properties: Array.isArray(input?.properties) ? input.properties : [],\r\n hasNotification: !!input?.hasNotification,\r\n hasForm:\r\n input?.hasForm === undefined || input?.hasForm === null\r\n ? undefined\r\n : !!input.hasForm,\r\n appAction,\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowStepType(type: unknown): WorkflowStepType {\r\n return type === 'AppAction' ? 'AppAction' : 'UserInput';\r\n}\r\n\r\nfunction normalizeWorkflowStepName(\r\n name: unknown,\r\n): string | Record<string, string> {\r\n if (typeof name === 'string') {\r\n return name;\r\n }\r\n\r\n if (name && typeof name === 'object') {\r\n return name as Record<string, string>;\r\n }\r\n\r\n return '';\r\n}\r\n\r\nfunction normalizeWorkflowRecordName(name: unknown): Record<string, string> {\r\n if (name && typeof name === 'object') {\r\n return name as Record<string, string>;\r\n }\r\n\r\n const label = typeof name === 'string' ? name : '';\r\n return {\r\n display: label,\r\n en: label,\r\n ar: label,\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowAppAction(\r\n input: any,\r\n type: WorkflowStepType,\r\n): WorkflowAppAction | null {\r\n const candidate = isRecord(input?.appAction) ? input.appAction : input;\r\n const hasAppActionData =\r\n !!candidate?.appCode ||\r\n !!candidate?.actionKey ||\r\n candidate?.configJson !== undefined ||\r\n candidate?.failureBehavior !== undefined ||\r\n candidate?.timeoutSeconds !== undefined;\r\n\r\n if (!hasAppActionData && type !== 'AppAction') {\r\n return null;\r\n }\r\n\r\n return {\r\n appCode:\r\n typeof candidate?.appCode === 'string' && candidate.appCode.trim().length\r\n ? candidate.appCode\r\n : 'pplus',\r\n actionKey:\r\n typeof candidate?.actionKey === 'string' ? candidate.actionKey : '',\r\n configJson:\r\n typeof candidate?.configJson === 'string'\r\n ? candidate.configJson\r\n : safeJsonStringify(candidate?.configJson ?? {}),\r\n failureBehavior:\r\n typeof candidate?.failureBehavior === 'string'\r\n ? candidate.failureBehavior\r\n : 'Stop',\r\n timeoutSeconds: Number(candidate?.timeoutSeconds ?? 300),\r\n displayName:\r\n typeof candidate?.displayName === 'string' ? candidate.displayName : null,\r\n description:\r\n typeof candidate?.description === 'string' ? candidate.description : null,\r\n configSchemaJson:\r\n typeof candidate?.configSchemaJson === 'string'\r\n ? candidate.configSchemaJson\r\n : null,\r\n requiredContextKeys: Array.isArray(candidate?.requiredContextKeys)\r\n ? candidate.requiredContextKeys.map(String)\r\n : [],\r\n supportedScopes: Array.isArray(candidate?.supportedScopes)\r\n ? candidate.supportedScopes.map(String)\r\n : [],\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowAppActionDescriptors(\r\n data: unknown,\r\n): WorkflowAppActionDescriptor[] {\r\n return extractCollection(data, ['actions', 'items'])\r\n .map(normalizeWorkflowAppActionDescriptor)\r\n .filter(Boolean);\r\n}\r\n\r\nfunction normalizeWorkflowAppActionDescriptor(\r\n data: unknown,\r\n): WorkflowAppActionDescriptor {\r\n const record = isRecord(data) ? data : {};\r\n\r\n return {\r\n appCode: readString(record, 'appCode') ?? 'pplus',\r\n actionKey: readString(record, 'actionKey') ?? '',\r\n displayName:\r\n readString(record, 'displayName') ??\r\n readString(record, 'name') ??\r\n readString(record, 'actionKey') ??\r\n '',\r\n description: readString(record, 'description') ?? null,\r\n configSchemaJson: readString(record, 'configSchemaJson') ?? null,\r\n requiredContextKeys: Array.isArray(record['requiredContextKeys'])\r\n ? record['requiredContextKeys'].map(String)\r\n : [],\r\n supportedScopes: Array.isArray(record['supportedScopes'])\r\n ? record['supportedScopes'].map(String)\r\n : [],\r\n };\r\n}\r\n\r\nfunction upsertWorkflowAppActionDescriptor(\r\n descriptors: WorkflowAppActionDescriptor[],\r\n descriptor: WorkflowAppActionDescriptor,\r\n): WorkflowAppActionDescriptor[] {\r\n const index = descriptors.findIndex(\r\n (item) => item.actionKey === descriptor.actionKey,\r\n );\r\n\r\n if (index < 0) {\r\n return [...descriptors, descriptor];\r\n }\r\n\r\n return descriptors.map((item, currentIndex) =>\r\n currentIndex === index ? { ...item, ...descriptor } : item,\r\n );\r\n}\r\n\r\nfunction extractCollection(\r\n data: unknown,\r\n nestedKeys: string[],\r\n): Array<Record<string, unknown>> {\r\n if (Array.isArray(data)) {\r\n return data.filter(isRecord);\r\n }\r\n\r\n if (!isRecord(data)) {\r\n return [];\r\n }\r\n\r\n for (const key of nestedKeys) {\r\n const nestedValue = data[key];\r\n if (Array.isArray(nestedValue)) {\r\n return nestedValue.filter(isRecord);\r\n }\r\n }\r\n\r\n return [];\r\n}\r\n\r\nfunction readString(\r\n record: Record<string, unknown>,\r\n key: string,\r\n): string | null {\r\n const value = record[key];\r\n return typeof value === 'string' && value.trim().length > 0 ? value : null;\r\n}\r\n\r\nfunction safeJsonStringify(value: unknown): string {\r\n try {\r\n return JSON.stringify(value ?? {});\r\n } catch {\r\n return '{}';\r\n }\r\n}\r\n\r\nfunction isRecord(value: unknown): value is Record<string, unknown> {\r\n return !!value && typeof value === 'object' && !Array.isArray(value);\r\n}\r\n\r\nfunction normalizeWorkflowRole(role: any): RoleDefinition {\r\n const value = role?.value ?? role?.id;\r\n return {\r\n ...role,\r\n id: role?.id ?? value,\r\n value,\r\n name: normalizeWorkflowRoleName(role?.name),\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowRoleName(\r\n name: unknown,\r\n): string | Record<string, string> {\r\n if (name && typeof name === 'object') {\r\n return name as Record<string, string>;\r\n }\r\n\r\n const label = typeof name === 'string' ? name : '';\r\n return {\r\n display: label,\r\n en: label,\r\n ar: label,\r\n };\r\n}\r\n\r\nfunction resolveWorkflowRoleGroupLabel(group: any): string {\r\n const level = group?.level;\r\n if (typeof level === 'string') {\r\n return level;\r\n }\r\n\r\n if (level?.display) {\r\n return level.display;\r\n }\r\n\r\n if (level?.en) {\r\n return level.en;\r\n }\r\n\r\n if (level?.ar) {\r\n return level.ar;\r\n }\r\n\r\n return group?.levelKey ?? group?.scopeType ?? 'Roles';\r\n}\r\n","import { Injectable, computed, inject } from '@angular/core';\r\nimport { select, Store } from '@ngxs/store';\r\nimport type { Observable } from 'rxjs';\r\n\r\nimport type {\r\n ConnectionPayload,\r\n FormulaProperty,\r\n WorkflowAppActionDescriptor,\r\n GroupDefinition,\r\n RoleGroupDefinition,\r\n RoleDefinition,\r\n StepPayload,\r\n StepSchema,\r\n WorkflowConnection,\r\n WorkflowListItem,\r\n WorkflowLoadingName,\r\n WorkflowSchema,\r\n WorkflowStepSchema,\r\n} from './workflow.model';\r\nimport {\r\n CreateConnection,\r\n CreateStep,\r\n DeleteConnection,\r\n DeleteStep,\r\n GetAppActionDetail,\r\n GetAppActions,\r\n GetFormulaProperties,\r\n GetGroups,\r\n GetRolesForModule,\r\n GetStep,\r\n GetWorkflow,\r\n GetWorkflows,\r\n PublishWorkflow,\r\n SetModuleInfo,\r\n UpdateConnection,\r\n UpdateStep,\r\n ValidateFlow,\r\n} from './workflow.actions';\r\nimport { WorkflowState } from './workflow.state';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WorkflowFacade {\r\n private readonly store = inject(Store);\r\n\r\n readonly workflowId = select<string | number | null>(\r\n WorkflowState.workflowId,\r\n );\r\n readonly moduleType = select<string | null>(WorkflowState.moduleType);\r\n readonly moduleId = select<string | number | null>(WorkflowState.moduleId);\r\n readonly workflows = select<WorkflowListItem[]>(WorkflowState.workflows);\r\n readonly workflow = select<WorkflowSchema | null>(WorkflowState.workflow);\r\n readonly formulaProperties = select<FormulaProperty[]>(\r\n WorkflowState.formulaProperties,\r\n );\r\n readonly groups = select<GroupDefinition[]>(WorkflowState.groups);\r\n readonly roles = select<Array<RoleDefinition | RoleGroupDefinition>>(\r\n WorkflowState.roles,\r\n );\r\n readonly appActionDescriptors = select<WorkflowAppActionDescriptor[]>(\r\n WorkflowState.appActionDescriptors,\r\n );\r\n readonly selectedAppActionDescriptor =\r\n select<WorkflowAppActionDescriptor | null>(\r\n WorkflowState.selectedAppActionDescriptor,\r\n );\r\n readonly selectedStep = select<StepSchema | null>(WorkflowState.selectedStep);\r\n readonly isFlowValid = select<boolean | null>(WorkflowState.isFlowValid);\r\n readonly steps = select<WorkflowStepSchema[]>(WorkflowState.stepsSchema);\r\n readonly connections = select<WorkflowConnection[]>(\r\n WorkflowState.connections,\r\n );\r\n\r\n isLoading(loadingName: WorkflowLoadingName) {\r\n const loadingFactory = select<(name: WorkflowLoadingName) => boolean>(\r\n WorkflowState.isLoadingFactory,\r\n );\r\n return computed(() => loadingFactory()(loadingName));\r\n }\r\n\r\n error(loadingName: WorkflowLoadingName) {\r\n const errorFactory = select<(name: WorkflowLoadingName) => string | null>(\r\n WorkflowState.errorFactory,\r\n );\r\n return computed(() => errorFactory()(loadingName));\r\n }\r\n setModuleInfo(\r\n moduleType: string,\r\n moduleId: string | number,\r\n parentModuleType?: string,\r\n parentModuleId?: string | number,\r\n parentPath?: string,\r\n ): Observable<unknown> {\r\n return this.store.dispatch(\r\n new SetModuleInfo(\r\n moduleType,\r\n moduleId,\r\n parentModuleType,\r\n parentModuleId,\r\n parentPath,\r\n ),\r\n );\r\n }\r\n\r\n loadWorkflows(): Observable<unknown> {\r\n return this.store.dispatch(new GetWorkflows());\r\n }\r\n\r\n selectWorkflow(workflowId: string | number): Observable<unknown> {\r\n return this.store.dispatch(new GetWorkflow(workflowId));\r\n }\r\n\r\n loadWorkflow(): Observable<unknown> {\r\n return this.loadWorkflows();\r\n }\r\n\r\n loadFormulaProperties(): Observable<unknown> {\r\n return this.store.dispatch(new GetFormulaProperties());\r\n }\r\n\r\n loadGroups(): Observable<unknown> {\r\n return this.store.dispatch(new GetGroups());\r\n }\r\n\r\n loadRolesForModule(): Observable<unknown> {\r\n return this.store.dispatch(new GetRolesForModule());\r\n }\r\n\r\n loadAppActions(): Observable<unknown> {\r\n return this.store.dispatch(new GetAppActions());\r\n }\r\n\r\n loadAppActionDetail(actionKey: string): Observable<unknown> {\r\n return this.store.dispatch(new GetAppActionDetail(actionKey));\r\n }\r\n\r\n loadStep(stepId: string | number): Observable<unknown> {\r\n return this.store.dispatch(new GetStep(stepId));\r\n }\r\n\r\n validateFlow(): Observable<unknown> {\r\n return this.store.dispatch(new ValidateFlow());\r\n }\r\n\r\n createStep(payload: StepPayload): Observable<unknown> {\r\n return this.store.dispatch(new CreateStep(payload));\r\n }\r\n\r\n updateStep(\r\n stepId: string | number,\r\n payload: StepPayload,\r\n isInitial?: boolean,\r\n ): Observable<unknown> {\r\n return this.store.dispatch(new UpdateStep(stepId, payload, isInitial));\r\n }\r\n\r\n createConnection(payload: ConnectionPayload): Observable<unknown> {\r\n return this.store.dispatch(new CreateConnection(payload));\r\n }\r\n\r\n updateConnection(\r\n connectionId: string | number,\r\n payload: ConnectionPayload,\r\n ): Observable<unknown> {\r\n return this.store.dispatch(new UpdateConnection(connectionId, payload));\r\n }\r\n\r\n publishWorkflow(isPublished: boolean): Observable<unknown> {\r\n return this.store.dispatch(new PublishWorkflow(isPublished));\r\n }\r\n\r\n deleteStep(stepId: string | number): Observable<unknown> {\r\n return this.store.dispatch(new DeleteStep(stepId));\r\n }\r\n\r\n deleteConnection(connectionId: string | number): Observable<unknown> {\r\n return this.store.dispatch(new DeleteConnection(connectionId));\r\n }\r\n}\r\n","// shared/models/api.model.ts\n\nexport interface Response<T> {\n endpoint: string;\n status: number;\n code: number;\n locale: string;\n message?: string | null;\n errors?: any | null;\n data: T;\n cacheSession?: string;\n}\n","import type {\r\n WorkflowAppActionConfigPropertySchema,\r\n WorkflowAppActionConfigPropertyType,\r\n WorkflowAppActionConfigSchema,\r\n} from '../../store/workflow';\r\n\r\nexport type WorkflowAppActionConfigFieldKind =\r\n | 'text'\r\n | 'number'\r\n | 'toggle'\r\n | 'select'\r\n | 'json';\r\n\r\nexport interface WorkflowAppActionConfigField {\r\n key: string;\r\n title: string;\r\n description?: string | null;\r\n type: WorkflowAppActionConfigPropertyType;\r\n kind: WorkflowAppActionConfigFieldKind;\r\n required: boolean;\r\n enumValues?: Array<string | number | boolean>;\r\n jsonValueType?: 'array' | 'object';\r\n}\r\n\r\nexport interface WorkflowAppActionConfigEditorDefinition {\r\n mode: 'schema' | 'raw';\r\n schema: WorkflowAppActionConfigSchema | null;\r\n fields: WorkflowAppActionConfigField[];\r\n errors: string[];\r\n}\r\n\r\nexport interface WorkflowAppActionConfigEditorValue {\r\n fields: Record<string, unknown>;\r\n rawConfigJson: string;\r\n errors: string[];\r\n}\r\n\r\nexport interface WorkflowAppActionConfigSerializationResult {\r\n configJson: string;\r\n errors: string[];\r\n}\r\n\r\nconst SUPPORTED_PROPERTY_TYPES: WorkflowAppActionConfigPropertyType[] = [\r\n 'string',\r\n 'number',\r\n 'boolean',\r\n 'array',\r\n 'object',\r\n];\r\n\r\nexport function buildWorkflowAppActionConfigEditorDefinition(\r\n configSchemaJson: string | null | undefined,\r\n): WorkflowAppActionConfigEditorDefinition {\r\n if (!configSchemaJson?.trim()) {\r\n return {\r\n mode: 'schema',\r\n schema: {\r\n type: 'object',\r\n properties: [],\r\n required: [],\r\n },\r\n fields: [],\r\n errors: [],\r\n };\r\n }\r\n\r\n let parsedSchema: unknown;\r\n\r\n try {\r\n parsedSchema = JSON.parse(configSchemaJson);\r\n } catch {\r\n return buildRawDefinition('Invalid config schema JSON.');\r\n }\r\n\r\n if (!isRecord(parsedSchema) || parsedSchema['type'] !== 'object') {\r\n return buildRawDefinition('Config schema must use a root object.');\r\n }\r\n\r\n const propertyEntries = Object.entries(parsedSchema['properties'] ?? {});\r\n const requiredKeys = Array.isArray(parsedSchema['required'])\r\n ? parsedSchema['required'].map(String)\r\n : [];\r\n\r\n const properties: WorkflowAppActionConfigPropertySchema[] = [];\r\n\r\n for (const [key, rawProperty] of propertyEntries) {\r\n if (!isRecord(rawProperty)) {\r\n return buildRawDefinition(`Unsupported schema for \"${key}\".`);\r\n }\r\n\r\n const propertyType = resolvePropertyType(rawProperty);\r\n if (!propertyType) {\r\n return buildRawDefinition(`Unsupported schema type for \"${key}\".`);\r\n }\r\n\r\n properties.push({\r\n key,\r\n title: resolvePropertyTitle(key, rawProperty),\r\n description:\r\n typeof rawProperty['description'] === 'string'\r\n ? rawProperty['description']\r\n : null,\r\n type: propertyType,\r\n required: requiredKeys.includes(key),\r\n enumValues: Array.isArray(rawProperty['enum'])\r\n ? rawProperty['enum'].filter(isPrimitiveEnumValue)\r\n : undefined,\r\n rawSchema: rawProperty,\r\n });\r\n }\r\n\r\n const schema: WorkflowAppActionConfigSchema = {\r\n type: 'object',\r\n properties,\r\n required: requiredKeys,\r\n };\r\n\r\n return {\r\n mode: 'schema',\r\n schema,\r\n fields: properties.map(mapSchemaPropertyToField),\r\n errors: [],\r\n };\r\n}\r\n\r\nexport function mapWorkflowAppActionConfigJsonToEditorValue(\r\n configJson: string | null | undefined,\r\n definition: WorkflowAppActionConfigEditorDefinition,\r\n): WorkflowAppActionConfigEditorValue {\r\n const rawConfigJson =\r\n typeof configJson === 'string' && configJson.trim().length\r\n ? configJson\r\n : '{}';\r\n\r\n if (definition.mode === 'raw' || !definition.schema) {\r\n const errors = isValidJson(rawConfigJson) ? [] : ['Invalid config JSON.'];\r\n return {\r\n fields: {},\r\n rawConfigJson,\r\n errors,\r\n };\r\n }\r\n\r\n let parsedValue: Record<string, unknown> = {};\r\n\r\n try {\r\n const candidate = JSON.parse(rawConfigJson);\r\n if (isRecord(candidate)) {\r\n parsedValue = candidate;\r\n }\r\n } catch {\r\n return {\r\n fields: {},\r\n rawConfigJson,\r\n errors: ['Invalid config JSON.'],\r\n };\r\n }\r\n\r\n const fields = definition.fields.reduce<Record<string, unknown>>(\r\n (result, field) => {\r\n const fieldValue = parsedValue[field.key];\r\n\r\n if (field.kind === 'json') {\r\n result[field.key] =\r\n fieldValue === undefined ? '' : JSON.stringify(fieldValue, null, 2);\r\n return result;\r\n }\r\n\r\n result[field.key] = fieldValue ?? null;\r\n return result;\r\n },\r\n {},\r\n );\r\n\r\n return {\r\n fields,\r\n rawConfigJson,\r\n errors: [],\r\n };\r\n}\r\n\r\nexport function serializeWorkflowAppActionConfigValue(\r\n value: Record<string, unknown>,\r\n definition: WorkflowAppActionConfigEditorDefinition,\r\n rawConfigJson?: string | null,\r\n): WorkflowAppActionConfigSerializationResult {\r\n if (definition.mode === 'raw' || !definition.schema) {\r\n const normalizedRawConfigJson =\r\n typeof rawConfigJson === 'string' && rawConfigJson.trim().length\r\n ? rawConfigJson\r\n : '{}';\r\n\r\n if (!isValidJson(normalizedRawConfigJson)) {\r\n return {\r\n configJson: normalizedRawConfigJson,\r\n errors: ['Invalid config JSON.'],\r\n };\r\n }\r\n\r\n return {\r\n configJson: normalizedRawConfigJson,\r\n errors: [],\r\n };\r\n }\r\n\r\n const errors: string[] = [];\r\n const serializedValue: Record<string, unknown> = {};\r\n\r\n definition.fields.forEach((field) => {\r\n const rawFieldValue = value[field.key];\r\n\r\n if (field.kind === 'json') {\r\n const stringValue =\r\n typeof rawFieldValue === 'string' ? rawFieldValue.trim() : '';\r\n\r\n if (!stringValue) {\r\n if (field.required) {\r\n errors.push(`${field.title} is required.`);\r\n }\r\n return;\r\n }\r\n\r\n try {\r\n const parsedFieldValue = JSON.parse(stringValue);\r\n if (\r\n field.jsonValueType === 'array' &&\r\n !Array.isArray(parsedFieldValue)\r\n ) {\r\n errors.push(`${field.title} must be a JSON array.`);\r\n return;\r\n }\r\n\r\n if (\r\n field.jsonValueType === 'object' &&\r\n (!isRecord(parsedFieldValue) || Array.isArray(parsedFieldValue))\r\n ) {\r\n errors.push(`${field.title} must be a JSON object.`);\r\n return;\r\n }\r\n\r\n serializedValue[field.key] = parsedFieldValue;\r\n } catch {\r\n errors.push(`${field.title} must be valid JSON.`);\r\n }\r\n\r\n return;\r\n }\r\n\r\n if (\r\n rawFieldValue === null ||\r\n rawFieldValue === undefined ||\r\n rawFieldValue === ''\r\n ) {\r\n if (field.required) {\r\n errors.push(`${field.title} is required.`);\r\n }\r\n return;\r\n }\r\n\r\n serializedValue[field.key] = rawFieldValue;\r\n });\r\n\r\n return {\r\n configJson: JSON.stringify(serializedValue),\r\n errors,\r\n };\r\n}\r\n\r\nfunction buildRawDefinition(\r\n error: string,\r\n): WorkflowAppActionConfigEditorDefinition {\r\n return {\r\n mode: 'raw',\r\n schema: null,\r\n fields: [],\r\n errors: [error],\r\n };\r\n}\r\n\r\nfunction mapSchemaPropertyToField(\r\n property: WorkflowAppActionConfigPropertySchema,\r\n): WorkflowAppActionConfigField {\r\n if (property.enumValues?.length) {\r\n return {\r\n key: property.key,\r\n title: property.title,\r\n description: property.description,\r\n type: property.type,\r\n kind: 'select',\r\n required: property.required,\r\n enumValues: property.enumValues,\r\n };\r\n }\r\n\r\n if (property.type === 'array' || property.type === 'object') {\r\n return {\r\n key: property.key,\r\n title: property.title,\r\n description: property.description,\r\n type: property.type,\r\n kind: 'json',\r\n required: property.required,\r\n jsonValueType: property.type,\r\n };\r\n }\r\n\r\n return {\r\n key: property.key,\r\n title: property.title,\r\n description: property.description,\r\n type: property.type,\r\n kind:\r\n property.type === 'boolean'\r\n ? 'toggle'\r\n : property.type === 'number'\r\n ? 'number'\r\n : 'text',\r\n required: property.required,\r\n };\r\n}\r\n\r\nfunction resolvePropertyType(\r\n property: Record<string, unknown>,\r\n): WorkflowAppActionConfigPropertyType | null {\r\n const typeValue = property['type'];\r\n\r\n if (typeof typeValue === 'string') {\r\n return normalizePropertyType(typeValue);\r\n }\r\n\r\n if (Array.isArray(typeValue)) {\r\n for (const item of typeValue) {\r\n if (typeof item !== 'string' || item === 'null') {\r\n continue;\r\n }\r\n\r\n const normalizedType = normalizePropertyType(item);\r\n if (normalizedType) {\r\n return normalizedType;\r\n }\r\n }\r\n }\r\n\r\n if (Array.isArray(property['enum']) && property['enum'].length > 0) {\r\n const firstEnumValue = property['enum'].find((item) => item !== null);\r\n if (typeof firstEnumValue === 'boolean') {\r\n return 'boolean';\r\n }\r\n if (typeof firstEnumValue === 'number') {\r\n return 'number';\r\n }\r\n if (typeof firstEnumValue === 'string') {\r\n return 'string';\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction normalizePropertyType(\r\n type: string,\r\n): WorkflowAppActionConfigPropertyType | null {\r\n if (type === 'integer' || type === 'number') {\r\n return 'number';\r\n }\r\n\r\n return SUPPORTED_PROPERTY_TYPES.includes(\r\n type as WorkflowAppActionConfigPropertyType,\r\n )\r\n ? (type as WorkflowAppActionConfigPropertyType)\r\n : null;\r\n}\r\n\r\nfunction resolvePropertyTitle(\r\n key: string,\r\n property: Record<string, unknown>,\r\n): string {\r\n if (\r\n typeof property['title'] === 'string' &&\r\n property['title'].trim().length\r\n ) {\r\n return property['title'];\r\n }\r\n\r\n return key\r\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\r\n .replace(/[_-]+/g, ' ')\r\n .replace(/\\s+/g, ' ')\r\n .trim()\r\n .replace(/\\b\\w/g, (character) => character.toUpperCase());\r\n}\r\n\r\nfunction isPrimitiveEnumValue(\r\n value: unknown,\r\n): value is string | number | boolean {\r\n return (\r\n typeof value === 'string' ||\r\n typeof value === 'number' ||\r\n typeof value === 'boolean'\r\n );\r\n}\r\n\r\nfunction isValidJson(value: string): boolean {\r\n try {\r\n JSON.parse(value);\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n}\r\n\r\nfunction isRecord(value: unknown): value is Record<string, unknown> {\r\n return !!value && typeof value === 'object' && !Array.isArray(value);\r\n}\r\n","import type {\r\n StepPayload,\r\n StepPropertyPayload,\r\n StepSchema,\r\n WorkflowAppActionFailureBehavior,\r\n WorkflowStepType,\r\n} from '../../store/workflow';\r\n\r\nexport interface WorkflowStepEditorValue {\r\n name: Record<string, string>;\r\n type: WorkflowStepType;\r\n targetType: string;\r\n group: number | null;\r\n role: string | null;\r\n sla: number;\r\n}\r\n\r\nexport interface WorkflowAppActionEditorValue {\r\n actionKey: string | null;\r\n failureBehavior: WorkflowAppActionFailureBehavior;\r\n timeoutSeconds: number;\r\n configJson: string;\r\n}\r\n\r\nexport interface WorkflowStepEditorState {\r\n stepFormValue: WorkflowStepEditorValue;\r\n appActionValue: WorkflowAppActionEditorValue;\r\n}\r\n\r\nexport interface BuildWorkflowStepPayloadOptions {\r\n formValue: WorkflowStepEditorValue;\r\n properties: StepPropertyPayload[];\r\n hasNotification: boolean;\r\n appActionValue?: WorkflowAppActionEditorValue | null;\r\n}\r\n\r\nexport const DEFAULT_WORKFLOW_STEP_NAME = {\r\n en: '',\r\n ar: '',\r\n};\r\n\r\nexport const DEFAULT_APP_ACTION_EDITOR_VALUE: WorkflowAppActionEditorValue = {\r\n actionKey: null,\r\n failureBehavior: 'Stop',\r\n timeoutSeconds: 300,\r\n configJson: '{}',\r\n};\r\n\r\nexport function createDefaultWorkflowStepEditorValue(): WorkflowStepEditorValue {\r\n return {\r\n name: { ...DEFAULT_WORKFLOW_STEP_NAME },\r\n type: 'UserInput',\r\n targetType: '1',\r\n group: null,\r\n role: null,\r\n sla: 0,\r\n };\r\n}\r\n\r\nexport function mapWorkflowStepToEditorState(\r\n step: StepSchema | null | undefined,\r\n): WorkflowStepEditorState {\r\n if (!step) {\r\n return {\r\n stepFormValue: createDefaultWorkflowStepEditorValue(),\r\n appActionValue: { ...DEFAULT_APP_ACTION_EDITOR_VALUE },\r\n };\r\n }\r\n\r\n const type = normalizeWorkflowStepType(step.type);\r\n\r\n return {\r\n stepFormValue: {\r\n name: normalizeStepName(step.name),\r\n type,\r\n targetType: step.targetType || '1',\r\n group:\r\n type === 'UserInput' && step.targetType === '1' && step.targetValue\r\n ? Number(step.targetValue)\r\n : null,\r\n role:\r\n type === 'UserInput' && step.targetType === '2'\r\n ? (step.targetValue ?? null)\r\n : null,\r\n sla: Number(step.sla ?? 0),\r\n },\r\n appActionValue: {\r\n actionKey: step.appAction?.actionKey ?? null,\r\n failureBehavior: step.appAction?.failureBehavior ?? 'Stop',\r\n timeoutSeconds: Number(step.appAction?.timeoutSeconds ?? 300),\r\n configJson: step.appAction?.configJson ?? '{}',\r\n },\r\n };\r\n}\r\n\r\nexport function buildWorkflowStepPayload({\r\n formValue,\r\n properties,\r\n hasNotification,\r\n appActionValue,\r\n}: BuildWorkflowStepPayloadOptions): StepPayload {\r\n const type = normalizeWorkflowStepType(formValue.type);\r\n\r\n if (type === 'AppAction') {\r\n return {\r\n type,\r\n name: normalizeStepName(formValue.name),\r\n sla: Number(formValue.sla ?? 0),\r\n properties: [],\r\n hasNotification,\r\n appCode: 'pplus',\r\n actionKey: appActionValue?.actionKey ?? '',\r\n configJson: appActionValue?.configJson ?? '{}',\r\n failureBehavior: appActionValue?.failureBehavior ?? 'Stop',\r\n timeoutSeconds: Number(appActionValue?.timeoutSeconds ?? 300),\r\n };\r\n }\r\n\r\n return {\r\n type,\r\n name: normalizeStepName(formValue.name),\r\n targetType: formValue.targetType || '1',\r\n targetValue:\r\n formValue.targetType === '1'\r\n ? (formValue.group ?? undefined)\r\n : (formValue.role ?? undefined),\r\n sla: Number(formValue.sla ?? 0),\r\n properties,\r\n hasNotification,\r\n hasForm: true,\r\n };\r\n}\r\n\r\nexport function normalizeWorkflowStepType(type: unknown): WorkflowStepType {\r\n return type === 'AppAction' ? 'AppAction' : 'UserInput';\r\n}\r\n\r\nfunction normalizeStepName(\r\n name: Record<string, string> | string | null | undefined,\r\n): Record<string, string> {\r\n if (name && typeof name === 'object') {\r\n return {\r\n en: name['en'] ?? '',\r\n ar: name['ar'] ?? '',\r\n ...(name['display'] ? { display: name['display'] } : {}),\r\n };\r\n }\r\n\r\n const label = typeof name === 'string' ? name : '';\r\n return {\r\n display: label,\r\n en: label,\r\n ar: label,\r\n };\r\n}\r\n","import { Component, inject } from '@angular/core';\nimport { FormBuilder } from '@masterteam/form-builder';\nimport { ModalService } from '@masterteam/components/modal';\n\n@Component({\n selector: 'mt-workflow-form-drawer',\n imports: [FormBuilder],\n templateUrl: './workflow-form-drawer.html',\n styleUrl: './workflow-form-drawer.css',\n})\nexport class WorkflowFormDrawer {\n readonly modal = inject(ModalService);\n}\n","<div [class]=\"modal.contentClass + ' p-4'\">\n <mt-form-builder\n class=\"flex-1\"\n canvasStyleClass=\"!w-full\"\n mode=\"manageProperties\"\n />\n</div>\n","import { Component } from '@angular/core';\nimport { NotificationTemplate } from '@masterteam/notification';\nimport { Card } from '@masterteam/components/card';\n\n@Component({\n selector: 'mt-workflow-notifications-drawer',\n imports: [Card, NotificationTemplate, Card],\n templateUrl: './workflow-notifications-drawer.html',\n styleUrl: './workflow-notifications-drawer.css',\n})\nexport class WorkflowNotificationsDrawer {}\n","<div class=\"overflow-hidden h-full w-full\">\n <div\n class=\"flex-1 flex justify-center items-start p-4 h-full overflow-y-auto\"\n >\n <div class=\"w-2/3\">\n <mt-card headless>\n <mt-notification-template />\n </mt-card>\n </div>\n </div>\n</div>\n","import { Component, computed, effect, inject, signal } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { TranslocoModule, TranslocoService } from '@jsverse/transloco';\r\nimport { DynamicFormConfig } from '@masterteam/components';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { Card } from '@masterteam/components/card';\r\nimport { ConfirmationService } from '@masterteam/components/confirmation';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { NumberField } from '@masterteam/components/number-field';\r\nimport { SelectField } from '@masterteam/components/select-field';\r\nimport { TextField } from '@masterteam/components/text-field';\r\nimport { TextareaField } from '@masterteam/components/textarea-field';\r\nimport { ToggleField } from '@masterteam/components/toggle-field';\r\nimport { FormBuilderFacade } from '@masterteam/form-builder';\r\nimport {\r\n NotificationFacade,\r\n NotificationTemplate,\r\n} from '@masterteam/notification';\r\nimport type {\r\n NodeDialogFooterConfig,\r\n SBAction,\r\n} from '@masterteam/structure-builder';\r\nimport { StructureBuilder } from '@masterteam/structure-builder';\r\nimport { Tabs } from '@masterteam/components/tabs';\r\nimport { Skeleton } from 'primeng/skeleton';\r\n\r\nimport type {\r\n StepPropertyPayload,\r\n StepSchema,\r\n WorkflowAppActionDescriptor,\r\n WorkflowAppActionFailureBehavior,\r\n WorkflowStepSchema,\r\n WorkflowStepType,\r\n} from '../../store/workflow';\r\nimport { WorkflowFacade } from '../../store/workflow';\r\nimport type { WorkflowAppActionConfigField } from './workflow-app-action-config.utils';\r\nimport {\r\n buildWorkflowAppActionConfigEditorDefinition,\r\n mapWorkflowAppActionConfigJsonToEditorValue,\r\n serializeWorkflowAppActionConfigValue,\r\n} from './workflow-app-action-config.utils';\r\nimport {\r\n buildWorkflowStepPayload,\r\n createDefaultWorkflowStepEditorValue,\r\n DEFAULT_APP_ACTION_EDITOR_VALUE,\r\n mapWorkflowStepToEditorState,\r\n normalizeWorkflowStepType,\r\n} from './workflow-step.utils';\r\nimport { WorkflowFormDrawer } from './workflow-form-drawer/workflow-form-drawer';\r\nimport { WorkflowNotificationsDrawer } from './workflow-notifications-drawer/workflow-notifications-drawer';\r\n\r\n@Component({\r\n selector: 'mt-workflow-builder',\r\n imports: [\r\n StructureBuilder,\r\n Card,\r\n Tabs,\r\n ReactiveFormsModule,\r\n FormsModule,\r\n Skeleton,\r\n ToggleField,\r\n Button,\r\n TranslocoModule,\r\n NotificationTemplate,\r\n SelectField,\r\n TextField,\r\n NumberField,\r\n TextareaField,\r\n ],\r\n templateUrl: './workflow-builder.html',\r\n styles: [],\r\n host: {},\r\n})\r\nexport class WorkflowBuilder {\r\n private readonly workflowFacade = inject(WorkflowFacade);\r\n private readonly notificationFacade = inject(NotificationFacade);\r\n private readonly formBuilderFacade = inject(FormBuilderFacade);\r\n private readonly transloco = inject(TranslocoService);\r\n private readonly confirmationService = inject(ConfirmationService);\r\n\r\n readonly modal: ModalService = inject(ModalService);\r\n\r\n private isPatchingStepForm = false;\r\n private lastAppActionDescriptorSignature = '';\r\n\r\n readonly mainTab = signal<'workflow' | 'notification'>('workflow');\r\n readonly selectedTab = signal<'tab1' | 'tab2' | 'tab3'>('tab1');\r\n readonly isPublished = signal(false);\r\n readonly isEditingInitialNode = signal(false);\r\n readonly isCreatingStep = signal(false);\r\n readonly currentStepType = signal<WorkflowStepType>('UserInput');\r\n readonly draftAppActionDescriptor =\r\n signal<WorkflowAppActionDescriptor | null>(null);\r\n readonly nodeFields = signal({\r\n name: 'name.display',\r\n icon: 'icon',\r\n color: 'color',\r\n subtitle: 'subtitle',\r\n badge: 'badge',\r\n status: 'status',\r\n style: 'style',\r\n });\r\n\r\n readonly workflow = this.workflowFacade.workflow;\r\n readonly workflows = this.workflowFacade.workflows;\r\n readonly selectedStep = this.workflowFacade.selectedStep;\r\n readonly groups = this.workflowFacade.groups;\r\n readonly roles = this.workflowFacade.roles;\r\n readonly appActionDescriptors = this.workflowFacade.appActionDescriptors;\r\n readonly selectedAppActionDescriptor =\r\n this.workflowFacade.selectedAppActionDescriptor;\r\n readonly isFlowValid = this.workflowFacade.isFlowValid;\r\n\r\n readonly loading = this.workflowFacade.isLoading('getWorkflow');\r\n readonly loadingStep = this.workflowFacade.isLoading('getStep');\r\n readonly loadingAppActions = this.workflowFacade.isLoading('getAppActions');\r\n readonly loadingAppActionDetail =\r\n this.workflowFacade.isLoading('getAppActionDetail');\r\n\r\n readonly appActionListError = this.workflowFacade.error('getAppActions');\r\n readonly appActionDetailError =\r\n this.workflowFacade.error('getAppActionDetail');\r\n\r\n readonly selectedWorkflowId = computed(() => this.workflow()?.id);\r\n readonly connectionFormulaSchemaId = computed(() => this.workflow()?.id);\r\n readonly hasMultipleWorkflows = computed(() => this.workflows().length > 1);\r\n readonly isPublishDisabled = computed(() => !this.isFlowValid());\r\n readonly hasGroupedRoles = computed(() =>\r\n this.roles().some((role: any) => Array.isArray(role?.items)),\r\n );\r\n\r\n readonly stepForm = new FormGroup({\r\n nameEn: new FormControl('', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n nameAr: new FormControl('', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n type: new FormControl<WorkflowStepType>('UserInput', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n targetType: new FormControl('1', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n group: new FormControl<number | null>(null),\r\n role: new FormControl<string | number | null>(null),\r\n sla: new FormControl(0, {\r\n nonNullable: true,\r\n validators: [Validators.required, Validators.min(0)],\r\n }),\r\n });\r\n\r\n readonly appActionSettingsForm = new FormGroup({\r\n actionKey: new FormControl<string | null>(null, Validators.required),\r\n failureBehavior: new FormControl<WorkflowAppActionFailureBehavior>('Stop', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n timeoutSeconds: new FormControl(300, {\r\n nonNullable: true,\r\n validators: [Validators.required, Validators.min(1)],\r\n }),\r\n });\r\n\r\n readonly appActionRawConfigControl = new FormControl('{}', {\r\n nonNullable: true,\r\n });\r\n readonly appActionConfigForm = new FormGroup({});\r\n readonly showHideControl = new FormControl(false, {\r\n nonNullable: true,\r\n });\r\n\r\n readonly appActionConfigDefinition = signal(\r\n buildWorkflowAppActionConfigEditorDefinition(null),\r\n );\r\n\r\n private readonly propertiesTableDataState = signal<any[]>([]);\r\n readonly propertiesTableData = computed(() =>\r\n this.propertiesTableDataState(),\r\n );\r\n\r\n readonly mainTabsList = computed(() => [\r\n {\r\n label: this.transloco.translate('workflow.builder.workflow'),\r\n value: 'workflow',\r\n },\r\n {\r\n label: this.transloco.translate('workflow.builder.notification'),\r\n value: 'notification',\r\n },\r\n ]);\r\n\r\n readonly failureBehaviorOptions = computed(() => [\r\n {\r\n label: this.transloco.translate('workflow.builder.failureBehaviorStop'),\r\n value: 'Stop',\r\n },\r\n {\r\n label: this.transloco.translate(\r\n 'workflow.builder.failureBehaviorContinue',\r\n ),\r\n value: 'Continue',\r\n },\r\n ]);\r\n\r\n readonly tabsList = computed(() => {\r\n const tabs = [\r\n {\r\n label: this.transloco.translate('workflow.builder.tabSettings'),\r\n value: 'tab1',\r\n },\r\n ];\r\n\r\n if (!this.isCreatingStep() && this.currentStepType() === 'UserInput') {\r\n tabs.push({\r\n label: this.transloco.translate('workflow.builder.form'),\r\n value: 'tab2',\r\n });\r\n }\r\n\r\n if (!this.isCreatingStep() && !this.isEditingInitialNode()) {\r\n tabs.push({\r\n label: this.transloco.translate('workflow.builder.notification'),\r\n value: 'tab3',\r\n });\r\n }\r\n\r\n return tabs;\r\n });\r\n\r\n readonly availableNodes = computed(() => [\r\n {\r\n id: 'FormStep',\r\n type: 'UserInput' as WorkflowStepType,\r\n label: this.transloco.translate('workflow.builder.newStep'),\r\n tab: [this.transloco.translate('workflow.builder.userInputTab')],\r\n name: {\r\n en: 'Form Step',\r\n ar: 'خطوة النموذج',\r\n },\r\n targetType: '1',\r\n icon: 'file.clipboard-check',\r\n color: '#0369A1',\r\n subtitle: this.transloco.translate('workflow.builder.stepTypeUserInput'),\r\n },\r\n ...this.appActionDescriptors().map((descriptor) => ({\r\n id: `AppActionStep:${descriptor.actionKey}`,\r\n type: 'AppAction' as WorkflowStepType,\r\n tab: [this.transloco.translate('workflow.builder.appActionsTab')],\r\n label: descriptor.displayName,\r\n name: {\r\n en: descriptor.displayName,\r\n ar: descriptor.displayName,\r\n display: descriptor.displayName,\r\n },\r\n appCode: descriptor.appCode,\r\n actionKey: descriptor.actionKey,\r\n displayName: descriptor.displayName,\r\n description: descriptor.description ?? null,\r\n configSchemaJson: descriptor.configSchemaJson ?? null,\r\n requiredContextKeys: descriptor.requiredContextKeys ?? [],\r\n supportedScopes: descriptor.supportedScopes ?? [],\r\n icon: 'general.zap',\r\n color: '#B45309',\r\n subtitle: this.transloco.translate('workflow.builder.stepTypeAppAction'),\r\n style: 'icon',\r\n })),\r\n ]);\r\n\r\n readonly nodeActions = signal([\r\n {\r\n key: 'edit',\r\n icon: 'general.edit-05',\r\n variant: 'outlined',\r\n size: 'small',\r\n tooltip: 'Edit',\r\n },\r\n {\r\n key: 'delete',\r\n icon: 'general.trash-01',\r\n variant: 'outlined',\r\n size: 'small',\r\n severity: 'danger',\r\n tooltip: 'Delete',\r\n condition: (node: WorkflowStepSchema) => !node.isInitial,\r\n },\r\n ]);\r\n\r\n readonly nodeDialogFooterConfig: NodeDialogFooterConfig = {\r\n showSaveButton: () => this.selectedTab() === 'tab1',\r\n disableSaveButton: () => this.isNodeDialogSaveDisabled(),\r\n };\r\n\r\n readonly connectionForm = signal<DynamicFormConfig>({\r\n sections: [\r\n {\r\n key: 'basic',\r\n label: this.transloco.translate('workflow.builder.basic-information'),\r\n type: 'none',\r\n cssClass: 'p-4',\r\n columns: 2,\r\n order: 1,\r\n fields: [\r\n {\r\n key: 'priority',\r\n label: this.transloco.translate('workflow.builder.priority'),\r\n },\r\n ],\r\n },\r\n ],\r\n });\r\n\r\n readonly connectionFormulaConfig = signal({\r\n codeOnly: true,\r\n toolbarTabs: ['functions', 'operators'] as const,\r\n isProcessBuilder: true,\r\n });\r\n\r\n readonly steps = computed(() =>\r\n this.workflowFacade.steps().map((step) => {\r\n const isAppAction = step.type === 'AppAction';\r\n return {\r\n ...step,\r\n color: isAppAction ? '#B45309' : '#0369A1',\r\n icon: isAppAction\r\n ? 'general.zap'\r\n : step.isInitial\r\n ? 'map.flag-04'\r\n : 'file.clipboard-check',\r\n subtitle: this.getStepTypeLabel(step.type),\r\n badge: step.isInitial\r\n ? this.transloco.translate('workflow.builder.initial')\r\n : null,\r\n style: isAppAction ? 'icon' : 'detail',\r\n };\r\n }),\r\n );\r\n\r\n readonly connections = computed(() =>\r\n this.workflowFacade.connections().map((connection) => ({\r\n ...connection,\r\n from: connection.source,\r\n to: connection.target,\r\n })),\r\n );\r\n\r\n readonly currentAppActionDescriptor =\r\n computed<WorkflowAppActionDescriptor | null>(() => {\r\n const actionKey = this.appActionSettingsForm.controls.actionKey.value;\r\n if (!actionKey) {\r\n return null;\r\n }\r\n\r\n const selectedDescriptor = this.selectedAppActionDescriptor();\r\n if (selectedDescriptor?.actionKey === actionKey) {\r\n return selectedDescriptor;\r\n }\r\n\r\n const cachedDescriptor = this.appActionDescriptors().find(\r\n (descriptor) => descriptor.actionKey === actionKey,\r\n );\r\n if (cachedDescriptor) {\r\n return cachedDescriptor;\r\n }\r\n\r\n const draftDescriptor = this.draftAppActionDescriptor();\r\n if (draftDescriptor?.actionKey === actionKey) {\r\n return draftDescriptor;\r\n }\r\n\r\n const step = this.selectedStep();\r\n if (\r\n step?.type === 'AppAction' &&\r\n step.appAction?.actionKey === actionKey\r\n ) {\r\n return {\r\n appCode: step.appAction.appCode,\r\n actionKey,\r\n displayName: step.appAction.displayName ?? actionKey,\r\n description: step.appAction.description ?? null,\r\n configSchemaJson: step.appAction.configSchemaJson ?? null,\r\n requiredContextKeys: step.appAction.requiredContextKeys ?? [],\r\n supportedScopes: step.appAction.supportedScopes ?? [],\r\n };\r\n }\r\n\r\n return null;\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const workflow = this.workflow();\r\n if (workflow?.isPublished !== undefined) {\r\n this.isPublished.set(workflow.isPublished);\r\n }\r\n });\r\n\r\n effect(() => {\r\n if (this.mainTab() === 'workflow') {\r\n this.workflowFacade.loadAppActions();\r\n }\r\n });\r\n\r\n effect(() => {\r\n const step = this.selectedStep();\r\n if (step) {\r\n this.applyLoadedStep(step);\r\n }\r\n });\r\n\r\n effect(() => {\r\n if (this.currentStepType() !== 'AppAction') {\r\n this.lastAppActionDescriptorSignature = '';\r\n return;\r\n }\r\n\r\n const actionKey = this.appActionSettingsForm.controls.actionKey.value;\r\n if (!actionKey) {\r\n this.lastAppActionDescriptorSignature = '';\r\n return;\r\n }\r\n\r\n const descriptor = this.currentAppActionDescriptor();\r\n const signature = this.createAppActionDescriptorSignature(\r\n actionKey,\r\n descriptor?.configSchemaJson ?? null,\r\n );\r\n\r\n if (signature === this.lastAppActionDescriptorSignature) {\r\n return;\r\n }\r\n\r\n this.rebuildAppActionConfigEditor(\r\n this.getCurrentAppActionConfigJson(),\r\n descriptor?.configSchemaJson ?? null,\r\n );\r\n this.lastAppActionDescriptorSignature = signature;\r\n });\r\n\r\n this.stepForm.controls.targetType.valueChanges\r\n .pipe(takeUntilDestroyed())\r\n .subscribe(() => this.syncUserInputValidators());\r\n\r\n this.appActionSettingsForm.controls.actionKey.valueChanges\r\n .pipe(takeUntilDestroyed())\r\n .subscribe((actionKey) => {\r\n if (this.isPatchingStepForm) {\r\n return;\r\n }\r\n this.onAppActionActionChanged(actionKey);\r\n });\r\n }\r\n\r\n onMainTabChange(tab: string): void {\r\n this.mainTab.set(tab as 'workflow' | 'notification');\r\n if (tab === 'notification') {\r\n const workflowId = this.workflow()?.id;\r\n if (workflowId) {\r\n this.notificationFacade.setModuleInfo('request', workflowId);\r\n this.notificationFacade.loadBaseData();\r\n }\r\n }\r\n }\r\n\r\n onNodeDialogTabChange(tab: string): void {\r\n this.selectedTab.set(tab as 'tab1' | 'tab2' | 'tab3');\r\n }\r\n\r\n onPublishToggle(isPublished: boolean): void {\r\n if (isPublished && !this.isFlowValid()) {\r\n this.isPublished.set(false);\r\n return;\r\n }\r\n\r\n this.workflowFacade.publishWorkflow(isPublished).subscribe({\r\n error: () => {\r\n this.isPublished.set(!isPublished);\r\n },\r\n });\r\n }\r\n\r\n onWorkflowChange(workflowId: number): void {\r\n this.workflowFacade.selectWorkflow(workflowId);\r\n }\r\n\r\n onStructureAction(event: SBAction): void {\r\n switch (event.action) {\r\n case 'startCreating': {\r\n const stepType = normalizeWorkflowStepType(event.data?.type);\r\n this.clearForm(stepType);\r\n this.isCreatingStep.set(true);\r\n this.applyCreateNodeDefaults(event.data);\r\n return;\r\n }\r\n\r\n case 'startUpdating': {\r\n if (!event.data) {\r\n return;\r\n }\r\n\r\n this.clearForm(normalizeWorkflowStepType(event.data.type));\r\n this.isCreatingStep.set(false);\r\n this.isEditingInitialNode.set(!!event.data.isInitial);\r\n this.configureStepTypeControl();\r\n this.workflowFacade.loadStep(event.data.id);\r\n\r\n if (event.data.id) {\r\n this.notificationFacade.setModuleInfo('step', event.data.id);\r\n this.notificationFacade.loadBaseData();\r\n\r\n if (event.data.type !== 'AppAction') {\r\n const workflowId = this.workflow()?.id;\r\n if (workflowId) {\r\n this.formBuilderFacade.setModuleInfo(\r\n 'processstep',\r\n event.data.id,\r\n 'processschema',\r\n workflowId,\r\n );\r\n this.formBuilderFacade.getFormConfiguration();\r\n }\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n case 'createNode': {\r\n this.isCreatingStep.set(false);\r\n const stepPayload = this.buildStepPayload();\r\n if (!stepPayload) {\r\n return;\r\n }\r\n this.workflowFacade.createStep(stepPayload);\r\n return;\r\n }\r\n\r\n case 'updateNode': {\r\n if (!event.data?.id) {\r\n return;\r\n }\r\n\r\n const stepPayload = this.buildStepPayload();\r\n if (!stepPayload) {\r\n return;\r\n }\r\n\r\n this.workflowFacade.updateStep(\r\n event.data.id,\r\n stepPayload,\r\n !!event.data.isInitial,\r\n );\r\n return;\r\n }\r\n\r\n case 'deleteNode': {\r\n if (!event.data) {\r\n return;\r\n }\r\n\r\n this.confirmationService.confirmDelete({\r\n type: 'dialog',\r\n accept: () => {\r\n this.workflowFacade.deleteStep(event.data.id);\r\n },\r\n reject: () => {},\r\n });\r\n return;\r\n }\r\n\r\n case 'createConnection': {\r\n if (!event.data) {\r\n return;\r\n }\r\n\r\n this.workflowFacade.createConnection({\r\n sourceStepId: event.data.from,\r\n targetStepId: event.data.to,\r\n priority: event.data.priority ?? 1,\r\n formula: event.data.formula ?? null,\r\n });\r\n return;\r\n }\r\n\r\n case 'updateConnection': {\r\n if (!event.data) {\r\n return;\r\n }\r\n\r\n this.workflowFacade.updateConnection(event.data.id, {\r\n sourceStepId: event.data.from,\r\n targetStepId: event.data.to,\r\n priority: event.data.priority ?? 1,\r\n formula: event.data.formula ?? null,\r\n });\r\n return;\r\n }\r\n\r\n case 'deleteConnection': {\r\n if (event.data?.id) {\r\n this.workflowFacade.deleteConnection(event.data.id);\r\n }\r\n return;\r\n }\r\n\r\n default:\r\n return;\r\n }\r\n }\r\n\r\n openNotificationsModal(): void {\r\n const notificationsDialogRef = this.modal.openModal(\r\n WorkflowNotificationsDrawer,\r\n 'drawer',\r\n {\r\n header: this.transloco.translate('workflow.builder.notification'),\r\n styleClass: '!w-[calc(100%-25rem)] !absolute',\r\n position: 'start',\r\n modal: true,\r\n dismissible: true,\r\n appendTo: '#page-content',\r\n inputValues: {},\r\n },\r\n );\r\n\r\n notificationsDialogRef.onClose.subscribe(() => {});\r\n }\r\n\r\n openFormModal(): void {\r\n const formDialogRef = this.modal.openModal(WorkflowFormDrawer, 'drawer', {\r\n header: this.transloco.translate('workflow.builder.form'),\r\n styleClass: '!w-[calc(100%-25rem)] !absolute',\r\n position: 'start',\r\n modal: true,\r\n dismissible: true,\r\n appendTo: '#page-content',\r\n inputValues: {},\r\n });\r\n\r\n formDialogRef.onClose.subscribe(() => {});\r\n }\r\n\r\n getStepBadgeClass(type: WorkflowStepType): string {\r\n return type === 'AppAction'\r\n ? 'inline-flex rounded-full bg-amber-100 px-2 py-1 text-xs font-semibold text-amber-800'\r\n : 'inline-flex rounded-full bg-sky-100 px-2 py-1 text-xs font-semibold text-sky-800';\r\n }\r\n\r\n getStepCardTitle(step: WorkflowStepSchema): string {\r\n return this.resolveDisplayName(step.name);\r\n }\r\n\r\n getStepTypeLabel(type: WorkflowStepType): string {\r\n return this.transloco.translate(\r\n type === 'AppAction'\r\n ? 'workflow.builder.stepTypeAppAction'\r\n : 'workflow.builder.stepTypeUserInput',\r\n );\r\n }\r\n\r\n getAppActionConfigControl(key: string): FormControl {\r\n return this.appActionConfigForm.get(key) as FormControl;\r\n }\r\n\r\n getAppActionEnumOptions(field: WorkflowAppActionConfigField) {\r\n return (field.enumValues ?? []).map((value) => ({\r\n label: String(value),\r\n value,\r\n }));\r\n }\r\n\r\n getAppActionDescription(): string | null {\r\n return this.currentAppActionDescriptor()?.description ?? null;\r\n }\r\n\r\n getAppActionDisplayName(): string {\r\n return (\r\n this.currentAppActionDescriptor()?.displayName ||\r\n this.appActionSettingsForm.controls.actionKey.value ||\r\n this.transloco.translate('workflow.builder.appActionUnavailable')\r\n );\r\n }\r\n\r\n getAppActionKey(): string {\r\n return this.appActionSettingsForm.controls.actionKey.value ?? '';\r\n }\r\n\r\n getAppActionConfigMessages(): string[] {\r\n const definition = this.appActionConfigDefinition();\r\n const serialization = serializeWorkflowAppActionConfigValue(\r\n this.appActionConfigForm.getRawValue(),\r\n definition,\r\n this.appActionRawConfigControl.value,\r\n );\r\n\r\n return Array.from(\r\n new Set([\r\n ...definition.errors,\r\n ...(this.appActionDetailError() ? [this.appActionDetailError()!] : []),\r\n ...serialization.errors,\r\n ]),\r\n );\r\n }\r\n\r\n getAppActionDiscoveryMessage(): string | null {\r\n if (this.currentStepType() !== 'AppAction') {\r\n return null;\r\n }\r\n\r\n if (this.appActionListError()) {\r\n return this.appActionListError();\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private clearForm(stepType: WorkflowStepType = 'UserInput'): void {\r\n const defaults = createDefaultWorkflowStepEditorValue();\r\n\r\n this.isPatchingStepForm = true;\r\n this.isEditingInitialNode.set(false);\r\n this.currentStepType.set(stepType);\r\n this.draftAppActionDescriptor.set(null);\r\n this.selectedTab.set('tab1');\r\n\r\n this.stepForm.reset(\r\n {\r\n nameEn: defaults.name['en'],\r\n nameAr: defaults.name['ar'],\r\n type: stepType,\r\n targetType: defaults.targetType,\r\n group: defaults.group,\r\n role: defaults.role,\r\n sla: defaults.sla,\r\n },\r\n { emitEvent: false },\r\n );\r\n this.configureStepTypeControl();\r\n this.resetPropertiesTable();\r\n this.showHideControl.setValue(false, { emitEvent: false });\r\n this.resetAppActionState();\r\n this.isPatchingStepForm = false;\r\n\r\n this.syncUserInputValidators();\r\n\r\n if (stepType === 'AppAction') {\r\n this.ensureAppActionDiscoveryLoaded();\r\n }\r\n }\r\n\r\n private applyLoadedStep(step: StepSchema): void {\r\n const editorState = mapWorkflowStepToEditorState(step);\r\n const stepType = step.isInitial\r\n ? 'UserInput'\r\n : editorState.stepFormValue.type;\r\n const descriptor = this.resolveDescriptorForActionKey(\r\n editorState.appActionValue.actionKey,\r\n step,\r\n );\r\n\r\n this.isPatchingStepForm = true;\r\n this.isEditingInitialNode.set(!!step.isInitial);\r\n this.currentStepType.set(stepType);\r\n this.selectedTab.set('tab1');\r\n\r\n this.stepForm.reset(\r\n {\r\n nameEn: editorState.stepFormValue.name['en'] ?? '',\r\n nameAr: editorState.stepFormValue.name['ar'] ?? '',\r\n type: stepType,\r\n targetType: editorState.stepFormValue.targetType ?? '1',\r\n group: editorState.stepFormValue.group,\r\n role: editorState.stepFormValue.role,\r\n sla: editorState.stepFormValue.sla,\r\n },\r\n { emitEvent: false },\r\n );\r\n this.configureStepTypeControl();\r\n this.populatePropertiesTable(step);\r\n this.showHideControl.setValue(step.hasNotification ?? false, {\r\n emitEvent: false,\r\n });\r\n\r\n this.appActionSettingsForm.reset(\r\n {\r\n actionKey: editorState.appActionValue.actionKey,\r\n failureBehavior: editorState.appActionValue.failureBehavior,\r\n timeoutSeconds: editorState.appActionValue.timeoutSeconds,\r\n },\r\n { emitEvent: false },\r\n );\r\n\r\n this.rebuildAppActionConfigEditor(\r\n editorState.appActionValue.configJson,\r\n descriptor?.configSchemaJson ?? step.appAction?.configSchemaJson ?? null,\r\n );\r\n this.lastAppActionDescriptorSignature =\r\n this.createAppActionDescriptorSignature(\r\n editorState.appActionValue.actionKey,\r\n descriptor?.configSchemaJson ??\r\n step.appAction?.configSchemaJson ??\r\n null,\r\n );\r\n\r\n this.isPatchingStepForm = false;\r\n this.syncUserInputValidators();\r\n\r\n if (stepType === 'AppAction') {\r\n this.ensureAppActionDiscoveryLoaded();\r\n this.ensureAppActionDetailLoaded(editorState.appActionValue.actionKey);\r\n }\r\n }\r\n\r\n private onAppActionActionChanged(actionKey: string | null): void {\r\n this.selectedTab.set('tab1');\r\n this.lastAppActionDescriptorSignature = '';\r\n\r\n this.rebuildAppActionConfigEditor(\r\n DEFAULT_APP_ACTION_EDITOR_VALUE.configJson,\r\n this.resolveDescriptorForActionKey(actionKey)?.configSchemaJson ?? null,\r\n );\r\n\r\n if (actionKey) {\r\n this.ensureAppActionDetailLoaded(actionKey);\r\n }\r\n }\r\n\r\n private applyCreateNodeDefaults(nodeData: any): void {\r\n if (!nodeData) {\r\n return;\r\n }\r\n\r\n const stepType = normalizeWorkflowStepType(nodeData.type);\r\n if (stepType !== 'AppAction') {\r\n return;\r\n }\r\n\r\n const actionKey =\r\n typeof nodeData.actionKey === 'string' ? nodeData.actionKey : null;\r\n const displayName =\r\n typeof nodeData.displayName === 'string'\r\n ? nodeData.displayName\r\n : typeof nodeData.label === 'string'\r\n ? nodeData.label\r\n : '';\r\n\r\n this.draftAppActionDescriptor.set({\r\n appCode:\r\n typeof nodeData.appCode === 'string' ? nodeData.appCode : 'pplus',\r\n actionKey: actionKey ?? '',\r\n displayName,\r\n description:\r\n typeof nodeData.description === 'string' ? nodeData.description : null,\r\n configSchemaJson:\r\n typeof nodeData.configSchemaJson === 'string'\r\n ? nodeData.configSchemaJson\r\n : null,\r\n requiredContextKeys: Array.isArray(nodeData.requiredContextKeys)\r\n ? nodeData.requiredContextKeys.map(String)\r\n : [],\r\n supportedScopes: Array.isArray(nodeData.supportedScopes)\r\n ? nodeData.supportedScopes.map(String)\r\n : [],\r\n });\r\n\r\n this.isPatchingStepForm = true;\r\n this.stepForm.patchValue(\r\n {\r\n nameEn: displayName,\r\n nameAr: displayName,\r\n type: 'AppAction',\r\n },\r\n { emitEvent: false },\r\n );\r\n this.appActionSettingsForm.patchValue(\r\n {\r\n actionKey,\r\n failureBehavior: DEFAULT_APP_ACTION_EDITOR_VALUE.failureBehavior,\r\n timeoutSeconds: DEFAULT_APP_ACTION_EDITOR_VALUE.timeoutSeconds,\r\n },\r\n { emitEvent: false },\r\n );\r\n this.isPatchingStepForm = false;\r\n\r\n this.rebuildAppActionConfigEditor(\r\n DEFAULT_APP_ACTION_EDITOR_VALUE.configJson,\r\n this.draftAppActionDescriptor()?.configSchemaJson ?? null,\r\n );\r\n this.ensureAppActionDetailLoaded(actionKey);\r\n }\r\n\r\n private resetPropertiesTable(): void {\r\n const properties = this.workflow()?.properties ?? [];\r\n this.propertiesTableDataState.set(\r\n properties.map((property) => ({\r\n id: property.id,\r\n name: property.property.name,\r\n isVisible: false,\r\n isEditable: false,\r\n _original: property,\r\n })),\r\n );\r\n }\r\n\r\n private populatePropertiesTable(step: StepSchema): void {\r\n const properties = this.workflow()?.properties ?? [];\r\n this.propertiesTableDataState.set(\r\n properties.map((property) => {\r\n const stepProperty = step.properties?.find(\r\n (item) => item.propertyId === property.id,\r\n );\r\n\r\n return {\r\n id: property.id,\r\n name: property.property.name,\r\n isVisible: stepProperty?.isRead || false,\r\n isEditable: stepProperty?.isWrite || false,\r\n _original: property,\r\n };\r\n }),\r\n );\r\n }\r\n\r\n private configureStepTypeControl(): void {\r\n if (this.isEditingInitialNode()) {\r\n this.stepForm.controls.type.disable({ emitEvent: false });\r\n return;\r\n }\r\n\r\n this.stepForm.controls.type.enable({ emitEvent: false });\r\n }\r\n\r\n private syncUserInputValidators(): void {\r\n const groupControl = this.stepForm.controls.group;\r\n const roleControl = this.stepForm.controls.role;\r\n const targetType = this.stepForm.controls.targetType.value;\r\n\r\n groupControl.clearValidators();\r\n roleControl.clearValidators();\r\n\r\n if (\r\n this.currentStepType() === 'UserInput' &&\r\n !this.isEditingInitialNode() &&\r\n targetType === '1'\r\n ) {\r\n groupControl.addValidators(Validators.required);\r\n }\r\n\r\n if (\r\n this.currentStepType() === 'UserInput' &&\r\n !this.isEditingInitialNode() &&\r\n targetType === '2'\r\n ) {\r\n roleControl.addValidators(Validators.required);\r\n }\r\n\r\n groupControl.updateValueAndValidity({ emitEvent: false });\r\n roleControl.updateValueAndValidity({ emitEvent: false });\r\n }\r\n\r\n private resetAppActionState(): void {\r\n this.appActionSettingsForm.reset(\r\n {\r\n actionKey: DEFAULT_APP_ACTION_EDITOR_VALUE.actionKey,\r\n failureBehavior: DEFAULT_APP_ACTION_EDITOR_VALUE.failureBehavior,\r\n timeoutSeconds: DEFAULT_APP_ACTION_EDITOR_VALUE.timeoutSeconds,\r\n },\r\n { emitEvent: false },\r\n );\r\n this.rebuildAppActionConfigEditor(\r\n DEFAULT_APP_ACTION_EDITOR_VALUE.configJson,\r\n null,\r\n );\r\n this.lastAppActionDescriptorSignature = '';\r\n }\r\n\r\n private rebuildAppActionConfigEditor(\r\n configJson: string | null | undefined,\r\n configSchemaJson: string | null | undefined,\r\n ): void {\r\n const definition =\r\n buildWorkflowAppActionConfigEditorDefinition(configSchemaJson);\r\n const editorValue = mapWorkflowAppActionConfigJsonToEditorValue(\r\n configJson,\r\n definition,\r\n );\r\n\r\n Object.keys(this.appActionConfigForm.controls).forEach((key) => {\r\n this.appActionConfigForm.removeControl(key);\r\n });\r\n\r\n definition.fields.forEach((field) => {\r\n this.appActionConfigForm.addControl(\r\n field.key,\r\n new FormControl(editorValue.fields[field.key] ?? null, {\r\n validators: field.required ? [Validators.required] : [],\r\n }),\r\n );\r\n });\r\n\r\n this.appActionRawConfigControl.setValue(editorValue.rawConfigJson, {\r\n emitEvent: false,\r\n });\r\n this.appActionConfigDefinition.set(definition);\r\n }\r\n\r\n private ensureAppActionDiscoveryLoaded(): void {\r\n this.workflowFacade.loadAppActions();\r\n }\r\n\r\n private ensureAppActionDetailLoaded(\r\n actionKey: string | null | undefined,\r\n ): void {\r\n if (!actionKey) {\r\n return;\r\n }\r\n\r\n const cachedDescriptor = this.resolveDescriptorForActionKey(actionKey);\r\n if (cachedDescriptor?.configSchemaJson) {\r\n return;\r\n }\r\n\r\n this.workflowFacade.loadAppActionDetail(actionKey);\r\n }\r\n\r\n private resolveDescriptorForActionKey(\r\n actionKey: string | null | undefined,\r\n step?: StepSchema | null,\r\n ): WorkflowAppActionDescriptor | null {\r\n if (!actionKey) {\r\n return null;\r\n }\r\n\r\n const selectedDescriptor = this.selectedAppActionDescriptor();\r\n if (selectedDescriptor?.actionKey === actionKey) {\r\n return selectedDescriptor;\r\n }\r\n\r\n const cachedDescriptor = this.appActionDescriptors().find(\r\n (descriptor) => descriptor.actionKey === actionKey,\r\n );\r\n if (cachedDescriptor) {\r\n return cachedDescriptor;\r\n }\r\n\r\n const currentStep = step ?? this.selectedStep();\r\n if (\r\n currentStep?.type === 'AppAction' &&\r\n currentStep.appAction?.actionKey === actionKey\r\n ) {\r\n return {\r\n appCode: currentStep.appAction.appCode,\r\n actionKey,\r\n displayName: currentStep.appAction.displayName ?? actionKey,\r\n description: currentStep.appAction.description ?? null,\r\n configSchemaJson: currentStep.appAction.configSchemaJson ?? null,\r\n requiredContextKeys: currentStep.appAction.requiredContextKeys ?? [],\r\n supportedScopes: currentStep.appAction.supportedScopes ?? [],\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private buildStepPayload() {\r\n if (this.isNodeDialogSaveDisabled()) {\r\n return null;\r\n }\r\n\r\n const formValue = this.stepForm.getRawValue();\r\n const appActionConfig = serializeWorkflowAppActionConfigValue(\r\n this.appActionConfigForm.getRawValue(),\r\n this.appActionConfigDefinition(),\r\n this.appActionRawConfigControl.value,\r\n );\r\n\r\n return buildWorkflowStepPayload({\r\n formValue: {\r\n name: {\r\n en: formValue.nameEn,\r\n ar: formValue.nameAr,\r\n },\r\n type: normalizeWorkflowStepType(formValue.type),\r\n targetType: formValue.targetType || '1',\r\n group: formValue.group,\r\n role: this.normalizeRoleValue(formValue.role),\r\n sla: Number(formValue.sla ?? 0),\r\n },\r\n properties: this.buildPropertiesPayload(),\r\n hasNotification: this.showHideControl.value,\r\n appActionValue:\r\n this.currentStepType() === 'AppAction'\r\n ? {\r\n actionKey: this.appActionSettingsForm.controls.actionKey.value,\r\n failureBehavior:\r\n this.appActionSettingsForm.controls.failureBehavior.value,\r\n timeoutSeconds: Number(\r\n this.appActionSettingsForm.controls.timeoutSeconds.value ?? 300,\r\n ),\r\n configJson: appActionConfig.configJson,\r\n }\r\n : null,\r\n });\r\n }\r\n\r\n private buildPropertiesPayload(): StepPropertyPayload[] {\r\n return this.propertiesTableData()\r\n .filter((property) => property.isVisible || property.isEditable)\r\n .map((property) => ({\r\n PropertyId: property.id,\r\n isRead: property.isVisible,\r\n isWrite: property.isEditable,\r\n }));\r\n }\r\n\r\n private getCurrentAppActionConfigJson(): string {\r\n const definition = this.appActionConfigDefinition();\r\n if (definition.mode === 'raw') {\r\n return this.appActionRawConfigControl.value;\r\n }\r\n\r\n return serializeWorkflowAppActionConfigValue(\r\n this.appActionConfigForm.getRawValue(),\r\n definition,\r\n this.appActionRawConfigControl.value,\r\n ).configJson;\r\n }\r\n\r\n private createAppActionDescriptorSignature(\r\n actionKey: string | null | undefined,\r\n configSchemaJson: string | null | undefined,\r\n ): string {\r\n return `${actionKey ?? ''}::${configSchemaJson ?? ''}`;\r\n }\r\n\r\n private isNodeDialogSaveDisabled(): boolean {\r\n if (this.selectedTab() !== 'tab1' || this.loadingStep()) {\r\n return true;\r\n }\r\n\r\n if (\r\n this.stepForm.controls.nameEn.invalid ||\r\n this.stepForm.controls.nameAr.invalid\r\n ) {\r\n return true;\r\n }\r\n\r\n if (this.currentStepType() === 'UserInput') {\r\n if (!this.isEditingInitialNode() && this.stepForm.controls.sla.invalid) {\r\n return true;\r\n }\r\n\r\n if (this.isEditingInitialNode()) {\r\n return false;\r\n }\r\n\r\n return this.stepForm.controls.targetType.value === '1'\r\n ? this.stepForm.controls.group.invalid\r\n : this.stepForm.controls.role.invalid;\r\n }\r\n\r\n if (this.stepForm.controls.sla.invalid) {\r\n return true;\r\n }\r\n\r\n if (!!this.getAppActionDiscoveryMessage()) {\r\n return true;\r\n }\r\n\r\n if (this.appActionSettingsForm.invalid) {\r\n return true;\r\n }\r\n\r\n return this.getAppActionConfigMessages().length > 0;\r\n }\r\n\r\n private normalizeRoleValue(\r\n value: string | number | null | undefined,\r\n ): string | null {\r\n if (value === null || value === undefined || value === '') {\r\n return null;\r\n }\r\n\r\n return String(value);\r\n }\r\n\r\n private resolveDisplayName(\r\n name: string | Record<string, string> | null | undefined,\r\n ): string {\r\n if (typeof name === 'string') {\r\n return name;\r\n }\r\n\r\n if (name && typeof name === 'object') {\r\n return name['display'] || name['en'] || name['ar'] || '';\r\n }\r\n\r\n return '';\r\n }\r\n}\r\n","<ng-container *transloco=\"let t; prefix: 'workflow.builder'\">\r\n <div class=\"h-full flex flex-col\" id=\"workflow-builder-card\">\r\n <div class=\"flex justify-center w-full py-2\">\r\n <mt-tabs\r\n [active]=\"mainTab()\"\r\n (activeChange)=\"onMainTabChange($event)\"\r\n [options]=\"mainTabsList()\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n </div>\r\n @switch (mainTab()) {\r\n @case (\"workflow\") {\r\n @if (!loading()) {\r\n <mt-structure-builder\r\n class=\"flex-1\"\r\n [availableNodes]=\"availableNodes()\"\r\n [availableNodesLabel]=\"t('stepTemplates')\"\r\n [connectionForm]=\"connectionForm()\"\r\n [connectionFormulaSchemaId]=\"connectionFormulaSchemaId()\"\r\n [connectionFormulaConfig]=\"connectionFormulaConfig()\"\r\n [nodeActions]=\"nodeActions()\"\r\n [nodes]=\"steps()\"\r\n [connections]=\"connections()\"\r\n (action)=\"onStructureAction($event)\"\r\n [addModalType]=\"'drawer'\"\r\n [addModalStyleClass]=\"'!w-[25rem] !absolute !shadow-none'\"\r\n [updateModalStyleClass]=\"'!w-[25rem] !absolute !shadow-none'\"\r\n [addModalHeader]=\"'workflow.builder.addStep' | transloco\"\r\n [updateModalHeader]=\"'workflow.builder.editStep' | transloco\"\r\n [nodeDialogFooterConfig]=\"nodeDialogFooterConfig\"\r\n [appendTo]=\"'page-content'\"\r\n [nodeFields]=\"nodeFields()\"\r\n [availableTabsClass]=\"hasMultipleWorkflows() ? '!mt-28' : ''\"\r\n [layoutDirection]=\"'LR'\"\r\n >\r\n <div flowContent class=\"pointer-events-none\">\r\n @if (hasMultipleWorkflows()) {\r\n <div class=\"pointer-events-auto absolute top-4 start-4 z-10\">\r\n <mt-card class=\"w-64\">\r\n <mt-select-field\r\n [options]=\"workflows()\"\r\n optionLabel=\"name.display\"\r\n optionValue=\"id\"\r\n [ngModel]=\"selectedWorkflowId()\"\r\n (ngModelChange)=\"onWorkflowChange($event)\"\r\n class=\"mt-2\"\r\n />\r\n </mt-card>\r\n </div>\r\n }\r\n <div class=\"pointer-events-auto absolute top-4 end-4 z-10\">\r\n <div class=\"flex flex-col gap-2 w-80\">\r\n <mt-card>\r\n <div class=\"flex items-center gap-10\">\r\n <div class=\"flex items-center gap-2\">\r\n <mt-button\r\n [severity]=\"'secondary'\"\r\n icon=\"dev.dataflow-01\"\r\n />\r\n <label>{{\r\n \"workflow.builder.enableWorkflow\" | transloco\r\n }}</label>\r\n </div>\r\n <mt-toggle-field\r\n [ngModel]=\"isPublished()\"\r\n (ngModelChange)=\"onPublishToggle($event)\"\r\n [disabled]=\"isPublishDisabled()\"\r\n ></mt-toggle-field>\r\n </div>\r\n </mt-card>\r\n </div>\r\n </div>\r\n </div>\r\n <ng-template\r\n #nodeDialog\r\n let-close=\"close\"\r\n let-save=\"save\"\r\n let-node=\"node\"\r\n let-drawerController=\"drawerController\"\r\n >\r\n <div class=\"p-4\">\r\n @if (loadingStep()) {\r\n <div class=\"space-y-4\">\r\n <div class=\"flex gap-2 mb-4\">\r\n <p-skeleton\r\n width=\"6rem\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"8rem\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <!-- Form fields skeleton -->\r\n <div class=\"space-y-4\">\r\n <div>\r\n <p-skeleton\r\n width=\"8rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <div>\r\n <p-skeleton\r\n width=\"8rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <div>\r\n <p-skeleton\r\n width=\"10rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"3rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <div>\r\n <p-skeleton\r\n width=\"6rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <div>\r\n <p-skeleton\r\n width=\"4rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <mt-tabs\r\n [active]=\"selectedTab()\"\r\n (activeChange)=\"onNodeDialogTabChange($event)\"\r\n [options]=\"tabsList()\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n @switch (selectedTab()) {\r\n @case (\"tab1\") {\r\n <div class=\"mt-4 space-y-4\">\r\n <div class=\"grid gap-3\">\r\n <mt-text-field\r\n [label]=\"t('nameEnglish')\"\r\n [placeholder]=\"t('enterNameEnglish')\"\r\n [formControl]=\"stepForm.controls.nameEn\"\r\n [required]=\"true\"\r\n ></mt-text-field>\r\n <mt-text-field\r\n [label]=\"t('nameArabic')\"\r\n [placeholder]=\"t('enterNameArabic')\"\r\n [formControl]=\"stepForm.controls.nameAr\"\r\n [required]=\"true\"\r\n ></mt-text-field>\r\n </div>\r\n\r\n @if (currentStepType() === \"UserInput\") {\r\n @if (!isEditingInitialNode()) {\r\n <mt-card>\r\n <div class=\"space-y-4\">\r\n <div\r\n class=\"text-sm font-semibold text-surface-900\"\r\n >\r\n {{ t(\"approver\") }}\r\n </div>\r\n <mt-select-field\r\n [label]=\"t('approver')\"\r\n [options]=\"[\r\n { label: t('group'), value: '1' },\r\n { label: t('role'), value: '2' },\r\n ]\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"stepForm.controls.targetType\"\r\n [required]=\"true\"\r\n ></mt-select-field>\r\n\r\n @if (\r\n stepForm.controls.targetType.value === \"1\"\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('group')\"\r\n [placeholder]=\"t('selectGroup')\"\r\n [options]=\"groups()\"\r\n optionLabel=\"name.display\"\r\n optionValue=\"id\"\r\n [formControl]=\"stepForm.controls.group\"\r\n [required]=\"true\"\r\n ></mt-select-field>\r\n } @else {\r\n <mt-select-field\r\n [label]=\"t('role')\"\r\n [placeholder]=\"t('selectRole')\"\r\n [options]=\"roles()\"\r\n [group]=\"hasGroupedRoles()\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n optionLabel=\"name.display\"\r\n optionValue=\"value\"\r\n [formControl]=\"stepForm.controls.role\"\r\n [required]=\"true\"\r\n ></mt-select-field>\r\n }\r\n\r\n <mt-number-field\r\n [label]=\"t('sla')\"\r\n [placeholder]=\"t('enterSla')\"\r\n [formControl]=\"stepForm.controls.sla\"\r\n [required]=\"true\"\r\n [min]=\"0\"\r\n ></mt-number-field>\r\n </div>\r\n </mt-card>\r\n }\r\n } @else {\r\n <mt-card>\r\n <div class=\"space-y-4\">\r\n <div class=\"grid gap-3\">\r\n <div class=\"grid gap-1\">\r\n <label\r\n class=\"text-sm font-medium text-surface-900\"\r\n >\r\n {{ t(\"app\") }}\r\n </label>\r\n <div\r\n class=\"rounded-xl border border-surface-200 bg-surface-50 px-3 py-2 text-sm text-surface-700\"\r\n >\r\n {{ t(\"appLabelPplus\") }}\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid gap-1\">\r\n <label\r\n class=\"text-sm font-medium text-surface-900\"\r\n >\r\n {{ t(\"action\") }}\r\n </label>\r\n <div\r\n class=\"rounded-xl border border-surface-200 bg-surface-50 px-3 py-2 text-sm text-surface-900\"\r\n >\r\n {{ getAppActionDisplayName() }}\r\n </div>\r\n @if (getAppActionKey()) {\r\n <div class=\"text-xs text-muted-color\">\r\n {{ getAppActionKey() }}\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (\r\n getAppActionDescription();\r\n as description\r\n ) {\r\n <div\r\n class=\"rounded-xl border border-surface-200 bg-surface-50 px-3 py-2 text-sm text-muted-color\"\r\n >\r\n {{ description }}\r\n </div>\r\n }\r\n\r\n @if (\r\n getAppActionDiscoveryMessage();\r\n as discoveryMessage\r\n ) {\r\n <div\r\n class=\"rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700\"\r\n >\r\n {{ discoveryMessage }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </mt-card>\r\n\r\n <mt-card>\r\n <div class=\"space-y-4\">\r\n <div>\r\n <div\r\n class=\"text-sm font-semibold text-surface-900\"\r\n >\r\n {{ t(\"appActionConfiguration\") }}\r\n </div>\r\n <div class=\"mt-1 text-sm text-muted-color\">\r\n {{ t(\"appActionConfigurationDescription\") }}\r\n </div>\r\n </div>\r\n\r\n @if (\r\n loadingAppActionDetail() &&\r\n appActionSettingsForm.controls.actionKey.value\r\n ) {\r\n <div class=\"space-y-3\">\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"6rem\"\r\n ></p-skeleton>\r\n </div>\r\n } @else if (\r\n !appActionSettingsForm.controls.actionKey.value\r\n ) {\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface-300 px-3 py-4 text-sm text-muted-color\"\r\n >\r\n {{ t(\"appActionUnavailable\") }}\r\n </div>\r\n } @else if (\r\n appActionConfigDefinition().mode === \"schema\" &&\r\n appActionConfigDefinition().fields.length === 0\r\n ) {\r\n <div\r\n class=\"rounded-xl border border-surface-200 bg-surface-50 px-3 py-4 text-sm text-muted-color\"\r\n >\r\n {{ t(\"appActionNoConfigRequired\") }}\r\n </div>\r\n } @else if (\r\n appActionConfigDefinition().mode === \"raw\"\r\n ) {\r\n <div class=\"space-y-3\">\r\n <div\r\n class=\"rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-800\"\r\n >\r\n {{ t(\"appActionRawConfigFallback\") }}\r\n </div>\r\n <mt-textarea-field\r\n [label]=\"t('appActionConfigJson')\"\r\n [placeholder]=\"\r\n t('enterAppActionConfigJson')\r\n \"\r\n [formControl]=\"appActionRawConfigControl\"\r\n [rows]=\"'10'\"\r\n ></mt-textarea-field>\r\n </div>\r\n } @else {\r\n <div class=\"space-y-3\">\r\n @for (\r\n field of appActionConfigDefinition().fields;\r\n track field.key\r\n ) {\r\n <div class=\"space-y-2\">\r\n @switch (field.kind) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"field.title\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n [required]=\"field.required\"\r\n ></mt-text-field>\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"field.title\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n [required]=\"field.required\"\r\n ></mt-number-field>\r\n }\r\n @case (\"toggle\") {\r\n <mt-toggle-field\r\n [label]=\"field.title\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"field.title\"\r\n [options]=\"\r\n getAppActionEnumOptions(field)\r\n \"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n [required]=\"field.required\"\r\n ></mt-select-field>\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n [label]=\"field.title\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n [required]=\"field.required\"\r\n [rows]=\"'8'\"\r\n ></mt-textarea-field>\r\n }\r\n }\r\n\r\n @if (field.description) {\r\n <div class=\"text-xs text-muted-color\">\r\n {{ field.description }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (getAppActionConfigMessages().length) {\r\n <div\r\n class=\"rounded-xl border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-700\"\r\n >\r\n @for (\r\n message of getAppActionConfigMessages();\r\n track message\r\n ) {\r\n <div>{{ message }}</div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </mt-card>\r\n\r\n <mt-card>\r\n <div class=\"space-y-4\">\r\n <div\r\n class=\"text-sm font-semibold text-surface-900\"\r\n >\r\n {{ t(\"advancedExecution\") }}\r\n </div>\r\n\r\n <mt-number-field\r\n [label]=\"t('sla')\"\r\n [placeholder]=\"t('enterSla')\"\r\n [formControl]=\"stepForm.controls.sla\"\r\n [required]=\"true\"\r\n [min]=\"0\"\r\n ></mt-number-field>\r\n\r\n <mt-select-field\r\n [label]=\"t('failureBehavior')\"\r\n [options]=\"failureBehaviorOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"\r\n appActionSettingsForm.controls.failureBehavior\r\n \"\r\n [required]=\"true\"\r\n ></mt-select-field>\r\n\r\n <mt-number-field\r\n [label]=\"t('timeoutSeconds')\"\r\n [formControl]=\"\r\n appActionSettingsForm.controls.timeoutSeconds\r\n \"\r\n [required]=\"true\"\r\n [min]=\"1\"\r\n ></mt-number-field>\r\n </div>\r\n </mt-card>\r\n }\r\n </div>\r\n }\r\n @case (\"tab2\") {\r\n <div class=\"mt-4\">\r\n <mt-card>\r\n <div class=\"flex items-center gap-4\">\r\n <div class=\"flex flex-1 items-center gap-3\">\r\n <mt-button\r\n [severity]=\"'secondary'\"\r\n icon=\"file.file-check-02\"\r\n />\r\n <div class=\"flex flex-col\">\r\n <label class=\"font-medium\">{{\r\n t(\"configureForm\")\r\n }}</label>\r\n <span class=\"text-sm text-muted-color\">{{\r\n t(\"configureForm-description\")\r\n }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"mt-3\">\r\n <mt-button\r\n [label]=\"t('configureForm')\"\r\n size=\"small\"\r\n (onClick)=\"openFormModal()\"\r\n ></mt-button>\r\n </div>\r\n </mt-card>\r\n </div>\r\n }\r\n @case (\"tab3\") {\r\n <div class=\"mt-4\">\r\n <mt-toggle-field\r\n toggleShape=\"card\"\r\n [label]=\"t('show-hide')\"\r\n [descriptionCard]=\"t('show-hide-notifications')\"\r\n icon=\"general.eye\"\r\n [formControl]=\"showHideControl\"\r\n >\r\n <ng-template #toggleCardBottom>\r\n @if (showHideControl.value) {\r\n <div class=\"mt-3\">\r\n <mt-button\r\n [label]=\"t('configureNotifications')\"\r\n size=\"small\"\r\n (onClick)=\"openNotificationsModal()\"\r\n ></mt-button>\r\n </div>\r\n }\r\n </ng-template>\r\n </mt-toggle-field>\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n </ng-template>\r\n </mt-structure-builder>\r\n } @else {\r\n <p-skeleton width=\"100%\" height=\"50rem\" />\r\n }\r\n }\r\n @case (\"notification\") {\r\n <div class=\"flex-1 flex justify-center items-start p-4\">\r\n <div class=\"w-1/2 max-[1025px]:w-full\">\r\n <mt-card [title]=\"t('notifications')\">\r\n <mt-notification-template />\r\n </mt-card>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</ng-container>\r\n","// store/app.state.ts\n\nimport { HttpContextToken } from '@angular/common/http';\n\nexport const REQUEST_CONTEXT = new HttpContextToken<{ useBaseUrl: boolean }>(\n () => ({\n useBaseUrl: false,\n }),\n);\n","// Re-export app state\nexport * from './app.state';\n\n// Re-export workflow state\nexport * from './workflow';\n","/*\n * Public API Surface of structure-builder\n */\n\nexport * from './lib/workflow-builder/workflow-builder';\n\nexport * from './store';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["normalizeWorkflowStepType","isRecord"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MAEa,aAAa,CAAA;AAIN,IAAA,UAAA;AACA,IAAA,QAAA;AACA,IAAA,gBAAA;AACA,IAAA,cAAA;AACA,IAAA,UAAA;AAPlB,IAAA,OAAgB,IAAI,GAAG,4BAA4B;IAEnD,WAAA,CACkB,UAAkB,EAClB,QAAyB,EACzB,gBAAyB,EACzB,cAAgC,EAChC,UAAmB,EAAA;QAJnB,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,IAAA,CAAA,cAAc,GAAd,cAAc;QACd,IAAA,CAAA,UAAU,GAAV,UAAU;IACzB;;MAGQ,YAAY,CAAA;AACvB,IAAA,OAAgB,IAAI,GAAG,0BAA0B;;MAGtC,WAAW,CAAA;AAGM,IAAA,UAAA;AAF5B,IAAA,OAAgB,IAAI,GAAG,yBAAyB;AAEhD,IAAA,WAAA,CAA4B,UAA2B,EAAA;QAA3B,IAAA,CAAA,UAAU,GAAV,UAAU;IAAoB;;MAG/C,oBAAoB,CAAA;AAC/B,IAAA,OAAgB,IAAI,GAAG,mCAAmC;;MAG/C,SAAS,CAAA;AACpB,IAAA,OAAgB,IAAI,GAAG,uBAAuB;;MAGnC,iBAAiB,CAAA;AAC5B,IAAA,OAAgB,IAAI,GAAG,iCAAiC;;MAG7C,aAAa,CAAA;AACxB,IAAA,OAAgB,IAAI,GAAG,4BAA4B;;MAGxC,kBAAkB,CAAA;AAGD,IAAA,SAAA;AAF5B,IAAA,OAAgB,IAAI,GAAG,kCAAkC;AAEzD,IAAA,W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AA,EAAA,wy4BAAA,EAAA;;;AE9EV;AAIO,MAAM,eAAe,GAAG,IAAI,gBAAgB,CACjD,OAAO;AACL,IAAA,UAAU,EAAE,KAAK;AAClB,CAAA,CAAC;;ACPJ;;ACAA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-workflow.mjs","sources":["../../../../packages/masterteam/workflow/src/store/workflow/workflow.actions.ts","../../../../packages/masterteam/workflow/src/store/utils/state-helpers.ts","../../../../packages/masterteam/workflow/src/store/workflow/workflow.state.ts","../../../../packages/masterteam/workflow/src/store/workflow/workflow.facade.ts","../../../../packages/masterteam/workflow/src/store/workflow/api.model.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-app-action-config.utils.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-step.utils.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-form-drawer/workflow-form-drawer.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-form-drawer/workflow-form-drawer.html","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-notifications-drawer/workflow-notifications-drawer.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-notifications-drawer/workflow-notifications-drawer.html","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-builder.ts","../../../../packages/masterteam/workflow/src/lib/workflow-builder/workflow-builder.html","../../../../packages/masterteam/workflow/src/store/app.state.ts","../../../../packages/masterteam/workflow/src/store/index.ts","../../../../packages/masterteam/workflow/src/public-api.ts","../../../../packages/masterteam/workflow/src/masterteam-workflow.ts"],"sourcesContent":["import type { ConnectionPayload, StepPayload } from './workflow.model';\r\n\r\nexport class SetModuleInfo {\r\n static readonly type = '[Workflow] Set Module Info';\r\n\r\n constructor(\r\n public readonly moduleType: string,\r\n public readonly moduleId: string | number,\r\n public readonly parentModuleType?: string,\r\n public readonly parentModuleId?: string | number,\r\n public readonly parentPath?: string,\r\n ) {}\r\n}\r\n\r\nexport class GetWorkflows {\r\n static readonly type = '[Workflow] Get Workflows';\r\n}\r\n\r\nexport class GetWorkflow {\r\n static readonly type = '[Workflow] Get Workflow';\r\n\r\n constructor(public readonly workflowId: string | number) {}\r\n}\r\n\r\nexport class GetFormulaProperties {\r\n static readonly type = '[Workflow] Get Formula Properties';\r\n}\r\n\r\nexport class GetGroups {\r\n static readonly type = '[Workflow] Get Groups';\r\n}\r\n\r\nexport class GetRolesForModule {\r\n static readonly type = '[Workflow] Get Roles For Module';\r\n}\r\n\r\nexport class GetAppActions {\r\n static readonly type = '[Workflow] Get App Actions';\r\n}\r\n\r\nexport class GetAppActionDetail {\r\n static readonly type = '[Workflow] Get App Action Detail';\r\n\r\n constructor(public readonly actionKey: string) {}\r\n}\r\n\r\nexport class GetStep {\r\n static readonly type = '[Workflow] Get Step';\r\n\r\n constructor(public readonly stepId: string | number) {}\r\n}\r\n\r\nexport class ValidateFlow {\r\n static readonly type = '[Workflow] Validate Flow';\r\n}\r\n\r\nexport class CreateStep {\r\n static readonly type = '[Workflow] Create Step';\r\n\r\n constructor(public readonly payload: StepPayload) {}\r\n}\r\n\r\nexport class UpdateStep {\r\n static readonly type = '[Workflow] Update Step';\r\n\r\n constructor(\r\n public readonly stepId: string | number,\r\n public readonly payload: StepPayload,\r\n public readonly isInitial?: boolean,\r\n ) {}\r\n}\r\n\r\nexport class CreateConnection {\r\n static readonly type = '[Workflow] Create Connection';\r\n\r\n constructor(public readonly payload: ConnectionPayload) {}\r\n}\r\n\r\nexport class UpdateConnection {\r\n static readonly type = '[Workflow] Update Connection';\r\n\r\n constructor(\r\n public readonly connectionId: string | number,\r\n public readonly payload: ConnectionPayload,\r\n ) {}\r\n}\r\n\r\nexport class PublishWorkflow {\r\n static readonly type = '[Workflow] Publish Workflow';\r\n\r\n constructor(public readonly isPublished: boolean) {}\r\n}\r\n\r\nexport class DeleteStep {\r\n static readonly type = '[Workflow] Delete Step';\r\n\r\n constructor(public readonly stepId: string | number) {}\r\n}\r\n\r\nexport class DeleteConnection {\r\n static readonly type = '[Workflow] Delete Connection';\r\n\r\n constructor(public readonly connectionId: string | number) {}\r\n}\r\n","import type { StateContext } from '@ngxs/store';\n\nexport interface LoadingStateShape<L extends string = string> {\n loadingActive: L[];\n errors: Partial<Record<L, string>>;\n}\n\ntype LoadingName<T extends LoadingStateShape<string>> =\n T['loadingActive'][number];\n\nexport function startLoading<T extends LoadingStateShape<string>>(\n ctx: StateContext<T>,\n loadingName: LoadingName<T>,\n): void {\n const { loadingActive, errors } = ctx.getState();\n\n if (!loadingActive.includes(loadingName)) {\n ctx.patchState({\n loadingActive: [...loadingActive, loadingName],\n } as Partial<T>);\n }\n\n if (errors && errors[loadingName]) {\n const { [loadingName]: _removed, ...rest } = errors;\n ctx.patchState({ errors: rest } as Partial<T>);\n }\n}\n\nexport function endLoading<T extends LoadingStateShape<string>>(\n ctx: StateContext<T>,\n loadingName: LoadingName<T>,\n): void {\n const { loadingActive } = ctx.getState();\n\n ctx.patchState({\n loadingActive: loadingActive.filter((name) => name !== loadingName),\n } as Partial<T>);\n}\n\nexport function setLoadingError<T extends LoadingStateShape<string>>(\n ctx: StateContext<T>,\n loadingName: LoadingName<T>,\n message: string,\n): void {\n const { errors } = ctx.getState();\n ctx.patchState({\n errors: { ...errors, [loadingName]: message },\n } as Partial<T>);\n}\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\r\nimport { of } from 'rxjs';\r\nimport { catchError, finalize, tap } from 'rxjs/operators';\r\n\r\nimport {\r\n endLoading,\r\n setLoadingError,\r\n startLoading,\r\n} from '../utils/state-helpers';\r\n\r\nimport type {\r\n ConnectionResponse,\r\n FormulaProperty,\r\n GroupDefinition,\r\n RoleGroupDefinition,\r\n PublishResponse,\r\n RoleDefinition,\r\n StepResponse,\r\n StepSchema,\r\n WorkflowAppAction,\r\n WorkflowAppActionDescriptor,\r\n WorkflowConnection,\r\n WorkflowListItem,\r\n WorkflowLoadingName,\r\n WorkflowSchema,\r\n WorkflowStateModel,\r\n WorkflowStepType,\r\n WorkflowStepSchema,\r\n} from './workflow.model';\r\nimport {\r\n CreateConnection,\r\n CreateStep,\r\n DeleteConnection,\r\n DeleteStep,\r\n GetAppActionDetail,\r\n GetAppActions,\r\n GetFormulaProperties,\r\n GetGroups,\r\n GetRolesForModule,\r\n GetStep,\r\n GetWorkflow,\r\n GetWorkflows,\r\n PublishWorkflow,\r\n SetModuleInfo,\r\n UpdateConnection,\r\n UpdateStep,\r\n ValidateFlow,\r\n} from './workflow.actions';\r\nimport { Response } from './api.model';\r\n\r\nconst DEFAULT_STATE: WorkflowStateModel = {\r\n workflowId: null,\r\n moduleType: null,\r\n moduleId: null,\r\n workflows: [],\r\n workflow: null,\r\n formulaProperties: [],\r\n groups: [],\r\n roles: [],\r\n appActionDescriptors: [],\r\n selectedAppActionDescriptor: null,\r\n selectedStep: null,\r\n isFlowValid: null,\r\n loadingActive: [],\r\n errors: {},\r\n};\r\n\r\n@State<WorkflowStateModel>({\r\n name: 'workflow',\r\n defaults: DEFAULT_STATE,\r\n})\r\n@Injectable()\r\nexport class WorkflowState {\r\n private readonly http = inject(HttpClient);\r\n private readonly baseUrl = 'ProcessBuilder';\r\n private readonly groupsUrl = 'identity/Groups';\r\n private readonly rolesUrl = 'identity/roles/scopes';\r\n private readonly workflowAppActionsUrl = 'workflow-app-actions';\r\n\r\n @Selector()\r\n static workflowId(state: WorkflowStateModel): string | number | null {\r\n return state.workflowId;\r\n }\r\n\r\n @Selector()\r\n static moduleType(state: WorkflowStateModel): string | null {\r\n return state.moduleType;\r\n }\r\n\r\n @Selector()\r\n static moduleId(state: WorkflowStateModel): string | number | null {\r\n return state.moduleId;\r\n }\r\n\r\n @Selector()\r\n static workflows(state: WorkflowStateModel) {\r\n return state.workflows;\r\n }\r\n\r\n @Selector()\r\n static workflow(state: WorkflowStateModel): WorkflowSchema | null {\r\n return state.workflow;\r\n }\r\n\r\n @Selector()\r\n static formulaProperties(state: WorkflowStateModel): FormulaProperty[] {\r\n return state.formulaProperties;\r\n }\r\n\r\n @Selector()\r\n static groups(state: WorkflowStateModel): GroupDefinition[] {\r\n return state.groups;\r\n }\r\n\r\n @Selector()\r\n static roles(\r\n state: WorkflowStateModel,\r\n ): Array<RoleDefinition | RoleGroupDefinition> {\r\n return state.roles;\r\n }\r\n\r\n @Selector()\r\n static appActionDescriptors(\r\n state: WorkflowStateModel,\r\n ): WorkflowAppActionDescriptor[] {\r\n return state.appActionDescriptors;\r\n }\r\n\r\n @Selector()\r\n static selectedAppActionDescriptor(\r\n state: WorkflowStateModel,\r\n ): WorkflowAppActionDescriptor | null {\r\n return state.selectedAppActionDescriptor;\r\n }\r\n\r\n @Selector()\r\n static selectedStep(state: WorkflowStateModel): StepSchema | null {\r\n return state.selectedStep;\r\n }\r\n\r\n @Selector()\r\n static isFlowValid(state: WorkflowStateModel): boolean | null {\r\n return state.isFlowValid;\r\n }\r\n\r\n @Selector()\r\n static stepsSchema(state: WorkflowStateModel): WorkflowStepSchema[] {\r\n return state.workflow?.stepsSchema ?? [];\r\n }\r\n\r\n @Selector()\r\n static connections(state: WorkflowStateModel): WorkflowConnection[] {\r\n return state.workflow?.connections ?? [];\r\n }\r\n\r\n @Selector()\r\n static isLoadingFactory(state: WorkflowStateModel) {\r\n return (loadingName: WorkflowLoadingName) =>\r\n state.loadingActive.includes(loadingName);\r\n }\r\n\r\n @Selector()\r\n static errorFactory(state: WorkflowStateModel) {\r\n return (loadingName: WorkflowLoadingName) =>\r\n state.errors?.[loadingName] ?? null;\r\n }\r\n\r\n @Action(SetModuleInfo)\r\n setModuleInfo(ctx: StateContext<WorkflowStateModel>, action: SetModuleInfo) {\r\n let parentPath = '';\r\n if (action.parentModuleType && action.parentModuleId) {\r\n parentPath = `/${action.parentModuleType}/${action.parentModuleId}`;\r\n } else if (action.parentPath) {\r\n parentPath = action.parentPath;\r\n }\r\n ctx.patchState({\r\n moduleType: action.moduleType,\r\n moduleId: action.moduleId,\r\n parentModuleType: action.parentModuleType ?? null,\r\n parentModuleId: action.parentModuleId ?? null,\r\n parentPath: parentPath ?? '',\r\n });\r\n }\r\n\r\n @Action(GetWorkflows)\r\n getWorkflows(ctx: StateContext<WorkflowStateModel>, _action: GetWorkflows) {\r\n startLoading(ctx, 'getWorkflows');\r\n\r\n const state = ctx.getState();\r\n const { moduleId, parentPath, moduleType } = state;\r\n\r\n if (!moduleId) {\r\n const message = 'Module ID is not set';\r\n setLoadingError(ctx, 'getWorkflows', message);\r\n endLoading(ctx, 'getWorkflows');\r\n return of(null);\r\n }\r\n\r\n return this.http\r\n .get<\r\n Response<WorkflowListItem[]>\r\n >(`${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/requestSchema`)\r\n .pipe(\r\n tap((response) => {\r\n const workflows = response?.data ?? [];\r\n ctx.patchState({ workflows });\r\n\r\n // Auto-select and load first workflow if available\r\n if (workflows.length > 0) {\r\n const firstWorkflow = workflows[0];\r\n ctx.patchState({ workflowId: firstWorkflow.id });\r\n ctx.dispatch(new GetWorkflow(firstWorkflow.id));\r\n }\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load workflows';\r\n setLoadingError(ctx, 'getWorkflows', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'getWorkflows')),\r\n );\r\n }\r\n\r\n @Action(GetWorkflow)\r\n getWorkflow(ctx: StateContext<WorkflowStateModel>, action: GetWorkflow) {\r\n startLoading(ctx, 'getWorkflow');\r\n\r\n const state = ctx.getState();\r\n const workflowId = action.workflowId;\r\n const { moduleId, parentPath, moduleType } = state;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'getWorkflow', message);\r\n endLoading(ctx, 'getWorkflow');\r\n return of(null);\r\n }\r\n\r\n // Set the workflowId in state\r\n ctx.patchState({ workflowId });\r\n\r\n return this.http\r\n .get<Response<WorkflowSchema>>(\r\n `${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/requestSchema/${workflowId}`,\r\n {\r\n params: { Mode: 'edit' },\r\n },\r\n )\r\n .pipe(\r\n tap((response) => {\r\n const workflow = response?.data\r\n ? normalizeWorkflowSchema(response.data)\r\n : null;\r\n ctx.patchState({\r\n workflow,\r\n isFlowValid: workflow?.isValid ?? null,\r\n });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load workflow';\r\n setLoadingError(ctx, 'getWorkflow', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'getWorkflow')),\r\n );\r\n }\r\n\r\n @Action(GetFormulaProperties)\r\n getFormulaProperties(\r\n ctx: StateContext<WorkflowStateModel>,\r\n _action: GetFormulaProperties,\r\n ) {\r\n startLoading(ctx, 'getFormulaProperties');\r\n\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'getFormulaProperties', message);\r\n endLoading(ctx, 'getFormulaProperties');\r\n return of(null);\r\n }\r\n\r\n return this.http\r\n .get<\r\n Response<FormulaProperty[]>\r\n >(`${this.baseUrl}/processFormulaProperties/${workflowId}`)\r\n .pipe(\r\n tap((response) => {\r\n const formulaProperties = Array.isArray(response?.data)\r\n ? response.data\r\n : [];\r\n ctx.patchState({ formulaProperties });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load formula properties';\r\n setLoadingError(ctx, 'getFormulaProperties', message);\r\n return of([]);\r\n }),\r\n finalize(() => endLoading(ctx, 'getFormulaProperties')),\r\n );\r\n }\r\n\r\n @Action(GetGroups)\r\n getGroups(ctx: StateContext<WorkflowStateModel>, _action: GetGroups) {\r\n const state = ctx.getState();\r\n if (state.groups.length) {\r\n return of(state.groups);\r\n }\r\n\r\n startLoading(ctx, 'getGroups');\r\n\r\n return this.http.get<Response<GroupDefinition[]>>(this.groupsUrl).pipe(\r\n tap((response) => {\r\n const groups = Array.isArray(response?.data) ? response.data : [];\r\n ctx.patchState({ groups });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to load groups';\r\n setLoadingError(ctx, 'getGroups', message);\r\n return of([]);\r\n }),\r\n finalize(() => endLoading(ctx, 'getGroups')),\r\n );\r\n }\r\n\r\n @Action(GetRolesForModule)\r\n getRolesForModule(\r\n ctx: StateContext<WorkflowStateModel>,\r\n _action: GetRolesForModule,\r\n ) {\r\n const state = ctx.getState();\r\n const { moduleType, moduleId, parentPath } = state;\r\n\r\n if (!moduleType || !moduleId) {\r\n const message = 'Module type and module ID must be set';\r\n setLoadingError(ctx, 'getRolesForModule', message);\r\n return of([]);\r\n }\r\n\r\n startLoading(ctx, 'getRolesForModule');\r\n\r\n return this.http\r\n .get<Response<unknown[]>>(\r\n `${parentPath ? this.rolesUrl.replace('/scopes', '') : this.rolesUrl}${parentPath}/${moduleType}/${moduleId}`,\r\n parentPath\r\n ? undefined\r\n : {\r\n params: { inherited: 'true' },\r\n },\r\n )\r\n .pipe(\r\n tap((response) => {\r\n const roles = normalizeWorkflowRoles(response?.data);\r\n ctx.patchState({ roles });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to load roles';\r\n setLoadingError(ctx, 'getRolesForModule', message);\r\n return of([]);\r\n }),\r\n finalize(() => endLoading(ctx, 'getRolesForModule')),\r\n );\r\n }\r\n\r\n @Action(GetAppActions)\r\n getAppActions(ctx: StateContext<WorkflowStateModel>, _action: GetAppActions) {\r\n const state = ctx.getState();\r\n if (state.appActionDescriptors.length) {\r\n return of(state.appActionDescriptors);\r\n }\r\n\r\n startLoading(ctx, 'getAppActions');\r\n\r\n return this.http\r\n .get<Response<unknown>>(`${this.workflowAppActionsUrl}/actions`)\r\n .pipe(\r\n tap((response) => {\r\n const descriptors = normalizeWorkflowAppActionDescriptors(\r\n response?.data,\r\n );\r\n ctx.patchState({\r\n appActionDescriptors: descriptors,\r\n });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load app actions';\r\n setLoadingError(ctx, 'getAppActions', message);\r\n return of([]);\r\n }),\r\n finalize(() => endLoading(ctx, 'getAppActions')),\r\n );\r\n }\r\n\r\n @Action(GetAppActionDetail)\r\n getAppActionDetail(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: GetAppActionDetail,\r\n ) {\r\n const state = ctx.getState();\r\n const cachedDescriptor = state.appActionDescriptors.find(\r\n (descriptor) =>\r\n descriptor.actionKey === action.actionKey &&\r\n !!descriptor.configSchemaJson,\r\n );\r\n\r\n if (cachedDescriptor) {\r\n ctx.patchState({\r\n selectedAppActionDescriptor: cachedDescriptor,\r\n });\r\n return of(cachedDescriptor);\r\n }\r\n\r\n startLoading(ctx, 'getAppActionDetail');\r\n\r\n return this.http\r\n .get<\r\n Response<unknown>\r\n >(`${this.workflowAppActionsUrl}/actions/${encodeURIComponent(action.actionKey)}`)\r\n .pipe(\r\n tap((response) => {\r\n const descriptor = normalizeWorkflowAppActionDescriptor(\r\n response?.data,\r\n );\r\n const currentState = ctx.getState();\r\n const descriptors = upsertWorkflowAppActionDescriptor(\r\n currentState.appActionDescriptors,\r\n descriptor,\r\n );\r\n\r\n ctx.patchState({\r\n appActionDescriptors: descriptors,\r\n selectedAppActionDescriptor: descriptor,\r\n });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to load app action details';\r\n setLoadingError(ctx, 'getAppActionDetail', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'getAppActionDetail')),\r\n );\r\n }\r\n\r\n @Action(GetStep)\r\n getStep(ctx: StateContext<WorkflowStateModel>, action: GetStep) {\r\n startLoading(ctx, 'getStep');\r\n\r\n return this.http\r\n .get<Response<StepSchema>>(\r\n `${this.baseUrl}/stepSchema/${action.stepId}`,\r\n {\r\n params: { Mode: 'edit' },\r\n },\r\n )\r\n .pipe(\r\n tap((response) => {\r\n const selectedStep = response?.data\r\n ? normalizeWorkflowStepDetail(response.data)\r\n : null;\r\n ctx.patchState({ selectedStep });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to load step';\r\n setLoadingError(ctx, 'getStep', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'getStep')),\r\n );\r\n }\r\n\r\n @Action(ValidateFlow)\r\n validateFlow(ctx: StateContext<WorkflowStateModel>, _action: ValidateFlow) {\r\n startLoading(ctx, 'validateFlow');\r\n\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'validateFlow', message);\r\n endLoading(ctx, 'validateFlow');\r\n return of(null);\r\n }\r\n\r\n return this.http\r\n .get<\r\n Response<boolean>\r\n >(`${this.baseUrl}/requestSchema/${workflowId}/validity`)\r\n .pipe(\r\n tap((response) => {\r\n const isFlowValid = response?.data ?? null;\r\n ctx.patchState({ isFlowValid });\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to validate flow';\r\n setLoadingError(ctx, 'validateFlow', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'validateFlow')),\r\n );\r\n }\r\n\r\n @Action(CreateStep)\r\n createStep(ctx: StateContext<WorkflowStateModel>, action: CreateStep) {\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'createStep', message);\r\n return of(null);\r\n }\r\n\r\n const tempId = -Date.now();\r\n const tempStep = normalizeWorkflowStepSchema({\r\n ...action.payload,\r\n id: tempId,\r\n loading: true,\r\n });\r\n\r\n if (state.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n stepsSchema: [...state.workflow.stepsSchema, tempStep],\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'createStep');\r\n\r\n return this.http\r\n .post<\r\n Response<StepResponse>\r\n >(`${this.baseUrl}/requestSchema/${workflowId}/stepSchema`, action.payload)\r\n .pipe(\r\n tap((response) => {\r\n const createdStep = response?.data\r\n ? normalizeWorkflowStepSchema({\r\n ...tempStep,\r\n ...response.data,\r\n loading: false,\r\n })\r\n : null;\r\n const currentState = ctx.getState();\r\n if (createdStep && currentState.workflow) {\r\n const updatedSteps = currentState.workflow.stepsSchema.map(\r\n (step) => (step.id === tempId ? createdStep : step),\r\n );\r\n\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: updatedSteps,\r\n },\r\n });\r\n }\r\n // Validate flow after creating step\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const filteredSteps = currentState.workflow.stepsSchema.filter(\r\n (step) => step.id !== tempId,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: filteredSteps,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to create step';\r\n setLoadingError(ctx, 'createStep', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'createStep')),\r\n );\r\n }\r\n\r\n @Action(UpdateStep)\r\n updateStep(ctx: StateContext<WorkflowStateModel>, action: UpdateStep) {\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'updateStep', message);\r\n return of(null);\r\n }\r\n\r\n if (state.workflow) {\r\n const updatedSteps = state.workflow.stepsSchema.map((step) =>\r\n step.id === action.stepId ? { ...step, loading: true } : step,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n stepsSchema: updatedSteps,\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'updateStep');\r\n\r\n const endpoint = action.isInitial ? 'initialStepSchema' : 'stepSchema';\r\n\r\n return this.http\r\n .put<\r\n Response<StepResponse>\r\n >(`${this.baseUrl}/${endpoint}/${action.stepId}`, action.payload)\r\n .pipe(\r\n tap((response) => {\r\n const currentState = ctx.getState();\r\n const existingStep =\r\n currentState.workflow?.stepsSchema.find(\r\n (step) => step.id === action.stepId,\r\n ) ?? null;\r\n const updatedStep = response?.data\r\n ? normalizeWorkflowStepSchema({\r\n ...existingStep,\r\n ...response.data,\r\n loading: false,\r\n })\r\n : null;\r\n if (updatedStep && currentState.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: currentState.workflow.stepsSchema.map((step) =>\r\n step.id === updatedStep.id ? updatedStep : step,\r\n ),\r\n },\r\n });\r\n }\r\n // Validate flow after updating step\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const errorSteps = currentState.workflow.stepsSchema.map((step) =>\r\n step.id === action.stepId ? { ...step, loading: false } : step,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: errorSteps,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to update step';\r\n setLoadingError(ctx, 'updateStep', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'updateStep')),\r\n );\r\n }\r\n\r\n @Action(CreateConnection)\r\n createConnection(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: CreateConnection,\r\n ) {\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'createConnection', message);\r\n return of(null);\r\n }\r\n\r\n const tempId = -Date.now();\r\n const tempConnection: any = {\r\n ...action.payload,\r\n id: tempId,\r\n loading: true,\r\n source: action.payload.sourceStepId,\r\n target: action.payload.targetStepId,\r\n };\r\n\r\n if (state.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n connections: [...state.workflow.connections, tempConnection],\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'createConnection');\r\n\r\n return this.http\r\n .post<\r\n Response<ConnectionResponse>\r\n >(`${this.baseUrl}/requestSchema/${workflowId}/connection`, action.payload)\r\n .pipe(\r\n tap((response) => {\r\n const createdConnection = response?.data;\r\n const currentState = ctx.getState();\r\n if (createdConnection && currentState.workflow) {\r\n const updatedConnections = currentState.workflow.connections.map(\r\n (conn) =>\r\n conn.id === tempId\r\n ? { ...createdConnection, loading: false }\r\n : conn,\r\n );\r\n\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: updatedConnections,\r\n },\r\n });\r\n }\r\n // Validate flow after creating connection\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const filteredConnections =\r\n currentState.workflow.connections.filter(\r\n (conn) => conn.id !== tempId,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: filteredConnections,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to create connection';\r\n setLoadingError(ctx, 'createConnection', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'createConnection')),\r\n );\r\n }\r\n\r\n @Action(UpdateConnection)\r\n updateConnection(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: UpdateConnection,\r\n ) {\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'updateConnection', message);\r\n return of(null);\r\n }\r\n\r\n if (state.workflow) {\r\n const updatedConnections = state.workflow.connections.map((conn) =>\r\n conn.id === action.connectionId ? { ...conn, loading: true } : conn,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n connections: updatedConnections,\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'updateConnection');\r\n\r\n return this.http\r\n .put<\r\n Response<ConnectionResponse>\r\n >(`${this.baseUrl}/stepSchemaConnection/${action.connectionId}`, action.payload)\r\n .pipe(\r\n tap((response) => {\r\n const updatedConnection = response?.data;\r\n const currentState = ctx.getState();\r\n if (updatedConnection && currentState.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: currentState.workflow.connections.map((conn) =>\r\n conn.id === updatedConnection.id\r\n ? { ...updatedConnection, loading: false }\r\n : conn,\r\n ),\r\n },\r\n });\r\n }\r\n // Validate flow after updating connection\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const errorConnections = currentState.workflow.connections.map(\r\n (conn) =>\r\n conn.id === action.connectionId\r\n ? { ...conn, loading: false }\r\n : conn,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: errorConnections,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to update connection';\r\n setLoadingError(ctx, 'updateConnection', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'updateConnection')),\r\n );\r\n }\r\n\r\n @Action(PublishWorkflow)\r\n publishWorkflow(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: PublishWorkflow,\r\n ) {\r\n startLoading(ctx, 'publishWorkflow');\r\n\r\n const state = ctx.getState();\r\n const workflowId = state.workflowId;\r\n\r\n if (!workflowId) {\r\n const message = 'Workflow ID is not set';\r\n setLoadingError(ctx, 'publishWorkflow', message);\r\n endLoading(ctx, 'publishWorkflow');\r\n return of(null);\r\n }\r\n\r\n return this.http\r\n .put<\r\n Response<PublishResponse>\r\n >(`${this.baseUrl}/requestSchema/${workflowId}/publish`, { IsPublished: action.isPublished })\r\n .pipe(\r\n tap((response) => {\r\n const publishedData = response?.data;\r\n if (publishedData && state.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n isPublished: publishedData.isPublished,\r\n isValid: publishedData.isValid,\r\n },\r\n });\r\n }\r\n }),\r\n catchError((error) => {\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to publish workflow';\r\n setLoadingError(ctx, 'publishWorkflow', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'publishWorkflow')),\r\n );\r\n }\r\n\r\n @Action(DeleteStep)\r\n deleteStep(ctx: StateContext<WorkflowStateModel>, action: DeleteStep) {\r\n const state = ctx.getState();\r\n\r\n if (state.workflow) {\r\n // Mark step as loading\r\n const updatedSteps = state.workflow.stepsSchema.map((step) =>\r\n step.id == action.stepId ? { ...step, loading: true } : step,\r\n );\r\n\r\n // Filter out all connections related to this step\r\n const updatedConnections = state.workflow.connections.filter(\r\n (conn) => conn.source != action.stepId && conn.target != action.stepId,\r\n );\r\n\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n stepsSchema: updatedSteps,\r\n connections: updatedConnections,\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'deleteStep');\r\n\r\n return this.http\r\n .delete<Response<boolean>>(`${this.baseUrl}/stepSchema/${action.stepId}`)\r\n .pipe(\r\n tap(() => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: currentState.workflow.stepsSchema.filter(\r\n (step) => step.id != action.stepId,\r\n ),\r\n },\r\n });\r\n }\r\n // Validate flow after deleting step\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n // Restore step loading state\r\n const errorSteps = currentState.workflow.stepsSchema.map((step) =>\r\n step.id == action.stepId ? { ...step, loading: false } : step,\r\n );\r\n\r\n // Restore connections related to this step from original state\r\n const relatedConnections =\r\n state.workflow?.connections.filter(\r\n (conn) =>\r\n conn.source == action.stepId || conn.target == action.stepId,\r\n ) || [];\r\n\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n stepsSchema: errorSteps,\r\n connections: [\r\n ...currentState.workflow.connections,\r\n ...relatedConnections,\r\n ],\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ?? error?.message ?? 'Failed to delete step';\r\n setLoadingError(ctx, 'deleteStep', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'deleteStep')),\r\n );\r\n }\r\n\r\n @Action(DeleteConnection)\r\n deleteConnection(\r\n ctx: StateContext<WorkflowStateModel>,\r\n action: DeleteConnection,\r\n ) {\r\n const state = ctx.getState();\r\n\r\n if (state.workflow) {\r\n const updatedConnections = state.workflow.connections.map((conn) =>\r\n conn.id == action.connectionId ? { ...conn, loading: true } : conn,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...state.workflow,\r\n connections: updatedConnections,\r\n },\r\n });\r\n }\r\n\r\n startLoading(ctx, 'deleteConnection');\r\n\r\n return this.http\r\n .delete<\r\n Response<boolean>\r\n >(`${this.baseUrl}/stepSchemaConnection/${action.connectionId}`)\r\n .pipe(\r\n tap(() => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: currentState.workflow.connections.filter(\r\n (conn) => conn.id != action.connectionId,\r\n ),\r\n },\r\n });\r\n }\r\n // Validate flow after deleting connection\r\n ctx.dispatch(new ValidateFlow());\r\n }),\r\n catchError((error) => {\r\n const currentState = ctx.getState();\r\n if (currentState.workflow) {\r\n const errorConnections = currentState.workflow.connections.map(\r\n (conn) =>\r\n conn.id == action.connectionId\r\n ? { ...conn, loading: false }\r\n : conn,\r\n );\r\n ctx.patchState({\r\n workflow: {\r\n ...currentState.workflow,\r\n connections: errorConnections,\r\n },\r\n });\r\n }\r\n\r\n const message =\r\n error?.error?.message ??\r\n error?.message ??\r\n 'Failed to delete connection';\r\n setLoadingError(ctx, 'deleteConnection', message);\r\n return of(null);\r\n }),\r\n finalize(() => endLoading(ctx, 'deleteConnection')),\r\n );\r\n }\r\n}\r\n\r\nfunction normalizeWorkflowRoles(\r\n data: unknown,\r\n): Array<RoleDefinition | RoleGroupDefinition> {\r\n if (!Array.isArray(data)) {\r\n return [];\r\n }\r\n\r\n if (data.some((item: any) => Array.isArray(item?.roles))) {\r\n return data\r\n .map((group: any) => ({\r\n label: resolveWorkflowRoleGroupLabel(group),\r\n items: Array.isArray(group?.roles)\r\n ? group.roles.map(normalizeWorkflowRole).filter(Boolean)\r\n : [],\r\n }))\r\n .filter((group) => group.items.length > 0);\r\n }\r\n\r\n return data.map(normalizeWorkflowRole).filter(Boolean);\r\n}\r\n\r\nfunction normalizeWorkflowSchema(input: any): WorkflowSchema {\r\n return {\r\n ...input,\r\n stepsSchema: Array.isArray(input?.stepsSchema)\r\n ? input.stepsSchema.map(normalizeWorkflowStepSchema)\r\n : [],\r\n connections: Array.isArray(input?.connections) ? input.connections : [],\r\n properties: Array.isArray(input?.properties) ? input.properties : [],\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowStepSchema(input: any): WorkflowStepSchema {\r\n const type = normalizeWorkflowStepType(input?.type);\r\n const appAction = normalizeWorkflowAppAction(input, type);\r\n\r\n return {\r\n ...input,\r\n id: Number(input?.id ?? 0),\r\n name: normalizeWorkflowStepName(input?.name),\r\n sla: Number(input?.sla ?? 0),\r\n isInitial: !!input?.isInitial,\r\n type,\r\n targetType: input?.targetType ?? undefined,\r\n targetValue:\r\n input?.targetValue === null || input?.targetValue === undefined\r\n ? undefined\r\n : String(input.targetValue),\r\n appAction,\r\n loading: !!input?.loading,\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowStepDetail(input: any): StepSchema {\r\n const type = normalizeWorkflowStepType(input?.type);\r\n const appAction = normalizeWorkflowAppAction(input, type);\r\n\r\n return {\r\n ...input,\r\n id: Number(input?.id ?? 0),\r\n name: normalizeWorkflowRecordName(input?.name),\r\n sla: Number(input?.sla ?? 0),\r\n isInitial: !!input?.isInitial,\r\n type,\r\n targetType: input?.targetType ?? undefined,\r\n targetValue:\r\n input?.targetValue === null || input?.targetValue === undefined\r\n ? undefined\r\n : String(input.targetValue),\r\n properties: Array.isArray(input?.properties) ? input.properties : [],\r\n hasNotification: !!input?.hasNotification,\r\n hasForm:\r\n input?.hasForm === undefined || input?.hasForm === null\r\n ? undefined\r\n : !!input.hasForm,\r\n appAction,\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowStepType(type: unknown): WorkflowStepType {\r\n return type === 'AppAction' ? 'AppAction' : 'UserInput';\r\n}\r\n\r\nfunction normalizeWorkflowStepName(\r\n name: unknown,\r\n): string | Record<string, string> {\r\n if (typeof name === 'string') {\r\n return name;\r\n }\r\n\r\n if (name && typeof name === 'object') {\r\n return name as Record<string, string>;\r\n }\r\n\r\n return '';\r\n}\r\n\r\nfunction normalizeWorkflowRecordName(name: unknown): Record<string, string> {\r\n if (name && typeof name === 'object') {\r\n return name as Record<string, string>;\r\n }\r\n\r\n const label = typeof name === 'string' ? name : '';\r\n return {\r\n display: label,\r\n en: label,\r\n ar: label,\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowAppAction(\r\n input: any,\r\n type: WorkflowStepType,\r\n): WorkflowAppAction | null {\r\n const candidate = isRecord(input?.appAction) ? input.appAction : input;\r\n const hasAppActionData =\r\n !!candidate?.appCode ||\r\n !!candidate?.actionKey ||\r\n candidate?.configJson !== undefined ||\r\n candidate?.failureBehavior !== undefined ||\r\n candidate?.timeoutSeconds !== undefined;\r\n\r\n if (!hasAppActionData && type !== 'AppAction') {\r\n return null;\r\n }\r\n\r\n return {\r\n appCode:\r\n typeof candidate?.appCode === 'string' && candidate.appCode.trim().length\r\n ? candidate.appCode\r\n : 'pplus',\r\n actionKey:\r\n typeof candidate?.actionKey === 'string' ? candidate.actionKey : '',\r\n configJson:\r\n typeof candidate?.configJson === 'string'\r\n ? candidate.configJson\r\n : safeJsonStringify(candidate?.configJson ?? {}),\r\n failureBehavior:\r\n typeof candidate?.failureBehavior === 'string'\r\n ? candidate.failureBehavior\r\n : 'Stop',\r\n timeoutSeconds: Number(candidate?.timeoutSeconds ?? 300),\r\n displayName:\r\n typeof candidate?.displayName === 'string' ? candidate.displayName : null,\r\n description:\r\n typeof candidate?.description === 'string' ? candidate.description : null,\r\n configSchemaJson:\r\n typeof candidate?.configSchemaJson === 'string'\r\n ? candidate.configSchemaJson\r\n : null,\r\n requiredContextKeys: Array.isArray(candidate?.requiredContextKeys)\r\n ? candidate.requiredContextKeys.map(String)\r\n : [],\r\n supportedScopes: Array.isArray(candidate?.supportedScopes)\r\n ? candidate.supportedScopes.map(String)\r\n : [],\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowAppActionDescriptors(\r\n data: unknown,\r\n): WorkflowAppActionDescriptor[] {\r\n return extractCollection(data, ['actions', 'items'])\r\n .map(normalizeWorkflowAppActionDescriptor)\r\n .filter(Boolean);\r\n}\r\n\r\nfunction normalizeWorkflowAppActionDescriptor(\r\n data: unknown,\r\n): WorkflowAppActionDescriptor {\r\n const record = isRecord(data) ? data : {};\r\n\r\n return {\r\n appCode: readString(record, 'appCode') ?? 'pplus',\r\n actionKey: readString(record, 'actionKey') ?? '',\r\n displayName:\r\n readString(record, 'displayName') ??\r\n readString(record, 'name') ??\r\n readString(record, 'actionKey') ??\r\n '',\r\n description: readString(record, 'description') ?? null,\r\n configSchemaJson: readString(record, 'configSchemaJson') ?? null,\r\n requiredContextKeys: Array.isArray(record['requiredContextKeys'])\r\n ? record['requiredContextKeys'].map(String)\r\n : [],\r\n supportedScopes: Array.isArray(record['supportedScopes'])\r\n ? record['supportedScopes'].map(String)\r\n : [],\r\n };\r\n}\r\n\r\nfunction upsertWorkflowAppActionDescriptor(\r\n descriptors: WorkflowAppActionDescriptor[],\r\n descriptor: WorkflowAppActionDescriptor,\r\n): WorkflowAppActionDescriptor[] {\r\n const index = descriptors.findIndex(\r\n (item) => item.actionKey === descriptor.actionKey,\r\n );\r\n\r\n if (index < 0) {\r\n return [...descriptors, descriptor];\r\n }\r\n\r\n return descriptors.map((item, currentIndex) =>\r\n currentIndex === index ? { ...item, ...descriptor } : item,\r\n );\r\n}\r\n\r\nfunction extractCollection(\r\n data: unknown,\r\n nestedKeys: string[],\r\n): Array<Record<string, unknown>> {\r\n if (Array.isArray(data)) {\r\n return data.filter(isRecord);\r\n }\r\n\r\n if (!isRecord(data)) {\r\n return [];\r\n }\r\n\r\n for (const key of nestedKeys) {\r\n const nestedValue = data[key];\r\n if (Array.isArray(nestedValue)) {\r\n return nestedValue.filter(isRecord);\r\n }\r\n }\r\n\r\n return [];\r\n}\r\n\r\nfunction readString(\r\n record: Record<string, unknown>,\r\n key: string,\r\n): string | null {\r\n const value = record[key];\r\n return typeof value === 'string' && value.trim().length > 0 ? value : null;\r\n}\r\n\r\nfunction safeJsonStringify(value: unknown): string {\r\n try {\r\n return JSON.stringify(value ?? {});\r\n } catch {\r\n return '{}';\r\n }\r\n}\r\n\r\nfunction isRecord(value: unknown): value is Record<string, unknown> {\r\n return !!value && typeof value === 'object' && !Array.isArray(value);\r\n}\r\n\r\nfunction normalizeWorkflowRole(role: any): RoleDefinition {\r\n const value = role?.value ?? role?.id;\r\n return {\r\n ...role,\r\n id: role?.id ?? value,\r\n value,\r\n name: normalizeWorkflowRoleName(role?.name),\r\n };\r\n}\r\n\r\nfunction normalizeWorkflowRoleName(\r\n name: unknown,\r\n): string | Record<string, string> {\r\n if (name && typeof name === 'object') {\r\n return name as Record<string, string>;\r\n }\r\n\r\n const label = typeof name === 'string' ? name : '';\r\n return {\r\n display: label,\r\n en: label,\r\n ar: label,\r\n };\r\n}\r\n\r\nfunction resolveWorkflowRoleGroupLabel(group: any): string {\r\n const level = group?.level;\r\n if (typeof level === 'string') {\r\n return level;\r\n }\r\n\r\n if (level?.display) {\r\n return level.display;\r\n }\r\n\r\n if (level?.en) {\r\n return level.en;\r\n }\r\n\r\n if (level?.ar) {\r\n return level.ar;\r\n }\r\n\r\n return group?.levelKey ?? group?.scopeType ?? 'Roles';\r\n}\r\n","import { Injectable, computed, inject } from '@angular/core';\r\nimport { select, Store } from '@ngxs/store';\r\nimport type { Observable } from 'rxjs';\r\n\r\nimport type {\r\n ConnectionPayload,\r\n FormulaProperty,\r\n WorkflowAppActionDescriptor,\r\n GroupDefinition,\r\n RoleGroupDefinition,\r\n RoleDefinition,\r\n StepPayload,\r\n StepSchema,\r\n WorkflowConnection,\r\n WorkflowListItem,\r\n WorkflowLoadingName,\r\n WorkflowSchema,\r\n WorkflowStepSchema,\r\n} from './workflow.model';\r\nimport {\r\n CreateConnection,\r\n CreateStep,\r\n DeleteConnection,\r\n DeleteStep,\r\n GetAppActionDetail,\r\n GetAppActions,\r\n GetFormulaProperties,\r\n GetGroups,\r\n GetRolesForModule,\r\n GetStep,\r\n GetWorkflow,\r\n GetWorkflows,\r\n PublishWorkflow,\r\n SetModuleInfo,\r\n UpdateConnection,\r\n UpdateStep,\r\n ValidateFlow,\r\n} from './workflow.actions';\r\nimport { WorkflowState } from './workflow.state';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class WorkflowFacade {\r\n private readonly store = inject(Store);\r\n\r\n readonly workflowId = select<string | number | null>(\r\n WorkflowState.workflowId,\r\n );\r\n readonly moduleType = select<string | null>(WorkflowState.moduleType);\r\n readonly moduleId = select<string | number | null>(WorkflowState.moduleId);\r\n readonly workflows = select<WorkflowListItem[]>(WorkflowState.workflows);\r\n readonly workflow = select<WorkflowSchema | null>(WorkflowState.workflow);\r\n readonly formulaProperties = select<FormulaProperty[]>(\r\n WorkflowState.formulaProperties,\r\n );\r\n readonly groups = select<GroupDefinition[]>(WorkflowState.groups);\r\n readonly roles = select<Array<RoleDefinition | RoleGroupDefinition>>(\r\n WorkflowState.roles,\r\n );\r\n readonly appActionDescriptors = select<WorkflowAppActionDescriptor[]>(\r\n WorkflowState.appActionDescriptors,\r\n );\r\n readonly selectedAppActionDescriptor =\r\n select<WorkflowAppActionDescriptor | null>(\r\n WorkflowState.selectedAppActionDescriptor,\r\n );\r\n readonly selectedStep = select<StepSchema | null>(WorkflowState.selectedStep);\r\n readonly isFlowValid = select<boolean | null>(WorkflowState.isFlowValid);\r\n readonly steps = select<WorkflowStepSchema[]>(WorkflowState.stepsSchema);\r\n readonly connections = select<WorkflowConnection[]>(\r\n WorkflowState.connections,\r\n );\r\n\r\n isLoading(loadingName: WorkflowLoadingName) {\r\n const loadingFactory = select<(name: WorkflowLoadingName) => boolean>(\r\n WorkflowState.isLoadingFactory,\r\n );\r\n return computed(() => loadingFactory()(loadingName));\r\n }\r\n\r\n error(loadingName: WorkflowLoadingName) {\r\n const errorFactory = select<(name: WorkflowLoadingName) => string | null>(\r\n WorkflowState.errorFactory,\r\n );\r\n return computed(() => errorFactory()(loadingName));\r\n }\r\n setModuleInfo(\r\n moduleType: string,\r\n moduleId: string | number,\r\n parentModuleType?: string,\r\n parentModuleId?: string | number,\r\n parentPath?: string,\r\n ): Observable<unknown> {\r\n return this.store.dispatch(\r\n new SetModuleInfo(\r\n moduleType,\r\n moduleId,\r\n parentModuleType,\r\n parentModuleId,\r\n parentPath,\r\n ),\r\n );\r\n }\r\n\r\n loadWorkflows(): Observable<unknown> {\r\n return this.store.dispatch(new GetWorkflows());\r\n }\r\n\r\n selectWorkflow(workflowId: string | number): Observable<unknown> {\r\n return this.store.dispatch(new GetWorkflow(workflowId));\r\n }\r\n\r\n loadWorkflow(): Observable<unknown> {\r\n return this.loadWorkflows();\r\n }\r\n\r\n loadFormulaProperties(): Observable<unknown> {\r\n return this.store.dispatch(new GetFormulaProperties());\r\n }\r\n\r\n loadGroups(): Observable<unknown> {\r\n return this.store.dispatch(new GetGroups());\r\n }\r\n\r\n loadRolesForModule(): Observable<unknown> {\r\n return this.store.dispatch(new GetRolesForModule());\r\n }\r\n\r\n loadAppActions(): Observable<unknown> {\r\n return this.store.dispatch(new GetAppActions());\r\n }\r\n\r\n loadAppActionDetail(actionKey: string): Observable<unknown> {\r\n return this.store.dispatch(new GetAppActionDetail(actionKey));\r\n }\r\n\r\n loadStep(stepId: string | number): Observable<unknown> {\r\n return this.store.dispatch(new GetStep(stepId));\r\n }\r\n\r\n validateFlow(): Observable<unknown> {\r\n return this.store.dispatch(new ValidateFlow());\r\n }\r\n\r\n createStep(payload: StepPayload): Observable<unknown> {\r\n return this.store.dispatch(new CreateStep(payload));\r\n }\r\n\r\n updateStep(\r\n stepId: string | number,\r\n payload: StepPayload,\r\n isInitial?: boolean,\r\n ): Observable<unknown> {\r\n return this.store.dispatch(new UpdateStep(stepId, payload, isInitial));\r\n }\r\n\r\n createConnection(payload: ConnectionPayload): Observable<unknown> {\r\n return this.store.dispatch(new CreateConnection(payload));\r\n }\r\n\r\n updateConnection(\r\n connectionId: string | number,\r\n payload: ConnectionPayload,\r\n ): Observable<unknown> {\r\n return this.store.dispatch(new UpdateConnection(connectionId, payload));\r\n }\r\n\r\n publishWorkflow(isPublished: boolean): Observable<unknown> {\r\n return this.store.dispatch(new PublishWorkflow(isPublished));\r\n }\r\n\r\n deleteStep(stepId: string | number): Observable<unknown> {\r\n return this.store.dispatch(new DeleteStep(stepId));\r\n }\r\n\r\n deleteConnection(connectionId: string | number): Observable<unknown> {\r\n return this.store.dispatch(new DeleteConnection(connectionId));\r\n }\r\n}\r\n","// shared/models/api.model.ts\n\nexport interface Response<T> {\n endpoint: string;\n status: number;\n code: number;\n locale: string;\n message?: string | null;\n errors?: any | null;\n data: T;\n cacheSession?: string;\n}\n","import type {\r\n WorkflowAppActionConfigPropertySchema,\r\n WorkflowAppActionConfigPropertyType,\r\n WorkflowAppActionConfigSchema,\r\n} from '../../store/workflow';\r\n\r\nexport type WorkflowAppActionConfigFieldKind =\r\n | 'text'\r\n | 'number'\r\n | 'toggle'\r\n | 'select'\r\n | 'json';\r\n\r\nexport interface WorkflowAppActionConfigField {\r\n key: string;\r\n title: string;\r\n description?: string | null;\r\n type: WorkflowAppActionConfigPropertyType;\r\n kind: WorkflowAppActionConfigFieldKind;\r\n required: boolean;\r\n enumValues?: Array<string | number | boolean>;\r\n jsonValueType?: 'array' | 'object';\r\n}\r\n\r\nexport interface WorkflowAppActionConfigEditorDefinition {\r\n mode: 'schema' | 'raw';\r\n schema: WorkflowAppActionConfigSchema | null;\r\n fields: WorkflowAppActionConfigField[];\r\n errors: string[];\r\n}\r\n\r\nexport interface WorkflowAppActionConfigEditorValue {\r\n fields: Record<string, unknown>;\r\n rawConfigJson: string;\r\n errors: string[];\r\n}\r\n\r\nexport interface WorkflowAppActionConfigSerializationResult {\r\n configJson: string;\r\n errors: string[];\r\n}\r\n\r\nconst SUPPORTED_PROPERTY_TYPES: WorkflowAppActionConfigPropertyType[] = [\r\n 'string',\r\n 'number',\r\n 'boolean',\r\n 'array',\r\n 'object',\r\n];\r\n\r\nexport function buildWorkflowAppActionConfigEditorDefinition(\r\n configSchemaJson: string | null | undefined,\r\n): WorkflowAppActionConfigEditorDefinition {\r\n if (!configSchemaJson?.trim()) {\r\n return {\r\n mode: 'schema',\r\n schema: {\r\n type: 'object',\r\n properties: [],\r\n required: [],\r\n },\r\n fields: [],\r\n errors: [],\r\n };\r\n }\r\n\r\n let parsedSchema: unknown;\r\n\r\n try {\r\n parsedSchema = JSON.parse(configSchemaJson);\r\n } catch {\r\n return buildRawDefinition('Invalid config schema JSON.');\r\n }\r\n\r\n if (!isRecord(parsedSchema) || parsedSchema['type'] !== 'object') {\r\n return buildRawDefinition('Config schema must use a root object.');\r\n }\r\n\r\n const propertyEntries = Object.entries(parsedSchema['properties'] ?? {});\r\n const requiredKeys = Array.isArray(parsedSchema['required'])\r\n ? parsedSchema['required'].map(String)\r\n : [];\r\n\r\n const properties: WorkflowAppActionConfigPropertySchema[] = [];\r\n\r\n for (const [key, rawProperty] of propertyEntries) {\r\n if (!isRecord(rawProperty)) {\r\n return buildRawDefinition(`Unsupported schema for \"${key}\".`);\r\n }\r\n\r\n const propertyType = resolvePropertyType(rawProperty);\r\n if (!propertyType) {\r\n return buildRawDefinition(`Unsupported schema type for \"${key}\".`);\r\n }\r\n\r\n properties.push({\r\n key,\r\n title: resolvePropertyTitle(key, rawProperty),\r\n description:\r\n typeof rawProperty['description'] === 'string'\r\n ? rawProperty['description']\r\n : null,\r\n type: propertyType,\r\n required: requiredKeys.includes(key),\r\n enumValues: Array.isArray(rawProperty['enum'])\r\n ? rawProperty['enum'].filter(isPrimitiveEnumValue)\r\n : undefined,\r\n rawSchema: rawProperty,\r\n });\r\n }\r\n\r\n const schema: WorkflowAppActionConfigSchema = {\r\n type: 'object',\r\n properties,\r\n required: requiredKeys,\r\n };\r\n\r\n return {\r\n mode: 'schema',\r\n schema,\r\n fields: properties.map(mapSchemaPropertyToField),\r\n errors: [],\r\n };\r\n}\r\n\r\nexport function mapWorkflowAppActionConfigJsonToEditorValue(\r\n configJson: string | null | undefined,\r\n definition: WorkflowAppActionConfigEditorDefinition,\r\n): WorkflowAppActionConfigEditorValue {\r\n const rawConfigJson =\r\n typeof configJson === 'string' && configJson.trim().length\r\n ? configJson\r\n : '{}';\r\n\r\n if (definition.mode === 'raw' || !definition.schema) {\r\n const errors = isValidJson(rawConfigJson) ? [] : ['Invalid config JSON.'];\r\n return {\r\n fields: {},\r\n rawConfigJson,\r\n errors,\r\n };\r\n }\r\n\r\n let parsedValue: Record<string, unknown> = {};\r\n\r\n try {\r\n const candidate = JSON.parse(rawConfigJson);\r\n if (isRecord(candidate)) {\r\n parsedValue = candidate;\r\n }\r\n } catch {\r\n return {\r\n fields: {},\r\n rawConfigJson,\r\n errors: ['Invalid config JSON.'],\r\n };\r\n }\r\n\r\n const fields = definition.fields.reduce<Record<string, unknown>>(\r\n (result, field) => {\r\n const fieldValue = parsedValue[field.key];\r\n\r\n if (field.kind === 'json') {\r\n result[field.key] =\r\n fieldValue === undefined ? '' : JSON.stringify(fieldValue, null, 2);\r\n return result;\r\n }\r\n\r\n result[field.key] = fieldValue ?? null;\r\n return result;\r\n },\r\n {},\r\n );\r\n\r\n return {\r\n fields,\r\n rawConfigJson,\r\n errors: [],\r\n };\r\n}\r\n\r\nexport function serializeWorkflowAppActionConfigValue(\r\n value: Record<string, unknown>,\r\n definition: WorkflowAppActionConfigEditorDefinition,\r\n rawConfigJson?: string | null,\r\n): WorkflowAppActionConfigSerializationResult {\r\n if (definition.mode === 'raw' || !definition.schema) {\r\n const normalizedRawConfigJson =\r\n typeof rawConfigJson === 'string' && rawConfigJson.trim().length\r\n ? rawConfigJson\r\n : '{}';\r\n\r\n if (!isValidJson(normalizedRawConfigJson)) {\r\n return {\r\n configJson: normalizedRawConfigJson,\r\n errors: ['Invalid config JSON.'],\r\n };\r\n }\r\n\r\n return {\r\n configJson: normalizedRawConfigJson,\r\n errors: [],\r\n };\r\n }\r\n\r\n const errors: string[] = [];\r\n const serializedValue: Record<string, unknown> = {};\r\n\r\n definition.fields.forEach((field) => {\r\n const rawFieldValue = value[field.key];\r\n\r\n if (field.kind === 'json') {\r\n const stringValue =\r\n typeof rawFieldValue === 'string' ? rawFieldValue.trim() : '';\r\n\r\n if (!stringValue) {\r\n if (field.required) {\r\n errors.push(`${field.title} is required.`);\r\n }\r\n return;\r\n }\r\n\r\n try {\r\n const parsedFieldValue = JSON.parse(stringValue);\r\n if (\r\n field.jsonValueType === 'array' &&\r\n !Array.isArray(parsedFieldValue)\r\n ) {\r\n errors.push(`${field.title} must be a JSON array.`);\r\n return;\r\n }\r\n\r\n if (\r\n field.jsonValueType === 'object' &&\r\n (!isRecord(parsedFieldValue) || Array.isArray(parsedFieldValue))\r\n ) {\r\n errors.push(`${field.title} must be a JSON object.`);\r\n return;\r\n }\r\n\r\n serializedValue[field.key] = parsedFieldValue;\r\n } catch {\r\n errors.push(`${field.title} must be valid JSON.`);\r\n }\r\n\r\n return;\r\n }\r\n\r\n if (\r\n rawFieldValue === null ||\r\n rawFieldValue === undefined ||\r\n rawFieldValue === ''\r\n ) {\r\n if (field.required) {\r\n errors.push(`${field.title} is required.`);\r\n }\r\n return;\r\n }\r\n\r\n serializedValue[field.key] = rawFieldValue;\r\n });\r\n\r\n return {\r\n configJson: JSON.stringify(serializedValue),\r\n errors,\r\n };\r\n}\r\n\r\nfunction buildRawDefinition(\r\n error: string,\r\n): WorkflowAppActionConfigEditorDefinition {\r\n return {\r\n mode: 'raw',\r\n schema: null,\r\n fields: [],\r\n errors: [error],\r\n };\r\n}\r\n\r\nfunction mapSchemaPropertyToField(\r\n property: WorkflowAppActionConfigPropertySchema,\r\n): WorkflowAppActionConfigField {\r\n if (property.enumValues?.length) {\r\n return {\r\n key: property.key,\r\n title: property.title,\r\n description: property.description,\r\n type: property.type,\r\n kind: 'select',\r\n required: property.required,\r\n enumValues: property.enumValues,\r\n };\r\n }\r\n\r\n if (property.type === 'array' || property.type === 'object') {\r\n return {\r\n key: property.key,\r\n title: property.title,\r\n description: property.description,\r\n type: property.type,\r\n kind: 'json',\r\n required: property.required,\r\n jsonValueType: property.type,\r\n };\r\n }\r\n\r\n return {\r\n key: property.key,\r\n title: property.title,\r\n description: property.description,\r\n type: property.type,\r\n kind:\r\n property.type === 'boolean'\r\n ? 'toggle'\r\n : property.type === 'number'\r\n ? 'number'\r\n : 'text',\r\n required: property.required,\r\n };\r\n}\r\n\r\nfunction resolvePropertyType(\r\n property: Record<string, unknown>,\r\n): WorkflowAppActionConfigPropertyType | null {\r\n const typeValue = property['type'];\r\n\r\n if (typeof typeValue === 'string') {\r\n return normalizePropertyType(typeValue);\r\n }\r\n\r\n if (Array.isArray(typeValue)) {\r\n for (const item of typeValue) {\r\n if (typeof item !== 'string' || item === 'null') {\r\n continue;\r\n }\r\n\r\n const normalizedType = normalizePropertyType(item);\r\n if (normalizedType) {\r\n return normalizedType;\r\n }\r\n }\r\n }\r\n\r\n if (Array.isArray(property['enum']) && property['enum'].length > 0) {\r\n const firstEnumValue = property['enum'].find((item) => item !== null);\r\n if (typeof firstEnumValue === 'boolean') {\r\n return 'boolean';\r\n }\r\n if (typeof firstEnumValue === 'number') {\r\n return 'number';\r\n }\r\n if (typeof firstEnumValue === 'string') {\r\n return 'string';\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction normalizePropertyType(\r\n type: string,\r\n): WorkflowAppActionConfigPropertyType | null {\r\n if (type === 'integer' || type === 'number') {\r\n return 'number';\r\n }\r\n\r\n return SUPPORTED_PROPERTY_TYPES.includes(\r\n type as WorkflowAppActionConfigPropertyType,\r\n )\r\n ? (type as WorkflowAppActionConfigPropertyType)\r\n : null;\r\n}\r\n\r\nfunction resolvePropertyTitle(\r\n key: string,\r\n property: Record<string, unknown>,\r\n): string {\r\n if (\r\n typeof property['title'] === 'string' &&\r\n property['title'].trim().length\r\n ) {\r\n return property['title'];\r\n }\r\n\r\n return key\r\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\r\n .replace(/[_-]+/g, ' ')\r\n .replace(/\\s+/g, ' ')\r\n .trim()\r\n .replace(/\\b\\w/g, (character) => character.toUpperCase());\r\n}\r\n\r\nfunction isPrimitiveEnumValue(\r\n value: unknown,\r\n): value is string | number | boolean {\r\n return (\r\n typeof value === 'string' ||\r\n typeof value === 'number' ||\r\n typeof value === 'boolean'\r\n );\r\n}\r\n\r\nfunction isValidJson(value: string): boolean {\r\n try {\r\n JSON.parse(value);\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n}\r\n\r\nfunction isRecord(value: unknown): value is Record<string, unknown> {\r\n return !!value && typeof value === 'object' && !Array.isArray(value);\r\n}\r\n","import type {\r\n StepPayload,\r\n StepPropertyPayload,\r\n StepSchema,\r\n WorkflowAppActionFailureBehavior,\r\n WorkflowStepType,\r\n} from '../../store/workflow';\r\n\r\nexport interface WorkflowStepEditorValue {\r\n name: Record<string, string>;\r\n type: WorkflowStepType;\r\n targetType: string;\r\n group: number | null;\r\n role: string | null;\r\n sla: number;\r\n}\r\n\r\nexport interface WorkflowAppActionEditorValue {\r\n actionKey: string | null;\r\n failureBehavior: WorkflowAppActionFailureBehavior;\r\n timeoutSeconds: number;\r\n configJson: string;\r\n}\r\n\r\nexport interface WorkflowStepEditorState {\r\n stepFormValue: WorkflowStepEditorValue;\r\n appActionValue: WorkflowAppActionEditorValue;\r\n}\r\n\r\nexport interface BuildWorkflowStepPayloadOptions {\r\n formValue: WorkflowStepEditorValue;\r\n properties: StepPropertyPayload[];\r\n hasNotification: boolean;\r\n appActionValue?: WorkflowAppActionEditorValue | null;\r\n}\r\n\r\nexport const DEFAULT_WORKFLOW_STEP_NAME = {\r\n en: '',\r\n ar: '',\r\n};\r\n\r\nexport const DEFAULT_APP_ACTION_EDITOR_VALUE: WorkflowAppActionEditorValue = {\r\n actionKey: null,\r\n failureBehavior: 'Stop',\r\n timeoutSeconds: 300,\r\n configJson: '{}',\r\n};\r\n\r\nexport function createDefaultWorkflowStepEditorValue(): WorkflowStepEditorValue {\r\n return {\r\n name: { ...DEFAULT_WORKFLOW_STEP_NAME },\r\n type: 'UserInput',\r\n targetType: '1',\r\n group: null,\r\n role: null,\r\n sla: 0,\r\n };\r\n}\r\n\r\nexport function mapWorkflowStepToEditorState(\r\n step: StepSchema | null | undefined,\r\n): WorkflowStepEditorState {\r\n if (!step) {\r\n return {\r\n stepFormValue: createDefaultWorkflowStepEditorValue(),\r\n appActionValue: { ...DEFAULT_APP_ACTION_EDITOR_VALUE },\r\n };\r\n }\r\n\r\n const type = normalizeWorkflowStepType(step.type);\r\n\r\n return {\r\n stepFormValue: {\r\n name: normalizeStepName(step.name),\r\n type,\r\n targetType: step.targetType || '1',\r\n group:\r\n type === 'UserInput' && step.targetType === '1' && step.targetValue\r\n ? Number(step.targetValue)\r\n : null,\r\n role:\r\n type === 'UserInput' && step.targetType === '2'\r\n ? (step.targetValue ?? null)\r\n : null,\r\n sla: Number(step.sla ?? 0),\r\n },\r\n appActionValue: {\r\n actionKey: step.appAction?.actionKey ?? null,\r\n failureBehavior: step.appAction?.failureBehavior ?? 'Stop',\r\n timeoutSeconds: Number(step.appAction?.timeoutSeconds ?? 300),\r\n configJson: step.appAction?.configJson ?? '{}',\r\n },\r\n };\r\n}\r\n\r\nexport function buildWorkflowStepPayload({\r\n formValue,\r\n properties,\r\n hasNotification,\r\n appActionValue,\r\n}: BuildWorkflowStepPayloadOptions): StepPayload {\r\n const type = normalizeWorkflowStepType(formValue.type);\r\n\r\n if (type === 'AppAction') {\r\n return {\r\n type,\r\n name: normalizeStepName(formValue.name),\r\n sla: Number(formValue.sla ?? 0),\r\n properties: [],\r\n hasNotification,\r\n appCode: 'pplus',\r\n actionKey: appActionValue?.actionKey ?? '',\r\n configJson: appActionValue?.configJson ?? '{}',\r\n failureBehavior: appActionValue?.failureBehavior ?? 'Stop',\r\n timeoutSeconds: Number(appActionValue?.timeoutSeconds ?? 300),\r\n };\r\n }\r\n\r\n return {\r\n type,\r\n name: normalizeStepName(formValue.name),\r\n targetType: formValue.targetType || '1',\r\n targetValue:\r\n formValue.targetType === '1'\r\n ? (formValue.group ?? undefined)\r\n : (formValue.role ?? undefined),\r\n sla: Number(formValue.sla ?? 0),\r\n properties,\r\n hasNotification,\r\n hasForm: true,\r\n };\r\n}\r\n\r\nexport function normalizeWorkflowStepType(type: unknown): WorkflowStepType {\r\n return type === 'AppAction' ? 'AppAction' : 'UserInput';\r\n}\r\n\r\nfunction normalizeStepName(\r\n name: Record<string, string> | string | null | undefined,\r\n): Record<string, string> {\r\n if (name && typeof name === 'object') {\r\n return {\r\n en: name['en'] ?? '',\r\n ar: name['ar'] ?? '',\r\n ...(name['display'] ? { display: name['display'] } : {}),\r\n };\r\n }\r\n\r\n const label = typeof name === 'string' ? name : '';\r\n return {\r\n display: label,\r\n en: label,\r\n ar: label,\r\n };\r\n}\r\n","import { Component, inject } from '@angular/core';\nimport { FormBuilder } from '@masterteam/form-builder';\nimport { ModalService } from '@masterteam/components/modal';\n\n@Component({\n selector: 'mt-workflow-form-drawer',\n imports: [FormBuilder],\n templateUrl: './workflow-form-drawer.html',\n styleUrl: './workflow-form-drawer.css',\n})\nexport class WorkflowFormDrawer {\n readonly modal = inject(ModalService);\n}\n","<div [class]=\"modal.contentClass + ' p-4'\">\n <mt-form-builder\n class=\"flex-1\"\n canvasStyleClass=\"!w-full\"\n mode=\"manageProperties\"\n />\n</div>\n","import { Component } from '@angular/core';\nimport { NotificationTemplate } from '@masterteam/notification';\nimport { Card } from '@masterteam/components/card';\n\n@Component({\n selector: 'mt-workflow-notifications-drawer',\n imports: [Card, NotificationTemplate, Card],\n templateUrl: './workflow-notifications-drawer.html',\n styleUrl: './workflow-notifications-drawer.css',\n})\nexport class WorkflowNotificationsDrawer {}\n","<div class=\"overflow-hidden h-full w-full\">\n <div\n class=\"flex-1 flex justify-center items-start p-4 h-full overflow-y-auto\"\n >\n <div class=\"w-2/3\">\n <mt-card headless>\n <mt-notification-template />\n </mt-card>\n </div>\n </div>\n</div>\n","import { Component, computed, effect, inject, signal } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n Validators,\r\n} from '@angular/forms';\r\nimport { TranslocoModule, TranslocoService } from '@jsverse/transloco';\r\nimport { DynamicFormConfig } from '@masterteam/components';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { Card } from '@masterteam/components/card';\r\nimport { ConfirmationService } from '@masterteam/components/confirmation';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { NumberField } from '@masterteam/components/number-field';\r\nimport { SelectField } from '@masterteam/components/select-field';\r\nimport { TextField } from '@masterteam/components/text-field';\r\nimport { TextareaField } from '@masterteam/components/textarea-field';\r\nimport { ToggleField } from '@masterteam/components/toggle-field';\r\nimport { FormBuilderFacade } from '@masterteam/form-builder';\r\nimport {\r\n NotificationFacade,\r\n NotificationTemplate,\r\n} from '@masterteam/notification';\r\nimport type {\r\n NodeDialogFooterConfig,\r\n SBAction,\r\n} from '@masterteam/structure-builder';\r\nimport { StructureBuilder } from '@masterteam/structure-builder';\r\nimport { Tabs } from '@masterteam/components/tabs';\r\nimport { Skeleton } from 'primeng/skeleton';\r\n\r\nimport type {\r\n StepPropertyPayload,\r\n StepSchema,\r\n WorkflowAppActionDescriptor,\r\n WorkflowAppActionFailureBehavior,\r\n WorkflowStepSchema,\r\n WorkflowStepType,\r\n} from '../../store/workflow';\r\nimport { WorkflowFacade } from '../../store/workflow';\r\nimport type { WorkflowAppActionConfigField } from './workflow-app-action-config.utils';\r\nimport {\r\n buildWorkflowAppActionConfigEditorDefinition,\r\n mapWorkflowAppActionConfigJsonToEditorValue,\r\n serializeWorkflowAppActionConfigValue,\r\n} from './workflow-app-action-config.utils';\r\nimport {\r\n buildWorkflowStepPayload,\r\n createDefaultWorkflowStepEditorValue,\r\n DEFAULT_APP_ACTION_EDITOR_VALUE,\r\n mapWorkflowStepToEditorState,\r\n normalizeWorkflowStepType,\r\n} from './workflow-step.utils';\r\nimport { WorkflowFormDrawer } from './workflow-form-drawer/workflow-form-drawer';\r\nimport { WorkflowNotificationsDrawer } from './workflow-notifications-drawer/workflow-notifications-drawer';\r\n\r\n@Component({\r\n selector: 'mt-workflow-builder',\r\n imports: [\r\n StructureBuilder,\r\n Card,\r\n Tabs,\r\n ReactiveFormsModule,\r\n FormsModule,\r\n Skeleton,\r\n ToggleField,\r\n Button,\r\n TranslocoModule,\r\n NotificationTemplate,\r\n SelectField,\r\n TextField,\r\n NumberField,\r\n TextareaField,\r\n ],\r\n templateUrl: './workflow-builder.html',\r\n styles: [],\r\n host: {},\r\n})\r\nexport class WorkflowBuilder {\r\n private readonly workflowFacade = inject(WorkflowFacade);\r\n private readonly notificationFacade = inject(NotificationFacade);\r\n private readonly formBuilderFacade = inject(FormBuilderFacade);\r\n private readonly transloco = inject(TranslocoService);\r\n private readonly confirmationService = inject(ConfirmationService);\r\n\r\n readonly modal: ModalService = inject(ModalService);\r\n\r\n private isPatchingStepForm = false;\r\n private lastAppActionDescriptorSignature = '';\r\n\r\n readonly mainTab = signal<'workflow' | 'notification'>('workflow');\r\n readonly selectedTab = signal<'tab1' | 'tab2' | 'tab3'>('tab1');\r\n readonly isPublished = signal(false);\r\n readonly isEditingInitialNode = signal(false);\r\n readonly isCreatingStep = signal(false);\r\n readonly currentStepType = signal<WorkflowStepType>('UserInput');\r\n readonly draftAppActionDescriptor =\r\n signal<WorkflowAppActionDescriptor | null>(null);\r\n readonly nodeFields = signal({\r\n name: 'name.display',\r\n icon: 'icon',\r\n color: 'color',\r\n subtitle: 'subtitle',\r\n badge: 'badge',\r\n status: 'status',\r\n style: 'style',\r\n });\r\n\r\n readonly workflow = this.workflowFacade.workflow;\r\n readonly workflows = this.workflowFacade.workflows;\r\n readonly selectedStep = this.workflowFacade.selectedStep;\r\n readonly groups = this.workflowFacade.groups;\r\n readonly roles = this.workflowFacade.roles;\r\n readonly appActionDescriptors = this.workflowFacade.appActionDescriptors;\r\n readonly selectedAppActionDescriptor =\r\n this.workflowFacade.selectedAppActionDescriptor;\r\n readonly isFlowValid = this.workflowFacade.isFlowValid;\r\n\r\n readonly loading = this.workflowFacade.isLoading('getWorkflow');\r\n readonly loadingStep = this.workflowFacade.isLoading('getStep');\r\n readonly loadingAppActions = this.workflowFacade.isLoading('getAppActions');\r\n readonly loadingAppActionDetail =\r\n this.workflowFacade.isLoading('getAppActionDetail');\r\n\r\n readonly appActionListError = this.workflowFacade.error('getAppActions');\r\n readonly appActionDetailError =\r\n this.workflowFacade.error('getAppActionDetail');\r\n\r\n readonly selectedWorkflowId = computed(() => this.workflow()?.id);\r\n readonly connectionFormulaSchemaId = computed(() => this.workflow()?.id);\r\n readonly hasMultipleWorkflows = computed(() => this.workflows().length > 1);\r\n readonly isPublishDisabled = computed(() => !this.isFlowValid());\r\n readonly hasGroupedRoles = computed(() =>\r\n this.roles().some((role: any) => Array.isArray(role?.items)),\r\n );\r\n\r\n readonly stepForm = new FormGroup({\r\n nameEn: new FormControl('', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n nameAr: new FormControl('', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n type: new FormControl<WorkflowStepType>('UserInput', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n targetType: new FormControl('1', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n group: new FormControl<number | null>(null),\r\n role: new FormControl<string | number | null>(null),\r\n sla: new FormControl(0, {\r\n nonNullable: true,\r\n validators: [Validators.required, Validators.min(0)],\r\n }),\r\n });\r\n\r\n readonly appActionSettingsForm = new FormGroup({\r\n actionKey: new FormControl<string | null>(null, Validators.required),\r\n failureBehavior: new FormControl<WorkflowAppActionFailureBehavior>('Stop', {\r\n nonNullable: true,\r\n validators: [Validators.required],\r\n }),\r\n timeoutSeconds: new FormControl(300, {\r\n nonNullable: true,\r\n validators: [Validators.required, Validators.min(1)],\r\n }),\r\n });\r\n\r\n readonly appActionRawConfigControl = new FormControl('{}', {\r\n nonNullable: true,\r\n });\r\n readonly appActionConfigForm = new FormGroup({});\r\n readonly showHideControl = new FormControl(false, {\r\n nonNullable: true,\r\n });\r\n\r\n readonly appActionConfigDefinition = signal(\r\n buildWorkflowAppActionConfigEditorDefinition(null),\r\n );\r\n\r\n private readonly propertiesTableDataState = signal<any[]>([]);\r\n readonly propertiesTableData = computed(() =>\r\n this.propertiesTableDataState(),\r\n );\r\n\r\n readonly mainTabsList = computed(() => [\r\n {\r\n label: this.transloco.translate('workflow.builder.workflow'),\r\n value: 'workflow',\r\n },\r\n {\r\n label: this.transloco.translate('workflow.builder.notification'),\r\n value: 'notification',\r\n },\r\n ]);\r\n\r\n readonly failureBehaviorOptions = computed(() => [\r\n {\r\n label: this.transloco.translate('workflow.builder.failureBehaviorStop'),\r\n value: 'Stop',\r\n },\r\n {\r\n label: this.transloco.translate(\r\n 'workflow.builder.failureBehaviorContinue',\r\n ),\r\n value: 'Continue',\r\n },\r\n ]);\r\n\r\n readonly tabsList = computed(() => {\r\n const tabs = [\r\n {\r\n label: this.transloco.translate('workflow.builder.tabSettings'),\r\n value: 'tab1',\r\n },\r\n ];\r\n\r\n if (!this.isCreatingStep() && this.currentStepType() === 'UserInput') {\r\n tabs.push({\r\n label: this.transloco.translate('workflow.builder.form'),\r\n value: 'tab2',\r\n });\r\n }\r\n\r\n if (!this.isCreatingStep() && !this.isEditingInitialNode()) {\r\n tabs.push({\r\n label: this.transloco.translate('workflow.builder.notification'),\r\n value: 'tab3',\r\n });\r\n }\r\n\r\n return tabs;\r\n });\r\n\r\n readonly availableNodes = computed(() => [\r\n {\r\n id: 'FormStep',\r\n type: 'UserInput' as WorkflowStepType,\r\n label: this.transloco.translate('workflow.builder.newStep'),\r\n tab: [this.transloco.translate('workflow.builder.userInputTab')],\r\n name: {\r\n en: 'Form Step',\r\n ar: 'خطوة النموذج',\r\n },\r\n targetType: '1',\r\n icon: 'file.clipboard-check',\r\n color: '#0369A1',\r\n subtitle: this.transloco.translate('workflow.builder.stepTypeUserInput'),\r\n },\r\n ...this.appActionDescriptors().map((descriptor) => ({\r\n id: `AppActionStep:${descriptor.actionKey}`,\r\n type: 'AppAction' as WorkflowStepType,\r\n tab: [this.transloco.translate('workflow.builder.appActionsTab')],\r\n label: descriptor.displayName,\r\n name: {\r\n en: descriptor.displayName,\r\n ar: descriptor.displayName,\r\n display: descriptor.displayName,\r\n },\r\n appCode: descriptor.appCode,\r\n actionKey: descriptor.actionKey,\r\n displayName: descriptor.displayName,\r\n description: descriptor.description ?? null,\r\n configSchemaJson: descriptor.configSchemaJson ?? null,\r\n requiredContextKeys: descriptor.requiredContextKeys ?? [],\r\n supportedScopes: descriptor.supportedScopes ?? [],\r\n icon: 'general.zap',\r\n color: '#B45309',\r\n subtitle: this.transloco.translate('workflow.builder.stepTypeAppAction'),\r\n style: 'icon',\r\n })),\r\n ]);\r\n\r\n readonly nodeActions = signal([\r\n {\r\n key: 'edit',\r\n icon: 'general.edit-05',\r\n variant: 'outlined',\r\n size: 'small',\r\n tooltip: 'Edit',\r\n },\r\n {\r\n key: 'delete',\r\n icon: 'general.trash-01',\r\n variant: 'outlined',\r\n size: 'small',\r\n severity: 'danger',\r\n tooltip: 'Delete',\r\n condition: (node: WorkflowStepSchema) => !node.isInitial,\r\n },\r\n ]);\r\n\r\n readonly nodeDialogFooterConfig: NodeDialogFooterConfig = {\r\n showSaveButton: () => this.selectedTab() === 'tab1',\r\n disableSaveButton: () => this.isNodeDialogSaveDisabled(),\r\n };\r\n\r\n readonly connectionForm = signal<DynamicFormConfig>({\r\n sections: [\r\n {\r\n key: 'basic',\r\n label: this.transloco.translate('workflow.builder.basic-information'),\r\n type: 'none',\r\n cssClass: 'p-4',\r\n columns: 2,\r\n order: 1,\r\n fields: [\r\n {\r\n key: 'priority',\r\n label: this.transloco.translate('workflow.builder.priority'),\r\n },\r\n ],\r\n },\r\n ],\r\n });\r\n\r\n readonly connectionFormulaConfig = signal({\r\n codeOnly: true,\r\n toolbarTabs: ['functions', 'operators'] as const,\r\n isProcessBuilder: true,\r\n });\r\n\r\n readonly steps = computed(() =>\r\n this.workflowFacade.steps().map((step) => {\r\n const isAppAction = step.type === 'AppAction';\r\n return {\r\n ...step,\r\n color: isAppAction ? '#B45309' : '#0369A1',\r\n icon: isAppAction\r\n ? 'general.zap'\r\n : step.isInitial\r\n ? 'map.flag-04'\r\n : 'file.clipboard-check',\r\n subtitle: this.getStepTypeLabel(step.type),\r\n badge: step.isInitial\r\n ? this.transloco.translate('workflow.builder.initial')\r\n : null,\r\n style: isAppAction ? 'icon' : 'detail',\r\n };\r\n }),\r\n );\r\n\r\n readonly connections = computed(() =>\r\n this.workflowFacade.connections().map((connection) => ({\r\n ...connection,\r\n from: connection.source,\r\n to: connection.target,\r\n })),\r\n );\r\n\r\n readonly currentAppActionDescriptor =\r\n computed<WorkflowAppActionDescriptor | null>(() => {\r\n const actionKey = this.appActionSettingsForm.controls.actionKey.value;\r\n if (!actionKey) {\r\n return null;\r\n }\r\n\r\n const selectedDescriptor = this.selectedAppActionDescriptor();\r\n if (selectedDescriptor?.actionKey === actionKey) {\r\n return selectedDescriptor;\r\n }\r\n\r\n const cachedDescriptor = this.appActionDescriptors().find(\r\n (descriptor) => descriptor.actionKey === actionKey,\r\n );\r\n if (cachedDescriptor) {\r\n return cachedDescriptor;\r\n }\r\n\r\n const draftDescriptor = this.draftAppActionDescriptor();\r\n if (draftDescriptor?.actionKey === actionKey) {\r\n return draftDescriptor;\r\n }\r\n\r\n const step = this.selectedStep();\r\n if (\r\n step?.type === 'AppAction' &&\r\n step.appAction?.actionKey === actionKey\r\n ) {\r\n return {\r\n appCode: step.appAction.appCode,\r\n actionKey,\r\n displayName: step.appAction.displayName ?? actionKey,\r\n description: step.appAction.description ?? null,\r\n configSchemaJson: step.appAction.configSchemaJson ?? null,\r\n requiredContextKeys: step.appAction.requiredContextKeys ?? [],\r\n supportedScopes: step.appAction.supportedScopes ?? [],\r\n };\r\n }\r\n\r\n return null;\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const workflow = this.workflow();\r\n if (workflow?.isPublished !== undefined) {\r\n this.isPublished.set(workflow.isPublished);\r\n }\r\n });\r\n\r\n effect(() => {\r\n if (this.mainTab() === 'workflow') {\r\n this.workflowFacade.loadAppActions();\r\n }\r\n });\r\n\r\n effect(() => {\r\n const step = this.selectedStep();\r\n if (step) {\r\n this.applyLoadedStep(step);\r\n }\r\n });\r\n\r\n effect(() => {\r\n if (this.currentStepType() !== 'AppAction') {\r\n this.lastAppActionDescriptorSignature = '';\r\n return;\r\n }\r\n\r\n const actionKey = this.appActionSettingsForm.controls.actionKey.value;\r\n if (!actionKey) {\r\n this.lastAppActionDescriptorSignature = '';\r\n return;\r\n }\r\n\r\n const descriptor = this.currentAppActionDescriptor();\r\n const signature = this.createAppActionDescriptorSignature(\r\n actionKey,\r\n descriptor?.configSchemaJson ?? null,\r\n );\r\n\r\n if (signature === this.lastAppActionDescriptorSignature) {\r\n return;\r\n }\r\n\r\n this.rebuildAppActionConfigEditor(\r\n this.getCurrentAppActionConfigJson(),\r\n descriptor?.configSchemaJson ?? null,\r\n );\r\n this.lastAppActionDescriptorSignature = signature;\r\n });\r\n\r\n this.stepForm.controls.targetType.valueChanges\r\n .pipe(takeUntilDestroyed())\r\n .subscribe(() => this.syncUserInputValidators());\r\n\r\n this.appActionSettingsForm.controls.actionKey.valueChanges\r\n .pipe(takeUntilDestroyed())\r\n .subscribe((actionKey) => {\r\n if (this.isPatchingStepForm) {\r\n return;\r\n }\r\n this.onAppActionActionChanged(actionKey);\r\n });\r\n }\r\n\r\n onMainTabChange(tab: string): void {\r\n this.mainTab.set(tab as 'workflow' | 'notification');\r\n if (tab === 'notification') {\r\n const workflowId = this.workflow()?.id;\r\n if (workflowId) {\r\n this.notificationFacade.setModuleInfo('request', workflowId);\r\n this.notificationFacade.loadBaseData();\r\n }\r\n }\r\n }\r\n\r\n onNodeDialogTabChange(tab: string): void {\r\n this.selectedTab.set(tab as 'tab1' | 'tab2' | 'tab3');\r\n }\r\n\r\n onPublishToggle(isPublished: boolean): void {\r\n if (isPublished && !this.isFlowValid()) {\r\n this.isPublished.set(false);\r\n return;\r\n }\r\n\r\n this.workflowFacade.publishWorkflow(isPublished).subscribe({\r\n error: () => {\r\n this.isPublished.set(!isPublished);\r\n },\r\n });\r\n }\r\n\r\n onWorkflowChange(workflowId: number): void {\r\n this.workflowFacade.selectWorkflow(workflowId);\r\n }\r\n\r\n onStructureAction(event: SBAction): void {\r\n switch (event.action) {\r\n case 'startCreating': {\r\n const stepType = normalizeWorkflowStepType(event.data?.type);\r\n this.clearForm(stepType);\r\n this.isCreatingStep.set(true);\r\n this.applyCreateNodeDefaults(event.data);\r\n return;\r\n }\r\n\r\n case 'startUpdating': {\r\n if (!event.data) {\r\n return;\r\n }\r\n\r\n this.clearForm(normalizeWorkflowStepType(event.data.type));\r\n this.isCreatingStep.set(false);\r\n this.isEditingInitialNode.set(!!event.data.isInitial);\r\n this.configureStepTypeControl();\r\n this.workflowFacade.loadStep(event.data.id);\r\n\r\n if (event.data.id) {\r\n this.notificationFacade.setModuleInfo('step', event.data.id);\r\n this.notificationFacade.loadBaseData();\r\n\r\n if (event.data.type !== 'AppAction') {\r\n const workflowId = this.workflow()?.id;\r\n if (workflowId) {\r\n this.formBuilderFacade.setModuleInfo(\r\n 'processstep',\r\n event.data.id,\r\n 'processschema',\r\n workflowId,\r\n );\r\n this.formBuilderFacade.getFormConfiguration();\r\n }\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n case 'createNode': {\r\n this.isCreatingStep.set(false);\r\n const stepPayload = this.buildStepPayload();\r\n if (!stepPayload) {\r\n return;\r\n }\r\n this.workflowFacade.createStep(stepPayload);\r\n return;\r\n }\r\n\r\n case 'updateNode': {\r\n if (!event.data?.id) {\r\n return;\r\n }\r\n\r\n const stepPayload = this.buildStepPayload();\r\n if (!stepPayload) {\r\n return;\r\n }\r\n\r\n this.workflowFacade.updateStep(\r\n event.data.id,\r\n stepPayload,\r\n !!event.data.isInitial,\r\n );\r\n return;\r\n }\r\n\r\n case 'deleteNode': {\r\n if (!event.data) {\r\n return;\r\n }\r\n\r\n this.confirmationService.confirmDelete({\r\n type: 'dialog',\r\n accept: () => {\r\n this.workflowFacade.deleteStep(event.data.id);\r\n },\r\n reject: () => {},\r\n });\r\n return;\r\n }\r\n\r\n case 'createConnection': {\r\n if (!event.data) {\r\n return;\r\n }\r\n\r\n this.workflowFacade.createConnection({\r\n sourceStepId: event.data.from,\r\n targetStepId: event.data.to,\r\n priority: event.data.priority ?? 1,\r\n formula: event.data.formula ?? null,\r\n });\r\n return;\r\n }\r\n\r\n case 'updateConnection': {\r\n if (!event.data) {\r\n return;\r\n }\r\n\r\n this.workflowFacade.updateConnection(event.data.id, {\r\n sourceStepId: event.data.from,\r\n targetStepId: event.data.to,\r\n priority: event.data.priority ?? 1,\r\n formula: event.data.formula ?? null,\r\n });\r\n return;\r\n }\r\n\r\n case 'deleteConnection': {\r\n if (event.data?.id) {\r\n this.workflowFacade.deleteConnection(event.data.id);\r\n }\r\n return;\r\n }\r\n\r\n default:\r\n return;\r\n }\r\n }\r\n\r\n openNotificationsModal(): void {\r\n const notificationsDialogRef = this.modal.openModal(\r\n WorkflowNotificationsDrawer,\r\n 'drawer',\r\n {\r\n header: this.transloco.translate('workflow.builder.notification'),\r\n styleClass: '!w-[calc(100%-25rem)] !absolute',\r\n position: 'start',\r\n modal: true,\r\n dismissible: true,\r\n appendTo: '#page-content',\r\n inputValues: {},\r\n },\r\n );\r\n\r\n notificationsDialogRef.onClose.subscribe(() => {});\r\n }\r\n\r\n openFormModal(): void {\r\n const formDialogRef = this.modal.openModal(WorkflowFormDrawer, 'drawer', {\r\n header: this.transloco.translate('workflow.builder.form'),\r\n styleClass: '!w-[calc(100%-25rem)] !absolute',\r\n position: 'start',\r\n modal: true,\r\n dismissible: true,\r\n appendTo: '#page-content',\r\n inputValues: {},\r\n });\r\n\r\n formDialogRef.onClose.subscribe(() => {});\r\n }\r\n\r\n getStepBadgeClass(type: WorkflowStepType): string {\r\n return type === 'AppAction'\r\n ? 'inline-flex rounded-full bg-amber-100 px-2 py-1 text-xs font-semibold text-amber-800'\r\n : 'inline-flex rounded-full bg-sky-100 px-2 py-1 text-xs font-semibold text-sky-800';\r\n }\r\n\r\n getStepCardTitle(step: WorkflowStepSchema): string {\r\n return this.resolveDisplayName(step.name);\r\n }\r\n\r\n getStepTypeLabel(type: WorkflowStepType): string {\r\n return this.transloco.translate(\r\n type === 'AppAction'\r\n ? 'workflow.builder.stepTypeAppAction'\r\n : 'workflow.builder.stepTypeUserInput',\r\n );\r\n }\r\n\r\n getAppActionConfigControl(key: string): FormControl {\r\n return this.appActionConfigForm.get(key) as FormControl;\r\n }\r\n\r\n getAppActionEnumOptions(field: WorkflowAppActionConfigField) {\r\n return (field.enumValues ?? []).map((value) => ({\r\n label: String(value),\r\n value,\r\n }));\r\n }\r\n\r\n getAppActionDescription(): string | null {\r\n return this.currentAppActionDescriptor()?.description ?? null;\r\n }\r\n\r\n getAppActionDisplayName(): string {\r\n return (\r\n this.currentAppActionDescriptor()?.displayName ||\r\n this.appActionSettingsForm.controls.actionKey.value ||\r\n this.transloco.translate('workflow.builder.appActionUnavailable')\r\n );\r\n }\r\n\r\n getAppActionKey(): string {\r\n return this.appActionSettingsForm.controls.actionKey.value ?? '';\r\n }\r\n\r\n getAppActionConfigMessages(): string[] {\r\n const definition = this.appActionConfigDefinition();\r\n const serialization = serializeWorkflowAppActionConfigValue(\r\n this.appActionConfigForm.getRawValue(),\r\n definition,\r\n this.appActionRawConfigControl.value,\r\n );\r\n\r\n return Array.from(\r\n new Set([\r\n ...definition.errors,\r\n ...(this.appActionDetailError() ? [this.appActionDetailError()!] : []),\r\n ...serialization.errors,\r\n ]),\r\n );\r\n }\r\n\r\n getAppActionDiscoveryMessage(): string | null {\r\n if (this.currentStepType() !== 'AppAction') {\r\n return null;\r\n }\r\n\r\n if (this.appActionListError()) {\r\n return this.appActionListError();\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private clearForm(stepType: WorkflowStepType = 'UserInput'): void {\r\n const defaults = createDefaultWorkflowStepEditorValue();\r\n\r\n this.isPatchingStepForm = true;\r\n this.isEditingInitialNode.set(false);\r\n this.currentStepType.set(stepType);\r\n this.draftAppActionDescriptor.set(null);\r\n this.selectedTab.set('tab1');\r\n\r\n this.stepForm.reset(\r\n {\r\n nameEn: defaults.name['en'],\r\n nameAr: defaults.name['ar'],\r\n type: stepType,\r\n targetType: defaults.targetType,\r\n group: defaults.group,\r\n role: defaults.role,\r\n sla: defaults.sla,\r\n },\r\n { emitEvent: false },\r\n );\r\n this.configureStepTypeControl();\r\n this.resetPropertiesTable();\r\n this.showHideControl.setValue(false, { emitEvent: false });\r\n this.resetAppActionState();\r\n this.isPatchingStepForm = false;\r\n\r\n this.syncUserInputValidators();\r\n\r\n if (stepType === 'AppAction') {\r\n this.ensureAppActionDiscoveryLoaded();\r\n }\r\n }\r\n\r\n private applyLoadedStep(step: StepSchema): void {\r\n const editorState = mapWorkflowStepToEditorState(step);\r\n const stepType = step.isInitial\r\n ? 'UserInput'\r\n : editorState.stepFormValue.type;\r\n const descriptor = this.resolveDescriptorForActionKey(\r\n editorState.appActionValue.actionKey,\r\n step,\r\n );\r\n\r\n this.isPatchingStepForm = true;\r\n this.isEditingInitialNode.set(!!step.isInitial);\r\n this.currentStepType.set(stepType);\r\n this.selectedTab.set('tab1');\r\n\r\n this.stepForm.reset(\r\n {\r\n nameEn: editorState.stepFormValue.name['en'] ?? '',\r\n nameAr: editorState.stepFormValue.name['ar'] ?? '',\r\n type: stepType,\r\n targetType: editorState.stepFormValue.targetType ?? '1',\r\n group: editorState.stepFormValue.group,\r\n role: editorState.stepFormValue.role,\r\n sla: editorState.stepFormValue.sla,\r\n },\r\n { emitEvent: false },\r\n );\r\n this.configureStepTypeControl();\r\n this.populatePropertiesTable(step);\r\n this.showHideControl.setValue(step.hasNotification ?? false, {\r\n emitEvent: false,\r\n });\r\n\r\n this.appActionSettingsForm.reset(\r\n {\r\n actionKey: editorState.appActionValue.actionKey,\r\n failureBehavior: editorState.appActionValue.failureBehavior,\r\n timeoutSeconds: editorState.appActionValue.timeoutSeconds,\r\n },\r\n { emitEvent: false },\r\n );\r\n\r\n this.rebuildAppActionConfigEditor(\r\n editorState.appActionValue.configJson,\r\n descriptor?.configSchemaJson ?? step.appAction?.configSchemaJson ?? null,\r\n );\r\n this.lastAppActionDescriptorSignature =\r\n this.createAppActionDescriptorSignature(\r\n editorState.appActionValue.actionKey,\r\n descriptor?.configSchemaJson ??\r\n step.appAction?.configSchemaJson ??\r\n null,\r\n );\r\n\r\n this.isPatchingStepForm = false;\r\n this.syncUserInputValidators();\r\n\r\n if (stepType === 'AppAction') {\r\n this.ensureAppActionDiscoveryLoaded();\r\n this.ensureAppActionDetailLoaded(editorState.appActionValue.actionKey);\r\n }\r\n }\r\n\r\n private onAppActionActionChanged(actionKey: string | null): void {\r\n this.selectedTab.set('tab1');\r\n this.lastAppActionDescriptorSignature = '';\r\n\r\n this.rebuildAppActionConfigEditor(\r\n DEFAULT_APP_ACTION_EDITOR_VALUE.configJson,\r\n this.resolveDescriptorForActionKey(actionKey)?.configSchemaJson ?? null,\r\n );\r\n\r\n if (actionKey) {\r\n this.ensureAppActionDetailLoaded(actionKey);\r\n }\r\n }\r\n\r\n private applyCreateNodeDefaults(nodeData: any): void {\r\n if (!nodeData) {\r\n return;\r\n }\r\n\r\n const stepType = normalizeWorkflowStepType(nodeData.type);\r\n if (stepType !== 'AppAction') {\r\n return;\r\n }\r\n\r\n const actionKey =\r\n typeof nodeData.actionKey === 'string' ? nodeData.actionKey : null;\r\n const displayName =\r\n typeof nodeData.displayName === 'string'\r\n ? nodeData.displayName\r\n : typeof nodeData.label === 'string'\r\n ? nodeData.label\r\n : '';\r\n\r\n this.draftAppActionDescriptor.set({\r\n appCode:\r\n typeof nodeData.appCode === 'string' ? nodeData.appCode : 'pplus',\r\n actionKey: actionKey ?? '',\r\n displayName,\r\n description:\r\n typeof nodeData.description === 'string' ? nodeData.description : null,\r\n configSchemaJson:\r\n typeof nodeData.configSchemaJson === 'string'\r\n ? nodeData.configSchemaJson\r\n : null,\r\n requiredContextKeys: Array.isArray(nodeData.requiredContextKeys)\r\n ? nodeData.requiredContextKeys.map(String)\r\n : [],\r\n supportedScopes: Array.isArray(nodeData.supportedScopes)\r\n ? nodeData.supportedScopes.map(String)\r\n : [],\r\n });\r\n\r\n this.isPatchingStepForm = true;\r\n this.stepForm.patchValue(\r\n {\r\n nameEn: displayName,\r\n nameAr: displayName,\r\n type: 'AppAction',\r\n },\r\n { emitEvent: false },\r\n );\r\n this.appActionSettingsForm.patchValue(\r\n {\r\n actionKey,\r\n failureBehavior: DEFAULT_APP_ACTION_EDITOR_VALUE.failureBehavior,\r\n timeoutSeconds: DEFAULT_APP_ACTION_EDITOR_VALUE.timeoutSeconds,\r\n },\r\n { emitEvent: false },\r\n );\r\n this.isPatchingStepForm = false;\r\n\r\n this.rebuildAppActionConfigEditor(\r\n DEFAULT_APP_ACTION_EDITOR_VALUE.configJson,\r\n this.draftAppActionDescriptor()?.configSchemaJson ?? null,\r\n );\r\n this.ensureAppActionDetailLoaded(actionKey);\r\n }\r\n\r\n private resetPropertiesTable(): void {\r\n const properties = this.workflow()?.properties ?? [];\r\n this.propertiesTableDataState.set(\r\n properties.map((property) => ({\r\n id: property.id,\r\n name: property.property.name,\r\n isVisible: false,\r\n isEditable: false,\r\n _original: property,\r\n })),\r\n );\r\n }\r\n\r\n private populatePropertiesTable(step: StepSchema): void {\r\n const properties = this.workflow()?.properties ?? [];\r\n this.propertiesTableDataState.set(\r\n properties.map((property) => {\r\n const stepProperty = step.properties?.find(\r\n (item) => item.propertyId === property.id,\r\n );\r\n\r\n return {\r\n id: property.id,\r\n name: property.property.name,\r\n isVisible: stepProperty?.isRead || false,\r\n isEditable: stepProperty?.isWrite || false,\r\n _original: property,\r\n };\r\n }),\r\n );\r\n }\r\n\r\n private configureStepTypeControl(): void {\r\n if (this.isEditingInitialNode()) {\r\n this.stepForm.controls.type.disable({ emitEvent: false });\r\n return;\r\n }\r\n\r\n this.stepForm.controls.type.enable({ emitEvent: false });\r\n }\r\n\r\n private syncUserInputValidators(): void {\r\n const groupControl = this.stepForm.controls.group;\r\n const roleControl = this.stepForm.controls.role;\r\n const targetType = this.stepForm.controls.targetType.value;\r\n\r\n groupControl.clearValidators();\r\n roleControl.clearValidators();\r\n\r\n if (\r\n this.currentStepType() === 'UserInput' &&\r\n !this.isEditingInitialNode() &&\r\n targetType === '1'\r\n ) {\r\n groupControl.addValidators(Validators.required);\r\n }\r\n\r\n if (\r\n this.currentStepType() === 'UserInput' &&\r\n !this.isEditingInitialNode() &&\r\n targetType === '2'\r\n ) {\r\n roleControl.addValidators(Validators.required);\r\n }\r\n\r\n groupControl.updateValueAndValidity({ emitEvent: false });\r\n roleControl.updateValueAndValidity({ emitEvent: false });\r\n }\r\n\r\n private resetAppActionState(): void {\r\n this.appActionSettingsForm.reset(\r\n {\r\n actionKey: DEFAULT_APP_ACTION_EDITOR_VALUE.actionKey,\r\n failureBehavior: DEFAULT_APP_ACTION_EDITOR_VALUE.failureBehavior,\r\n timeoutSeconds: DEFAULT_APP_ACTION_EDITOR_VALUE.timeoutSeconds,\r\n },\r\n { emitEvent: false },\r\n );\r\n this.rebuildAppActionConfigEditor(\r\n DEFAULT_APP_ACTION_EDITOR_VALUE.configJson,\r\n null,\r\n );\r\n this.lastAppActionDescriptorSignature = '';\r\n }\r\n\r\n private rebuildAppActionConfigEditor(\r\n configJson: string | null | undefined,\r\n configSchemaJson: string | null | undefined,\r\n ): void {\r\n const definition =\r\n buildWorkflowAppActionConfigEditorDefinition(configSchemaJson);\r\n const editorValue = mapWorkflowAppActionConfigJsonToEditorValue(\r\n configJson,\r\n definition,\r\n );\r\n\r\n Object.keys(this.appActionConfigForm.controls).forEach((key) => {\r\n this.appActionConfigForm.removeControl(key);\r\n });\r\n\r\n definition.fields.forEach((field) => {\r\n this.appActionConfigForm.addControl(\r\n field.key,\r\n new FormControl(editorValue.fields[field.key] ?? null, {\r\n validators: field.required ? [Validators.required] : [],\r\n }),\r\n );\r\n });\r\n\r\n this.appActionRawConfigControl.setValue(editorValue.rawConfigJson, {\r\n emitEvent: false,\r\n });\r\n this.appActionConfigDefinition.set(definition);\r\n }\r\n\r\n private ensureAppActionDiscoveryLoaded(): void {\r\n this.workflowFacade.loadAppActions();\r\n }\r\n\r\n private ensureAppActionDetailLoaded(\r\n actionKey: string | null | undefined,\r\n ): void {\r\n if (!actionKey) {\r\n return;\r\n }\r\n\r\n const cachedDescriptor = this.resolveDescriptorForActionKey(actionKey);\r\n if (cachedDescriptor?.configSchemaJson) {\r\n return;\r\n }\r\n\r\n this.workflowFacade.loadAppActionDetail(actionKey);\r\n }\r\n\r\n private resolveDescriptorForActionKey(\r\n actionKey: string | null | undefined,\r\n step?: StepSchema | null,\r\n ): WorkflowAppActionDescriptor | null {\r\n if (!actionKey) {\r\n return null;\r\n }\r\n\r\n const selectedDescriptor = this.selectedAppActionDescriptor();\r\n if (selectedDescriptor?.actionKey === actionKey) {\r\n return selectedDescriptor;\r\n }\r\n\r\n const cachedDescriptor = this.appActionDescriptors().find(\r\n (descriptor) => descriptor.actionKey === actionKey,\r\n );\r\n if (cachedDescriptor) {\r\n return cachedDescriptor;\r\n }\r\n\r\n const currentStep = step ?? this.selectedStep();\r\n if (\r\n currentStep?.type === 'AppAction' &&\r\n currentStep.appAction?.actionKey === actionKey\r\n ) {\r\n return {\r\n appCode: currentStep.appAction.appCode,\r\n actionKey,\r\n displayName: currentStep.appAction.displayName ?? actionKey,\r\n description: currentStep.appAction.description ?? null,\r\n configSchemaJson: currentStep.appAction.configSchemaJson ?? null,\r\n requiredContextKeys: currentStep.appAction.requiredContextKeys ?? [],\r\n supportedScopes: currentStep.appAction.supportedScopes ?? [],\r\n };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private buildStepPayload() {\r\n if (this.isNodeDialogSaveDisabled()) {\r\n return null;\r\n }\r\n\r\n const formValue = this.stepForm.getRawValue();\r\n const appActionConfig = serializeWorkflowAppActionConfigValue(\r\n this.appActionConfigForm.getRawValue(),\r\n this.appActionConfigDefinition(),\r\n this.appActionRawConfigControl.value,\r\n );\r\n\r\n return buildWorkflowStepPayload({\r\n formValue: {\r\n name: {\r\n en: formValue.nameEn,\r\n ar: formValue.nameAr,\r\n },\r\n type: normalizeWorkflowStepType(formValue.type),\r\n targetType: formValue.targetType || '1',\r\n group: formValue.group,\r\n role: this.normalizeRoleValue(formValue.role),\r\n sla: Number(formValue.sla ?? 0),\r\n },\r\n properties: this.buildPropertiesPayload(),\r\n hasNotification: this.showHideControl.value,\r\n appActionValue:\r\n this.currentStepType() === 'AppAction'\r\n ? {\r\n actionKey: this.appActionSettingsForm.controls.actionKey.value,\r\n failureBehavior:\r\n this.appActionSettingsForm.controls.failureBehavior.value,\r\n timeoutSeconds: Number(\r\n this.appActionSettingsForm.controls.timeoutSeconds.value ?? 300,\r\n ),\r\n configJson: appActionConfig.configJson,\r\n }\r\n : null,\r\n });\r\n }\r\n\r\n private buildPropertiesPayload(): StepPropertyPayload[] {\r\n return this.propertiesTableData()\r\n .filter((property) => property.isVisible || property.isEditable)\r\n .map((property) => ({\r\n PropertyId: property.id,\r\n isRead: property.isVisible,\r\n isWrite: property.isEditable,\r\n }));\r\n }\r\n\r\n private getCurrentAppActionConfigJson(): string {\r\n const definition = this.appActionConfigDefinition();\r\n if (definition.mode === 'raw') {\r\n return this.appActionRawConfigControl.value;\r\n }\r\n\r\n return serializeWorkflowAppActionConfigValue(\r\n this.appActionConfigForm.getRawValue(),\r\n definition,\r\n this.appActionRawConfigControl.value,\r\n ).configJson;\r\n }\r\n\r\n private createAppActionDescriptorSignature(\r\n actionKey: string | null | undefined,\r\n configSchemaJson: string | null | undefined,\r\n ): string {\r\n return `${actionKey ?? ''}::${configSchemaJson ?? ''}`;\r\n }\r\n\r\n private isNodeDialogSaveDisabled(): boolean {\r\n if (this.selectedTab() !== 'tab1' || this.loadingStep()) {\r\n return true;\r\n }\r\n\r\n if (\r\n this.stepForm.controls.nameEn.invalid ||\r\n this.stepForm.controls.nameAr.invalid\r\n ) {\r\n return true;\r\n }\r\n\r\n if (this.currentStepType() === 'UserInput') {\r\n if (!this.isEditingInitialNode() && this.stepForm.controls.sla.invalid) {\r\n return true;\r\n }\r\n\r\n if (this.isEditingInitialNode()) {\r\n return false;\r\n }\r\n\r\n return this.stepForm.controls.targetType.value === '1'\r\n ? this.stepForm.controls.group.invalid\r\n : this.stepForm.controls.role.invalid;\r\n }\r\n\r\n if (this.stepForm.controls.sla.invalid) {\r\n return true;\r\n }\r\n\r\n if (!!this.getAppActionDiscoveryMessage()) {\r\n return true;\r\n }\r\n\r\n if (this.appActionSettingsForm.invalid) {\r\n return true;\r\n }\r\n\r\n return this.getAppActionConfigMessages().length > 0;\r\n }\r\n\r\n private normalizeRoleValue(\r\n value: string | number | null | undefined,\r\n ): string | null {\r\n if (value === null || value === undefined || value === '') {\r\n return null;\r\n }\r\n\r\n return String(value);\r\n }\r\n\r\n private resolveDisplayName(\r\n name: string | Record<string, string> | null | undefined,\r\n ): string {\r\n if (typeof name === 'string') {\r\n return name;\r\n }\r\n\r\n if (name && typeof name === 'object') {\r\n return name['display'] || name['en'] || name['ar'] || '';\r\n }\r\n\r\n return '';\r\n }\r\n}\r\n","<ng-container *transloco=\"let t; prefix: 'workflow.builder'\">\r\n <div class=\"h-full flex flex-col\" id=\"workflow-builder-card\">\r\n <div class=\"flex justify-center w-full py-2\">\r\n <mt-tabs\r\n [active]=\"mainTab()\"\r\n (activeChange)=\"onMainTabChange($event)\"\r\n [options]=\"mainTabsList()\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n </div>\r\n @switch (mainTab()) {\r\n @case (\"workflow\") {\r\n @if (!loading()) {\r\n <mt-structure-builder\r\n class=\"flex-1\"\r\n [structureMode]=\"'workflow'\"\r\n [availableNodes]=\"availableNodes()\"\r\n [availableNodesLabel]=\"t('stepTemplates')\"\r\n [connectionForm]=\"connectionForm()\"\r\n [connectionFormulaSchemaId]=\"connectionFormulaSchemaId()\"\r\n [connectionFormulaConfig]=\"connectionFormulaConfig()\"\r\n [nodeActions]=\"nodeActions()\"\r\n [nodes]=\"steps()\"\r\n [connections]=\"connections()\"\r\n (action)=\"onStructureAction($event)\"\r\n [addModalType]=\"'drawer'\"\r\n [addModalStyleClass]=\"'!w-[25rem] !absolute !shadow-none'\"\r\n [updateModalStyleClass]=\"'!w-[25rem] !absolute !shadow-none'\"\r\n [addModalHeader]=\"'workflow.builder.addStep' | transloco\"\r\n [updateModalHeader]=\"'workflow.builder.editStep' | transloco\"\r\n [nodeDialogFooterConfig]=\"nodeDialogFooterConfig\"\r\n [appendTo]=\"'page-content'\"\r\n [nodeFields]=\"nodeFields()\"\r\n [availableTabsClass]=\"hasMultipleWorkflows() ? '!mt-28' : ''\"\r\n [layoutDirection]=\"'LR'\"\r\n >\r\n <div flowContent class=\"pointer-events-none\">\r\n @if (hasMultipleWorkflows()) {\r\n <div class=\"pointer-events-auto absolute top-4 start-4 z-10\">\r\n <mt-card class=\"w-64\">\r\n <mt-select-field\r\n [options]=\"workflows()\"\r\n optionLabel=\"name.display\"\r\n optionValue=\"id\"\r\n [ngModel]=\"selectedWorkflowId()\"\r\n (ngModelChange)=\"onWorkflowChange($event)\"\r\n class=\"mt-2\"\r\n />\r\n </mt-card>\r\n </div>\r\n }\r\n <div class=\"pointer-events-auto absolute top-4 end-4 z-10\">\r\n <div class=\"flex flex-col gap-2 w-80\">\r\n <mt-card>\r\n <div class=\"flex items-center gap-10\">\r\n <div class=\"flex items-center gap-2\">\r\n <mt-button\r\n [severity]=\"'secondary'\"\r\n icon=\"dev.dataflow-01\"\r\n />\r\n <label>{{\r\n \"workflow.builder.enableWorkflow\" | transloco\r\n }}</label>\r\n </div>\r\n <mt-toggle-field\r\n [ngModel]=\"isPublished()\"\r\n (ngModelChange)=\"onPublishToggle($event)\"\r\n [disabled]=\"isPublishDisabled()\"\r\n ></mt-toggle-field>\r\n </div>\r\n </mt-card>\r\n </div>\r\n </div>\r\n </div>\r\n <ng-template\r\n #nodeDialog\r\n let-close=\"close\"\r\n let-save=\"save\"\r\n let-node=\"node\"\r\n let-drawerController=\"drawerController\"\r\n >\r\n <div class=\"p-4\">\r\n @if (loadingStep()) {\r\n <div class=\"space-y-4\">\r\n <div class=\"flex gap-2 mb-4\">\r\n <p-skeleton\r\n width=\"6rem\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"8rem\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <!-- Form fields skeleton -->\r\n <div class=\"space-y-4\">\r\n <div>\r\n <p-skeleton\r\n width=\"8rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <div>\r\n <p-skeleton\r\n width=\"8rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <div>\r\n <p-skeleton\r\n width=\"10rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"3rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <div>\r\n <p-skeleton\r\n width=\"6rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n <div>\r\n <p-skeleton\r\n width=\"4rem\"\r\n height=\"1rem\"\r\n styleClass=\"mb-2\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n borderRadius=\"0.5rem\"\r\n ></p-skeleton>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <mt-tabs\r\n [active]=\"selectedTab()\"\r\n (activeChange)=\"onNodeDialogTabChange($event)\"\r\n [options]=\"tabsList()\"\r\n size=\"large\"\r\n ></mt-tabs>\r\n @switch (selectedTab()) {\r\n @case (\"tab1\") {\r\n <div class=\"mt-4 space-y-4\">\r\n <div class=\"grid gap-3\">\r\n <mt-text-field\r\n [label]=\"t('nameEnglish')\"\r\n [placeholder]=\"t('enterNameEnglish')\"\r\n [formControl]=\"stepForm.controls.nameEn\"\r\n [required]=\"true\"\r\n ></mt-text-field>\r\n <mt-text-field\r\n [label]=\"t('nameArabic')\"\r\n [placeholder]=\"t('enterNameArabic')\"\r\n [formControl]=\"stepForm.controls.nameAr\"\r\n [required]=\"true\"\r\n ></mt-text-field>\r\n </div>\r\n\r\n @if (currentStepType() === \"UserInput\") {\r\n @if (!isEditingInitialNode()) {\r\n <mt-card>\r\n <div class=\"space-y-4\">\r\n <div\r\n class=\"text-sm font-semibold text-surface-900\"\r\n >\r\n {{ t(\"approver\") }}\r\n </div>\r\n <mt-select-field\r\n [label]=\"t('approver')\"\r\n [options]=\"[\r\n { label: t('group'), value: '1' },\r\n { label: t('role'), value: '2' },\r\n ]\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"stepForm.controls.targetType\"\r\n [required]=\"true\"\r\n ></mt-select-field>\r\n\r\n @if (\r\n stepForm.controls.targetType.value === \"1\"\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('group')\"\r\n [placeholder]=\"t('selectGroup')\"\r\n [options]=\"groups()\"\r\n optionLabel=\"name.display\"\r\n optionValue=\"id\"\r\n [formControl]=\"stepForm.controls.group\"\r\n [required]=\"true\"\r\n ></mt-select-field>\r\n } @else {\r\n <mt-select-field\r\n [label]=\"t('role')\"\r\n [placeholder]=\"t('selectRole')\"\r\n [options]=\"roles()\"\r\n [group]=\"hasGroupedRoles()\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n optionLabel=\"name.display\"\r\n optionValue=\"value\"\r\n [formControl]=\"stepForm.controls.role\"\r\n [required]=\"true\"\r\n ></mt-select-field>\r\n }\r\n\r\n <mt-number-field\r\n [label]=\"t('sla')\"\r\n [placeholder]=\"t('enterSla')\"\r\n [formControl]=\"stepForm.controls.sla\"\r\n [required]=\"true\"\r\n [min]=\"0\"\r\n ></mt-number-field>\r\n </div>\r\n </mt-card>\r\n }\r\n } @else {\r\n <mt-card>\r\n <div class=\"space-y-4\">\r\n <div class=\"grid gap-3\">\r\n <div class=\"grid gap-1\">\r\n <label\r\n class=\"text-sm font-medium text-surface-900\"\r\n >\r\n {{ t(\"app\") }}\r\n </label>\r\n <div\r\n class=\"rounded-xl border border-surface-200 bg-surface-50 px-3 py-2 text-sm text-surface-700\"\r\n >\r\n {{ t(\"appLabelPplus\") }}\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid gap-1\">\r\n <label\r\n class=\"text-sm font-medium text-surface-900\"\r\n >\r\n {{ t(\"action\") }}\r\n </label>\r\n <div\r\n class=\"rounded-xl border border-surface-200 bg-surface-50 px-3 py-2 text-sm text-surface-900\"\r\n >\r\n {{ getAppActionDisplayName() }}\r\n </div>\r\n @if (getAppActionKey()) {\r\n <div class=\"text-xs text-muted-color\">\r\n {{ getAppActionKey() }}\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (\r\n getAppActionDescription();\r\n as description\r\n ) {\r\n <div\r\n class=\"rounded-xl border border-surface-200 bg-surface-50 px-3 py-2 text-sm text-muted-color\"\r\n >\r\n {{ description }}\r\n </div>\r\n }\r\n\r\n @if (\r\n getAppActionDiscoveryMessage();\r\n as discoveryMessage\r\n ) {\r\n <div\r\n class=\"rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700\"\r\n >\r\n {{ discoveryMessage }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </mt-card>\r\n\r\n <mt-card>\r\n <div class=\"space-y-4\">\r\n <div>\r\n <div\r\n class=\"text-sm font-semibold text-surface-900\"\r\n >\r\n {{ t(\"appActionConfiguration\") }}\r\n </div>\r\n <div class=\"mt-1 text-sm text-muted-color\">\r\n {{ t(\"appActionConfigurationDescription\") }}\r\n </div>\r\n </div>\r\n\r\n @if (\r\n loadingAppActionDetail() &&\r\n appActionSettingsForm.controls.actionKey.value\r\n ) {\r\n <div class=\"space-y-3\">\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"2.5rem\"\r\n ></p-skeleton>\r\n <p-skeleton\r\n width=\"100%\"\r\n height=\"6rem\"\r\n ></p-skeleton>\r\n </div>\r\n } @else if (\r\n !appActionSettingsForm.controls.actionKey.value\r\n ) {\r\n <div\r\n class=\"rounded-xl border border-dashed border-surface-300 px-3 py-4 text-sm text-muted-color\"\r\n >\r\n {{ t(\"appActionUnavailable\") }}\r\n </div>\r\n } @else if (\r\n appActionConfigDefinition().mode === \"schema\" &&\r\n appActionConfigDefinition().fields.length === 0\r\n ) {\r\n <div\r\n class=\"rounded-xl border border-surface-200 bg-surface-50 px-3 py-4 text-sm text-muted-color\"\r\n >\r\n {{ t(\"appActionNoConfigRequired\") }}\r\n </div>\r\n } @else if (\r\n appActionConfigDefinition().mode === \"raw\"\r\n ) {\r\n <div class=\"space-y-3\">\r\n <div\r\n class=\"rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-800\"\r\n >\r\n {{ t(\"appActionRawConfigFallback\") }}\r\n </div>\r\n <mt-textarea-field\r\n [label]=\"t('appActionConfigJson')\"\r\n [placeholder]=\"\r\n t('enterAppActionConfigJson')\r\n \"\r\n [formControl]=\"appActionRawConfigControl\"\r\n [rows]=\"'10'\"\r\n ></mt-textarea-field>\r\n </div>\r\n } @else {\r\n <div class=\"space-y-3\">\r\n @for (\r\n field of appActionConfigDefinition().fields;\r\n track field.key\r\n ) {\r\n <div class=\"space-y-2\">\r\n @switch (field.kind) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"field.title\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n [required]=\"field.required\"\r\n ></mt-text-field>\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"field.title\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n [required]=\"field.required\"\r\n ></mt-number-field>\r\n }\r\n @case (\"toggle\") {\r\n <mt-toggle-field\r\n [label]=\"field.title\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n ></mt-toggle-field>\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"field.title\"\r\n [options]=\"\r\n getAppActionEnumOptions(field)\r\n \"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n [required]=\"field.required\"\r\n ></mt-select-field>\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n [label]=\"field.title\"\r\n [formControl]=\"\r\n getAppActionConfigControl(\r\n field.key\r\n )\r\n \"\r\n [required]=\"field.required\"\r\n [rows]=\"'8'\"\r\n ></mt-textarea-field>\r\n }\r\n }\r\n\r\n @if (field.description) {\r\n <div class=\"text-xs text-muted-color\">\r\n {{ field.description }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (getAppActionConfigMessages().length) {\r\n <div\r\n class=\"rounded-xl border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-700\"\r\n >\r\n @for (\r\n message of getAppActionConfigMessages();\r\n track message\r\n ) {\r\n <div>{{ message }}</div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </mt-card>\r\n\r\n <mt-card>\r\n <div class=\"space-y-4\">\r\n <div\r\n class=\"text-sm font-semibold text-surface-900\"\r\n >\r\n {{ t(\"advancedExecution\") }}\r\n </div>\r\n\r\n <mt-number-field\r\n [label]=\"t('sla')\"\r\n [placeholder]=\"t('enterSla')\"\r\n [formControl]=\"stepForm.controls.sla\"\r\n [required]=\"true\"\r\n [min]=\"0\"\r\n ></mt-number-field>\r\n\r\n <mt-select-field\r\n [label]=\"t('failureBehavior')\"\r\n [options]=\"failureBehaviorOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"\r\n appActionSettingsForm.controls.failureBehavior\r\n \"\r\n [required]=\"true\"\r\n ></mt-select-field>\r\n\r\n <mt-number-field\r\n [label]=\"t('timeoutSeconds')\"\r\n [formControl]=\"\r\n appActionSettingsForm.controls.timeoutSeconds\r\n \"\r\n [required]=\"true\"\r\n [min]=\"1\"\r\n ></mt-number-field>\r\n </div>\r\n </mt-card>\r\n }\r\n </div>\r\n }\r\n @case (\"tab2\") {\r\n <div class=\"mt-4\">\r\n <mt-card>\r\n <div class=\"flex items-center gap-4\">\r\n <div class=\"flex flex-1 items-center gap-3\">\r\n <mt-button\r\n [severity]=\"'secondary'\"\r\n icon=\"file.file-check-02\"\r\n />\r\n <div class=\"flex flex-col\">\r\n <label class=\"font-medium\">{{\r\n t(\"configureForm\")\r\n }}</label>\r\n <span class=\"text-sm text-muted-color\">{{\r\n t(\"configureForm-description\")\r\n }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"mt-3\">\r\n <mt-button\r\n [label]=\"t('configureForm')\"\r\n size=\"small\"\r\n (onClick)=\"openFormModal()\"\r\n ></mt-button>\r\n </div>\r\n </mt-card>\r\n </div>\r\n }\r\n @case (\"tab3\") {\r\n <div class=\"mt-4\">\r\n <mt-toggle-field\r\n toggleShape=\"card\"\r\n [label]=\"t('show-hide')\"\r\n [descriptionCard]=\"t('show-hide-notifications')\"\r\n icon=\"general.eye\"\r\n [formControl]=\"showHideControl\"\r\n >\r\n <ng-template #toggleCardBottom>\r\n @if (showHideControl.value) {\r\n <div class=\"mt-3\">\r\n <mt-button\r\n [label]=\"t('configureNotifications')\"\r\n size=\"small\"\r\n (onClick)=\"openNotificationsModal()\"\r\n ></mt-button>\r\n </div>\r\n }\r\n </ng-template>\r\n </mt-toggle-field>\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n </ng-template>\r\n </mt-structure-builder>\r\n } @else {\r\n <p-skeleton width=\"100%\" height=\"50rem\" />\r\n }\r\n }\r\n @case (\"notification\") {\r\n <div class=\"flex-1 flex justify-center items-start p-4\">\r\n <div class=\"w-1/2 max-[1025px]:w-full\">\r\n <mt-card [title]=\"t('notifications')\">\r\n <mt-notification-template />\r\n </mt-card>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</ng-container>\r\n","// store/app.state.ts\n\nimport { HttpContextToken } from '@angular/common/http';\n\nexport const REQUEST_CONTEXT = new HttpContextToken<{ useBaseUrl: boolean }>(\n () => ({\n useBaseUrl: false,\n }),\n);\n","// Re-export app state\nexport * from './app.state';\n\n// Re-export workflow state\nexport * from './workflow';\n","/*\n * Public API Surface of structure-builder\n */\n\nexport * from './lib/workflow-builder/workflow-builder';\n\nexport * from './store';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["normalizeWorkflowStepType","isRecord"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MAEa,aAAa,CAAA;AAIN,IAAA,UAAA;AACA,IAAA,QAAA;AACA,IAAA,gBAAA;AACA,IAAA,cAAA;AACA,IAAA,UAAA;AAPlB,IAAA,OAAgB,IAAI,GAAG,4BAA4B;IAEnD,WAAA,CACkB,UAAkB,EAClB,QAAyB,EACzB,gBAAyB,EACzB,cAAgC,EAChC,UAAmB,EAAA;QAJnB,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,IAAA,CAAA,cAAc,GAAd,cAAc;QACd,IAAA,CAAA,UAAU,GAAV,UAAU;IACzB;;MAGQ,YAAY,CAAA;AACvB,IAAA,OAAgB,IAAI,GAAG,0BAA0B;;MAGtC,WAAW,CAAA;AAGM,IAAA,UAAA;AAF5B,IAAA,OAAgB,IAAI,GAAG,yBAAyB;AAEhD,IAAA,WAAA,CAA4B,UAA2B,EAAA;QAA3B,IAAA,CAAA,UAAU,GAAV,UAAU;IAAoB;;MAG/C,oBAAoB,CAAA;AAC/B,IAAA,OAAgB,IAAI,GAAG,mCAAmC;;MAG/C,SAAS,CAAA;AACpB,IAAA,OAAgB,IAAI,GAAG,uBAAuB;;MAGnC,iBAAiB,CAAA;AAC5B,IAAA,OAAgB,IAAI,GAAG,iCAAiC;;MAG7C,aAAa,CAAA;AACxB,IAAA,OAAgB,IAAI,GAAG,4BAA4B;;MAGxC,kBAAkB,CAAA;AAG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