diff --git a/package-lock.json b/package-lock.json index def052f4..17e5c127 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 405390dc..072a2ca4 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 4b26359c..934fa5a0 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 00000000..83e39f0d --- /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 c445c46d..f799e2f2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,6 +33,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, { @@ -52,7 +53,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 46732bdc..4fea94b0 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 90facc64..4de04343 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 bb418f39..a8455da8 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 2f3d9d1b..7b32b1b3 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 853e740b..7100ad58 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 d354981d..f9834596 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 3a265dd4..363b7ad5 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 be9f6e9c..fa00d453 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 4ca5f023..1ddc6b30 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 e37f4965..471f13f6 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 d45fb701..22636b5c 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 d46d39cd..42e01774 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) }}

-
+
@@ -120,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", @@ -152,14 +145,9 @@ 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', @@ -191,9 +179,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); } } }); diff --git a/tsconfig.json b/tsconfig.json index e621cbc3..f14d2aa9 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,