Skip to content

Commit 2d044b3

Browse files
authored
[One Workflow] Small fix to not show inputs twice (event+inputs) (#245042)
Before: <img width="344" height="261" alt="CleanShot 2025-12-03 at 11 59 47" src="https://github.com/user-attachments/assets/1db20596-73e8-47ac-b238-ddf375ff3ac1" /> After: <img width="291" height="231" alt="CleanShot 2025-12-03 at 12 00 12" src="https://github.com/user-attachments/assets/e0461336-35d6-4f5c-a859-d909411b0268" />
1 parent b1de364 commit 2d044b3

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

src/platform/plugins/shared/workflows_management/public/features/workflow_execution_detail/ui/build_step_executions_tree.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ export function buildStepExecutionsTree(
186186
});
187187
}
188188

189-
if (hasInputs) {
189+
// in scheduled workflows, inputs are available but are presented in the trigger itself.
190+
// This is to avoid showing the inputs pseudo-step when the event is present
191+
// as the inputs are already displayed in the event pseudo-step
192+
if (hasInputs && !hasEvent) {
190193
pseudoSteps.push({
191194
stepId: 'Inputs',
192195
stepType: '__inputs',

src/platform/plugins/shared/workflows_management/public/features/workflow_execution_detail/ui/tests/build_step_executions_tree.test.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ describe('buildStepExecutionsTree', () => {
792792
expect(result[1].stepId).toBe('step-1');
793793
});
794794

795-
it('should prepend both trigger and inputs pseudo-steps in correct order', () => {
795+
it('should prepend only trigger pseudo-step when both event and inputs exist', () => {
796796
const stepExecutions: WorkflowStepExecutionDto[] = [
797797
createStepExecution({
798798
id: 'exec-1',
@@ -814,17 +814,13 @@ describe('buildStepExecutionsTree', () => {
814814

815815
const result = buildStepExecutionsTree(stepExecutions, executionContext);
816816

817-
expect(result).toHaveLength(3);
817+
expect(result).toHaveLength(2);
818818
expect(result[0].stepId).toBe('Event');
819819
expect(result[0].stepType).toBe('__trigger');
820820
expect(result[0].isTriggerPseudoStep).toBe(true);
821821

822-
expect(result[1].stepId).toBe('Inputs');
823-
expect(result[1].stepType).toBe('__inputs');
824-
expect(result[1].isTriggerPseudoStep).toBe(true);
825-
826-
expect(result[2].stepId).toBe('step-1');
827-
expect(result[2].isTriggerPseudoStep).toBeUndefined();
822+
expect(result[1].stepId).toBe('step-1');
823+
expect(result[1].isTriggerPseudoStep).toBeUndefined();
828824
});
829825

830826
it('should not add pseudo-steps when context is missing', () => {
@@ -927,9 +923,8 @@ describe('buildStepExecutionsTree', () => {
927923

928924
const result = buildStepExecutionsTree([], executionContext);
929925

930-
expect(result).toHaveLength(2);
926+
expect(result).toHaveLength(1);
931927
expect(result[0].stepId).toBe('Event');
932-
expect(result[1].stepId).toBe('Inputs');
933928
});
934929
});
935930

@@ -992,15 +987,13 @@ describe('buildStepExecutionsTree', () => {
992987
ExecutionStatus.RUNNING
993988
);
994989

995-
expect(result).toHaveLength(4);
990+
expect(result).toHaveLength(3);
996991
expect(result[0].stepId).toBe('Overview');
997992
expect(result[0].stepType).toBe('__overview');
998993
expect(result[0].status).toBe(ExecutionStatus.RUNNING);
999994
expect(result[1].stepId).toBe('Event');
1000995
expect(result[1].stepType).toBe('__trigger');
1001-
expect(result[2].stepId).toBe('Inputs');
1002-
expect(result[2].stepType).toBe('__inputs');
1003-
expect(result[3].stepId).toBe('step-1');
996+
expect(result[2].stepId).toBe('step-1');
1004997
});
1005998

1006999
it.each([

0 commit comments

Comments
 (0)