From 39e625b98e1125db07de78236ec077e9368f0a69 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 30 Dec 2024 16:18:38 +0530 Subject: [PATCH 1/2] Improved: empty state in case of no cycle count items and UI for the counted count for hard count (#555) --- src/utils/index.ts | 8 ++++++-- src/views/Assigned.vue | 2 +- src/views/AssignedDetail.vue | 4 ++-- src/views/Closed.vue | 2 +- src/views/Count.vue | 4 ++-- src/views/CountDetail.vue | 2 +- src/views/DraftDetail.vue | 2 +- src/views/PendingReview.vue | 2 +- src/views/PendingReviewDetail.vue | 2 +- 9 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 4d30ff32..33e1b686 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -92,9 +92,13 @@ function timeFromNow(time: any) { return DateTime.local().plus(timeDiff).toRelative(); } -function getCycleCountStats(id: string) { +function getCycleCountStats(id: string, isHardCount = false) { const stats = cycleCountStats(id) - return stats ? `${stats.itemCounted}/${stats.totalItems}` : "0/0" + if(stats) { + return isHardCount ? `${stats.itemCounted}` : `${stats.itemCounted}/${stats.totalItems}` + } else { + return isHardCount ? "0" : "0/0" + } } function getFacilityName(id: string) { diff --git a/src/views/Assigned.vue b/src/views/Assigned.vue index f28fbbaf..532d53d0 100644 --- a/src/views/Assigned.vue +++ b/src/views/Assigned.vue @@ -34,7 +34,7 @@ - {{ getCycleCountStats(count.inventoryCountImportId) }} + {{ getCycleCountStats(count.inventoryCountImportId, count.countTypeEnumId === "HARD_COUNT") }}

{{ translate("counted") }}

diff --git a/src/views/AssignedDetail.vue b/src/views/AssignedDetail.vue index 473477ea..972c81cb 100644 --- a/src/views/AssignedDetail.vue +++ b/src/views/AssignedDetail.vue @@ -56,7 +56,7 @@
- + {{ translate("Progress") }} {{ getProgress() }} @@ -118,7 +118,7 @@

- {{ translate("No items found") }} + {{ translate("No items added to count") }}

diff --git a/src/views/DraftDetail.vue b/src/views/DraftDetail.vue index a7986cae..b8bb8342 100644 --- a/src/views/DraftDetail.vue +++ b/src/views/DraftDetail.vue @@ -99,7 +99,7 @@ -

{{ translate("No product found") }}

+

{{ translate("No items added to count") }}


diff --git a/src/views/PendingReview.vue b/src/views/PendingReview.vue index 44bcb78f..b9d26820 100644 --- a/src/views/PendingReview.vue +++ b/src/views/PendingReview.vue @@ -34,7 +34,7 @@ - {{ getCycleCountStats(count.inventoryCountImportId) }} + {{ getCycleCountStats(count.inventoryCountImportId, count.countTypeEnumId === "HARD_COUNT") }}

{{ translate("counted") }}

diff --git a/src/views/PendingReviewDetail.vue b/src/views/PendingReviewDetail.vue index e720dadf..0c57f666 100644 --- a/src/views/PendingReviewDetail.vue +++ b/src/views/PendingReviewDetail.vue @@ -153,7 +153,7 @@

- {{ translate("No items found") }} + {{ translate("No items added to count") }}