diff --git a/package-lock.json b/package-lock.json index 505f0bd01..61f195f8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.1.0", - "@hotwax/dxp-components": "^1.9.1", + "@hotwax/dxp-components": "^1.11.0", "@hotwax/oms-api": "^1.11.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", @@ -2876,9 +2876,9 @@ "license": "Apache-2.0" }, "node_modules/@hotwax/dxp-components": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.9.1.tgz", - "integrity": "sha512-iViIoOqqGFVoBPrFLJWuC6+85QNbI6BP4u05ClYP1uvtFi9lJeA31hlH1vf7lk7HVMnOdkvUFGbelRK+mZ8bGw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.11.0.tgz", + "integrity": "sha512-z9UNzi1veT8Aj8Y1WWAGBGOR+I0s6A58qrsFj+L3LkpxTkq6zGN/JS80tTv29obEeeOfONm6XyLHvNOM6TFKyA==", "dependencies": { "@hotwax/oms-api": "^1.8.1", "@ionic/core": "^6.7.5", @@ -2888,6 +2888,7 @@ "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" @@ -32688,9 +32689,9 @@ "version": "1.1.0" }, "@hotwax/dxp-components": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.9.1.tgz", - "integrity": "sha512-iViIoOqqGFVoBPrFLJWuC6+85QNbI6BP4u05ClYP1uvtFi9lJeA31hlH1vf7lk7HVMnOdkvUFGbelRK+mZ8bGw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.11.0.tgz", + "integrity": "sha512-z9UNzi1veT8Aj8Y1WWAGBGOR+I0s6A58qrsFj+L3LkpxTkq6zGN/JS80tTv29obEeeOfONm6XyLHvNOM6TFKyA==", "requires": { "@hotwax/oms-api": "^1.8.1", "@ionic/core": "^6.7.5", @@ -32700,6 +32701,7 @@ "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" diff --git a/package.json b/package.json index dfd04616e..aa66b36a0 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@casl/ability": "^6.0.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.1.0", - "@hotwax/dxp-components": "^1.9.1", + "@hotwax/dxp-components": "^1.11.0", "@hotwax/oms-api": "^1.11.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", diff --git a/src/locales/en.json b/src/locales/en.json index d43047316..377f77330 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -10,6 +10,7 @@ "Arrived": "Arrived", "Authenticating": "Authenticating", "Assign Pickers": "Assign Pickers", + "Built: ": "Built: {builtDateTime}", "Catalog": "Catalog", "Cancel": "Cancel", "Cancel order before fulfillment": "Cancel order before fulfillment", @@ -186,6 +187,7 @@ "Worn Display": "Worn Display", "This order will be removed from your dashboard. This action cannot be undone.": "This order will be removed from your dashboard.{ space } This action cannot be undone.", "Update notification preferences": "Update notification preferences", + "Version: ": "Version: {appVersion}", "View shipping orders along with pickup orders.": "View shipping orders along with pickup orders.", "You do not have permission to access this page": "You do not have permission to access this page", "Zipcode": "Zipcode" diff --git a/src/locales/es.json b/src/locales/es.json index d51703de0..13b7de85d 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -10,6 +10,7 @@ "Arrived": "Llegó", "Authenticating": "Authenticating", "Assign Pickers": "Asignar recolectores", + "Built: ": "Built: {builtDateTime}", "Catalog": "Catálogo", "Cancel": "Cancelar", "Cancel order before fulfillment": "Cancelar pedido antes del cumplimiento", @@ -184,6 +185,7 @@ "Worn Display": "Pantalla desgastada", "This order will be removed from your dashboard. This action cannot be undone.": "Este pedido será eliminado de tu panel de control.{ space } Esta acción no se puede deshacer.", "Update notification preferences": "Update notification preferences", + "Version: ": "Version: {appVersion}", "View shipping orders along with pickup orders.": "Ver órdenes de envío junto con órdenes de recogida.", "You do not have permission to access this page": "No tienes permiso para acceder a esta página", "Zipcode": "Código postal", diff --git a/src/locales/ja.json b/src/locales/ja.json index f43807d6f..556397c7c 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -10,6 +10,7 @@ "Arrived": "到着", "Authenticating": "Authenticating", "Assign Pickers": "受け取り人の割当", + "Built: ": "Built: {builtDateTime}", "Catalog": "カタログ", "Cancel": "キャンセル", "Cancel order before fulfillment": "注文のキャンセル", @@ -183,6 +184,7 @@ "Worn Display": "すり切れたディスプレイ", "This order will be removed from your dashboard. This action cannot be undone.": "この注文はダッシュボードから削除されます。{ space } この操作は元に戻せません。", "Update notification preferences": "Update notification preferences", + "Version: ": "Version: {appVersion}", "View shipping orders along with pickup orders.": "店舗受取の注文と一緒に配送注文を表示します", "You do not have permission to access this page": "このページにアクセスする権限がありません", "Zipcode": "郵便番号" diff --git a/src/router/index.ts b/src/router/index.ts index 259d6e994..3a8531676 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -13,7 +13,7 @@ import { showToast } from '@/utils' import { translate } from '@hotwax/dxp-components' import 'vue-router' -import { Login, useAuthStore } from '@hotwax/dxp-components'; +import { DxpLogin, useAuthStore } from '@hotwax/dxp-components'; import { loader } from '@/utils/user'; // Defining types for the meta values @@ -83,7 +83,7 @@ const routes: Array = [ { path: '/login', name: 'Login', - component: Login, + component: DxpLogin, beforeEnter: loginGuard }, { diff --git a/src/store/modules/user/UserState.ts b/src/store/modules/user/UserState.ts index 5749dc70a..66983d542 100644 --- a/src/store/modules/user/UserState.ts +++ b/src/store/modules/user/UserState.ts @@ -6,7 +6,8 @@ export default interface UserState { preference: any; permissions: any; currentEComStore: any; - partialOrderRejectionConfig: any + partialOrderRejectionConfig: any; + pwaState: any; notifications: any; notificationPrefs: any; firebaseDeviceId: string; diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index a04520503..69bc7abb7 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -211,6 +211,10 @@ const actions: ActionTree = { } }, + updatePwaState({commit}, payload) { + commit(types.USER_PWA_STATE_UPDATED, payload); + }, + async getPartialOrderRejectionConfig ({ commit }) { let config = {}; const params = { diff --git a/src/store/modules/user/getters.ts b/src/store/modules/user/getters.ts index de9f7fe56..49caa8d98 100644 --- a/src/store/modules/user/getters.ts +++ b/src/store/modules/user/getters.ts @@ -27,6 +27,9 @@ const getters: GetterTree = { const baseUrl = process.env.VUE_APP_BASE_URL; return baseUrl ? baseUrl : state.instanceUrl; }, + getPwaState (state) { + return state.pwaState; + }, showShippingOrders (state) { return state.preference.showShippingOrders; }, diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index e9a2699c2..6ab8b93ee 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -17,6 +17,10 @@ const userModule: Module = { showPackingSlip: false, configurePicker: false }, + pwaState: { + updateExists: false, + registration: null, + }, currentEComStore: {}, partialOrderRejectionConfig: {}, permissions: [], diff --git a/src/store/modules/user/mutation-types.ts b/src/store/modules/user/mutation-types.ts index fe4c0b24b..2a4f6b25b 100644 --- a/src/store/modules/user/mutation-types.ts +++ b/src/store/modules/user/mutation-types.ts @@ -8,6 +8,7 @@ export const USER_PREFERENCE_UPDATED = SN_USER + '/PREFERENCE_UPDATED' export const USER_CURRENT_ECOM_STORE_UPDATED = SN_USER + '/CURRENT_ECOM_STORE_UPDATED' export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED' export const USER_PARTIAL_ORDER_REJECTION_CONFIG_UPDATED = SN_USER + '/PARTIAL_ORDER_REJECTION_CONFIG_UPDATED' +export const USER_PWA_STATE_UPDATED = SN_USER + '/PWA_STATE_UPDATED' export const USER_NOTIFICATIONS_UPDATED = SN_USER + '/NOTIFICATIONS_UPDATED' export const USER_NOTIFICATIONS_PREFERENCES_UPDATED = SN_USER + '/NOTIFICATIONS_PREFERENCES_UPDATED' export const USER_FIREBASE_DEVICEID_UPDATED = SN_USER + '/FIREBASE_DEVICEID_UPDATED' diff --git a/src/store/modules/user/mutations.ts b/src/store/modules/user/mutations.ts index f3de9e8f9..9f1670be4 100644 --- a/src/store/modules/user/mutations.ts +++ b/src/store/modules/user/mutations.ts @@ -33,6 +33,10 @@ const mutations: MutationTree = { [types.USER_PARTIAL_ORDER_REJECTION_CONFIG_UPDATED] (state, payload) { state.partialOrderRejectionConfig = payload }, + [types.USER_PWA_STATE_UPDATED] (state, payload) { + state.pwaState.registration = payload.registration; + state.pwaState.updateExists = payload.updateExists; + }, [types.USER_NOTIFICATIONS_UPDATED] (state, payload) { state.notifications = payload }, diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 83e8b0a0b..ea426cf62 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -108,13 +108,7 @@
-
-

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

{{ "Version: " + appVersion }}

-

-

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

-
+
@@ -239,7 +233,6 @@ import { mapGetters, useStore } from 'vuex'; import { useRouter } from 'vue-router'; import TimeZoneModal from './TimezoneModal.vue'; import Image from '@/components/Image.vue'; -import { DateTime } from 'luxon'; import { UserService } from '@/services/UserService' import { showToast } from '@/utils'; import { hasError, removeClientRegistrationToken, subscribeTopic, unsubscribeTopic } from '@/adapter' @@ -275,8 +268,6 @@ 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: "", rerouteFulfillmentConfig: { // TODO Remove fromDate and directly store values making it loosely coupled with OMS allowDeliveryMethodUpdate: {}, @@ -302,9 +293,6 @@ export default defineComponent({ notificationPrefs: 'user/getNotificationPrefs' }) }, - mounted() { - this.appVersion = this.appInfo.branch ? (this.appInfo.branch + "-" + this.appInfo.revision) : this.appInfo.tag; - }, async ionViewWillEnter() { // Only fetch configuration when environment mapping exists if (Object.keys(this.rerouteFulfillmentConfigMapping).length > 0) { @@ -366,9 +354,6 @@ export default defineComponent({ setConfigurePickerPreference (ev: any){ this.store.dispatch('user/setUserPreference', { configurePicker: ev.detail.checked }) }, - getDateTime(time: any) { - return DateTime.fromMillis(time).toLocaleString(DateTime.DATETIME_MED); - }, async getAvailableShipmentMethods () { this.availableShipmentMethods = []; try {