From 75165bb59b20fa1cc4ca3042e9f05b27289c8af6 Mon Sep 17 00:00:00 2001 From: Jason Sherman Date: Mon, 5 Feb 2024 15:32:02 -0800 Subject: [PATCH 1/2] Save Button stops working. Fix the intended logic when adding a component with the API Key of `form`. Errors in that logic prevented the notification from displaying and prompting the form designer to remove that component. Signed-off-by: Jason Sherman --- .../src/components/designer/FormDesigner.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/frontend/src/components/designer/FormDesigner.vue b/app/frontend/src/components/designer/FormDesigner.vue index c36ab5407..b7bc5ec4c 100644 --- a/app/frontend/src/components/designer/FormDesigner.vue +++ b/app/frontend/src/components/designer/FormDesigner.vue @@ -13,7 +13,7 @@ import { formService } from '~/services'; import { useAuthStore } from '~/store/auth'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; -import { IdentityMode, NotificationTypes } from '~/utils/constants'; +import { IdentityMode } from '~/utils/constants'; import { generateIdps } from '~/utils/transformUtils'; import { userService } from '../../services'; @@ -227,7 +227,6 @@ export default { 'setDirtyFlag', 'getFCProactiveHelpImageUrl', ]), - ...mapActions(useNotificationStore, ['addNotification']), async getFormSchema() { try { @@ -431,11 +430,13 @@ export default { this.canSave = true; modified?.components?.map((comp) => { if (comp.key === 'form') { - this.addNotification({ - ...NotificationTypes.ERROR, - message: this.$t('trans.formDesigner.fieldnameError', { - label: comp.label, - }), + const notificationStore = useNotificationStore(); + const msg = i18n.t('trans.formDesigner.fieldnameError', { + label: comp.label, + }); + notificationStore.addNotification({ + text: msg, + consoleError: msg, }); this.canSave = false; } From 217a8e840225be4af380904f4f5e900a8273ef79 Mon Sep 17 00:00:00 2001 From: Jason Sherman Date: Mon, 12 Feb 2024 15:27:10 -0800 Subject: [PATCH 2/2] update other notification calls to use text not message param. Signed-off-by: Jason Sherman --- app/frontend/src/components/forms/manage/EmailTemplate.vue | 2 +- .../src/components/forms/submission/UserSubmission.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/frontend/src/components/forms/manage/EmailTemplate.vue b/app/frontend/src/components/forms/manage/EmailTemplate.vue index 8278152d5..01ad2e3ab 100644 --- a/app/frontend/src/components/forms/manage/EmailTemplate.vue +++ b/app/frontend/src/components/forms/manage/EmailTemplate.vue @@ -58,7 +58,7 @@ export default { this.formChanged = false; } catch (error) { this.addNotification({ - message: i18n.t('trans.emailTemplate.saveEmailTemplateErrMsg'), + text: i18n.t('trans.emailTemplate.saveEmailTemplateErrMsg'), consoleError: i18n.t( 'trans.emailTemplate.saveEmailTemplateConsoleErrMsg', { diff --git a/app/frontend/src/components/forms/submission/UserSubmission.vue b/app/frontend/src/components/forms/submission/UserSubmission.vue index 004c5cf56..034cc5475 100644 --- a/app/frontend/src/components/forms/submission/UserSubmission.vue +++ b/app/frontend/src/components/forms/submission/UserSubmission.vue @@ -46,9 +46,10 @@ export default { s: this.formSubmission?.id, }, }); + this.addNotification({ ...NotificationTypes.WARNING, - message: this.$t('trans.formViewer.formDraftAccessErrMsg'), + text: this.$t('trans.formViewer.formDraftAccessErrMsg'), }); } this.loading = false;