From ee9ea601e8dd85bd69c0fc77876bef692ac4d397 Mon Sep 17 00:00:00 2001 From: Zayn Javed Date: Tue, 17 Mar 2026 22:57:44 +0100 Subject: [PATCH 01/13] reorganize the Start/Resume/Pause/Stop Icons initials, sort the Instances --- .../[processId]/process-deployment-view.tsx | 190 ++++++++++++------ 1 file changed, 124 insertions(+), 66 deletions(-) diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/(automation)/executions/[processId]/process-deployment-view.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/(automation)/executions/[processId]/process-deployment-view.tsx index 86fea36dd..ca353d1b3 100644 --- a/src/management-system-v2/app/(dashboard)/[environmentId]/(automation)/executions/[processId]/process-deployment-view.tsx +++ b/src/management-system-v2/app/(dashboard)/[environmentId]/(automation)/executions/[processId]/process-deployment-view.tsx @@ -12,6 +12,7 @@ import { CaretRightOutlined, PauseOutlined, StopOutlined, + CheckOutlined, } from '@ant-design/icons'; import { useCallback, useMemo, useRef, useState } from 'react'; import contentStyles from './content.module.scss'; @@ -34,6 +35,11 @@ import StartFormModal from './start-form-modal'; import useInstanceVariables from './use-instance-variables'; import { inlineScript, inlineUserTaskData } from '@proceed/user-task-helper'; +// TODO: implement this function — should activate/deactivate timer start events for the process +async function toggleProcessActivation(versionId: string, activate: boolean): Promise { + // placeholder — wire up your real API call here +} + export default function ProcessDeploymentView({ processId, initialDeploymentInfo, @@ -50,6 +56,8 @@ export default function ProcessDeploymentView({ const [resumingInstance, setResumingInstance] = useState(false); const [pausingInstance, setPausingInstance] = useState(false); const [stoppingInstance, setStoppingInstance] = useState(false); + const [togglingActivation, setTogglingActivation] = useState(false); + const [isProcessActivated, setIsProcessActivated] = useState(false); const [startForm, setStartForm] = useState(''); @@ -74,18 +82,25 @@ export default function ProcessDeploymentView({ instanceIsRunning, instanceIsPausing, instanceIsPaused, + hasTimerStartEvents, } = useMemo(() => { let selectedVersion, instances, selectedInstance, currentVersion; let instanceIsRunning = false; let instanceIsPausing = false; let instanceIsPaused = false; + let hasTimerStartEvents = false; const activeStates = ['PAUSED', 'RUNNING', 'READY', 'DEPLOYMENT-WAITING', 'WAITING']; if (deploymentInfo) { selectedVersion = deploymentInfo.versions.find((v) => v.versionId === selectedVersionId); - instances = getVersionInstances(deploymentInfo, selectedVersionId); + // sort instances newest first + const rawInstances = getVersionInstances(deploymentInfo, selectedVersionId); + instances = [...rawInstances].sort( + (a, b) => new Date(b.globalStartTime).getTime() - new Date(a.globalStartTime).getTime(), + ); + selectedInstance = selectedInstanceId ? instances.find((i) => i.processInstanceId === selectedInstanceId) : undefined; @@ -104,6 +119,9 @@ export default function ProcessDeploymentView({ currentVersion = deploymentInfo.versions.find( (version) => version.versionId === currentVersionId, ); + + // TODO: detect timer start events in the current version's BPMN may be call a function here + // hasTimerStartEvents = isimerStartEventExists(currentVersion) } return { @@ -114,6 +132,7 @@ export default function ProcessDeploymentView({ instanceIsRunning, instanceIsPausing, instanceIsPaused, + hasTimerStartEvents, }; }, [deploymentInfo, selectedVersionId, selectedInstanceId]); @@ -163,6 +182,7 @@ export default function ProcessDeploymentView({ alignItems: 'start', }} > + {/* Left group: Select Instance + Filter + Color */}