Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Product identifiers is visible for selected product(#373) #374

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/components/ClosePurchaseOrderModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<DxpShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label>
<h2>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}</h2>
<p>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
<ion-buttons>
<ion-checkbox aria-label="itemStatus" slot="end" :modelValue="isPOItemStatusPending(item) ? item.isChecked : true" :disabled="isPOItemStatusPending(item) ? false : true" />
Expand Down Expand Up @@ -65,8 +65,7 @@ import { closeOutline, checkmarkCircle, arrowBackOutline, saveOutline } from 'io
import { defineComponent } from 'vue';
import { mapGetters, useStore } from 'vuex'
import { OrderService } from "@/services/OrderService";
import { productHelpers } from '@/utils';
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate, getProductIdentificationValue } from '@hotwax/dxp-components';
import { useRouter } from 'vue-router';

export default defineComponent({
Expand Down Expand Up @@ -215,11 +214,11 @@ export default defineComponent({
checkmarkCircle,
hasPermission,
OrderService,
productHelpers,
router,
saveOutline,
store,
translate
translate,
getProductIdentificationValue
};
}
});
Expand Down
3 changes: 1 addition & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { toastController } from '@ionic/vue';
import { translate } from '@hotwax/dxp-components'
import { Plugins } from '@capacitor/core';
import productHelpers from './product'
import { DateTime } from "luxon";

// TODO Use separate files for specific utilities
Expand Down Expand Up @@ -53,4 +52,4 @@ const handleDateTimeInput = (dateTimeValue: any) => {
return DateTime.fromISO(dateTime).toMillis()
}

export { handleDateTimeInput, showToast, hasError, copyToClipboard, productHelpers }
export { handleDateTimeInput, showToast, hasError, copyToClipboard }
22 changes: 0 additions & 22 deletions src/utils/product/index.ts

This file was deleted.

10 changes: 6 additions & 4 deletions src/views/AddProductModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</ion-thumbnail>
<ion-label>
<!-- Honouring the identifications set by the user on the settings page -->
<h2>{{ product[productIdentificationPref.primaryId] }}</h2>
<p>{{ product[productIdentificationPref.secondaryId] }}</p>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(product.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(product.productId)) : getProduct(product.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(product.productId)) }}</p>
</ion-label>
<ion-icon v-if="isProductAvailableInShipment(product.productId)" color="success" :icon="checkmarkCircle" />
<ion-button v-else fill="outline" @click="addtoShipment(product)">{{ translate("Add to Shipment") }}</ion-button>
Expand Down Expand Up @@ -69,7 +69,7 @@ import { defineComponent } from 'vue';
import { closeOutline, checkmarkCircle } from 'ionicons/icons';
import { mapGetters } from 'vuex'
import { useStore } from "@/store";
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate, getProductIdentificationValue } from '@hotwax/dxp-components';
import { showToast } from '@/utils'

export default defineComponent({
Expand Down Expand Up @@ -101,6 +101,7 @@ export default defineComponent({
computed: {
...mapGetters({
products: 'product/getProducts',
getProduct: 'product/getProduct',
isScrollable: 'product/isScrollable',
isProductAvailableInShipment: 'product/isProductAvailableInShipment',
productIdentificationPref: 'user/getProductIdentificationPref',
Expand Down Expand Up @@ -172,7 +173,8 @@ export default defineComponent({
closeOutline,
checkmarkCircle,
store,
translate
translate,
getProductIdentificationValue
};
},
});
Expand Down
10 changes: 6 additions & 4 deletions src/views/AddProductToPOModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</ion-thumbnail>
<ion-label>
<!-- Honouring the identifications set by the user on the settings page -->
<h2>{{ product[productIdentificationPref.primaryId] }}</h2>
<p>{{ product[productIdentificationPref.secondaryId] }}</p>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(product.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(product.productId)) : getProduct(product.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(product.productId)) }}</p>
</ion-label>
<ion-icon v-if="isProductAvailableInOrder(product.productId)" color="success" :icon="checkmarkCircle" />
<ion-button v-else fill="outline" @click="addtoOrder(product)">{{ translate("Add to Purchase Order") }}</ion-button>
Expand Down Expand Up @@ -60,7 +60,7 @@ import { defineComponent } from 'vue';
import { closeOutline, checkmarkCircle } from 'ionicons/icons';
import { mapGetters } from 'vuex'
import { useStore } from "@/store";
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate, getProductIdentificationValue } from '@hotwax/dxp-components';
import { showToast } from '@/utils'

export default defineComponent({
Expand Down Expand Up @@ -92,6 +92,7 @@ export default defineComponent({
computed: {
...mapGetters({
products: 'product/getProducts',
getProduct: 'product/getProduct',
isScrollable: 'product/isScrollable',
isProductAvailableInOrder: 'order/isProductAvailableInOrder',
productIdentificationPref: 'user/getProductIdentificationPref',
Expand Down Expand Up @@ -163,7 +164,8 @@ export default defineComponent({
closeOutline,
checkmarkCircle,
store,
translate
translate,
getProductIdentificationValue,
};
},
});
Expand Down
16 changes: 8 additions & 8 deletions src/views/PurchaseOrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
<DxpShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<h2>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}</h2>
<p>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
</ion-item>
</div>
Expand Down Expand Up @@ -118,8 +118,8 @@
<DxpShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<h2>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}</h2>
<p>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
</ion-item>
</div>
Expand Down Expand Up @@ -180,15 +180,15 @@ import {
import { defineComponent } from 'vue';
import { addOutline, cameraOutline, checkmarkDone, copyOutline, eyeOffOutline, eyeOutline, locationOutline, saveOutline, timeOutline } from 'ionicons/icons';
import ReceivingHistoryModal from '@/views/ReceivingHistoryModal.vue'
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate, getProductIdentificationValue } from '@hotwax/dxp-components';
import { useStore, mapGetters } from 'vuex';
import { useRouter } from 'vue-router';
import Scanner from "@/components/Scanner.vue"
import AddProductToPOModal from '@/views/AddProductToPOModal.vue'
import ClosePurchaseOrderModal from '@/components/ClosePurchaseOrderModal.vue'
import LocationPopover from '@/components/LocationPopover.vue'
import ImageModal from '@/components/ImageModal.vue';
import { copyToClipboard, hasError, productHelpers, showToast } from '@/utils';
import { copyToClipboard, hasError, showToast } from '@/utils';
import { Actions, hasPermission } from '@/authorization'

export default defineComponent({
Expand Down Expand Up @@ -396,12 +396,12 @@ export default defineComponent({
eyeOutline,
hasPermission,
locationOutline,
productHelpers,
router,
saveOutline,
store,
timeOutline,
translate
translate,
getProductIdentificationValue
};
},
});
Expand Down
12 changes: 6 additions & 6 deletions src/views/ReturnDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<DxpShopifyImg :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<h2>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}</h2>
<p>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
</ion-item>
</div>
Expand Down Expand Up @@ -110,12 +110,12 @@ import { defineComponent } from 'vue';
import { checkmarkDone, barcodeOutline, locationOutline } from 'ionicons/icons';
import { mapGetters, useStore } from "vuex";
import AddProductModal from '@/views/AddProductModal.vue'
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate, getProductIdentificationValue } from '@hotwax/dxp-components';
import { useRouter } from 'vue-router';
import Scanner from "@/components/Scanner.vue";
import ImageModal from '@/components/ImageModal.vue';
import { hasError } from '@/utils';
import { showToast, productHelpers } from '@/utils'
import { showToast } from '@/utils'
import { Actions, hasPermission } from '@/authorization'

export default defineComponent({
Expand Down Expand Up @@ -292,9 +292,9 @@ export default defineComponent({
hasPermission,
locationOutline,
store,
productHelpers,
router,
translate
translate,
getProductIdentificationValue
};
},
});
Expand Down
12 changes: 6 additions & 6 deletions src/views/ShipmentDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
<DxpShopifyImg :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<h2>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}</h2>
<p>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
<h2>{{ getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) ? getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) : getProduct(item.productId).productName }}</h2>
<p>{{ getProductIdentificationValue(productIdentificationPref.secondaryId, getProduct(item.productId)) }}</p>
</ion-label>
</ion-item>
</div>
Expand Down Expand Up @@ -116,12 +116,12 @@ import { defineComponent } from 'vue';
import { add, checkmarkDone, cameraOutline, locationOutline } from 'ionicons/icons';
import { mapGetters, useStore } from "vuex";
import AddProductModal from '@/views/AddProductModal.vue'
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate, getProductIdentificationValue } from '@hotwax/dxp-components';
import { useRouter } from 'vue-router';
import Scanner from "@/components/Scanner.vue";
import LocationPopover from '@/components/LocationPopover.vue'
import ImageModal from '@/components/ImageModal.vue';
import { hasError, productHelpers, showToast } from '@/utils'
import { hasError, showToast } from '@/utils'
import { Actions, hasPermission } from '@/authorization'

export default defineComponent({
Expand Down Expand Up @@ -311,9 +311,9 @@ export default defineComponent({
hasPermission,
locationOutline,
store,
productHelpers,
router,
translate
translate,
getProductIdentificationValue
};
},
});
Expand Down
Loading