From b18aacc92241b87ab26a69d2708ddae3d5d6c3d3 Mon Sep 17 00:00:00 2001 From: FlaminWrap Date: Mon, 14 Nov 2022 00:33:00 +0000 Subject: [PATCH] Made changes to allow custom modal title Changed Question to User Prompt Allows custom title --- .../{QuestionPrompt.svelte => UserPrompt.svelte} | 2 ++ .../controls/ButtonActionEditor/actions/index.js | 2 +- .../settings/controls/ButtonActionEditor/manifest.json | 4 ++-- packages/client/src/utils/buttonActions.js | 10 ++++++---- 4 files changed, 11 insertions(+), 7 deletions(-) rename packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/{QuestionPrompt.svelte => UserPrompt.svelte} (89%) diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/QuestionPrompt.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/UserPrompt.svelte similarity index 89% rename from packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/QuestionPrompt.svelte rename to packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/UserPrompt.svelte index a42aaa1e73..2a563484be 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/QuestionPrompt.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/UserPrompt.svelte @@ -14,6 +14,8 @@
Enter the message you wish to display to the user.
+ + { notificationStore.actions[type]?.(message, autoDismiss) } -const questionHandler = action => { +const userPromptHandler = action => { action.parameters return } @@ -336,7 +336,7 @@ const handlerMap = { ["Export Data"]: exportDataHandler, ["Continue if / Stop if"]: continueIfHandler, ["Show Notification"]: showNotificationHandler, - ["Question"]: questionHandler, + ["User Prompt"]: userPromptHandler, } const confirmTextMap = { @@ -344,7 +344,7 @@ const confirmTextMap = { ["Save Row"]: "Are you sure you want to save this row?", ["Execute Query"]: "Are you sure you want to execute this query?", ["Trigger Automation"]: "Are you sure you want to trigger this automation?", - ["Question"]: "Are you sure you want to contiune?", + ["User Prompt"]: "Are you sure you want to contiune?", } /** @@ -396,8 +396,10 @@ export const enrichButtonActions = (actions, context) => { return new Promise(resolve => { const defaultText = confirmTextMap[action["##eventHandlerType"]] const confirmText = action.parameters?.confirmText || defaultText + const defaultTitleText = action["##eventHandlerType"] + const titleText = action.parameters?.titleText || defaultTitleText confirmationStore.actions.showConfirmation( - action["##eventHandlerType"], + titleText, confirmText, async () => { // When confirmed, execute this action immediately,