Skip to content

Commit

Permalink
Improved: display productName as fallback value when the primary sele…
Browse files Browse the repository at this point in the history
…cted identifier is missing(dxp/#345)
  • Loading branch information
ymaheshwari1 committed Oct 25, 2024
1 parent 29c5fea commit 762d2e7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/components/AddProductModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Image :src="product.mainImageUrl" />
</ion-thumbnail>
<ion-label>
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, product) }}</h2>
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, product) || getProduct(product.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].secondaryId, product) }}</p>
</ion-label>
<ion-icon v-if="isProductAvailableInCycleCount(product.productId)" color="success" :icon="checkmarkCircle" />
Expand Down Expand Up @@ -73,6 +73,7 @@ const props = defineProps(["cycleCount"])
const products = computed(() => store.getters["product/getProducts"])
const isScrollable = computed(() => store.getters["product/isScrollable"])
const productStoreSettings = computed(() => store.getters["user/getProductStoreSettings"])
const getProduct = computed(() => (id: any) => store.getters["product/getProduct"](id))
let queryString = ref('')
const isSearching = ref(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/AssignedCountPopover.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ion-content>
<ion-list>
<ion-list-header>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) || item.productId }}</ion-list-header>
<ion-list-header>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) || getProduct(item.productId).productName }}</ion-list-header>
<ion-item :lines="item.quantity ? 'none' : 'full'">
<ion-label>{{ translate("Last counted")}}</ion-label>
<ion-note slot="end">{{ timeFromNow(item.lastCountedDate) }}</ion-note>
Expand Down
2 changes: 1 addition & 1 deletion src/views/AssignedDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<Image :src="getProduct(item.productId).mainImageUrl"/>
</ion-thumbnail>
<ion-label>
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) }}</h2>
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) || getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
</ion-item>
Expand Down
2 changes: 1 addition & 1 deletion src/views/CountDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<div class="detail" v-if="Object.keys(product)?.length">
<ion-item lines="none">
<ion-label class="ion-text-wrap">
<h1>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(product.productId)) }}</h1>
<h1>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(product.productId)) || getProduct(product.productId).productName }}</h1>
<p>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].secondaryId, getProduct(product.productId)) }}</p>
</ion-label>

Expand Down
2 changes: 1 addition & 1 deletion src/views/DraftDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<Image :src="getProduct(item.productId).mainImageUrl"/>
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) }}</h2>
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) || getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
</ion-item>
Expand Down
2 changes: 1 addition & 1 deletion src/views/PendingReviewDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<Image :src="getProduct(item.productId).mainImageUrl"/>
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) }}</h2>
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) || getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
</ion-item>
Expand Down
2 changes: 1 addition & 1 deletion src/views/ProductItemList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<p class="overline">{{ item.itemStatusId === 'INV_COUNT_REJECTED' ? "rejected" : "" }}</p>
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) }}</h2>
<h2>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].primaryId, getProduct(item.productId)) || getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productStoreSettings["productIdentificationPref"].secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
<ion-badge slot="end" color="danger" v-if="item.itemStatusId === 'INV_COUNT_REJECTED'">
Expand Down

0 comments on commit 762d2e7

Please sign in to comment.