From b7fa8d27d5f9e3cee4b477edd385e41f0e9b69b7 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 7 Mar 2024 18:27:39 +0530 Subject: [PATCH] Implemented: app version component from dxp-components (#274) --- package-lock.json | 86 +++++++++++++--------- package.json | 2 +- src/components/ClosePurchaseOrderModal.vue | 6 +- src/components/ImageModal.vue | 6 +- src/locales/en.json | 2 + 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/AddProductModal.vue | 6 +- src/views/AddProductToPOModal.vue | 6 +- src/views/PurchaseOrderDetail.vue | 8 +- src/views/ReceivingHistoryModal.vue | 6 +- src/views/ReturnDetails.vue | 6 +- src/views/Settings.vue | 12 +-- src/views/ShipmentDetails.vue | 6 +- 18 files changed, 101 insertions(+), 70 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e07a2d0..0109834c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.1.0", - "@hotwax/dxp-components": "^1.11.0", + "@hotwax/dxp-components": "^1.12.1", "@hotwax/oms-api": "^1.10.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", @@ -2797,24 +2797,66 @@ "integrity": "sha512-3Vec4pGWJVs6vDbL/pO5hYqoF1zn2w8liXuleqDJ7waI2R5JuF2eaJmYcUQETnk/DZIg47bDdyOSxihQltB2Ow==" }, "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", @@ -3737,33 +3779,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", @@ -14777,6 +14792,7 @@ "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" } diff --git a/package.json b/package.json index 76a1e08b..b81bddc3 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.1.0", - "@hotwax/dxp-components": "^1.11.0", + "@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/components/ClosePurchaseOrderModal.vue b/src/components/ClosePurchaseOrderModal.vue index f54fe9b8..6f9e6fe1 100644 --- a/src/components/ClosePurchaseOrderModal.vue +++ b/src/components/ClosePurchaseOrderModal.vue @@ -20,7 +20,7 @@ - +

{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}

@@ -66,7 +66,7 @@ import { defineComponent } from 'vue'; import { mapGetters, useStore } from 'vuex' import { OrderService } from "@/services/OrderService"; import { productHelpers } from '@/utils'; -import { ShopifyImg, translate } from '@hotwax/dxp-components'; +import { DxpShopifyImg, translate } from '@hotwax/dxp-components'; import { useRouter } from 'vue-router'; export default defineComponent({ @@ -87,7 +87,7 @@ export default defineComponent({ IonTitle, IonThumbnail, IonToolbar, - ShopifyImg + DxpShopifyImg }, computed: { ...mapGetters({ diff --git a/src/components/ImageModal.vue b/src/components/ImageModal.vue index 95c78d14..0f404de0 100644 --- a/src/components/ImageModal.vue +++ b/src/components/ImageModal.vue @@ -11,7 +11,7 @@ - + @@ -29,7 +29,7 @@ import { } from '@ionic/vue'; import { defineComponent } from 'vue'; import { closeOutline } from 'ionicons/icons'; -import { ShopifyImg } from '@hotwax/dxp-components'; +import { DxpShopifyImg } from '@hotwax/dxp-components'; export default defineComponent({ name: 'ImageModal', @@ -41,7 +41,7 @@ export default defineComponent({ IonIcon, IonTitle, IonToolbar, - ShopifyImg + DxpShopifyImg }, props: ["imageUrl", "productName"], methods: { diff --git a/src/locales/en.json b/src/locales/en.json index a28f9237..75e5fc16 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -6,6 +6,7 @@ "Authenticating": "Authenticating", "Are you sure you have received the purchase order for the selected items? Once closed, the shipments for the selected items wont be available for receiving later.": "Are you sure you have received the purchase order for the selected items? { space } Once closed, the shipments for the selected items won't be available for receiving later.", "Arrival date": "Arrival date", + "Built: ": "Built: {builtDateTime}", "Cancel": "Cancel", "Change": "Change", "Choosing a product identifier allows you to view products with your preferred identifiers.": "Choosing a product identifier allows you to view products with your preferred identifiers.", @@ -123,6 +124,7 @@ "To close the purchase order, select all.": "To close the purchase order, select all.", "Unable to update product identifier preference": "Unable to update product identifier preference", "Username": "Username", + "Version: ": "Version: {appVersion}", "You do not have permission to access this page": "You do not have permission to access this page", "ZeroQuantity": "ZeroQuantity" } \ No newline at end of file diff --git a/src/store/modules/user/UserState.ts b/src/store/modules/user/UserState.ts index f99eaa68..05dae63f 100644 --- a/src/store/modules/user/UserState.ts +++ b/src/store/modules/user/UserState.ts @@ -7,4 +7,5 @@ export default interface UserState { facilityLocationsByFacilityId: any; productIdentificationPref: any; permissions: any; + pwaState: any; } \ No newline at end of file diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 5320472e..6e4c1dfd 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -348,6 +348,10 @@ const actions: ActionTree = { } catch(err) { console.error(err) } + }, + + updatePwaState({ commit }, payload) { + commit(types.USER_PWA_STATE_UPDATED, payload); } } diff --git a/src/store/modules/user/getters.ts b/src/store/modules/user/getters.ts index cab45d09..9ced635f 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -38,6 +38,9 @@ const getters: GetterTree = { }, getProductIdentificationPref: (state) => { return state.productIdentificationPref; + }, + 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 bb2c8058..b2ac1a25 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -18,6 +18,10 @@ const userModule: Module = { productIdentificationPref: { primaryId: 'productId', secondaryId: '' + }, + pwaState: { + updateExists: false, + registration: null, } }, getters, diff --git a/src/store/modules/user/mutation-types.ts b/src/store/modules/user/mutation-types.ts index 765ea606..34385352 100644 --- a/src/store/modules/user/mutation-types.ts +++ b/src/store/modules/user/mutation-types.ts @@ -7,4 +7,5 @@ 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_FACILITY_LOCATIONS_BY_FACILITY_ID = SN_USER + '/FACILITY_LOCATIONS_BY_FACILITY_ID' export const USER_PREF_PRODUCT_IDENT_CHANGED = SN_USER + '/PREF_PRODUCT_IDENT_CHANGED' -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 21f80965..206a09ef 100644 --- a/src/store/modules/user/mutations.ts +++ b/src/store/modules/user/mutations.ts @@ -33,6 +33,10 @@ 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/AddProductModal.vue b/src/views/AddProductModal.vue index 2145374c..c489d52c 100644 --- a/src/views/AddProductModal.vue +++ b/src/views/AddProductModal.vue @@ -16,7 +16,7 @@ - + @@ -61,7 +61,7 @@ import { defineComponent } from 'vue'; import { closeOutline, checkmarkCircle } from 'ionicons/icons'; import { mapGetters } from 'vuex' import { useStore } from "@/store"; -import { ShopifyImg, translate } from '@hotwax/dxp-components'; +import { DxpShopifyImg, translate } from '@hotwax/dxp-components'; import { showToast } from '@/utils' export default defineComponent({ @@ -81,7 +81,7 @@ export default defineComponent({ IonThumbnail, IonTitle, IonToolbar, - ShopifyImg + DxpShopifyImg }, data() { return { diff --git a/src/views/AddProductToPOModal.vue b/src/views/AddProductToPOModal.vue index a55cd418..bc69a42c 100644 --- a/src/views/AddProductToPOModal.vue +++ b/src/views/AddProductToPOModal.vue @@ -15,7 +15,7 @@ - + @@ -60,7 +60,7 @@ import { defineComponent } from 'vue'; import { closeOutline, checkmarkCircle } from 'ionicons/icons'; import { mapGetters } from 'vuex' import { useStore } from "@/store"; -import { ShopifyImg, translate } from '@hotwax/dxp-components'; +import { DxpShopifyImg, translate } from '@hotwax/dxp-components'; import { showToast } from '@/utils' export default defineComponent({ @@ -80,7 +80,7 @@ export default defineComponent({ IonThumbnail, IonTitle, IonToolbar, - ShopifyImg + DxpShopifyImg }, data() { return { diff --git a/src/views/PurchaseOrderDetail.vue b/src/views/PurchaseOrderDetail.vue index 1af48db2..4f3e5038 100644 --- a/src/views/PurchaseOrderDetail.vue +++ b/src/views/PurchaseOrderDetail.vue @@ -56,7 +56,7 @@
- +

{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}

@@ -119,7 +119,7 @@
- +

{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}

@@ -184,7 +184,7 @@ import { import { defineComponent } from 'vue'; import { addOutline, cameraOutline, checkmarkDone, copyOutline, eyeOffOutline, eyeOutline, locationOutline, saveOutline, timeOutline } from 'ionicons/icons'; import ReceivingHistoryModal from '@/views/ReceivingHistoryModal.vue' -import { ShopifyImg, translate } from '@hotwax/dxp-components'; +import { DxpShopifyImg, translate } from '@hotwax/dxp-components'; import { useStore, mapGetters } from 'vuex'; import { useRouter } from 'vue-router'; import Scanner from "@/components/Scanner.vue" @@ -198,7 +198,7 @@ import { Actions, hasPermission } from '@/authorization' export default defineComponent({ name: "PurchaseOrderDetails", components: { - ShopifyImg, + DxpShopifyImg, IonBackButton, IonBadge, IonButton, diff --git a/src/views/ReceivingHistoryModal.vue b/src/views/ReceivingHistoryModal.vue index 8feb89ee..f02c7f6e 100644 --- a/src/views/ReceivingHistoryModal.vue +++ b/src/views/ReceivingHistoryModal.vue @@ -13,7 +13,7 @@ - + {{ item.receiversFullName }} @@ -52,14 +52,14 @@ import { } from '@ionic/vue'; import { defineComponent } from 'vue'; import { closeOutline } from 'ionicons/icons'; -import { ShopifyImg, translate } from '@hotwax/dxp-components'; +import { DxpShopifyImg, translate } from '@hotwax/dxp-components'; import { mapGetters, useStore } from "vuex"; import { DateTime } from 'luxon'; export default defineComponent({ name: "ReceivingHistoryModal", components: { - ShopifyImg, + DxpShopifyImg, IonButton, IonButtons, IonContent, diff --git a/src/views/ReturnDetails.vue b/src/views/ReturnDetails.vue index 3cf30635..c6f71399 100644 --- a/src/views/ReturnDetails.vue +++ b/src/views/ReturnDetails.vue @@ -39,7 +39,7 @@
- +

{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}

@@ -112,7 +112,7 @@ import { defineComponent } from 'vue'; import { checkmarkDone, barcodeOutline, locationOutline } from 'ionicons/icons'; import { mapGetters, useStore } from "vuex"; import AddProductModal from '@/views/AddProductModal.vue' -import { ShopifyImg, translate } from '@hotwax/dxp-components'; +import { DxpShopifyImg, translate } from '@hotwax/dxp-components'; import { useRouter } from 'vue-router'; import Scanner from "@/components/Scanner.vue"; import ImageModal from '@/components/ImageModal.vue'; @@ -141,7 +141,7 @@ export default defineComponent({ IonThumbnail, IonTitle, IonToolbar, - ShopifyImg, + DxpShopifyImg, }, props: ["shipment"], data() { diff --git a/src/views/Settings.vue b/src/views/Settings.vue index b4018c98..12cc3b2d 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -36,7 +36,7 @@

{{ translate('OMS') }}

- + @@ -57,13 +57,8 @@

-
-

- {{ translate('App') }} -

{{ "Version: " + appVersion }}

-

-

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

-
+ +
@@ -120,6 +115,7 @@ import { DateTime } from 'luxon'; import TimeZoneModal from '@/views/TimezoneModal.vue'; import { Actions, hasPermission } from '@/authorization'; import { translate } from "@hotwax/dxp-components" +import { DxpAppVersionInfo } from '@hotwax/dxp-components/lib/components'; export default defineComponent({ name: 'Settings', diff --git a/src/views/ShipmentDetails.vue b/src/views/ShipmentDetails.vue index 24a0aa2d..6ec3a38c 100644 --- a/src/views/ShipmentDetails.vue +++ b/src/views/ShipmentDetails.vue @@ -37,7 +37,7 @@
- +

{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}

@@ -118,7 +118,7 @@ import { defineComponent } from 'vue'; import { add, checkmarkDone, cameraOutline, locationOutline } from 'ionicons/icons'; import { mapGetters, useStore } from "vuex"; import AddProductModal from '@/views/AddProductModal.vue' -import { ShopifyImg, translate } from '@hotwax/dxp-components'; +import { DxpShopifyImg, translate } from '@hotwax/dxp-components'; import { useRouter } from 'vue-router'; import Scanner from "@/components/Scanner.vue"; import LocationPopover from '@/components/LocationPopover.vue' @@ -147,7 +147,7 @@ export default defineComponent({ IonThumbnail, IonTitle, IonToolbar, - ShopifyImg, + DxpShopifyImg, IonChip, LocationPopover },