Skip to content

Commit

Permalink
fix(editor): Fix workflow executions list page redirection (#10981)
Browse files Browse the repository at this point in the history
  • Loading branch information
cstuncsik authored Sep 27, 2024
1 parent 819d20f commit fe7d060
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions cypress/e2e/20-workflow-executions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/views/WorkflowExecutionsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
})
Expand Down

0 comments on commit fe7d060

Please sign in to comment.