From 5e2f6a600eea6429c7820d86706b0adab7e2c537 Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Mon, 11 Mar 2024 19:31:59 +0530 Subject: [PATCH 1/3] Implemented: app version component from dxp-components(#219) --- package-lock.json | 129 ++++++++++------------- package.json | 4 +- src/locales/en.json | 2 + src/locales/index.ts | 5 + src/main.ts | 4 +- src/store/modules/user/UserState.ts | 1 + src/store/modules/user/actions.ts | 4 + src/store/modules/user/getters.ts | 3 + src/store/modules/user/index.ts | 4 + src/store/modules/user/mutation-types.ts | 3 +- src/store/modules/user/mutations.ts | 4 + src/views/SelectProduct.vue | 6 +- src/views/Settings.vue | 23 ++-- tsconfig.json | 1 + 14 files changed, 94 insertions(+), 99 deletions(-) create mode 100644 src/locales/index.ts diff --git a/package-lock.json b/package-lock.json index 2ca99776..989aab09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,8 +14,8 @@ "@casl/ability": "^6.0.0", "@casl/vue": "^2.2.0", "@hotwax/app-version-info": "^1.0.0", - "@hotwax/apps-theme": "^1.1.0", - "@hotwax/dxp-components": "1.11.0", + "@hotwax/apps-theme": "^1.2.6", + "@hotwax/dxp-components": "1.12.1", "@hotwax/oms-api": "^1.10.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", @@ -2815,29 +2815,66 @@ "integrity": "sha512-PnJTqTbFvvl9N23yi1DjL4aNmTkpYFrayyoJyfH1qDJXADFbQ9kB7gJmKcfiPpyYMGR86Yf3Is5ct0+wReUJGQ==" }, "node_modules/@hotwax/apps-theme": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@hotwax/apps-theme/-/apps-theme-1.2.5.tgz", - "integrity": "sha512-3Vec4pGWJVs6vDbL/pO5hYqoF1zn2w8liXuleqDJ7waI2R5JuF2eaJmYcUQETnk/DZIg47bDdyOSxihQltB2Ow==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@hotwax/apps-theme/-/apps-theme-1.2.6.tgz", + "integrity": "sha512-zpUjGoY7LBlKeiP0V7tonrmoey8HQ5THQmyixQ+IDtrjmEJNBjynW/Ef3gC0FUNNPuVqxWPZdT5CVgaETLGTwg==" }, "node_modules/@hotwax/dxp-components": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.11.0.tgz", - "integrity": "sha512-z9UNzi1veT8Aj8Y1WWAGBGOR+I0s6A58qrsFj+L3LkpxTkq6zGN/JS80tTv29obEeeOfONm6XyLHvNOM6TFKyA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.12.1.tgz", + "integrity": "sha512-5soKaVBFd7klZnHBCi68j4CZwTlrBCzvPsyd+wHMbenezU+lOwMK0ftdWXrQcQPedeGdVtQXvvgSPWnLL310bg==", "dependencies": { "@hotwax/oms-api": "^1.8.1", - "@ionic/core": "^6.7.5", - "@ionic/vue": "^6.7.5", - "@types/vue-barcode-reader": "^0.0.0", + "@ionic/core": "^7.6.0", + "@ionic/vue": "^7.6.0", "firebase": "^10.3.1", "luxon": "^3.3.0", "pinia": "2.0.36", "pinia-plugin-persistedstate": "^3.1.0", "register-service-worker": "^1.7.2", "vue": "^3.3.4", - "vue-barcode-reader": "^1.0.3", "vue-i18n": "^9.2.2" } }, + "node_modules/@hotwax/dxp-components/node_modules/@ionic/core": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-7.7.4.tgz", + "integrity": "sha512-zThio3ZfbTu+3eM6QBdyeEk5OBc7M0ApFwSlP/G7rrFVcTPm12FNvG9VPD+aN5NwnYy0EsV3hlMkxbawoqjVLw==", + "dependencies": { + "@stencil/core": "^4.12.2", + "ionicons": "^7.2.2", + "tslib": "^2.1.0" + } + }, + "node_modules/@hotwax/dxp-components/node_modules/@ionic/vue": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@ionic/vue/-/vue-7.7.4.tgz", + "integrity": "sha512-THrMMoQHU2Ym+JaTj/dm/FV8FyB7ZXmc6kierZ/+BSvOncIekla8Afe6Qk2c2U1afOPos0MBINf9xXkwxnHfIw==", + "dependencies": { + "@ionic/core": "7.7.4", + "ionicons": "^7.0.0" + } + }, + "node_modules/@hotwax/dxp-components/node_modules/@stencil/core": { + "version": "4.12.5", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-4.12.5.tgz", + "integrity": "sha512-vSyFjY7XSEx0ufa9SebOd437CvnneaTXlCpuGDhjUDxAjGBlu6ie5qHyubobVGBth//aErc6wZPHc6W75Vp3iQ==", + "bin": { + "stencil": "bin/stencil" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.10.0" + } + }, + "node_modules/@hotwax/dxp-components/node_modules/ionicons": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-7.2.2.tgz", + "integrity": "sha512-I3iYIfc9Q9FRifWyFSwTAvbEABWlWY32i0sAVDDPGYnaIZVugkLCZFbEcrphW6ixVPg8tt1oLwalo/JJwbEqnA==", + "dependencies": { + "@stencil/core": "^4.0.3" + } + }, "node_modules/@hotwax/dxp-components/node_modules/luxon": { "version": "3.4.4", "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", @@ -2846,6 +2883,11 @@ "node": ">=12" } }, + "node_modules/@hotwax/dxp-components/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, "node_modules/@hotwax/dxp-components/node_modules/vue-i18n": { "version": "9.8.0", "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.8.0.tgz", @@ -3882,33 +3924,6 @@ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", "dev": true }, - "node_modules/@types/vue-barcode-reader": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@types/vue-barcode-reader/-/vue-barcode-reader-0.0.0.tgz", - "integrity": "sha512-yngQhd35qGjCxMXWIqsAtF7qmxe0qUYRVd9qW5I/CcRPWDdBpqVkHnQSh6ro5BIBl3NQ3ppky7kMKS4pr+XwCQ==", - "dependencies": { - "vue": "^2.0.0" - } - }, - "node_modules/@types/vue-barcode-reader/node_modules/@vue/compiler-sfc": { - "version": "2.7.15", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-2.7.15.tgz", - "integrity": "sha512-FCvIEevPmgCgqFBH7wD+3B97y7u7oj/Wr69zADBf403Tui377bThTjBvekaZvlRr4IwUAu3M6hYZeULZFJbdYg==", - "dependencies": { - "@babel/parser": "^7.18.4", - "postcss": "^8.4.14", - "source-map": "^0.6.1" - } - }, - "node_modules/@types/vue-barcode-reader/node_modules/vue": { - "version": "2.7.15", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.7.15.tgz", - "integrity": "sha512-a29fsXd2G0KMRqIFTpRgpSbWaNBK3lpCTOLuGLEDnlHWdjB8fwl6zyYZ8xCrqkJdatwZb4mGHiEfJjnw0Q6AwQ==", - "dependencies": { - "@vue/compiler-sfc": "2.7.15", - "csstype": "^3.1.0" - } - }, "node_modules/@types/webpack-env": { "version": "1.18.4", "resolved": "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.18.4.tgz", @@ -5348,26 +5363,6 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, - "node_modules/@zxing/library": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@zxing/library/-/library-0.19.3.tgz", - "integrity": "sha512-RUv5svewpDoD0ymXleOP8yVTO5BLkR0zn5coGC/Vs1671u0OBJ4xdtR8WVWf08OcvrieEMHdSfQY3ZKtqII/hg==", - "dependencies": { - "ts-custom-error": "^3.2.1" - }, - "engines": { - "node": ">= 10.4.0" - }, - "optionalDependencies": { - "@zxing/text-encoding": "~0.9.0" - } - }, - "node_modules/@zxing/text-encoding": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", - "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", - "optional": true - }, "node_modules/abbrev": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", @@ -15876,14 +15871,6 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, - "node_modules/ts-custom-error": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/ts-custom-error/-/ts-custom-error-3.3.1.tgz", - "integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==", - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/ts-loader": { "version": "9.5.1", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.1.tgz", @@ -16435,14 +16422,6 @@ } } }, - "node_modules/vue-barcode-reader": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/vue-barcode-reader/-/vue-barcode-reader-1.0.3.tgz", - "integrity": "sha512-z4mv7+ai/8vECppBTb00tHnyFMMx6W1rAaQe+v214ihoaWK9iGrn8ZZsmgSxf3lwnrtGaibLdkonTtMrGsO+dA==", - "dependencies": { - "@zxing/library": "^0.19.1" - } - }, "node_modules/vue-cli-plugin-i18n": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-1.0.1.tgz", diff --git a/package.json b/package.json index 716c9117..1cda8406 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ "@casl/ability": "^6.0.0", "@casl/vue": "^2.2.0", "@hotwax/app-version-info": "^1.0.0", - "@hotwax/apps-theme": "^1.1.0", - "@hotwax/dxp-components": "1.11.0", + "@hotwax/apps-theme": "^1.2.6", + "@hotwax/dxp-components": "1.12.1", "@hotwax/oms-api": "^1.10.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", diff --git a/src/locales/en.json b/src/locales/en.json index c9315ea0..da8b1691 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -5,6 +5,7 @@ "Are you sure you want to change the time zone to?": "Are you sure you want to change the time zone to?", "Authenticating": "Authenticating", "Blank": "Blank", + "Built: ": "Built: {builtDateTime}", "Cancel": "Cancel", "CANCEL": "CANCEL", "Canceling this job will cancel this occurrence and all following occurrences. This job will have to be re-enabled manually to run it again.": "Canceling this job will cancel this occurrence and all following occurrences. This job will have to be re-enabled manually to run it again.", @@ -162,6 +163,7 @@ "Username": "Username", "virtual, ": "virtual, ", "variants": "variants", + "Version: ": "Version: {appVersion}", "You can also download the products, locations and safety stock you selected in a CSV to upload in other systems": "You can also download the products, locations and safety stock you selected in a CSV to upload in other systems", "You do not have permission to access this page": "You do not have permission to access this page", "You do not have permission to access the app.": "You do not have permission to access the app." diff --git a/src/locales/index.ts b/src/locales/index.ts new file mode 100644 index 00000000..83e39f0d --- /dev/null +++ b/src/locales/index.ts @@ -0,0 +1,5 @@ +import en from "./en.json" + +export default { + "en-US": en +}; \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 3115cfc7..a1c97d4c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -35,6 +35,7 @@ import permissionActions from '@/authorization/Actions'; import { dxpComponents } from '@hotwax/dxp-components' import { login, logout, loader } from './user-utils'; import { getConfig, initialise } from '@/adapter' +import localeMessages from './locales'; const app = createApp(App) @@ -58,7 +59,8 @@ const app = createApp(App) loader, appLoginUrl: process.env.VUE_APP_LOGIN_URL as string, getConfig, - initialise + initialise, + localeMessages }); // Filters are removed in Vue 3 and global filter introduced https://v3.vuejs.org/guide/migration/filters.html#global-filters diff --git a/src/store/modules/user/UserState.ts b/src/store/modules/user/UserState.ts index 077e20ba..07feebae 100644 --- a/src/store/modules/user/UserState.ts +++ b/src/store/modules/user/UserState.ts @@ -1,5 +1,6 @@ export default interface UserState { permissions: any; + pwaState: any; token: string; current: object | null; instanceUrl: string; diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 89626abb..c5d49e25 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -187,6 +187,10 @@ const actions: ActionTree = { commit(types.USER_INSTANCE_URL_UPDATED, payload) updateInstanceUrl(payload) }, + + updatePwaState({ commit }, payload) { + commit(types.USER_PWA_STATE_UPDATED, payload); + } } export default actions; \ No newline at end of file diff --git a/src/store/modules/user/getters.ts b/src/store/modules/user/getters.ts index fcc52248..b6c22f67 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -30,5 +30,8 @@ const getters: GetterTree = { getUserPermissions (state) { return state.permissions; }, + getPwaState(state) { + return state.pwaState; + }, } export default getters; \ No newline at end of file diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index 6796b71b..3ba85293 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -13,6 +13,10 @@ const userModule: Module = { current: {}, instanceUrl: '', currentEComStore: {}, + pwaState: { + updateExists: false, + registration: null, + } }, getters, actions, diff --git a/src/store/modules/user/mutation-types.ts b/src/store/modules/user/mutation-types.ts index 20ef2012..95162856 100644 --- a/src/store/modules/user/mutation-types.ts +++ b/src/store/modules/user/mutation-types.ts @@ -4,4 +4,5 @@ export const USER_END_SESSION = SN_USER + '/END_SESSION' export const USER_INFO_UPDATED = SN_USER + '/INFO_UPDATED' export const USER_INSTANCE_URL_UPDATED = SN_USER + '/INSTANCE_URL_UPDATED' export const USER_CURRENT_ECOM_STORE_UPDATED = SN_USER + '/CURRENT_ECOM_STORE_UPDATED' -export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED' \ No newline at end of file +export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED' +export const USER_PWA_STATE_UPDATED = SN_USER + '/PWA_STATE_UPDATED' \ No newline at end of file diff --git a/src/store/modules/user/mutations.ts b/src/store/modules/user/mutations.ts index fb7c75e0..2fafc6aa 100644 --- a/src/store/modules/user/mutations.ts +++ b/src/store/modules/user/mutations.ts @@ -24,5 +24,9 @@ const mutations: MutationTree = { [types.USER_PERMISSIONS_UPDATED] (state, payload) { state.permissions = payload }, + [types.USER_PWA_STATE_UPDATED](state, payload) { + state.pwaState.registration = payload.registration; + state.pwaState.updateExists = payload.updateExists; + }, } export default mutations; \ No newline at end of file diff --git a/src/views/SelectProduct.vue b/src/views/SelectProduct.vue index a9f92793..9089a218 100644 --- a/src/views/SelectProduct.vue +++ b/src/views/SelectProduct.vue @@ -120,7 +120,7 @@
- + {{ variant.productName }} @@ -163,7 +163,7 @@