From 95b5c0ef291d8dabc2723b61e74bc9235d3a13c3 Mon Sep 17 00:00:00 2001
From: jasonchung1871 <101672465+jasonchung1871@users.noreply.github.com>
Date: Wed, 13 Sep 2023 14:10:27 -0700
Subject: [PATCH 01/13] Update FormViewerMultiUpload.vue
quick fix to missing module
---
app/frontend/src/components/designer/FormViewerMultiUpload.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/frontend/src/components/designer/FormViewerMultiUpload.vue b/app/frontend/src/components/designer/FormViewerMultiUpload.vue
index 3441c86c4..8e1d422a3 100644
--- a/app/frontend/src/components/designer/FormViewerMultiUpload.vue
+++ b/app/frontend/src/components/designer/FormViewerMultiUpload.vue
@@ -1,6 +1,6 @@
diff --git a/app/frontend/tests/unit/components/bcgov/BCGovAlertBanner.spec.js b/app/frontend/tests/unit/components/bcgov/BCGovAlertBanner.spec.js
index e72645991..8ab59c095 100644
--- a/app/frontend/tests/unit/components/bcgov/BCGovAlertBanner.spec.js
+++ b/app/frontend/tests/unit/components/bcgov/BCGovAlertBanner.spec.js
@@ -36,7 +36,7 @@ describe('BCGovAlertBanner.vue', () => {
await flushPromises();
expect(wrapper.html()).toContain(NotificationTypes.ERROR.type);
- expect(wrapper.html()).toContain('Error');
+ expect(wrapper.html()).toContain('defaultErrMsg');
});
it('renders with a custom error message', async () => {
@@ -50,7 +50,7 @@ describe('BCGovAlertBanner.vue', () => {
text: message,
},
global: {
- plugins: [router],
+ plugins: [pinia, router],
},
});
diff --git a/app/frontend/tests/unit/store/modules/notifications.actions.spec.js b/app/frontend/tests/unit/store/modules/notifications.actions.spec.js
index 1bc623597..32513bf8d 100644
--- a/app/frontend/tests/unit/store/modules/notifications.actions.spec.js
+++ b/app/frontend/tests/unit/store/modules/notifications.actions.spec.js
@@ -1,18 +1,11 @@
import { setActivePinia, createPinia } from 'pinia';
-import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
import { useNotificationStore } from '~/store/notification';
import { NotificationTypes } from '~/utils/constants';
describe('notifications actions', () => {
- const mockConsoleError = vi.spyOn(console, 'error');
-
beforeEach(() => {
setActivePinia(createPinia());
- mockConsoleError.mockReset();
- });
-
- afterAll(() => {
- mockConsoleError.mockRestore();
});
it('addNotification should add notification', () => {
@@ -23,7 +16,6 @@ describe('notifications actions', () => {
};
const addNotificationSpy = vi.spyOn(mockStore, 'addNotification');
mockStore.addNotification(obj);
- expect(mockConsoleError).toHaveBeenCalledTimes(1);
expect(addNotificationSpy).toHaveBeenCalledTimes(1);
expect(mockStore.notifications).toEqual([
{
@@ -46,7 +38,6 @@ describe('notifications actions', () => {
const addNotificationSpy = vi.spyOn(mockStore, 'addNotification');
mockStore.addNotification(obj);
- expect(mockConsoleError).toHaveBeenCalledTimes(1);
expect(addNotificationSpy).toHaveBeenCalledTimes(1);
expect(mockStore.notifications).toEqual([
{
@@ -66,7 +57,6 @@ describe('notifications actions', () => {
};
const addNotificationSpy = vi.spyOn(mockStore, 'addNotification');
mockStore.addNotification(obj);
- expect(mockConsoleError).toHaveBeenCalledTimes(0);
expect(addNotificationSpy).toHaveBeenCalledTimes(1);
expect(mockStore.notifications).toEqual([
{
diff --git a/app/frontend/tests/unit/views/Error.spec.js b/app/frontend/tests/unit/views/Error.spec.js
index 2a7ee3255..3c1a4ca66 100644
--- a/app/frontend/tests/unit/views/Error.spec.js
+++ b/app/frontend/tests/unit/views/Error.spec.js
@@ -29,13 +29,13 @@ describe('Error.vue', () => {
await nextTick();
- expect(wrapper.text()).toMatch('Error: Something went wrong... :(');
+ expect(wrapper.text()).toMatch('trans.error.somethingWentWrong');
});
it('renders with a custom error message', async () => {
const wrapper = mount(Error, {
props: {
- msg: 'Custom Error Message',
+ text: 'Custom Error Message',
},
global: {
plugins: [pinia],
From 31cfbaa0bb80434f79d0ecf6d54f6b7af8bebf06 Mon Sep 17 00:00:00 2001
From: jasonchung1871 <101672465+jasonchung1871@users.noreply.github.com>
Date: Wed, 20 Sep 2023 14:36:18 -0700
Subject: [PATCH 05/13] Some fixes and sync with main
BaseNotificationBar now allows for translating an unformatted locale message
SubmissionsTable and MySubmissionsTable synced and search is working
---
.../components/base/BaseNotificationBar.vue | 15 ++++---
.../src/components/forms/SubmissionsTable.vue | 37 +++++++---------
.../forms/submission/MySubmissionsTable.vue | 43 ++++++++++---------
app/frontend/src/store/form.js | 18 +++++++-
4 files changed, 61 insertions(+), 52 deletions(-)
diff --git a/app/frontend/src/components/base/BaseNotificationBar.vue b/app/frontend/src/components/base/BaseNotificationBar.vue
index 88fc404dd..f2d41b462 100644
--- a/app/frontend/src/components/base/BaseNotificationBar.vue
+++ b/app/frontend/src/components/base/BaseNotificationBar.vue
@@ -20,18 +20,19 @@ export default {
computed: {
...mapState(useFormStore, ['form', 'isRTL', 'lang']),
},
- created() {
+ mounted() {
if (this.notification.consoleError) {
// eslint-disable-next-line no-console
console.error(
- i18n.t(
- this.notification.consoleError.text,
- this.notification.consoleError.options
- )
+ typeof this.notification.consoleError === 'string' ||
+ this.notification.consoleError instanceof String
+ ? this.notification.consoleError
+ : i18n.t(
+ this.notification.consoleError.text,
+ this.notification.consoleError.options
+ )
);
}
- },
- mounted() {
const notificationStore = useNotificationStore();
this.timeout = setTimeout(
() => notificationStore.deleteNotification(this.notification),
diff --git a/app/frontend/src/components/forms/SubmissionsTable.vue b/app/frontend/src/components/forms/SubmissionsTable.vue
index 5052b141b..dbcbef672 100644
--- a/app/frontend/src/components/forms/SubmissionsTable.vue
+++ b/app/frontend/src/components/forms/SubmissionsTable.vue
@@ -25,6 +25,7 @@ export default {
return {
// Show only items for the current logged in user
currentUserOnly: false,
+ debounceInput: null,
deleteItem: {},
// Show only deleted items
deletedOnly: false,
@@ -44,7 +45,6 @@ export default {
loading: true,
restoreItem: {},
search: '',
- searchEnabled: false,
selectedSubmissions: [],
serverItems: [],
showColumnsDialog: false,
@@ -318,23 +318,10 @@ export default {
},
//------------------------ END FILTER COLUMNS
},
- watch: {
- async search(newSearch, oldSearch) {
- this.searchEnabled = true;
- if (newSearch !== oldSearch) {
- if (newSearch === '') {
- this.searchEnabled = false;
- await this.getSubmissionData();
- } else {
- _.debounce(async () => {
- await this.getSubmissionData();
- }, 300);
- this.refreshSubmissions();
- }
- }
- },
- },
mounted() {
+ this.debounceInput = _.debounce(async () => {
+ this.refreshSubmissions();
+ }, 300);
this.refreshSubmissions();
},
methods: {
@@ -378,7 +365,11 @@ export default {
this.sortBy = {};
}
this.itemsPerPage = itemsPerPage;
- await this.getSubmissionData();
+ if (this.search === '') {
+ await this.getSubmissionData();
+ } else {
+ this.debounceInput();
+ }
},
async getSubmissionData() {
let criteria = {
@@ -388,7 +379,7 @@ export default {
filterformSubmissionStatusCode: true,
sortBy: this.sortBy,
search: this.search,
- searchEnabled: this.searchEnabled,
+ searchEnabled: this.search.length > 0,
createdAt: Object.values({
minDate:
this.userFormPreferences &&
@@ -469,7 +460,6 @@ export default {
},
async refreshSubmissions() {
this.loading = true;
- this.page = 0;
Promise.all([
this.getFormRolesForUser(this.formId),
this.getFormPermissionsForUser(this.formId),
@@ -552,6 +542,9 @@ export default {
await this.populateSubmissionsTable();
},
+ handleSearch(value) {
+ this.search = value;
+ },
},
};
@@ -660,7 +653,6 @@ export default {
@@ -689,7 +682,7 @@ export default {
:loading="loading"
:loading-text="$t('trans.submissionsTable.loadingText')"
:no-data-text="
- searchEnabled
+ search.length > 0
? $t('trans.submissionsTable.noMachingRecordText')
: $t('trans.submissionsTable.noDataText')
"
diff --git a/app/frontend/src/components/forms/submission/MySubmissionsTable.vue b/app/frontend/src/components/forms/submission/MySubmissionsTable.vue
index 2acb5d345..39b654b04 100644
--- a/app/frontend/src/components/forms/submission/MySubmissionsTable.vue
+++ b/app/frontend/src/components/forms/submission/MySubmissionsTable.vue
@@ -1,4 +1,5 @@
@@ -390,7 +387,6 @@ export default {
:class="isRTL ? 'float-left' : 'float-right'"
>
@@ -414,7 +411,11 @@ export default {
:search="search"
:loading="loading"
:loading-text="$t('trans.mySubmissionsTable.loadingText')"
- :no-data-text="$t('trans.mySubmissionsTable.noDataText')"
+ :no-data-text="
+ search.length > 0
+ ? $t('trans.mySubmissionsTable.noMatchingRecordText')
+ : $t('trans.mySubmissionsTable.noDataText')
+ "
:lang="lang"
@update:options="updateTableOptions"
>
diff --git a/app/frontend/src/store/form.js b/app/frontend/src/store/form.js
index b1a4f2f35..e436a00c6 100644
--- a/app/frontend/src/store/form.js
+++ b/app/frontend/src/store/form.js
@@ -525,7 +525,14 @@ export const useFormStore = defineStore('form', {
});
}
},
- async fetchFormCSVExportFields({ formId, type, draft, deleted, version }) {
+ async fetchFormCSVExportFields({
+ formId,
+ type,
+ draft,
+ deleted,
+ version,
+ singleRow,
+ }) {
try {
this.formFields = [];
const { data } = await formService.readCSVExportFields(
@@ -533,7 +540,8 @@ export const useFormStore = defineStore('form', {
type,
draft,
deleted,
- version
+ version,
+ singleRow
);
this.formFields = data;
} catch (error) {
@@ -560,6 +568,8 @@ export const useFormStore = defineStore('form', {
itemsPerPage,
filterformSubmissionStatusCode,
sortBy: sortBy,
+ search: search,
+ searchEnabled: searchEnabled,
}) {
try {
this.submissionList = [];
@@ -575,6 +585,8 @@ export const useFormStore = defineStore('form', {
itemsPerPage: itemsPerPage,
totalSubmissions: this.totalSubmissions,
sortBy: sortBy,
+ search: search,
+ searchEnabled: searchEnabled,
})
: await formService.listSubmissions(formId, {
deleted: deletedOnly,
@@ -586,6 +598,8 @@ export const useFormStore = defineStore('form', {
itemsPerPage: itemsPerPage,
totalSubmissions: this.totalSubmissions,
sortBy: sortBy,
+ search: search,
+ searchEnabled: searchEnabled,
});
this.submissionList = response.data.results;
this.totalSubmissions = response.data.total;
From d7017c5f802c7f12a20da9a824f72b859eb02e2e Mon Sep 17 00:00:00 2001
From: jasonchung1871 <101672465+jasonchung1871@users.noreply.github.com>
Date: Mon, 25 Sep 2023 09:30:31 -0700
Subject: [PATCH 06/13] Form access validation and formio
Form.io CSS styling moved away from the component level and into the root style.scss file. This seems to fix our issue but is not what we used to do.
Unable to detect nested radio group in the form.idps for validation and there's no way to manually enforce a validation rules check. So when we detect a change in the idpType, we set the form idps ourselves and then change the userType twice to re-validate the radio group that is the parent.
---
app/frontend/src/assets/scss/style.scss | 2 ++
.../src/components/designer/FormDesigner.vue | 3 ---
.../src/components/designer/FormViewer.vue | 3 ---
.../designer/settings/FormAccessSettings.vue | 27 ++++++++++++++++---
4 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/app/frontend/src/assets/scss/style.scss b/app/frontend/src/assets/scss/style.scss
index e20cca29b..f677a6054 100644
--- a/app/frontend/src/assets/scss/style.scss
+++ b/app/frontend/src/assets/scss/style.scss
@@ -1,6 +1,8 @@
@import url('https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900');
@import url('https://fonts.googleapis.com/css?family=Material+Icons');
@import '@mdi/font/css/materialdesignicons.css';
+@import '~font-awesome/css/font-awesome.min.css';
+@import '~formiojs/dist/formio.builder.min.css';
@import 'bootstrap-scss/bootstrap.scss'; // TODO: import this only for form designer/renderer formio components
@import 'vue-json-pretty/lib/styles.css';
diff --git a/app/frontend/src/components/designer/FormDesigner.vue b/app/frontend/src/components/designer/FormDesigner.vue
index 85fd363c6..0ca7dfedf 100644
--- a/app/frontend/src/components/designer/FormDesigner.vue
+++ b/app/frontend/src/components/designer/FormDesigner.vue
@@ -778,9 +778,6 @@ export default {
diff --git a/app/frontend/src/components/forms/manage/EmailManagement.vue b/app/frontend/src/components/forms/manage/EmailManagement.vue
index 157ad3143..4eb888ed3 100644
--- a/app/frontend/src/components/forms/manage/EmailManagement.vue
+++ b/app/frontend/src/components/forms/manage/EmailManagement.vue
@@ -1,3 +1,40 @@
+
+
{{ $t('trans.emailManagement.emailManagement')
- }}
- {{ this.form.name }}
+ {{ form.name }}
-
-
+
+
- settings
+
@@ -42,43 +78,3 @@
/>
-
-
diff --git a/app/frontend/src/components/forms/manage/EmailTemplate.vue b/app/frontend/src/components/forms/manage/EmailTemplate.vue
index 47bb31b51..8278152d5 100644
--- a/app/frontend/src/components/forms/manage/EmailTemplate.vue
+++ b/app/frontend/src/components/forms/manage/EmailTemplate.vue
@@ -1,54 +1,8 @@
-
-
- {{ this.title }}
-
-
-
-
-
- {{ $t('trans.emailTemplate.save') }}
-
-
-
-
-
+
+
+
+ {{ title }}
+
+
+
+
+
+ {{ $t('trans.emailTemplate.save') }}
+
+
+
+
diff --git a/app/frontend/src/components/forms/manage/ManageFormActions.vue b/app/frontend/src/components/forms/manage/ManageFormActions.vue
index 298d17d78..ddbfce254 100644
--- a/app/frontend/src/components/forms/manage/ManageFormActions.vue
+++ b/app/frontend/src/components/forms/manage/ManageFormActions.vue
@@ -116,10 +116,8 @@ export default {
{{ $t('trans.manageFormActions.emailManagement') }}
diff --git a/app/frontend/src/router.js b/app/frontend/src/router.js
index 4f093b497..c348c14f8 100644
--- a/app/frontend/src/router.js
+++ b/app/frontend/src/router.js
@@ -192,10 +192,7 @@ export default function getRouter(basePath = '/') {
{
path: 'emails',
name: 'FormEmails',
- component: () =>
- import(
- /* webpackChunkName: "emails" */ '@/views/form/Emails.vue'
- ),
+ component: () => import('~/views/form/Emails.vue'),
meta: {
breadcrumbTitle: 'Email Management',
requiresAuth: IdentityProviders.IDIR,
diff --git a/app/frontend/src/store/form.js b/app/frontend/src/store/form.js
index d275c98e4..b40a224c5 100644
--- a/app/frontend/src/store/form.js
+++ b/app/frontend/src/store/form.js
@@ -278,16 +278,15 @@ export const useFormStore = defineStore('form', {
this.emailTemplates = data;
} catch (error) {
const notificationStore = useNotificationStore();
- const consoleError = i18n.t(
- 'trans.store.form.fetchEmailTemplatesConsErrMsg',
- {
- formId,
- error,
- }
- );
notificationStore.addNotification({
text: i18n.t('trans.store.form.fetchEmailTemplatesErrMsg'),
- consoleError: consoleError,
+ consoleError: i18n.t(
+ 'trans.store.form.fetchEmailTemplatesConsErrMsg',
+ {
+ formId,
+ error,
+ }
+ ),
});
}
},
diff --git a/app/frontend/src/views/form/Emails.vue b/app/frontend/src/views/form/Emails.vue
index 6d7aff68f..783b65978 100644
--- a/app/frontend/src/views/form/Emails.vue
+++ b/app/frontend/src/views/form/Emails.vue
@@ -1,17 +1,13 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/app/jest.config.js b/app/jest.config.js
index 43831a03f..0eac637a6 100755
--- a/app/jest.config.js
+++ b/app/jest.config.js
@@ -4,7 +4,7 @@ module.exports = {
collectCoverageFrom: ['src/**/*.js', '!src/db/migrations/*.js', '!src/db/seeds/*.js', '!frontend/**/*.*'],
moduleFileExtensions: ['js', 'json'],
moduleNameMapper: {
- '^@/(.*)$': '
/src/$1',
+ '^~/(.*)$': '/src/$1',
},
testMatch: ['**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'],
testPathIgnorePatterns: ['frontend'],
diff --git a/app/package-lock.json b/app/package-lock.json
index 59c468745..ac46c2c4f 100644
--- a/app/package-lock.json
+++ b/app/package-lock.json
@@ -30,6 +30,7 @@
"fast-json-patch": "^3.1.1",
"form-data": "^4.0.0",
"fs-extra": "^10.1.0",
+ "handlebars": "^4.7.8",
"js-yaml": "^4.1.0",
"jsonwebtoken": "^9.0.0",
"keycloak-connect": "^21.1.1",
@@ -6249,6 +6250,26 @@
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
"dev": true
},
+ "node_modules/handlebars": {
+ "version": "4.7.8",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
+ "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
+ "dependencies": {
+ "minimist": "^1.2.5",
+ "neo-async": "^2.6.2",
+ "source-map": "^0.6.1",
+ "wordwrap": "^1.0.0"
+ },
+ "bin": {
+ "handlebars": "bin/handlebars"
+ },
+ "engines": {
+ "node": ">=0.4.7"
+ },
+ "optionalDependencies": {
+ "uglify-js": "^3.1.4"
+ }
+ },
"node_modules/has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -8244,6 +8265,11 @@
"node": ">= 0.6"
}
},
+ "node_modules/neo-async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
+ },
"node_modules/nested-objects-util": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/nested-objects-util/-/nested-objects-util-1.1.2.tgz",
@@ -9640,7 +9666,6 @@
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -10308,6 +10333,18 @@
"node": ">=4.2.0"
}
},
+ "node_modules/uglify-js": {
+ "version": "3.17.4",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
+ "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
+ "optional": true,
+ "bin": {
+ "uglifyjs": "bin/uglifyjs"
+ },
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
"node_modules/unbox-primitive": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
@@ -10720,6 +10757,11 @@
"node": ">=0.10.0"
}
},
+ "node_modules/wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
+ },
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -12828,6 +12870,7 @@
"fast-json-patch": "^3.1.1",
"form-data": "^4.0.0",
"fs-extra": "^10.1.0",
+ "handlebars": "^4.7.8",
"jest": "^28.0.0",
"js-yaml": "^4.1.0",
"jsonwebtoken": "^9.0.0",
@@ -17570,6 +17613,18 @@
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
"dev": true
},
+ "handlebars": {
+ "version": "4.7.8",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
+ "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
+ "requires": {
+ "minimist": "^1.2.5",
+ "neo-async": "^2.6.2",
+ "source-map": "^0.6.1",
+ "uglify-js": "^3.1.4",
+ "wordwrap": "^1.0.0"
+ }
+ },
"has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -19043,6 +19098,11 @@
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="
},
+ "neo-async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
+ },
"nested-objects-util": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/nested-objects-util/-/nested-objects-util-1.1.2.tgz",
@@ -20082,8 +20142,7 @@
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"source-map-support": {
"version": "0.5.13",
@@ -20579,6 +20638,12 @@
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"dev": true
},
+ "uglify-js": {
+ "version": "3.17.4",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
+ "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
+ "optional": true
+ },
"unbox-primitive": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
@@ -20874,6 +20939,11 @@
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"dev": true
},
+ "wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
+ },
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -23744,6 +23814,18 @@
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
"dev": true
},
+ "handlebars": {
+ "version": "4.7.8",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
+ "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
+ "requires": {
+ "minimist": "^1.2.5",
+ "neo-async": "^2.6.2",
+ "source-map": "^0.6.1",
+ "uglify-js": "^3.1.4",
+ "wordwrap": "^1.0.0"
+ }
+ },
"has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -25217,6 +25299,11 @@
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="
},
+ "neo-async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
+ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
+ },
"nested-objects-util": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/nested-objects-util/-/nested-objects-util-1.1.2.tgz",
@@ -26256,8 +26343,7 @@
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"source-map-support": {
"version": "0.5.13",
@@ -26753,6 +26839,12 @@
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"dev": true
},
+ "uglify-js": {
+ "version": "3.17.4",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
+ "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
+ "optional": true
+ },
"unbox-primitive": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
@@ -27048,6 +27140,11 @@
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"dev": true
},
+ "wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
+ },
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -27143,4 +27240,4 @@
"dev": true
}
}
-}
\ No newline at end of file
+}
From 6fa2fc8e86c9f715b862818d24ba8a32107fb0cc Mon Sep 17 00:00:00 2001
From: jasonchung1871 <101672465+jasonchung1871@users.noreply.github.com>
Date: Tue, 3 Oct 2023 16:35:51 -0700
Subject: [PATCH 13/13] Fixed BaseStepper
---
.../src/components/base/BaseStepper.vue | 29 ++++++++++++++-----
.../src/components/designer/FloatButton.vue | 5 +++-
app/frontend/src/router.js | 10 ++++++-
app/frontend/src/views/form/Create.vue | 6 ++--
app/frontend/src/views/form/Design.vue | 2 +-
app/frontend/src/views/form/PublishForm.vue | 28 ++++++++++++++++--
6 files changed, 66 insertions(+), 14 deletions(-)
diff --git a/app/frontend/src/components/base/BaseStepper.vue b/app/frontend/src/components/base/BaseStepper.vue
index 4bee1f04f..a370c1580 100644
--- a/app/frontend/src/components/base/BaseStepper.vue
+++ b/app/frontend/src/components/base/BaseStepper.vue
@@ -12,7 +12,7 @@ export default {
props: {
step: {
type: Number,
- default: 1,
+ required: true,
},
},
computed: {
@@ -29,19 +29,34 @@ export default {
-
+
{{ $t('trans.baseStepper.setUpForm') }}
-
+
{{ $t('trans.baseStepper.designForm') }}
-
+
{{ $t('trans.baseStepper.manageForm') }}
@@ -49,17 +64,17 @@ export default {
-
+
-
+
-
+
diff --git a/app/frontend/src/components/designer/FloatButton.vue b/app/frontend/src/components/designer/FloatButton.vue
index 416dcf755..54e4e5bbd 100644
--- a/app/frontend/src/components/designer/FloatButton.vue
+++ b/app/frontend/src/components/designer/FloatButton.vue
@@ -372,7 +372,10 @@ export default {
{
+ return {
+ ...route.query,
+ ...route.params,
+ fd:
+ String(route.query.fd).toLowerCase() === 'true' ||
+ route.query.fd === true,
+ };
+ },
},
{
path: 'design',
diff --git a/app/frontend/src/views/form/Create.vue b/app/frontend/src/views/form/Create.vue
index b91edc70b..9095e0e9f 100644
--- a/app/frontend/src/views/form/Create.vue
+++ b/app/frontend/src/views/form/Create.vue
@@ -34,7 +34,9 @@ export default {
computed: {
...mapState(useFormStore, ['form', 'isRTL', 'lang']),
IDP: () => IdentityProviders,
- stepper: () => this.step,
+ stepper() {
+ return this.step;
+ },
},
watch: {
form() {
@@ -105,7 +107,7 @@ export default {
-
+
{{ $t('trans.create.back') }}
diff --git a/app/frontend/src/views/form/Design.vue b/app/frontend/src/views/form/Design.vue
index 2c64a1eae..e8d28cd6a 100644
--- a/app/frontend/src/views/form/Design.vue
+++ b/app/frontend/src/views/form/Design.vue
@@ -56,7 +56,7 @@ export default {
methods: {
...mapActions(useFormStore, ['listFCProactiveHelp', 'deleteCurrentForm']),
onFormLoad() {
- this.$refs.formDesigner.onFormLoad();
+ if (this.$refs?.formDesigner) this.$refs.formDesigner.onFormLoad();
},
},
};
diff --git a/app/frontend/src/views/form/PublishForm.vue b/app/frontend/src/views/form/PublishForm.vue
index 1f88581a0..d17518aa8 100644
--- a/app/frontend/src/views/form/PublishForm.vue
+++ b/app/frontend/src/views/form/PublishForm.vue
@@ -1,4 +1,5 @@