From d378b59dc7e7a3376dc36dfcfa5902b2af163c3e Mon Sep 17 00:00:00 2001 From: Ridwa Date: Tue, 23 Jul 2024 17:09:15 +0530 Subject: [PATCH] Removed: removed productIdentifiers getter , mutation --- src/App.vue | 19 ------------------- src/components/ClosePurchaseOrderModal.vue | 4 ++-- src/store/modules/util/UtilState.ts | 1 - src/store/modules/util/actions.ts | 3 --- src/store/modules/util/getters.ts | 3 --- src/store/modules/util/index.ts | 1 - src/store/modules/util/mutations.ts | 3 --- src/views/AddProductToPOModal.vue | 2 +- src/views/Settings.vue | 1 - src/views/ShipmentDetails.vue | 2 +- 10 files changed, 4 insertions(+), 35 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9a16e2a4..e960eb00 100644 --- a/src/App.vue +++ b/src/App.vue @@ -36,7 +36,6 @@ export default defineComponent({ computed: { ...mapGetters({ currentEComStore: 'user/getCurrentEComStore', - productIdentifications: 'util/getProductIdentifications', userProfile: 'user/getUserProfile', userToken: 'user/getUserToken', instanceUrl: 'user/getInstanceUrl' @@ -100,24 +99,6 @@ export default defineComponent({ emitter.on('presentLoader', this.presentLoader); emitter.on('dismissLoader', this.dismissLoader); }, - async mounted() { - if(this.productIdentifications.length <= 0) { - // TODO: fetch product identifications from enumeration instead of storing it in env - this.store.dispatch('util/setProductIdentifications', process.env.VUE_APP_PRDT_IDENT ? JSON.parse(process.env.VUE_APP_PRDT_IDENT) : []) - } - - if(this.userProfile) { - this.store.dispatch('user/getProductIdentificationPref', this.currentEComStore.productStoreId); - } - // Handles case when user resumes or reloads the app - // Luxon timezzone should be set with the user's selected timezone - if (this.userProfile && this.userProfile.userTimeZone) { - Settings.defaultZone = this.userProfile.userTimeZone; - } - - await useProductIdentificationStore().getIdentificationPref(this.currentEComStore?.productStoreId) - .catch((error) => console.log(error)) - }, unmounted() { emitter.off('presentLoader', this.presentLoader); emitter.off('dismissLoader', this.dismissLoader); diff --git a/src/components/ClosePurchaseOrderModal.vue b/src/components/ClosePurchaseOrderModal.vue index 82a5a98d..1a0f68db 100644 --- a/src/components/ClosePurchaseOrderModal.vue +++ b/src/components/ClosePurchaseOrderModal.vue @@ -23,8 +23,8 @@ -

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

-

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId))}}

+

{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}

+

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}

diff --git a/src/store/modules/util/UtilState.ts b/src/store/modules/util/UtilState.ts index 3966daf5..23cb54c5 100644 --- a/src/store/modules/util/UtilState.ts +++ b/src/store/modules/util/UtilState.ts @@ -1,6 +1,5 @@ export default interface UtilState { status: any; - productIdentifications: Array; isForceScanEnabled: boolean; barcodeIdentificationPref: any; } \ No newline at end of file diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index 4ab98e13..1f5ed247 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -47,9 +47,6 @@ const actions: ActionTree = { } return cachedStatus; }, - async setProductIdentifications({ commit }, payload) { - commit(types.UTIL_PRODUCT_IDENT_UPDATED, payload) - }, async getForceScanSetting({ commit, dispatch }, eComStoreId) { const payload = { diff --git a/src/store/modules/util/getters.ts b/src/store/modules/util/getters.ts index 2c308a40..2dc66395 100644 --- a/src/store/modules/util/getters.ts +++ b/src/store/modules/util/getters.ts @@ -6,9 +6,6 @@ const getters: GetterTree = { getStatusDesc: (state) => (statusId: string) => { return state.status[statusId] }, - getProductIdentifications: (state) => { - return state.productIdentifications - }, isForceScanEnabled(state) { return state.isForceScanEnabled }, diff --git a/src/store/modules/util/index.ts b/src/store/modules/util/index.ts index 3afbf758..680e6368 100644 --- a/src/store/modules/util/index.ts +++ b/src/store/modules/util/index.ts @@ -9,7 +9,6 @@ const utilModule: Module = { namespaced: true, state: { status: {}, - productIdentifications: [], isForceScanEnabled: false, barcodeIdentificationPref: "" }, diff --git a/src/store/modules/util/mutations.ts b/src/store/modules/util/mutations.ts index f1971c1e..46e4f55a 100644 --- a/src/store/modules/util/mutations.ts +++ b/src/store/modules/util/mutations.ts @@ -6,9 +6,6 @@ const mutations: MutationTree = { [types.UTIL_STATUS_UPDATED](state, payload) { state.status = payload }, - [types.UTIL_PRODUCT_IDENT_UPDATED](state, payload) { - state.productIdentifications = payload - }, [types.UTIL_FORCE_SCAN_STATUS_UPDATED](state, payload) { state.isForceScanEnabled = payload }, diff --git a/src/views/AddProductToPOModal.vue b/src/views/AddProductToPOModal.vue index 7b91a3b7..9af7c17e 100644 --- a/src/views/AddProductToPOModal.vue +++ b/src/views/AddProductToPOModal.vue @@ -20,7 +20,7 @@

{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(product.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(product.productId)) : getProduct(product.productId).productName }}

-

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(product.productId)) }}

+

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(product.productId)) }}

{{ translate("Add to Purchase Order") }} diff --git a/src/views/Settings.vue b/src/views/Settings.vue index f098456f..8d528684 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -132,7 +132,6 @@ export default defineComponent({ userProfile: 'user/getUserProfile', currentFacility: 'user/getCurrentFacility', currentEComStore: 'user/getCurrentEComStore', - productIdentifications: 'util/getProductIdentifications', productIdentificationPref: 'user/getProductIdentificationPref', isForceScanEnabled: 'util/isForceScanEnabled', barcodeIdentificationPref: 'util/getBarcodeIdentificationPref' diff --git a/src/views/ShipmentDetails.vue b/src/views/ShipmentDetails.vue index f66cc1b0..6a583fb2 100644 --- a/src/views/ShipmentDetails.vue +++ b/src/views/ShipmentDetails.vue @@ -40,7 +40,7 @@

{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}

-

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}

+

{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}