diff --git a/src/locales/en.json b/src/locales/en.json index 8d36c657..59527b3c 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -70,7 +70,6 @@ "Pending: items": "Pending: {itemsCount} items", "Please provide a valid valid barcode identifier.": "Please provide a valid valid barcode identifier.", "primary identifier": "primary identifier", - "Primary identifier": "Primary identifier", "Primary Product Identifier": "Primary Product Identifier", "Primary": "Primary", "Proceed": "Proceed", @@ -104,7 +103,6 @@ "Scanned item is not present within the shipment:": "Scanned item is not present within the shipment: {itemName}", "Scanned successfully.": "Scanned {itemName} successfully.", "secondary identifier": "secondary identifier", - "Secondary identifier": "Secondary identifier", "Search": "Search", "Search purchase orders": "Search purchase orders", "Search returns": "Search returns", @@ -140,8 +138,8 @@ "Timezone": "Timezone", "Time zone updated successfully": "Time zone updated successfully", "To close the purchase order, select all.": "To close the purchase order, select all.", - "Unable to update barcode identification preference.": "Unable to update barcode identification preference.", - "Unable to update force scan preference.": "Unable to update force scan preference.", + "Unable to update barcode identification preference since no product store config found.": "Unable to update barcode identification preference since no product store config found.", + "Unable to update force scan preference since no product store config found.": "Unable to update force scan preference since no product store config found.", "Unable to update product identifier preference": "Unable to update product identifier preference", "Username": "Username", "Version: ": "Version: {appVersion}", diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 9d56b736..959b9fdf 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -42,7 +42,7 @@ const actions: ActionTree = { return resp; }, async updateProductCount({ commit, state }, payload ) { - const barcodeIdentifier = store.getters['util/getBarcodeIdentificationValue']; + const barcodeIdentifier = store.getters['util/getBarcodeIdentificationPref']; const getProduct = store.getters['product/getProduct']; const item = state.current.items.find((item: any) => { diff --git a/src/store/modules/return/actions.ts b/src/store/modules/return/actions.ts index 4bd19b35..6de6df99 100644 --- a/src/store/modules/return/actions.ts +++ b/src/store/modules/return/actions.ts @@ -34,7 +34,7 @@ const actions: ActionTree = { return resp; }, async updateReturnProductCount ({ commit, state }, payload) { - const barcodeIdentifier = store.getters['util/getBarcodeIdentificationValue']; + const barcodeIdentifier = store.getters['util/getBarcodeIdentificationPref']; const getProduct = store.getters['product/getProduct']; const item = state.current.items.find((item: any) => { diff --git a/src/store/modules/shipment/actions.ts b/src/store/modules/shipment/actions.ts index 7eb7f5ed..9a02c4a1 100644 --- a/src/store/modules/shipment/actions.ts +++ b/src/store/modules/shipment/actions.ts @@ -44,7 +44,7 @@ const actions: ActionTree = { }, async updateShipmentProductCount ({ commit, state }, payload) { - const barcodeIdentifier = store.getters['util/getBarcodeIdentificationValue']; + const barcodeIdentifier = store.getters['util/getBarcodeIdentificationPref']; const getProduct = store.getters['product/getProduct']; const item = state.current.items.find((item: any) => { diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 3d62a293..e252f7f6 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -180,6 +180,8 @@ const actions: ActionTree = { commit(types.USER_CURRENT_ECOM_STORE_UPDATED, eComStore); commit(types.USER_CURRENT_FACILITY_UPDATED, payload.facility); await dispatch('getFacilityLocations', payload.facility.facilityId) + eComStore?.productStoreId ? this.dispatch('util/getForceScanSetting', eComStore.productStoreId) : this.dispatch('util/updateForceScanStatus', false) + eComStore?.productStoreId ? this.dispatch('util/getBarcodeIdentificationPref', eComStore.productStoreId) : this.dispatch('util/updateBarcodeIdentificationPref', "internalName") }, /** diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index 1f5ed247..95903548 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -117,7 +117,7 @@ const actions: ActionTree = { // when selecting none as ecom store, not updating the pref as it's not possible to save pref with empty productStoreId if(!eComStoreId) { - showToast(translate("Unable to update force scan preference.")) + showToast(translate("Unable to update force scan preference since no product store config found.")) commit(types.UTIL_FORCE_SCAN_STATUS_UPDATED, prefValue) return; } @@ -191,7 +191,7 @@ const actions: ActionTree = { } } catch(err) { console.error(err) - commit(types.UTIL_BARCODE_IDENTIFICATION_PREF_UPDATED, "primaryId") + commit(types.UTIL_BARCODE_IDENTIFICATION_PREF_UPDATED, "internalName") } }, @@ -218,7 +218,7 @@ const actions: ActionTree = { fromDate, "productStoreId": ecomStore.productStoreId, "settingTypeEnumId": "BARCODE_IDEN_PREF", - "settingValue": "primaryId" + "settingValue": "internalName" } await UtilService.createBarcodeIdentificationPref(params) as any @@ -228,7 +228,7 @@ const actions: ActionTree = { // not checking for resp success and fail case as every time we need to update the state with the // default value when creating a scan setting - commit(types.UTIL_BARCODE_IDENTIFICATION_PREF_UPDATED, "primaryId") + commit(types.UTIL_BARCODE_IDENTIFICATION_PREF_UPDATED, "internalName") return fromDate; }, @@ -238,7 +238,7 @@ const actions: ActionTree = { // when selecting none as ecom store, not updating the pref as it's not possible to save pref with empty productStoreId if(!eComStoreId) { - showToast(translate("Unable to update barcode identification preference.")) + showToast(translate("Unable to update barcode identification preference since no product store config found.")) commit(types.UTIL_BARCODE_IDENTIFICATION_PREF_UPDATED, prefValue) return; } diff --git a/src/store/modules/util/getters.ts b/src/store/modules/util/getters.ts index 39723a4e..1d155de2 100644 --- a/src/store/modules/util/getters.ts +++ b/src/store/modules/util/getters.ts @@ -1,10 +1,6 @@ import { GetterTree } from 'vuex' import RootState from '@/store/RootState' import UtilState from './UtilState'; -import { computed } from 'vue'; -import { useProductIdentificationStore } from '@hotwax/dxp-components'; - - const getters: GetterTree = { @@ -16,11 +12,6 @@ const getters: GetterTree = { }, getBarcodeIdentificationPref(state) { return state.barcodeIdentificationPref - }, - getBarcodeIdentificationValue(state, getters, rootState, rootGetters) { - const productIdentificationStore = useProductIdentificationStore(); - const productIdentificationPref = computed(() => productIdentificationStore.getProductIdentificationPref) as any; - return productIdentificationPref.value[state.barcodeIdentificationPref] } } export default getters; \ No newline at end of file diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 87dbb0c5..3713c611 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -74,8 +74,7 @@ - {{ translate("Primary identifier") }} - {{ translate("Secondary identifier") }} + {{ identification }} @@ -86,14 +85,14 @@