diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js
index c7795d4b54..4d0653208c 100644
--- a/packages/builder/src/builderStore/store/frontend.js
+++ b/packages/builder/src/builderStore/store/frontend.js
@@ -40,6 +40,7 @@ const INITIAL_FRONTEND_STATE = {
devicePreview: false,
messagePassing: false,
continueIfAction: false,
+ showNotificationAction: false,
},
errors: [],
hasAppPackage: false,
diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ShowNotification.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ShowNotification.svelte
new file mode 100644
index 0000000000..ed4ecc2738
--- /dev/null
+++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ShowNotification.svelte
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+ (parameters.message = e.detail)}
+ />
+
+
+
diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/index.js b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/index.js
index 8f0baf08be..1ecd8f474a 100644
--- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/index.js
+++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/index.js
@@ -15,3 +15,4 @@ export { default as S3Upload } from "./S3Upload.svelte"
export { default as ExportData } from "./ExportData.svelte"
export { default as ContinueIf } from "./ContinueIf.svelte"
export { default as UpdateFieldValue } from "./UpdateFieldValue.svelte"
+export { default as ShowNotification } from "./ShowNotification.svelte"
diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/manifest.json b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/manifest.json
index c00b8dddec..5d11a27636 100644
--- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/manifest.json
+++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/manifest.json
@@ -110,6 +110,12 @@
"type": "logic",
"component": "ContinueIf",
"dependsOnFeature": "continueIfAction"
+ },
+ {
+ "name": "Show Notification",
+ "type": "application",
+ "component": "ShowNotification",
+ "dependsOnFeature": "showNotificationAction"
}
]
}
\ No newline at end of file
diff --git a/packages/client/manifest.json b/packages/client/manifest.json
index bbfd613835..87cc8b2567 100644
--- a/packages/client/manifest.json
+++ b/packages/client/manifest.json
@@ -8,7 +8,8 @@
"devicePreview": true,
"messagePassing": true,
"rowSelection": true,
- "continueIfAction": true
+ "continueIfAction": true,
+ "showNotificationAction": true
},
"layout": {
"name": "Layout",
diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js
index 558cab8f21..7cc0679a2d 100644
--- a/packages/client/src/utils/buttonActions.js
+++ b/packages/client/src/utils/buttonActions.js
@@ -300,6 +300,14 @@ const continueIfHandler = action => {
}
}
+const showNotificationHandler = action => {
+ const { message, type } = action.parameters
+ if (!message || !type) {
+ return
+ }
+ notificationStore.actions[type]?.(message)
+}
+
const handlerMap = {
["Save Row"]: saveRowHandler,
["Duplicate Row"]: duplicateRowHandler,
@@ -318,6 +326,7 @@ const handlerMap = {
["Upload File to S3"]: s3UploadHandler,
["Export Data"]: exportDataHandler,
["Continue if / Stop if"]: continueIfHandler,
+ ["Show Notification"]: showNotificationHandler,
}
const confirmTextMap = {