diff --git a/.env.example b/.env.example deleted file mode 100644 index 8f6b1b89..00000000 --- a/.env.example +++ /dev/null @@ -1,12 +0,0 @@ -VUE_APP_I18N_LOCALE=en -VUE_APP_I18N_FALLBACK_LOCALE=en -VUE_APP_CACHE_MAX_AGE=3600 -VUE_APP_VIEW_SIZE=20 -VUE_APP_PERMISSION_ID="INVCOUNT_APP_VIEW" -VUE_APP_DEFAULT_LOG_LEVEL="error" -VUE_APP_PRDT_IDENT=["productId", "groupId", "groupName", "internalName", "parentProductName", "primaryProductCategoryName", "title"] -VUE_APP_MAPPING_TYPES={"INVCOUNT": "INVCNT_MAPPING_PREF"} -VUE_APP_MAPPING_INVCOUNT={"countImportName": { "label": "Count name", "required": true}, "productSku": { "label": "Product SKU", "required": true, "description": "Products will not be deduplicated. Make sure products are only added to a count once."}, "facility": { "label": "Facility", "required": false, "description": "If a file includes multiple facilities, a count is created for every facility. All items with no facility location will be added to the same count." }, "statusId": { "label": "Status", "required": false, "description": "Defaults to 'Draft'" }, "dueDate": { "label": "Due date", "description": "Format: yyyy-mm-dd", "required": false }} -VUE_APP_DOWNLOAD_MAPPING_ID="INV_REPORT_PREF" -VUE_APP_LOGIN_URL="http://launchpad.hotwax.io/login" -VUE_APP_EMBEDDED_LAUNCHPAD_URL="https://hotwax-embedded-launchpad-dev.firebaseapp.com" \ No newline at end of file diff --git a/src/views/Count.vue b/src/views/Count.vue index 44dfeac4..83765fbb 100644 --- a/src/views/Count.vue +++ b/src/views/Count.vue @@ -3,6 +3,19 @@ {{ currentFacility?.facilityName || currentFacility?.facilityId }} + + + + + + {{ translate("Add") }} + + + + {{ translate("Assigned") }} @@ -22,9 +35,16 @@ +
+ + + + + + +
+ - - + + @@ -168,6 +220,9 @@ import { IonSegmentButton, IonTitle, IonToolbar, + IonButtons, + IonButton, + IonIcon, onIonViewDidEnter } from '@ionic/vue'; import { translate } from '@/i18n'; @@ -192,18 +247,25 @@ const contentRef = ref({}); const infiniteScrollRef = ref({}); let isLoading = ref(false); -onIonViewDidEnter(async() => { +onIonViewDidEnter(async () => { isLoading.value = true; await fetchCycleCounts(); isLoading.value = false; -}) +}); + +// 🔹 Add new item (only works in 'assigned' tab) +function addNewItem() { + if (selectedSegment.value !== "assigned") return; + showToast(translate("You can only add items in the Assigned tab.")); + // add your actual add logic here... +} function enableScrolling() { const parentElement = contentRef.value.$el const scrollEl = parentElement.shadowRoot.querySelector("main[part='scroll']") let scrollHeight = scrollEl.scrollHeight, infiniteHeight = infiniteScrollRef.value.$el.offsetHeight, scrollTop = scrollEl.scrollTop, threshold = 100, height = scrollEl.offsetHeight const distanceFromInfinite = scrollHeight - infiniteHeight - scrollTop - threshold - height - if(distanceFromInfinite < 0) { + if (distanceFromInfinite < 0) { isScrollingEnabled.value = false; } else { isScrollingEnabled.value = true; @@ -211,8 +273,7 @@ function enableScrolling() { } async function loadMoreCycleCount(event) { - // Added this check here as if added on infinite-scroll component the Loading content does not gets displayed - if(!(isScrollingEnabled.value && isScrollable.value)) { + if (!(isScrollingEnabled.value && isScrollable.value)) { await event.target.complete(); } fetchCycleCounts( @@ -226,7 +287,7 @@ async function loadMoreCycleCount(event) { } async function fetchCycleCounts(vSize, vIndex) { - if(!currentFacility.value?.facilityId) { + if (!currentFacility.value?.facilityId) { showToast(translate("No facility is associated with this user")); return; } @@ -254,9 +315,9 @@ function navigateToStoreView(count) { } function getStatusIdForCountsToBeFetched() { - if(selectedSegment.value === "assigned") { + if (selectedSegment.value === "assigned") { return "INV_COUNT_ASSIGNED" - } else if(selectedSegment.value === "pendingReview") { + } else if (selectedSegment.value === "pendingReview") { return "INV_COUNT_REVIEW" } else { return "INV_COUNT_COMPLETED" @@ -265,35 +326,27 @@ function getStatusIdForCountsToBeFetched() { function getSubmissionDate(count) { const history = cycleCountStats.value(count.inventoryCountImportId)?.statusHistory - if(!history) { - return "-"; - } - + if (!history) return "-"; const submissionStatus = history.toReversed().find((status) => status.statusId === "INV_COUNT_REVIEW") return getDateWithOrdinalSuffix(submissionStatus?.statusDate) } function getClosedDate(count) { const history = cycleCountStats.value(count.inventoryCountImportId)?.statusHistory - if(!history) { - return "-"; - } - + if (!history) return "-"; const submissionStatus = history.toReversed().find((status) => status.statusId === "INV_COUNT_COMPLETED") return getDateWithOrdinalSuffix(submissionStatus?.statusDate) } - + - -