From 876dc6061007c751ce7facf2e31c6d74c54a9e31 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Wed, 28 Sep 2022 16:30:54 +0200 Subject: [PATCH] feat(front): Add a confirmation modal (#634) * feat(front): Add a confirmation modal * feat(front): Simplify styles * feat(front): Remove code duplication * feat(front): Add shortcut + add Alert component --- .../lib/components/common/alert/Alert.svelte | 63 +++++++++++++++++++ .../src/lib/components/common/alert/model.ts | 1 + .../ConfirmationModal.svelte | 59 +++++++++++++++++ .../flows/content/FlowModuleHeader.svelte | 24 ++++++- .../flows/content/FlowModuleWrapper.svelte | 1 - .../RemoveStepConfirmationModal.svelte | 34 ++++++++++ .../flows/map/FlowErrorHandlerItem.svelte | 2 +- .../flows/map/FlowModuleSchemaItem.svelte | 2 +- .../flows/map/FlowModuleSchemaMap.svelte | 23 ++++++- 9 files changed, 201 insertions(+), 8 deletions(-) create mode 100644 frontend/src/lib/components/common/alert/Alert.svelte create mode 100644 frontend/src/lib/components/common/alert/model.ts create mode 100644 frontend/src/lib/components/common/confirmationModal/ConfirmationModal.svelte create mode 100644 frontend/src/lib/components/flows/content/RemoveStepConfirmationModal.svelte diff --git a/frontend/src/lib/components/common/alert/Alert.svelte b/frontend/src/lib/components/common/alert/Alert.svelte new file mode 100644 index 0000000000..e4819b2fbe --- /dev/null +++ b/frontend/src/lib/components/common/alert/Alert.svelte @@ -0,0 +1,63 @@ + + +
+
+
+ +
+ +
+ {title} +
+ +
+
+
+
diff --git a/frontend/src/lib/components/common/alert/model.ts b/frontend/src/lib/components/common/alert/model.ts new file mode 100644 index 0000000000..6da5cd78eb --- /dev/null +++ b/frontend/src/lib/components/common/alert/model.ts @@ -0,0 +1 @@ +export type AlertType = 'success' | 'error' | 'warning' | 'info' diff --git a/frontend/src/lib/components/common/confirmationModal/ConfirmationModal.svelte b/frontend/src/lib/components/common/confirmationModal/ConfirmationModal.svelte new file mode 100644 index 0000000000..024fdd5f5a --- /dev/null +++ b/frontend/src/lib/components/common/confirmationModal/ConfirmationModal.svelte @@ -0,0 +1,59 @@ + + +{#if open} + {#if $flowStore.value.failure_module} - diff --git a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte index d2a126bc5b..02ae527bbf 100644 --- a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte +++ b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte @@ -44,7 +44,7 @@ {#if deletable}