From c5866def49abb6b765bb96231b37c21b1967220c Mon Sep 17 00:00:00 2001 From: Ross Edfort Date: Tue, 10 Oct 2023 11:47:07 -0600 Subject: [PATCH] replace reset reapply type select with checkbox and add more descriptive label default the checkbox to checked, which applies signals after the reset point also add description to RadioGroup --- src/lib/components/workflow-actions.svelte | 4 +- .../workflow/workflow-reset-form.svelte | 44 +++++++------------ .../holocene/radio-input/radio-group.svelte | 4 ++ src/lib/holocene/radio-input/types.ts | 1 + src/lib/i18n/locales/en/workflows.ts | 7 ++- 5 files changed, 26 insertions(+), 34 deletions(-) diff --git a/src/lib/components/workflow-actions.svelte b/src/lib/components/workflow-actions.svelte index f4f822a7b..b2fd71bd4 100644 --- a/src/lib/components/workflow-actions.svelte +++ b/src/lib/components/workflow-actions.svelte @@ -48,7 +48,7 @@ let resetConfirmationModalOpen = false; let signalConfirmationModalOpen = false; let error = ''; - let resetReapplyType: ResetReapplyType = ResetReapplyType.Unspecified; + let resetReapplyType: ResetReapplyType = ResetReapplyType.Signal; let resetId = writable(); let resetReason: string; let loading = false; @@ -69,7 +69,7 @@ }; const hideResetModal = () => { - resetReapplyType = ResetReapplyType.Unspecified; + resetReapplyType = ResetReapplyType.Signal; $resetId = undefined; resetReason = undefined; }; diff --git a/src/lib/components/workflow/workflow-reset-form.svelte b/src/lib/components/workflow/workflow-reset-form.svelte index 5088d5b3a..21d78d7a9 100644 --- a/src/lib/components/workflow/workflow-reset-form.svelte +++ b/src/lib/components/workflow/workflow-reset-form.svelte @@ -1,33 +1,25 @@
@@ -35,6 +27,7 @@ name="reset-event-id" group={eventId} class="max-h-40 overflow-auto" + description={translate('workflows', 'reset-event-radio-group-description')} > {#each $resetEvents as event} {/each} - + /> +
diff --git a/src/lib/holocene/radio-input/radio-group.svelte b/src/lib/holocene/radio-input/radio-group.svelte index 707632fe7..393cf3708 100644 --- a/src/lib/holocene/radio-input/radio-group.svelte +++ b/src/lib/holocene/radio-input/radio-group.svelte @@ -17,6 +17,7 @@ export { className as class }; export let name: string; export let group: Writable; + export let description = ''; setContext>(RADIO_GROUP_CONTEXT, { name, @@ -25,5 +26,8 @@
+ {#if description} +

{description}

+ {/if}
diff --git a/src/lib/holocene/radio-input/types.ts b/src/lib/holocene/radio-input/types.ts index 013c117f0..7c7be1e62 100644 --- a/src/lib/holocene/radio-input/types.ts +++ b/src/lib/holocene/radio-input/types.ts @@ -14,6 +14,7 @@ export interface RadioInputProps extends HTMLInputAttributes { export interface RadioGroupProps extends HTMLAttributes { name: string; group: Writable; + description?: string; } export type RadioGroupContext = { diff --git a/src/lib/i18n/locales/en/workflows.ts b/src/lib/i18n/locales/en/workflows.ts index ba62cb5a8..01abdeb41 100644 --- a/src/lib/i18n/locales/en/workflows.ts +++ b/src/lib/i18n/locales/en/workflows.ts @@ -80,10 +80,9 @@ export const Strings = { 'cancel-success': 'Workflow canceled.', 'signal-success': 'Workflow signaled.', 'reset-modal-title': 'Reset Workflow', - 'reset-reapply-type-label': 'Reapply Type', - 'reset-reapply-all': 'All Events', - 'reset-reapply-signals-only': 'Signals Only', - 'reset-reapply-none': 'None', + 'reset-event-radio-group-description': 'Choose an Event to reset to', + 'reset-reapply-type-label': + 'Reapply Signals that happened after the Reset point', 'cancel-modal-title': 'Cancel Workflow', 'cancel-modal-confirmation': 'Are you sure you want to cancel this workflow? This action cannot be undone.',