Skip to content

Commit

Permalink
Improved: Added a function to return the shop name by shopId, removed…
Browse files Browse the repository at this point in the history
… the ion-menu-button, and removed the schedule time check from the upload function of the scheduled restock page (#304)
  • Loading branch information
R-Sourabh committed Jan 2, 2025
1 parent 957ad71 commit a678fd5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/views/AdjustInventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<ion-page>
<ion-header>
<ion-toolbar>
<ion-menu-button slot="start" />
<ion-back-button default-href="/unified-inventory" slot="start" />
<ion-title>{{ translate("Adjust Inventory") }}</ion-title>
<!-- TODO: We need to discuss what to display on this button click. -->
Expand Down Expand Up @@ -128,7 +127,7 @@ import { defineComponent } from "vue";
import { useRouter } from "vue-router";
import { translate } from "@hotwax/dxp-components";
import { addOutline, arrowForward, cloudUploadOutline, settingsOutline, } from "ionicons/icons";
import { IonBackButton, IonButton, IonChip, IonContent, IonHeader, IonIcon, IonItem, IonItemDivider, IonLabel, IonList, IonListHeader, IonMenuButton, IonPage, IonSelect, IonSelectOption, IonTitle, IonToolbar, modalController, alertController } from "@ionic/vue";
import { IonBackButton, IonButton, IonChip, IonContent, IonHeader, IonIcon, IonItem, IonItemDivider, IonLabel, IonList, IonListHeader, IonPage, IonSelect, IonSelectOption, IonTitle, IonToolbar, modalController, alertController } from "@ionic/vue";
import { jsonToCsv, showToast, hasError } from '@/utils';
import { mapGetters, useStore } from "vuex";
import { DateTime } from 'luxon';
Expand All @@ -152,7 +151,6 @@ export default defineComponent({
IonLabel,
IonList,
IonListHeader,
IonMenuButton,
IonPage,
IonSelect,
IonSelectOption,
Expand Down
5 changes: 1 addition & 4 deletions src/views/ScheduledIncomingInventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<ion-page>
<ion-header>
<ion-toolbar>
<ion-menu-button slot="start" />
<ion-back-button default-href="/unified-inventory" slot="start" />
<ion-title>{{ translate("Scheduled Incoming Inventory") }}</ion-title>
</ion-toolbar>
Expand Down Expand Up @@ -64,7 +63,7 @@
</ion-item>
</template>
</ion-list>
<div v-if="!jobs.length" class="empty-state">
<div v-else class="empty-state">
<p>{{ translate("No jobs are scheduled for incoming inventory") }}</p>
</div>
</main>
Expand All @@ -82,7 +81,6 @@ import {
IonPage,
IonHeader,
IonToolbar,
IonMenuButton,
IonTitle,
IonContent,
IonButton,
Expand Down Expand Up @@ -110,7 +108,6 @@ export default defineComponent({
IonPage,
IonHeader,
IonToolbar,
IonMenuButton,
IonTitle,
IonContent,
IonButton,
Expand Down
9 changes: 1 addition & 8 deletions src/views/ScheduledRestock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<ion-page>
<ion-header>
<ion-toolbar>
<ion-menu-button slot="start" />
<ion-back-button default-href="/scheduled-incoming-inventory" slot="start" />
<ion-title>{{ translate("Scheduled product launch") }}</ion-title>
<!-- TODO: We need to discuss what to display on this button click. -->
Expand Down Expand Up @@ -115,7 +114,7 @@ import { defineComponent } from "vue";
import { useRouter } from "vue-router";
import { translate } from "@hotwax/dxp-components";
import { addOutline, arrowForwardOutline, cloudUploadOutline, ellipsisVerticalOutline } from "ionicons/icons";
import { IonBackButton, IonButton, IonChip, IonContent, IonDatetime, IonHeader, IonIcon, IonInput, IonItem, IonItemDivider, IonLabel, IonList, IonListHeader, IonMenuButton, IonModal, IonPage, IonSelect, IonSelectOption, IonTitle, IonToolbar, modalController, alertController } from "@ionic/vue";
import { IonBackButton, IonButton, IonChip, IonContent, IonDatetime, IonHeader, IonIcon, IonInput, IonItem, IonItemDivider, IonLabel, IonList, IonListHeader, IonModal, IonPage, IonSelect, IonSelectOption, IonTitle, IonToolbar, modalController, alertController } from "@ionic/vue";
import parseFileMixin from '@/mixins/parseFileMixin';
import { showToast, hasError } from '@/utils';
import { mapGetters, useStore } from "vuex";
Expand All @@ -142,7 +141,6 @@ export default defineComponent({
IonLabel,
IonList,
IonListHeader,
IonMenuButton,
IonModal,
IonPage,
IonSelect,
Expand Down Expand Up @@ -286,11 +284,6 @@ export default defineComponent({
return;
}
if(!this.schedule) {
showToast(translate("Please select a schedule time"));
return;
}
if(!this.selectedFacility) {
showToast(translate("Please select a facility"));
return;
Expand Down
6 changes: 5 additions & 1 deletion src/views/ScheduledRestockReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<ion-item lines="none">
<ion-label>{{ translate("Shopify store") }}</ion-label>
<ion-label slot="end">
<p>{{ currentJob.shopId ? (shopifyShops.find(shop => shop.shopId === currentJob.shopId)?.name || currentJob.shopId) : translate("No shop selected") }}</p>
<p>{{ currentJob.shopId ? (getShopNameById(currentJob.shopId) || currentJob.shopId) : translate("No shop selected") }}</p>
</ion-label>
</ion-item>
</ion-list>
Expand Down Expand Up @@ -169,6 +169,10 @@ export default defineComponent({
this.isJobNameUpdating = false
}
},
getShopNameById(shopId) {
const shop = this.shopifyShops.find(shop => shop.shopId === shopId);
return shop?.name;
},
getTime(time) {
return DateTime.fromMillis(time, { setZone: true}).toFormat("hh:mm a dd MMM yyyy")
},
Expand Down

0 comments on commit a678fd5

Please sign in to comment.