From 745d21ac79a76c3d67b831669b5625032e5eee11 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 9 Jan 2025 16:01:49 +0530 Subject: [PATCH 1/6] Improved: loader starting and ending so as to show loader till all details are fetched (#528) --- src/views/CountDetail.vue | 4 ++-- src/views/HardCountDetail.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/CountDetail.vue b/src/views/CountDetail.vue index 7b2271dc..5a3cb333 100644 --- a/src/views/CountDetail.vue +++ b/src/views/CountDetail.vue @@ -295,12 +295,14 @@ const barcodeInput = ref(); let isScanningInProgress = ref(false); onIonViewDidEnter(async() => { + emitter.emit("presentLoader"); await Promise.allSettled([await fetchCycleCount(), store.dispatch("count/fetchCycleCountItems", { inventoryCountImportId : props?.id })]) selectedSegment.value = 'all'; queryString.value = ''; previousItem = itemsList.value[0] await store.dispatch("product/currentProduct", itemsList.value[0]) barcodeInput.value?.$el?.setFocus(); + emitter.emit("dismissLoader") }) onIonViewDidLeave(async() => { @@ -348,7 +350,6 @@ function inputCountValidation(event) { } async function fetchCycleCount() { - emitter.emit("presentLoader"); let payload = props?.id let resp try { @@ -362,7 +363,6 @@ async function fetchCycleCount() { logger.error(err) showToast(translate("Something went wrong")) } - emitter.emit("dismissLoader") return; } diff --git a/src/views/HardCountDetail.vue b/src/views/HardCountDetail.vue index 7799cd5a..84f2836e 100644 --- a/src/views/HardCountDetail.vue +++ b/src/views/HardCountDetail.vue @@ -253,12 +253,14 @@ let isScanningInProgress = ref(false); onIonViewDidEnter(async() => { + emitter.emit("presentLoader"); await Promise.allSettled([fetchCycleCount(), await store.dispatch("count/fetchCycleCountItems", { inventoryCountImportId : props?.id })]) previousItem = itemsList.value[0]; await store.dispatch("product/currentProduct", itemsList.value?.length ? itemsList.value[0] : {}) barcodeInputRef.value?.$el?.setFocus(); selectedCountUpdateType.value = defaultRecountUpdateBehaviour.value window.addEventListener('beforeunload', handleBeforeUnload); + emitter.emit("dismissLoader") }) onIonViewDidLeave(async() => { @@ -297,7 +299,6 @@ async function handleBeforeUnload() { } async function fetchCycleCount() { - emitter.emit("presentLoader"); try { const resp = await CountService.fetchCycleCount(props?.id) if(!hasError(resp)) { @@ -309,7 +310,6 @@ async function fetchCycleCount() { logger.error(err) showToast(translate("Something went wrong")) } - emitter.emit("dismissLoader") } function handleSegmentChange() { From 5d4bd3ccc373f3fc5cc49f45cda35d756aa89b38 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 9 Jan 2025 16:12:45 +0530 Subject: [PATCH 2/6] Improved: showing loader until fetching all the count items and fixed units label showing in case of no quantity in no match found (#528) --- src/views/ProductItemList.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/ProductItemList.vue b/src/views/ProductItemList.vue index 77d32c1a..550f21c0 100644 --- a/src/views/ProductItemList.vue +++ b/src/views/ProductItemList.vue @@ -18,10 +18,10 @@ {{ translate("accepted") }} - + {{ translate("units", { count: isItemAlreadyAdded(item) ? item.quantity : item.scannedCount }) }} - + {{ translate("pending") }} From 0f9f4b86b51224b65016c34deef851377f00bfc0 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 9 Jan 2025 16:16:19 +0530 Subject: [PATCH 3/6] Fixed: using scannedCount in condition for pending item status (#528) --- src/views/ProductItemList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/ProductItemList.vue b/src/views/ProductItemList.vue index 550f21c0..699fbfca 100644 --- a/src/views/ProductItemList.vue +++ b/src/views/ProductItemList.vue @@ -21,7 +21,7 @@ {{ translate("units", { count: isItemAlreadyAdded(item) ? item.quantity : item.scannedCount }) }} - + {{ translate("pending") }} From f980c1cbbc7c55b352105e9b30d44d7e8c8618cb Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 9 Jan 2025 16:38:47 +0530 Subject: [PATCH 4/6] Fixed: the empty message changing on changing the queryString (#528) --- src/components/MatchProductModal.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/MatchProductModal.vue b/src/components/MatchProductModal.vue index 93d9e461..75d59ea3 100644 --- a/src/components/MatchProductModal.vue +++ b/src/components/MatchProductModal.vue @@ -42,7 +42,7 @@
-

{{ translate("No results found for", { queryString }) }}

+

{{ translate("No results found for", { queryString: prevSearchedQuery }) }}

empty-state @@ -95,6 +95,7 @@ let queryString = ref(''); const isSearching = ref(false); const selectedProductId = ref("") as Ref; const isLoading = ref(false); +const prevSearchedQuery = ref(""); async function handleSearch() { if(!queryString.value.trim()) { @@ -120,6 +121,7 @@ async function getProducts() { logger.error("Failed to fetch products", err) } products.value = productsList + prevSearchedQuery.value = queryString.value isLoading.value = false; } function closeModal(payload = {}) { From 114c10265030a45b92e59236264df581ed0573ad Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 9 Jan 2025 16:48:06 +0530 Subject: [PATCH 5/6] Fixed: no facility filter not persisting when coming back from details page (#528) --- src/components/Filters.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Filters.vue b/src/components/Filters.vue index 77bf3ef4..56325f00 100644 --- a/src/components/Filters.vue +++ b/src/components/Filters.vue @@ -19,7 +19,7 @@ - {{ translate("No facility") }} + {{ translate("No facility") }} From 6fb1c121f6425d0961ed7468f8b70a41e8d98bec Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 9 Jan 2025 16:56:25 +0530 Subject: [PATCH 6/6] Improved: added comment for the reason for showing completed or rejcted item in the counted tab (#528) --- src/views/CountDetail.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/CountDetail.vue b/src/views/CountDetail.vue index 5a3cb333..19bcd391 100644 --- a/src/views/CountDetail.vue +++ b/src/views/CountDetail.vue @@ -270,6 +270,7 @@ const itemsList = computed(() => { } else if (selectedSegment.value === 'pending') { return cycleCountItems.value.itemList.filter(item =>(item.quantity === undefined || item.quantity === null) && item.itemStatusId === "INV_COUNT_CREATED"); } else if (selectedSegment.value === 'counted') { + // Based on discussion, item with rejected and completed status should be shown in the counted segment return cycleCountItems.value.itemList.filter(item => item.quantity >= 0 || (item.itemStatusId === 'INV_COUNT_REJECTED' || item.itemStatusId === 'INV_COUNT_COMPLETED')); } else if (selectedSegment.value === 'notCounted') { return cycleCountItems.value.itemList.filter(item => !item.quantity && item.statusId === "INV_COUNT_REVIEW");