Skip to content

Commit 2347029

Browse files
committed
feat: add abort button to progress status and improve time handling in workflow execution
1 parent 87a656d commit 2347029

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/Shared/Components/CICDHistory/TriggerDetails.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ImageChipCell } from '@Shared/Components/ImageChipCell'
55
import { CommitChipCell } from '@Shared/Components/CommitChipCell'
66
import { ReactComponent as ICSuccess } from '@Icons/ic-success.svg'
77
import { ReactComponent as ICPulsateStatus } from '@Icons/ic-pulsate-status.svg'
8+
import { ReactComponent as ICAborted } from '@Icons/ic-aborted.svg'
89
import { ReactComponent as ICArrowRight } from '@Icons/ic-arrow-right.svg'
910
import { ToastManager, ToastVariantType } from '@Shared/Services'
1011
import { getDeploymentStageTitle } from '@Pages/Applications'
@@ -31,10 +32,11 @@ import {
3132
PROGRESSING_STATUS,
3233
EXECUTION_FINISHED_TEXT_MAP,
3334
} from './constants'
34-
import { DeploymentStageType } from '../../constants'
35+
import { ComponentSizeType, DeploymentStageType } from '../../constants'
3536
import { GitTriggers } from '../../types'
3637
import { ConfirmationModal, ConfirmationModalVariantType } from '../ConfirmationModal'
3738
import WorkerStatus from './WorkerStatus'
39+
import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
3840

3941
const Finished = memo(({ status, finishedOn, artifact, type, executionInfo }: FinishedType): JSX.Element => {
4042
const finishedOnTime = executionInfo?.finishedOn || finishedOn
@@ -146,13 +148,15 @@ const ProgressingStatus = memo(({ stage, type, label = 'In progress' }: Progress
146148
{abort && (
147149
<>
148150
<span className="cn-5 fs-13 fw-4 lh-20">/</span>
149-
<button
150-
type="button"
151-
className="flex dc__transparent cr-5 fs-13 fw-6 lh-20"
151+
<Button
152+
dataTestId="abort-execution-button"
152153
onClick={toggleAbortConfiguration}
153-
>
154-
Abort
155-
</button>
154+
startIcon={<ICAborted />}
155+
text="Abort"
156+
variant={ButtonVariantType.text}
157+
style={ButtonStyleType.negative}
158+
size={ComponentSizeType.small}
159+
/>
156160
</>
157161
)}
158162
</div>
@@ -223,7 +227,7 @@ const CurrentStatus = memo(
223227
type={type}
224228
{...(!executionInfo.executionStartedOn
225229
? {
226-
label: 'Waiting To Start',
230+
label: 'Waiting to start',
227231
}
228232
: {})}
229233
/>

src/Shared/Components/CICDHistory/utils.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ export const sanitizeWorkflowExecutionStages = (
252252
(stage) => stage?.stageName === WorkflowExecutionStageNameType.EXECUTION,
253253
)
254254

255-
const isOldData = !preparationStage
256-
const computedTriggeredOn = isOldData ? executionStage?.startTime : preparationStage?.startTime
255+
const computedTriggeredOn = preparationStage?.startTime
257256

258257
let lastStatus: WorkflowStageStatusType = WorkflowStageStatusType.UNKNOWN
259258
workflowExecutionSteps.forEach(({ status }) => {
@@ -273,7 +272,7 @@ export const sanitizeWorkflowExecutionStages = (
273272

274273
return {
275274
triggeredOn: isTimeStringAvailable(computedTriggeredOn) ? computedTriggeredOn : '',
276-
executionStartedOn: isOldData ? '' : executionStage?.startTime,
275+
executionStartedOn: isTimeStringAvailable(executionStage?.startTime) ? executionStage?.startTime : '',
277276
finishedOn: isTimeStringAvailable(finishedOn) ? finishedOn : '',
278277
currentStatus: lastStatus,
279278
workerDetails: getWorkerInfoFromExecutionStages(workflowExecutionStages),

0 commit comments

Comments
 (0)