From 1de704fe1cd10e526f061c4a79173543fe07fb31 Mon Sep 17 00:00:00 2001 From: shanmukhdutt Date: Fri, 19 Jan 2024 14:19:12 +0530 Subject: [PATCH 1/8] Fixed: Service worker registration error(dxp-253) --- src/main.ts | 1 - src/registerServiceWorker.ts | 30 ------------------------------ 2 files changed, 31 deletions(-) delete mode 100644 src/registerServiceWorker.ts diff --git a/src/main.ts b/src/main.ts index 8d04647de..c445c46dc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,6 @@ import { createApp } from 'vue' import App from './App.vue' import router from './router'; -import './registerServiceWorker' import { IonicVue } from '@ionic/vue'; import i18n from './i18n' diff --git a/src/registerServiceWorker.ts b/src/registerServiceWorker.ts deleted file mode 100644 index 69e95fe6a..000000000 --- a/src/registerServiceWorker.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { register } from 'register-service-worker' - -if (process.env.NODE_ENV === 'production') { - register(`${process.env.BASE_URL}service-worker.js`, { - ready () { - console.log( - 'App is being served from cache by a service worker.\n' + - 'For more details, visit https://goo.gl/AFskqB' - ) - }, - registered () { - console.log('Service worker has been registered.') - }, - cached () { - console.log('Content has been cached for offline use.') - }, - updatefound () { - console.log('New content is downloading.') - }, - updated () { - console.log('New content is available; please refresh.') - }, - offline () { - console.log('No internet connection found. App is running in offline mode.') - }, - error (error) { - console.error('Error during service worker registration:', error) - } - }) -} \ No newline at end of file From 65e7144fb8fba37a55df2c072fc9d102e4ca9783 Mon Sep 17 00:00:00 2001 From: shanmukhdutt Date: Mon, 22 Jan 2024 16:50:55 +0530 Subject: [PATCH 2/8] Fixed: Permission issue when definning a base permission for app(#254) --- src/store/modules/user/actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 02f2eb0dc..9ed320e0d 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -39,9 +39,9 @@ const actions: ActionTree = { if (permissionId) { // As the token is not yet set in the state passing token headers explicitly // TODO Abstract this out, how token is handled should be part of the method not the callee - const hasPermission = appPermissions.some((appPermissionId: any) => appPermissionId === permissionId ); + const hasPermission = appPermissions.some((appPermission: any) => appPermission.action === permissionId ); // If there are any errors or permission check fails do not allow user to login - if (hasPermission) { + if (!hasPermission) { const permissionError = 'You do not have permission to access the app.'; showToast(translate(permissionError)); console.error("error", permissionError); From 4856712380ee1f726b28942eb0b072845275b710 Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Mon, 29 Jan 2024 19:47:08 +0530 Subject: [PATCH 3/8] Spinner in timezone modal so users can see that data is being fetched --- src/i18n/locales/en.json | 1 + src/views/timezone-modal.vue | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 4b26359cf..f3c4a64af 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -66,6 +66,7 @@ "Excluded ATP": "Excluded ATP", "from date": "from date", "Failed to update configuration": "Failed to update configuration", + "Fetching time zones": "Fetching time zones", "Go to Launchpad": "Go to Launchpad", "Go to OMS": "Go to OMS", "History": "History", diff --git a/src/views/timezone-modal.vue b/src/views/timezone-modal.vue index c801eb019..91fd3f414 100644 --- a/src/views/timezone-modal.vue +++ b/src/views/timezone-modal.vue @@ -15,8 +15,14 @@ -
-

{{ $t("No time zone found")}}

+
+ + + {{ $t("Fetching time zones") }} + +
+
+

{{ $t("No time zone found") }}

@@ -54,6 +60,7 @@ import { IonRadioGroup, IonRadio, IonSearchbar, + IonSpinner, IonTitle, IonToolbar, modalController, @@ -81,6 +88,7 @@ export default defineComponent({ IonRadioGroup, IonRadio, IonSearchbar, + IonSpinner, IonTitle, IonToolbar }, @@ -89,7 +97,8 @@ export default defineComponent({ queryString: '', filteredTimeZones: [], timeZones: [], - timeZoneId: '' + timeZoneId: '', + isLoading: false } }, methods: { @@ -126,6 +135,7 @@ export default defineComponent({ }); }, async getAvailableTimeZones() { + this.isLoading = true; const resp = await UserService.getAvailableTimeZones() if(resp.status === 200 && !hasError(resp)) { // We are filtering valid the timeZones coming with response here @@ -134,6 +144,7 @@ export default defineComponent({ }); this.findTimeZone(); } + this.isLoading = false; }, async selectSearchBarText(event: any) { const element = await event.target.getInputElement() From 2aabfc98f347aa8157bb39a882308e759dae6b3e Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Thu, 8 Feb 2024 15:29:47 +0530 Subject: [PATCH 4/8] Fixed: error handling in login process in case of object in error (dxp-258) --- src/store/modules/user/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 02f2eb0dc..f2bb4c2bd 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -76,7 +76,7 @@ const actions: ActionTree = { } catch (err: any) { showToast(translate('Something went wrong')); console.error("error", err); - return Promise.reject(new Error(err)) + return Promise.reject(err instanceof Object ? err :new Error(err)); } }, From 0b1525fde46abd6904c1a00ba7d0b8b4923a52d2 Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Mon, 11 Mar 2024 18:51:48 +0530 Subject: [PATCH 5/8] Implemented: app version component from dxp-components(#247) --- package-lock.json | 129 ++++++++++------------- package.json | 4 +- src/i18n/locales/en.json | 2 + src/i18n/locales/index.ts | 5 + src/main.ts | 4 +- src/store/modules/user/UserState.ts | 1 + src/store/modules/user/actions.ts | 5 + src/store/modules/user/getters.ts | 3 + src/store/modules/user/index.ts | 6 +- src/store/modules/user/mutation-types.ts | 3 +- src/store/modules/user/mutations.ts | 6 +- src/views/catalog-product-details.vue | 6 +- src/views/catalog.vue | 6 +- src/views/orders.vue | 6 +- src/views/product-details.vue | 8 +- src/views/products.vue | 6 +- src/views/settings.vue | 10 +- tsconfig.json | 1 + 18 files changed, 106 insertions(+), 105 deletions(-) create mode 100644 src/i18n/locales/index.ts diff --git a/package-lock.json b/package-lock.json index def052f44..17e5c127b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,8 +13,8 @@ "@capacitor/ios": "^2.5.0", "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", - "@hotwax/apps-theme": "^1.2.3", - "@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", @@ -2802,29 +2802,71 @@ "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/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", @@ -3861,33 +3903,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", @@ -5327,26 +5342,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", @@ -15850,14 +15845,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", @@ -16409,14 +16396,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 405390dc9..072a2ca4e 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ "@capacitor/ios": "^2.5.0", "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", - "@hotwax/apps-theme": "^1.2.3", - "@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/i18n/locales/en.json b/src/i18n/locales/en.json index 4b26359cf..934fa5a04 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -21,6 +21,7 @@ "back-order": "back-order", "Back-order": "Back-order", "Broker orders": "Broker orders", + "Built: ": "Built: {builtDateTime}", "eCom Store": "eCom Store", "Cancel": "Cancel", "Cancel item": "Cancel item", @@ -236,6 +237,7 @@ "Username": "Username", "variant": "variant", "variants": "variants", + "Version: ": "Version: {appVersion}", "When this product entered there was no sellable inventory and was available in": "When this product entered {categoryName} there was no sellable inventory and {poItemATP} was available in {poId}", "With Hold Pre-order Queue Physical Inventory disabled, the excess inventory is now available for sale online after deducting the queues": "With Hold Pre-order Queue Physical Inventory disabled, the excess inventory is now available for sale online after deducting the queues", "Would you like to update your time zone to . Your profile is currently set to . This setting can always be changed from the settings menu.": "Would you like to update your time zone to {localTimeZone}. Your profile is currently set to {profileTimeZone}. This setting can always be changed from the settings menu.", diff --git a/src/i18n/locales/index.ts b/src/i18n/locales/index.ts new file mode 100644 index 000000000..83e39f0da --- /dev/null +++ b/src/i18n/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 8d04647de..d20815842 100644 --- a/src/main.ts +++ b/src/main.ts @@ -34,6 +34,7 @@ import permissionPlugin from '@/authorization'; import permissionRules from '@/authorization/Rules'; import permissionActions from '@/authorization/Actions'; import { getConfig, initialise } from '@/adapter' +import localeMessages from './i18n/locales'; const app = createApp(App) .use(IonicVue, { @@ -53,7 +54,8 @@ const app = createApp(App) loader, appLoginUrl: process.env.VUE_APP_LOGIN_URL as string, getConfig: getConfig, - initialise: initialise + 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 46732bdc9..4fea94b06 100644 --- a/src/store/modules/user/UserState.ts +++ b/src/store/modules/user/UserState.ts @@ -2,6 +2,7 @@ export default interface UserState { token: string; current: object | null; permissions: any; + pwaState: any; instanceUrl: string; currentEComStore: object; } \ No newline at end of file diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 90facc643..4de043432 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -168,5 +168,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 bb418f399..a8455da82 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -27,6 +27,9 @@ const getters: GetterTree = { if (!baseURL) baseURL = state.instanceUrl; return baseURL.startsWith('http') ? baseURL : `https://${baseURL}.hotwax.io/api/`; }, + getPwaState(state) { + return state.pwaState; + }, getCurrentEComStore(state) { return state.currentEComStore } diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index 2f3d9d1b6..7b32b1b3b 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -12,7 +12,11 @@ const userModule: Module = { permissions: [], current: {}, instanceUrl: '', - currentEComStore: {} + 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 853e740be..7100ad584 100644 --- a/src/store/modules/user/mutation-types.ts +++ b/src/store/modules/user/mutation-types.ts @@ -5,4 +5,5 @@ export const USER_INFO_UPDATED = SN_USER + '/INFO_UPDATED' export const USER_INSTANCE_URL_UPDATED = SN_USER + '/INSTANCE_URL_UPDATED' export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED' export const USER_CURRENT_ECOM_STORE_UPDATED = SN_USER + '/CURRENT_ECOM_STORE_UPDATED' -export const USER_STORE_RSRV_INV_STATUS_UPDATED = SN_USER + '/STORE_RSRV_INV_STATUS_UPDATED' \ No newline at end of file +export const USER_STORE_RSRV_INV_STATUS_UPDATED = SN_USER + '/STORE_RSRV_INV_STATUS_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 d354981d2..f9834596c 100644 --- a/src/store/modules/user/mutations.ts +++ b/src/store/modules/user/mutations.ts @@ -23,6 +23,10 @@ const mutations: MutationTree = { }, [types.USER_CURRENT_ECOM_STORE_UPDATED] (state, payload) { state.currentEComStore = 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/catalog-product-details.vue b/src/views/catalog-product-details.vue index 3a265dd42..363b7ad55 100644 --- a/src/views/catalog-product-details.vue +++ b/src/views/catalog-product-details.vue @@ -12,7 +12,7 @@
- +
@@ -397,7 +397,7 @@ import { shirtOutline } from "ionicons/icons"; import { useStore } from "@/store"; -import { ShopifyImg } from "@hotwax/dxp-components"; +import { DxpShopifyImg } from "@hotwax/dxp-components"; import { mapGetters } from "vuex"; import { showToast, getFeature, hasError } from "@/utils"; import { translate } from "@/i18n"; @@ -416,7 +416,7 @@ import { Actions, hasPermission } from '@/authorization' export default defineComponent({ name: "catalog-product-details", components: { - ShopifyImg, + DxpShopifyImg, IonButtons, IonBackButton, IonCard, diff --git a/src/views/catalog.vue b/src/views/catalog.vue index be9f6e9c7..fa00d4538 100644 --- a/src/views/catalog.vue +++ b/src/views/catalog.vue @@ -49,7 +49,7 @@
- +
{{ product.parentProductName }}
@@ -109,7 +109,7 @@ import { import { defineComponent } from 'vue'; import { useRouter } from "vue-router"; import { useStore } from "@/store"; -import { ShopifyImg } from '@hotwax/dxp-components'; +import { DxpShopifyImg } from '@hotwax/dxp-components'; import { mapGetters } from 'vuex'; import { DateTime } from 'luxon'; import { JobService } from '@/services/JobService'; @@ -118,7 +118,7 @@ import { hasError } from '@/utils'; export default defineComponent({ name: 'Catalog', components: { - ShopifyImg, + DxpShopifyImg, IonButtons, IonChip, IonCard, diff --git a/src/views/orders.vue b/src/views/orders.vue index 4ca5f023c..1ddc6b307 100644 --- a/src/views/orders.vue +++ b/src/views/orders.vue @@ -117,7 +117,7 @@ - +

{{ item.parentProductName ? item.parentProductName :item.productName }}

@@ -222,7 +222,7 @@ import { useStore } from "@/store"; import { mapGetters } from "vuex"; import { showToast } from '@/utils' import { Plugins } from '@capacitor/core'; -import { ShopifyImg } from "@hotwax/dxp-components"; +import { DxpShopifyImg } from "@hotwax/dxp-components"; import emitter from "@/event-bus"; const { Clipboard } = Plugins; @@ -255,7 +255,7 @@ export default defineComponent({ IonToolbar, IonInfiniteScroll, IonInfiniteScrollContent, - ShopifyImg + DxpShopifyImg }, data() { return { diff --git a/src/views/product-details.vue b/src/views/product-details.vue index e37f49650..471f13f67 100644 --- a/src/views/product-details.vue +++ b/src/views/product-details.vue @@ -21,7 +21,7 @@
- +
@@ -124,7 +124,7 @@
- +

{{ getProduct(item.groupValue).productName }}

@@ -213,7 +213,7 @@ import BackgroundJobModal from "./background-job-modal.vue"; import { useStore } from "@/store"; import { mapGetters } from "vuex"; import { ProductService } from '@/services/ProductService' -import { ShopifyImg } from "@hotwax/dxp-components"; +import { DxpShopifyImg } from "@hotwax/dxp-components"; import { sizeIndex } from "@/apparel-sorter" import { DateTime } from 'luxon'; import emitter from "@/event-bus"; @@ -245,7 +245,7 @@ export default defineComponent({ IonTitle, IonToggle, IonToolbar, - ShopifyImg + DxpShopifyImg }, beforeMount () { // TODO Handle if product id is invalid diff --git a/src/views/products.vue b/src/views/products.vue index d45fb7013..22636b5c1 100644 --- a/src/views/products.vue +++ b/src/views/products.vue @@ -29,7 +29,7 @@
- +

{{ getProduct(product.groupValue).productName}}

@@ -72,7 +72,7 @@ import { useRouter } from "vue-router"; import BackgroundJobModal from "./background-job-modal.vue"; import { useStore } from "@/store"; import { mapGetters } from "vuex"; -import { ShopifyImg } from "@hotwax/dxp-components"; +import { DxpShopifyImg } from "@hotwax/dxp-components"; export default defineComponent({ name: "settings", @@ -93,7 +93,7 @@ export default defineComponent({ IonTitle, IonSearchbar, IonToolbar, - ShopifyImg + DxpShopifyImg }, data() { return { diff --git a/src/views/settings.vue b/src/views/settings.vue index d46d39cd4..900e1ea51 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -38,7 +38,7 @@

{{ $t('OMS') }}

- + @@ -62,13 +62,7 @@

-
-

- {{ $t('App') }} -

{{ "Version: " + appVersion }}

-

-

{{ "Built: " + getDateTime(appInfo.builtTime) }}

-
+
diff --git a/tsconfig.json b/tsconfig.json index e621cbc36..f14d2aa90 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "jsx": "preserve", "importHelpers": true, "moduleResolution": "node", + "resolveJsonModule": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, From 9dcf3585ad0640c4cfb41172354a556fea0eb136 Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Mon, 11 Mar 2024 19:39:52 +0530 Subject: [PATCH 6/8] Improved: code by removing unused code --- src/views/settings.vue | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/views/settings.vue b/src/views/settings.vue index 900e1ea51..e5582de2c 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -146,14 +146,10 @@ export default defineComponent({ }, data() { return { - baseURL: process.env.VUE_APP_BASE_URL, - appInfo: (process.env.VUE_APP_VERSION_INFO ? JSON.parse(process.env.VUE_APP_VERSION_INFO) : {}) as any, - appVersion: "" + baseURL: process.env.VUE_APP_BASE_URL } }, - mounted() { - this.appVersion = this.appInfo.branch ? (this.appInfo.branch + "-" + this.appInfo.revision) : this.appInfo.tag; - }, + computed: { ...mapGetters({ userProfile: 'user/getUserProfile', @@ -185,9 +181,6 @@ export default defineComponent({ 'eComStore': this.userProfile.stores.find((store: any) => store.productStoreId == event.detail.value) }) } - }, - getDateTime(time: any) { - return DateTime.fromMillis(time).toLocaleString(DateTime.DATETIME_MED); } } }); From 4c10fa522ae0616a033304d747e9d97e0c314622 Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Tue, 12 Mar 2024 12:48:18 +0530 Subject: [PATCH 7/8] Improved: code by removing unused imports --- src/views/settings.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/settings.vue b/src/views/settings.vue index e5582de2c..34621bb1d 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -114,7 +114,6 @@ import { defineComponent } from "vue"; import { mapGetters } from 'vuex' import TimeZoneModal from '@/views/timezone-modal.vue' import Image from '@/components/Image.vue'; -import { DateTime } from 'luxon'; export default defineComponent({ name: "settings", From 89f520fb7335cc8e23d165cf69f101b130d5ef9f Mon Sep 17 00:00:00 2001 From: Ritika-Patel08 Date: Tue, 12 Mar 2024 19:30:35 +0530 Subject: [PATCH 8/8] Improved: code by removing unnecessary line --- src/views/settings.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/settings.vue b/src/views/settings.vue index 34621bb1d..42e017740 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -148,7 +148,6 @@ export default defineComponent({ baseURL: process.env.VUE_APP_BASE_URL } }, - computed: { ...mapGetters({ userProfile: 'user/getUserProfile',