From fe7d0605681dc963f5e5d1607f9d40c5173e0f9f Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Fri, 27 Sep 2024 11:09:20 +0200 Subject: [PATCH] fix(editor): Fix workflow executions list page redirection (#10981) --- cypress/e2e/20-workflow-executions.cy.ts | 29 +++++++++++++++++++ .../src/views/WorkflowExecutionsView.vue | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/20-workflow-executions.cy.ts b/cypress/e2e/20-workflow-executions.cy.ts index 19256f3bf9d32..5788af171cdeb 100644 --- a/cypress/e2e/20-workflow-executions.cy.ts +++ b/cypress/e2e/20-workflow-executions.cy.ts @@ -229,6 +229,35 @@ describe('Workflow Executions', () => { cy.getByTestId('executions-filter-reset-button').should('be.visible').click(); executionsTab.getters.executionListItems().eq(11).should('be.visible'); }); + + it('should redirect back to editor after seeing a couple of execution using browser back button', () => { + createMockExecutions(); + cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions'); + + executionsTab.actions.switchToExecutionsTab(); + + cy.wait(['@getExecutions']); + executionsTab.getters.workflowExecutionPreviewIframe().should('exist'); + + executionsTab.getters.executionListItems().eq(2).click(); + executionsTab.getters.workflowExecutionPreviewIframe().should('exist'); + executionsTab.getters.executionListItems().eq(4).click(); + executionsTab.getters.workflowExecutionPreviewIframe().should('exist'); + executionsTab.getters.executionListItems().eq(6).click(); + executionsTab.getters.workflowExecutionPreviewIframe().should('exist'); + + cy.go('back'); + executionsTab.getters.workflowExecutionPreviewIframe().should('exist'); + cy.go('back'); + executionsTab.getters.workflowExecutionPreviewIframe().should('exist'); + cy.go('back'); + executionsTab.getters.workflowExecutionPreviewIframe().should('exist'); + cy.go('back'); + + cy.url().should('not.include', '/executions'); + cy.url().should('include', '/workflow/'); + workflowPage.getters.nodeViewRoot().should('be.visible'); + }); }); describe('when new workflow is not saved', () => { diff --git a/packages/editor-ui/src/views/WorkflowExecutionsView.vue b/packages/editor-ui/src/views/WorkflowExecutionsView.vue index a9abf67ee4b59..d5ff4dcb6b987 100644 --- a/packages/editor-ui/src/views/WorkflowExecutionsView.vue +++ b/packages/editor-ui/src/views/WorkflowExecutionsView.vue @@ -113,7 +113,7 @@ function onDocumentVisibilityChange() { async function initializeRoute() { if (route.name === VIEWS.EXECUTION_HOME && executions.value.length > 0 && workflow.value) { await router - .push({ + .replace({ name: VIEWS.EXECUTION_PREVIEW, params: { name: workflow.value.id, executionId: executions.value[0].id }, })