-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ability to cancel workflows from workflow details page (#944)
* cancel workflow from workflow details page - refactor toasts to support alternate positions eg. bottom right * fix cy test * fix other cy test * add cy test for cancel fix cy test for terminate hidden * POC of handling deadzone for cancelled workflows * add some animation to the alert * fix disabled logic for terminate action and fix cy test * fix access control for cancel and terminate * copy + design changes * wrap other modal in if statement for good measure * fix copy * disable cancel button when cancel request is sent remove 1s sleep * fix broken cy selector due to split button id changes * only show cancel in progress alert if wf is running
- Loading branch information
1 parent
671b6be
commit f3167b0
Showing
19 changed files
with
447 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import workflowCompletedFixture from '../fixtures/workflow-running.json'; | ||
|
||
const { workflowId, runId } = | ||
workflowCompletedFixture.workflowExecutionInfo.execution; | ||
|
||
describe('Workflow Actions', () => { | ||
beforeEach(() => { | ||
cy.interceptApi(); | ||
|
||
cy.intercept( | ||
Cypress.env('VITE_API_HOST') + | ||
`/api/v1/namespaces/default/workflows/*/runs/*/events/*`, | ||
{ fixture: 'event-history-completed-reverse.json' }, | ||
).as('event-history-api'); | ||
|
||
cy.intercept( | ||
Cypress.env('VITE_API_HOST') + | ||
`/api/v1/namespaces/default/workflows/${workflowId}/runs/${runId}?`, | ||
{ fixture: 'workflow-running.json' }, | ||
).as('workflow-api'); | ||
}); | ||
|
||
describe('Terminate', () => { | ||
it('works if the workflow is running and write actions are enabled', () => { | ||
cy.visit( | ||
`/namespaces/default/workflows/${workflowId}/${runId}/history/feed?sort=descending`, | ||
); | ||
|
||
cy.wait('@settings-api'); | ||
cy.wait('@workflow-api'); | ||
|
||
cy.get('#workflow-actions-menu-button').click(); | ||
cy.get('#workflow-actions-menu > [data-cy="terminate-button"]').click(); | ||
cy.get('#workflow-termination-reason').type('test'); | ||
cy.get('[data-cy="confirm-modal-button"').click(); | ||
cy.get('#workflow-termination-success-toast').should('exist'); | ||
}); | ||
}); | ||
|
||
describe('Cancel', () => { | ||
it('works if the workflow is running a write actions are enabled', () => { | ||
cy.visit( | ||
`/namespaces/default/workflows/${workflowId}/${runId}/history/feed?sort=descending`, | ||
); | ||
|
||
cy.wait('@settings-api'); | ||
cy.wait('@workflow-api'); | ||
|
||
cy.get('#workflow-actions-primary-button').click(); | ||
cy.get('[data-cy="confirm-modal-button"]').click(); | ||
|
||
cy.wait('@cancel-workflow-api'); | ||
}); | ||
}); | ||
|
||
describe('Write Actions Disabled', () => { | ||
it('the Cancel button is disabled if write actions are disabled', () => { | ||
cy.intercept(Cypress.env('VITE_API_HOST') + `/api/v1/settings?`, { | ||
fixture: 'settings.write-actions-disabled.json', | ||
}).as('settings-api'); | ||
|
||
cy.visit( | ||
`/namespaces/default/workflows/${workflowId}/${runId}/history/feed?sort=descending`, | ||
); | ||
|
||
cy.wait('@settings-api'); | ||
cy.wait('@workflow-api'); | ||
|
||
cy.get('#workflow-actions-primary-button').should('be.disabled'); | ||
cy.get('#workflow-actions-menu-button').should('be.disabled'); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
f3167b0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
holocene – ./
holocene.preview.thundergun.io
holocene-git-main.preview.thundergun.io
f3167b0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ui – ./
ui-git-main.preview.thundergun.io
ui-lyart.vercel.app
ui.preview.thundergun.io