From 2e94918ae9eda0c0b0f9edac703ed9468ef2d13c Mon Sep 17 00:00:00 2001 From: Vijaivir Dhaliwal <91633223+vijaivir@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:12:11 -0700 Subject: [PATCH 01/20] update formiojs (#1458) --- app/frontend/package-lock.json | 16 ++++++++-------- app/frontend/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/frontend/package-lock.json b/app/frontend/package-lock.json index b471325c8..07d6e6a58 100644 --- a/app/frontend/package-lock.json +++ b/app/frontend/package-lock.json @@ -19,7 +19,7 @@ "crypto-js": "^4.1.1", "fast-json-patch": "^3.1.1", "font-awesome": "^4.7.0", - "formiojs": "^4.14.13", + "formiojs": "^4.19.5", "keycloak-js": "^21.1.1", "lodash": "^4.17.21", "mitt": "^3.0.0", @@ -515,9 +515,9 @@ } }, "node_modules/@formio/choices.js": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-10.2.0.tgz", - "integrity": "sha512-dEF+es4yj3pstKHif7Ck14vQCZdN+b1Afojl0ufTmKw5WIjqas1KXEIBBgtsg4eY6bxqFkgEjtxsK4ecvEeZsA==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-10.2.1.tgz", + "integrity": "sha512-NCE5u7jG3XGokJP16MyAbVSUptKu/mpJYAxd4PPIoLiO/l9Do5uoOQ0MgNb9qG9qABJiOX+qNRE8q8RybY/SwQ==", "dependencies": { "deepmerge": "^4.2.2", "fuse.js": "^6.6.2", @@ -2704,12 +2704,12 @@ } }, "node_modules/formiojs": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.17.4.tgz", - "integrity": "sha512-1wUWPLKTJ6/FWa5jCtw5YfsUzgr85TYh8aMhXUWxxRNBtYxZMLg4RcFsArqDJP9Lfh9z4N8p/sLSaOik6iu7kA==", + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.19.5.tgz", + "integrity": "sha512-jkFothZR+Fz85br6gzneHhOXf4MZJYyheBtDL3k9NdjOaPhRsfyQZuGaWtvoMCYvZNYWcERoD6UtUwEdyMMY1w==", "dependencies": { "@formio/bootstrap3": "2.12.4-rc.1", - "@formio/choices.js": "10.2.0", + "@formio/choices.js": "10.2.1", "@formio/semantic": "2.6.1", "@formio/text-mask-addons": "^3.8.0-formio.2", "@formio/vanilla-text-mask": "^5.1.1-formio.1", diff --git a/app/frontend/package.json b/app/frontend/package.json index 76a987ddd..ca3dfb2fc 100644 --- a/app/frontend/package.json +++ b/app/frontend/package.json @@ -40,7 +40,7 @@ "crypto-js": "^4.1.1", "fast-json-patch": "^3.1.1", "font-awesome": "^4.7.0", - "formiojs": "^4.14.13", + "formiojs": "^4.19.5", "keycloak-js": "^21.1.1", "lodash": "^4.17.21", "mitt": "^3.0.0", From 607204684857c46671de905b7ffbf579f4c85240 Mon Sep 17 00:00:00 2001 From: Vijaivir Dhaliwal <91633223+vijaivir@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:32:58 -0700 Subject: [PATCH 02/20] Revert "update formiojs (#1458)" (#1462) This reverts commit 2e94918ae9eda0c0b0f9edac703ed9468ef2d13c. --- app/frontend/package-lock.json | 16 ++++++++-------- app/frontend/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/frontend/package-lock.json b/app/frontend/package-lock.json index 07d6e6a58..b471325c8 100644 --- a/app/frontend/package-lock.json +++ b/app/frontend/package-lock.json @@ -19,7 +19,7 @@ "crypto-js": "^4.1.1", "fast-json-patch": "^3.1.1", "font-awesome": "^4.7.0", - "formiojs": "^4.19.5", + "formiojs": "^4.14.13", "keycloak-js": "^21.1.1", "lodash": "^4.17.21", "mitt": "^3.0.0", @@ -515,9 +515,9 @@ } }, "node_modules/@formio/choices.js": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-10.2.1.tgz", - "integrity": "sha512-NCE5u7jG3XGokJP16MyAbVSUptKu/mpJYAxd4PPIoLiO/l9Do5uoOQ0MgNb9qG9qABJiOX+qNRE8q8RybY/SwQ==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-10.2.0.tgz", + "integrity": "sha512-dEF+es4yj3pstKHif7Ck14vQCZdN+b1Afojl0ufTmKw5WIjqas1KXEIBBgtsg4eY6bxqFkgEjtxsK4ecvEeZsA==", "dependencies": { "deepmerge": "^4.2.2", "fuse.js": "^6.6.2", @@ -2704,12 +2704,12 @@ } }, "node_modules/formiojs": { - "version": "4.19.5", - "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.19.5.tgz", - "integrity": "sha512-jkFothZR+Fz85br6gzneHhOXf4MZJYyheBtDL3k9NdjOaPhRsfyQZuGaWtvoMCYvZNYWcERoD6UtUwEdyMMY1w==", + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.17.4.tgz", + "integrity": "sha512-1wUWPLKTJ6/FWa5jCtw5YfsUzgr85TYh8aMhXUWxxRNBtYxZMLg4RcFsArqDJP9Lfh9z4N8p/sLSaOik6iu7kA==", "dependencies": { "@formio/bootstrap3": "2.12.4-rc.1", - "@formio/choices.js": "10.2.1", + "@formio/choices.js": "10.2.0", "@formio/semantic": "2.6.1", "@formio/text-mask-addons": "^3.8.0-formio.2", "@formio/vanilla-text-mask": "^5.1.1-formio.1", diff --git a/app/frontend/package.json b/app/frontend/package.json index ca3dfb2fc..76a987ddd 100644 --- a/app/frontend/package.json +++ b/app/frontend/package.json @@ -40,7 +40,7 @@ "crypto-js": "^4.1.1", "fast-json-patch": "^3.1.1", "font-awesome": "^4.7.0", - "formiojs": "^4.19.5", + "formiojs": "^4.14.13", "keycloak-js": "^21.1.1", "lodash": "^4.17.21", "mitt": "^3.0.0", From d07aed8eaa27ebf9013669e2d99be59d07dcddaa Mon Sep 17 00:00:00 2001 From: Vijaivir Dhaliwal <91633223+vijaivir@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:02:48 -0700 Subject: [PATCH 03/20] Fix: Update error message for unauthorized form access and fix button size for late submissions (#1442) * added tooltip * update unauthorized status * added translation files * fix form render post schedule expiration * fix button size * added else block for generic errors --- .../src/components/designer/FormViewer.vue | 49 +++++++++++++------ .../designer/settings/FormAccessSettings.vue | 18 +++++-- .../trans/chefs/ar/ar.json | 4 +- .../trans/chefs/de/de.json | 4 +- .../trans/chefs/en/en.json | 4 +- .../trans/chefs/es/es.json | 4 +- .../trans/chefs/fa/fa.json | 4 +- .../trans/chefs/fr/fr.json | 4 +- .../trans/chefs/hi/hi.json | 4 +- .../trans/chefs/it/it.json | 4 +- .../trans/chefs/ja/ja.json | 4 +- .../trans/chefs/ko/ko.json | 4 +- .../trans/chefs/pa/pa.json | 4 +- .../trans/chefs/pt/pt.json | 4 +- .../trans/chefs/ru/ru.json | 4 +- .../trans/chefs/tl/tl.json | 4 +- .../trans/chefs/uk/uk.json | 4 +- .../trans/chefs/vi/vi.json | 4 +- .../trans/chefs/zh/zh.json | 4 +- .../trans/chefs/zhTW/zh-TW.json | 4 +- 20 files changed, 102 insertions(+), 37 deletions(-) diff --git a/app/frontend/src/components/designer/FormViewer.vue b/app/frontend/src/components/designer/FormViewer.vue index 102436eff..74ddcc4c4 100644 --- a/app/frontend/src/components/designer/FormViewer.vue +++ b/app/frontend/src/components/designer/FormViewer.vue @@ -115,6 +115,7 @@ export default { submissionRecord: {}, version: 0, versionIdToSubmitTo: this.versionId, + isAuthorized: true, }; }, computed: { @@ -130,6 +131,9 @@ export default { formScheduleExpireMessage() { return this.$t('trans.formViewer.formScheduleExpireMessage'); }, + formUnauthorizedMessage() { + return this.$t('trans.formViewer.formUnauthorizedMessage'); + }, NOTIFICATIONS_TYPES() { return NotificationTypes; }, @@ -190,7 +194,6 @@ export default { this.showModal = true; await this.getFormSchema(); } - window.addEventListener('beforeunload', this.beforeWindowUnload); this.reRenderFormIo += 1; @@ -403,19 +406,22 @@ export default { } } catch (error) { if (this.authenticated) { - this.isFormScheduleExpired = true; - this.isLateSubmissionAllowed = false; - this.formScheduleExpireMessage = error.message; - this.addNotification({ - text: this.$t('trans.formViewer.fecthingFormErrMsg'), - consoleError: this.$t( - 'trans.formViewer.fecthingFormConsoleErrMsg', - { - versionId: this.versionId, - error: error, - } - ), - }); + // if 401 error, the user is not authorized to view the form + if (error.response && error.response.status === 401) { + this.isAuthorized = false; + } else { + // throw a generic error message + this.addNotification({ + text: this.$t('trans.formViewer.fecthingFormErrMsg'), + consoleError: this.$t( + 'trans.formViewer.fecthingFormConsoleErrMsg', + { + versionId: this.versionId, + error: error, + } + ), + }); + } } } }, @@ -1144,7 +1150,18 @@ export default {