From 75b897ad6ce473e0e2129403cded5b094e42e20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Fri, 23 Feb 2024 16:42:20 +0100 Subject: [PATCH] Add option to disable on record save notifications per record page --- client/web/compose/src/mixins/record.js | 4 +++- client/web/compose/src/views/Admin/Pages/Edit.vue | 8 ++++++++ lib/js/src/compose/types/page.ts | 14 ++++++++++++-- locale/en/corteza-webapp-compose/page.yaml | 4 +++- server/compose/service/page.go | 5 +++++ server/compose/types/page.go | 1 + 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/client/web/compose/src/mixins/record.js b/client/web/compose/src/mixins/record.js index 2226433ea..969d93a78 100644 --- a/client/web/compose/src/mixins/record.js +++ b/client/web/compose/src/mixins/record.js @@ -192,7 +192,9 @@ export default { } } - this.toastSuccess(this.$t(`notification:record.${isNew ? 'create' : 'update'}Success`)) + if (this.page.meta.notifications.enabled) { + this.toastSuccess(this.$t(`notification:record.${isNew ? 'create' : 'update'}Success`)) + } }) .catch(e => { // Since processing is set to false by the view record component, we need to set it to false here if we error out diff --git a/client/web/compose/src/views/Admin/Pages/Edit.vue b/client/web/compose/src/views/Admin/Pages/Edit.vue index 221d1b779..efd713aa1 100644 --- a/client/web/compose/src/views/Admin/Pages/Edit.vue +++ b/client/web/compose/src/views/Admin/Pages/Edit.vue @@ -225,6 +225,14 @@ > {{ $t('showSubPages') }} + + + {{ $t('edit.notifications.enabled') }} + diff --git a/lib/js/src/compose/types/page.ts b/lib/js/src/compose/types/page.ts index 1106cbeea..fdcd799bb 100644 --- a/lib/js/src/compose/types/page.ts +++ b/lib/js/src/compose/types/page.ts @@ -8,13 +8,19 @@ interface PartialPage extends Partial