Skip to content

Commit

Permalink
Save Button stops working.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
usingtechnology committed Feb 5, 2024
1 parent 731ffc1 commit 75165bb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/frontend/src/components/designer/FormDesigner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -227,7 +227,6 @@ export default {
'setDirtyFlag',
'getFCProactiveHelpImageUrl',
]),
...mapActions(useNotificationStore, ['addNotification']),
async getFormSchema() {
try {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 75165bb

Please sign in to comment.