Skip to content

Commit

Permalink
Improved: Corrected indentations, renamed variables, added childRoute…
Browse files Browse the repository at this point in the history
…s to the inventory menu item, and updated the .env.example file (#304).
  • Loading branch information
R-Sourabh committed Jan 2, 2025
1 parent 1f01cbb commit 53f4572
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ VUE_APP_ALIAS={}
VUE_APP_MAPPING_TYPES={"PO": "PO_MAPPING_PREF","RSTINV": "INV_MAPPING_PREF","RSTSTK": "STK_MAPPING_PREF"}
VUE_APP_MAPPING_PO={"orderId": { "label": "Order ID", "required": true }, "productSku": { "label": "Shopify product SKU", "required": true },"orderDate": { "label": "Arrival date", "required": true }, "quantity": { "label": "Ordered quantity", "required": true }, "facility": { "label": "Facility ID", "required": true }}
VUE_APP_MAPPING_RSTINV={"productIdentification": { "label": "Product Identification", "required": true }, "quantity": { "label": "Quantity", "required": true }, "facility": { "label": "Facility ID", "required": true }}
VUE_APP_MAPPING_RSTSTK={"product": { "label": "Product", "required": true }, "facility": { "label": "Facility", "required": true }, "quantity": { "label": "Quantity", "required": true }}
VUE_APP_MAPPING_RSTSTK={"productIdentification": { "label": "Product Identification", "required": true }, "facility": { "label": "Facility", "required": true }, "quantity": { "label": "Quantity", "required": true }}
VUE_APP_MAPPING_ADJINV={"productIdentification": { "label": "Product Identification", "required": true }, "facility": { "label": "Facility ID", "required": true }, "quantity": { "label": "Quantity", "required": true }}
VUE_APP_DEFAULT_LOG_LEVEL="error"
VUE_APP_LOGIN_URL="http://launchpad.hotwax.io/login"
4 changes: 0 additions & 4 deletions src/components/AddProductModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ import { hasError } from "@/adapter";
import { showToast } from '@/utils';
import logger from "@/logger";
export default defineComponent({
name: "AddProductModal",
components: {
Expand Down Expand Up @@ -188,8 +187,6 @@ export default defineComponent({
},
},
setup() {
const store = useStore();
const router = useRouter();
Expand All @@ -205,7 +202,6 @@ export default defineComponent({
productIdentificationPref,
router
}
}
})
</script>
1 change: 1 addition & 0 deletions src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default defineComponent({
{
title: "Inventory",
url: "/unified-inventory",
childRoutes: ["/inventory", "/inventory-review", "/adjust-inventory", "/adjust-inventory_history", "/scheduled-incoming-inventory", "/scheduled-restock", "/scheduled-restock-review/:id", "/purchase-order", "/purchase-order-review"],
iosIcon: albumsOutline,
mdIcon: albumsOutline
},
Expand Down
1 change: 0 additions & 1 deletion src/services/UtilService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const removeShipmentItem = async (payload: any): Promise<any> => {
});
}


const fetchDataManagerConfig = async (payload: any): Promise <any> => {
return api ({
url: "performFind",
Expand Down
38 changes: 17 additions & 21 deletions src/views/AdjustInventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,14 @@
<ion-icon slot="end" :icon="cloudUploadOutline" />
</ion-button>

<ion-item v-if="configDetails.executionModeId === 'DMC_SYNC'" lines="none">
{{ translate("Uploaded files will be processed immediately") }}
<ion-label slot="end">
<p>{{ translate("Sync") }}</p>
</ion-label>
</ion-item>

<ion-item v-else-if="configDetails.executionModeId === 'DMC_ASYNC'" lines="none">
{{ translate("Uploaded files will be processed asynchronously") }}
<ion-label slot="end">
<p>{{ translate("Async") }}</p>
</ion-label>
</ion-item>

<div v-else>

<div v-if="configDetails.executionModeId === 'DMC_QUEUE'">
<template v-if="hasPendingJobs()">
<!-- Pending Jobs in Queue -->
<ion-item lines="none">
{{ translate("Uploaded files will be processed in", { runTime: getRunTime() }) }}
<ion-label>
{{ translate("Uploaded files will be processed in", { runTime: getRunTime() }) }}
</ion-label>
<ion-label slot="end">
<p>{{ translate("Queued") }}</p>
</ion-label>
Expand All @@ -96,7 +85,9 @@
<template v-else>
<!-- Draft jobs in Queue -->
<ion-item lines="none">
{{ translate("Uploaded files will not be processed until the bulk file processing job is enabled.") }}
<ion-label>
{{ translate("Uploaded files will not be processed until the bulk file processing job is enabled.") }}
</ion-label>
<ion-label slot="end">
<p>{{ translate("Queued") }}</p>
</ion-label>
Expand All @@ -111,6 +102,15 @@
</ion-item>
</template>
</div>

<ion-item v-else lines="none">
<ion-label>
{{ translate( configDetails.executionModeId === 'DMC_SYNC' ? "Uploaded files will be processed immediately" : "Uploaded files will be processed asynchronously") }}
</ion-label>
<ion-label slot="end">
<p>{{ translate( configDetails.executionModeId === 'DMC_SYNC' ? "Sync" : "Async") }}</p>
</ion-label>
</ion-item>

<ion-button color="medium" expand="block" fill="outline" class="review" @click="router.push({ name: 'AdjustInventoryHistory' })">
{{ translate("View history") }}
Expand Down Expand Up @@ -402,8 +402,4 @@ main {
label {
cursor: pointer;
}
.job-section {
margin-bottom: 16px;
}
</style>
23 changes: 11 additions & 12 deletions src/views/AdjustInventoryHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<div class="empty-state" v-if="isLoading">
<ion-spinner name="crescent" />
</div>
<div v-else-if="dataManagerLogList?.length">
<div class="list-item" v-for="(log, index) in dataManagerLogList" :key="index">
<div v-else-if="filteredDataManagerLogList?.length">
<div class="list-item" v-for="(log, index) in filteredDataManagerLogList" :key="index">
<ion-item lines="none">
<ion-icon slot="start" :icon="documentTextOutline" />
<ion-label>
Expand Down Expand Up @@ -107,7 +107,6 @@ import { DateTime } from 'luxon'
import logger from "@/logger";
import DownloadLogsFilePopover from "@/components/DownloadLogsFilePopover.vue";
export default defineComponent ({
name: "AdjustInventoryHistory",
components: {
Expand All @@ -134,9 +133,9 @@ export default defineComponent ({
{ id: 'FAILED_LOGS', label: 'Failed logs' },
{ id: 'FAILED_RECORDS', label: 'Failed records' }
],
dataManagerLogList: [],
originalLogList: [],
isLoading: true,
dataManagerLogList: [],
filteredDataManagerLogList: [],
}
},
computed: {
Expand All @@ -148,8 +147,8 @@ export default defineComponent ({
async ionViewDidEnter() {
await this.store.dispatch('util/fetchDataManagerConfig', "MDM_INV_VARIANCE");
await this.fetchDataManagerLogs();
if(this.dataManagerLogList) {
await this.fetchDataResource(this.dataManagerLogList)
if(this.filteredDataManagerLogList) {
await this.fetchDataResource(this.filteredDataManagerLogList)
}
this.filterDataManagerLogs('ALL');
this.isLoading = false;
Expand All @@ -158,11 +157,11 @@ export default defineComponent ({
filterDataManagerLogs(id) {
this.selectedFilter = id;
if (id === 'ALL') {
this.dataManagerLogList = [...this.originalLogList]
this.filteredDataManagerLogList = [...this.dataManagerLogList]
} else if (id === 'FAILED_LOGS') {
this.dataManagerLogList = this.originalLogList.filter(log => log.statusId === 'SERVICE_FAILED')
this.filteredDataManagerLogList = this.dataManagerLogList.filter(log => log.statusId === 'SERVICE_FAILED')
} else if (id === 'FAILED_RECORDS') {
this.dataManagerLogList = this.originalLogList.filter(log => log.errorRecordContentId !== null)
this.filteredDataManagerLogList = this.dataManagerLogList.filter(log => log.errorRecordContentId !== null)
}
},
getExecutionModeLabel(executionModeId) {
Expand Down Expand Up @@ -195,8 +194,8 @@ export default defineComponent ({
try {
const resp = await UtilService.fetchDataManagerLogs(payload);
if (resp.data.docs?.length > 0 && !hasError(resp)) {
this.originalLogList = resp.data.docs;
this.dataManagerLogList = [...this.originalLogList];
this.dataManagerLogList = resp.data.docs;
this.filteredDataManagerLogList = [...this.dataManagerLogList];
} else {
throw resp.data;
}
Expand Down
2 changes: 0 additions & 2 deletions src/views/ScheduledIncomingInventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
</ion-list>
</main>
</ion-content>

</ion-page>
</template>

Expand Down Expand Up @@ -103,7 +102,6 @@ import { showToast, hasError } from '@/utils';
import { StockService } from "@/services/StockService";
import logger from "@/logger";
export default defineComponent({
name: "ScheduledIncomingInventory",
components: {
Expand Down
1 change: 0 additions & 1 deletion src/views/ScheduledRestockReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ import { UtilService } from '@/services/UtilService'
import { useRouter } from "vue-router";
import AddProductModal from "@/components/AddProductModal.vue"
export default defineComponent({
name: 'ScheduledRestockReview',
components: {
Expand Down

0 comments on commit 53f4572

Please sign in to comment.