Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DT-143 - batch cancel workflows on Recent Workflows page (#959)
* DT-143 - batch cancel * fix cy tests * use old batch api endpoints for versoins !> 2.9.0 * fix cy tests * fix some layout issues * change cancel single workflow to opt in * remove extra th and fix filter indicator animation Co-authored-by: Alex Tideman <alex.tideman@gmail.com>
- Loading branch information
1 parent
cd9d776
commit 6a0953e
Showing
16 changed files
with
385 additions
and
163 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
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 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
80 changes: 80 additions & 0 deletions
80
src/lib/components/workflow/batch-operation-confirmation-modal.svelte
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,80 @@ | ||
<script lang="ts"> | ||
import { createEventDispatcher } from 'svelte'; | ||
import Modal from '$lib/holocene/modal.svelte'; | ||
import { pluralize } from '$lib/utilities/pluralize'; | ||
import Input from '$lib/holocene/input/input.svelte'; | ||
export let open: boolean; | ||
export let action: 'Terminate' | 'Cancel'; | ||
export let loading: boolean; | ||
export let allSelected: boolean; | ||
export let actionableWorkflowsLength: number; | ||
export let query: string; | ||
const dispatch = createEventDispatcher<{ | ||
confirm: { reason: string }; | ||
}>(); | ||
let reason: string; | ||
const handleConfirmModal = () => { | ||
dispatch('confirm', { reason }); | ||
open = false; | ||
reason = ''; | ||
}; | ||
const handleCancelModal = () => { | ||
open = false; | ||
reason = ''; | ||
}; | ||
$: confirmText = action === 'Cancel' ? 'Confirm' : action; | ||
</script> | ||
|
||
<Modal | ||
{open} | ||
confirmType="destructive" | ||
confirmDisabled={reason === ''} | ||
{confirmText} | ||
{loading} | ||
on:cancelModal={handleCancelModal} | ||
on:confirmModal={handleConfirmModal} | ||
> | ||
<h3 slot="title">{action} Workflows</h3> | ||
<svelte:fragment slot="content"> | ||
<div class="mb-4 flex flex-col"> | ||
{#if allSelected} | ||
<p class="mb-2"> | ||
Are you sure you want to {action.toLowerCase()} all worklfows matching | ||
the following query? This action cannot be undone. | ||
</p> | ||
<div | ||
class="mb-2 overflow-scroll whitespace-nowrap rounded border border-primary bg-gray-100 p-2" | ||
> | ||
<code data-cy="batch-action-workflows-query"> | ||
{query} | ||
</code> | ||
</div> | ||
<span class="text-xs" | ||
>Note: The actual count of workflows that will be affected is the | ||
total number of running workflows matching this query at the time of | ||
clicking "{confirmText}".</span | ||
> | ||
{:else} | ||
<p class="mb-4"> | ||
Are you sure you want to {action.toLowerCase()} | ||
<strong | ||
>{actionableWorkflowsLength} running {pluralize( | ||
'workflow', | ||
actionableWorkflowsLength, | ||
)}</strong | ||
>? | ||
</p> | ||
{/if} | ||
</div> | ||
<Input | ||
id="bulk-action-reason" | ||
bind:value={reason} | ||
placeholder="Enter a reason" | ||
/> | ||
</svelte:fragment> | ||
</Modal> |
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 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
Oops, something went wrong.
6a0953e
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-git-main.preview.thundergun.io
holocene.preview.thundergun.io
6a0953e
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-lyart.vercel.app
ui-git-main.preview.thundergun.io
ui.preview.thundergun.io