Skip to content

Commit

Permalink
Improved: allowing user to select specific identifier instead of prim…
Browse files Browse the repository at this point in the history
…aryId/secondaryId in barcodeIdentififier (#412)
  • Loading branch information
amansinghbais committed Nov 5, 2024
1 parent cbe1b10 commit 71e58e1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const actions: ActionTree<OrderState, RootState> = {
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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/return/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const actions: ActionTree<ReturnState, RootState> = {
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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/shipment/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const actions: ActionTree<ShipmentState, RootState> = {
},

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) => {
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const actions: ActionTree<UtilState, RootState> = {
}
} catch(err) {
console.error(err)
commit(types.UTIL_BARCODE_IDENTIFICATION_PREF_UPDATED, "primaryId")
commit(types.UTIL_BARCODE_IDENTIFICATION_PREF_UPDATED, "internalName")
}
},

Expand All @@ -218,7 +218,7 @@ const actions: ActionTree<UtilState, RootState> = {
fromDate,
"productStoreId": ecomStore.productStoreId,
"settingTypeEnumId": "BARCODE_IDEN_PREF",
"settingValue": "primaryId"
"settingValue": "internalName"
}

await UtilService.createBarcodeIdentificationPref(params) as any
Expand All @@ -228,7 +228,7 @@ const actions: ActionTree<UtilState, RootState> = {

// 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;
},

Expand Down
10 changes: 6 additions & 4 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
</ion-item>
<ion-item lines="none">
<ion-select :label="translate('Barcode Identifier')" interface="popover" :placeholder="translate('Select')" :value="barcodeIdentificationPref" @ionChange="setBarcodeIdentificationPref($event.detail.value)">
<ion-select-option value="primaryId">{{ translate("Primary identifier") }}</ion-select-option>
<ion-select-option value="secondaryId">{{ translate("Secondary identifier") }}</ion-select-option>
<ion-select-option v-for="identification in barcodeIdentificationOptions" :key="identification" :value="identification" >{{ identification }}</ion-select-option>
</ion-select>
</ion-item>
</ion-card>
Expand All @@ -86,14 +85,14 @@
<script lang="ts">
import { alertController, IonAvatar, IonButton, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonContent, IonHeader,IonIcon, IonItem, IonMenuButton, IonPage, IonSelect, IonSelectOption, IonTitle, IonToggle, IonToolbar } from '@ionic/vue';
import { defineComponent } from 'vue';
import { computed, defineComponent } from 'vue';
import { codeWorkingOutline, ellipsisVertical, openOutline, saveOutline, globeOutline, personCircleOutline, storefrontOutline} from 'ionicons/icons'
import { mapGetters, useStore } from 'vuex';
import { useRouter } from 'vue-router';
import Image from '@/components/Image.vue'
import { DateTime } from 'luxon';
import { Actions, hasPermission } from '@/authorization';
import { DxpProductIdentifier, translate } from "@hotwax/dxp-components"
import { DxpProductIdentifier, translate, useProductIdentificationStore } from "@hotwax/dxp-components"
export default defineComponent({
name: 'Settings',
Expand Down Expand Up @@ -208,9 +207,12 @@ export default defineComponent({
setup(){
const store = useStore();
const router = useRouter();
const productIdentificationStore = useProductIdentificationStore();
let barcodeIdentificationOptions = computed(() => productIdentificationStore.getProductIdentificationOptions)
return {
Actions,
barcodeIdentificationOptions,
codeWorkingOutline,
ellipsisVertical,
globeOutline,
Expand Down

0 comments on commit 71e58e1

Please sign in to comment.