Skip to content

Commit

Permalink
Improved: added product identifier support in scheduledRestockReview …
Browse files Browse the repository at this point in the history
…page and entity to fetch product stores (hotwax#220)
  • Loading branch information
amansinghbais committed Dec 9, 2024
1 parent daf05da commit 05be427
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ async function getEComStores(): Promise<any> {
const params = {
"viewSize": 200,
"fieldList": ["productStoreId", "storeName"],
"entityName": "ProductStoreFacilityDetail",
"entityName": "ProductStore",
"distinct": "Y",
"noConditionFind": "Y",
"filterByDate": 'Y',
"noConditionFind": "Y"
};

try {
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const actions: ActionTree<UserState, RootState> = {
dispatch('setPreferredDateTimeFormat', process.env.VUE_APP_DATE_FORMAT ? process.env.VUE_APP_DATE_FORMAT : 'MM/dd/yyyy');

const ecomStores = await UserService.getEComStores()
useUserStore().$state.eComStores = ecomStores
useUserStore().eComStores = ecomStores
await useUserStore().getEComStorePreference("SELECTED_BRAND")
const preferredStore: any = useUserStore().getCurrentEComStore

Expand Down
16 changes: 11 additions & 5 deletions src/views/ScheduledRestockReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
<DxpShopifyImg :src="item.imageUrl" size="small" />
</ion-thumbnail>
<ion-label>
<h2>{{ item.parentProductName }}</h2>
<p>{{ item.identification }}</p>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.pseudoId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.pseudoId)) : item.parentProductName }}</h2>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.pseudoId)) }}</p>
</ion-label>
</ion-item>
<ion-chip outline class="tablet">
Expand All @@ -97,9 +97,9 @@
</template>

<script>
import { defineComponent } from "vue";
import { computed, defineComponent } from "vue";
import { IonBackButton, IonButton, IonButtons, IonCheckbox, IonChip, IonContent, IonDatetime, IonFab, IonFabButton, IonHeader, IonIcon, IonInput, IonItem, IonLabel, IonList, IonModal, IonPage, IonSearchbar, IonSelect, IonSelectOption, IonThumbnail, IonTitle, IonToolbar, alertController} from "@ionic/vue";
import { DxpShopifyImg, translate } from "@hotwax/dxp-components";
import { DxpShopifyImg, getProductIdentificationValue, translate, useProductIdentificationStore } from "@hotwax/dxp-components";
import { arrowUndoOutline, checkboxOutline, timerOutline, businessOutline, cloudUploadOutline, globeOutline} from "ionicons/icons"
import { mapGetters, useStore } from "vuex";
import { DateTime } from 'luxon';
Expand Down Expand Up @@ -147,7 +147,9 @@ export default defineComponent({
userProfile: 'user/getUserProfile',
fileName: 'order/getFileName',
schedule: 'stock/getScheduledInformation',
productStores: 'util/getProductStores'
productStores: 'util/getProductStores',
getProduct: 'product/getProduct',
})
},
data() {
Expand Down Expand Up @@ -352,6 +354,8 @@ export default defineComponent({
setup() {
const store = useStore();
const router = useRouter();
const productIdentificationStore = useProductIdentificationStore();
let productIdentificationPref = computed(() => productIdentificationStore.getProductIdentificationPref);
return {
translate,
Expand All @@ -362,7 +366,9 @@ export default defineComponent({
store,
cloudUploadOutline,
DateTime,
getProductIdentificationValue,
globeOutline,
productIdentificationPref,
router
}
}
Expand Down

0 comments on commit 05be427

Please sign in to comment.