Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved: Order detail page on the open tab (#283) #302

Merged
merged 27 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
428740b
Implemented: Mobile-Responsive Order Detail Page UI with Order Items …
sanskar345 Sep 20, 2023
eb2a5fd
Implemented: Order Detail Page UI, inspired by Job Manager app (#283)
sanskar345 Sep 21, 2023
dda48c5
Implemented: alphabatical ordering of export components and imports a…
sanskar345 Sep 21, 2023
ba26058
Implemented: option in setting to allow partial order rejection and c…
sanskar345 Sep 26, 2023
8b79775
Implemented: order item rejection history modal and report an issue m…
sanskar345 Sep 27, 2023
21869d8
Fixed: error while refreshing order detail page (#283)
sanskar345 Sep 27, 2023
2c85db2
Implemented: comment the code to display text below the reject order …
sanskar345 Sep 27, 2023
68dfd0a
Implemented: logic for showing user the status of the current order i…
sanskar345 Sep 29, 2023
2d531d3
Implemented logic to reject single item in an order (#283)
sanskar345 Sep 29, 2023
72c3cf7
Improved: logic to reject single item in an order (#283)
sanskar345 Oct 3, 2023
df0ae34
Implemented: entries in locale files (#283)
sanskar345 Oct 3, 2023
4f59112
Improved: code by removing the unwanted lines (#283)
sanskar345 Oct 3, 2023
e997b7c
Implemented: logic to fetch orderItemHistory and reject reasons and c…
sanskar345 Oct 3, 2023
53d6883
Improved: order detail page UI using css grid, removed the the usage …
sanskar345 Oct 4, 2023
b5b2ca3
Implemented: entries in locale files for partial order rejection card…
sanskar345 Oct 4, 2023
4c3b8d1
Implemented: display order item rejection history (#283)
sanskar345 Oct 4, 2023
11273ca
Improved: order detail page css - placing the grid item (#283)
sanskar345 Oct 5, 2023
9826ba9
Implemented: logic to fetch products that exist in order item rejecti…
sanskar345 Oct 5, 2023
228e81e
Improved: reject order alert heading and button label (#283)
sanskar345 Oct 5, 2023
a19a276
Implemented: show alert before rejecting a single item (#283)
sanskar345 Oct 5, 2023
4b3e6e0
Improved: code and indentation (#283)
sanskar345 Oct 5, 2023
b81152c
Implemented: service to reject a single order item (#283)
sanskar345 Oct 6, 2023
3368b32
Improved: code and removed conditions that are unnecessary (#283)
sanskar345 Oct 6, 2023
4817eef
Improved: the placement of empty states css code in variables.css (#283)
sanskar345 Oct 9, 2023
2d32058
Merge branch 'main' of https://github.com/hotwax/bopis into bopis/#283
sanskar345 Oct 11, 2023
2f7a6cb
Implemented: do not dispatch stock/addProducts action while dispatchi…
sanskar345 Oct 11, 2023
a3f2c89
Implemented: modal to select reject reason before rejecting an order …
sanskar345 Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/adapter/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { api, client, hasError, initialise, resetConfig, updateInstanceUrl, updateToken, getUserFacilities } from '@hotwax/oms-api'
import { api, client, getConfig, hasError, initialise, resetConfig, updateInstanceUrl, updateToken, getUserFacilities } from '@hotwax/oms-api'

export {
api,
client,
getConfig,
initialise,
hasError,
resetConfig,
Expand Down
99 changes: 99 additions & 0 deletions src/components/OrderItemRejHistoryModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<template>
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-button @click="closeModal">
<ion-icon slot="icon-only" :icon="closeOutline" />
</ion-button>
</ion-buttons>
<ion-title>{{ $t("Order item rejection history") }}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list v-for="(item, index) in [1]" :key="index">
<ion-item>
<ion-thumbnail slot="start">
<ShopifyImg :src="getProduct('10002').mainImageUrl" />
</ion-thumbnail>
<ion-label>
<h5>{{ getProduct("10002").brandName }}</h5>
<h2>{{ getProduct("10002").productName }}</h2>
<p v-if="$filters.getFeature(getProduct('10002').featureHierarchy, '1/COLOR/')">{{ $t("Color") }}: {{ $filters.getFeature(getProduct("10002").featureHierarchy, '1/COLOR/') }}</p>
<p v-if="$filters.getFeature(getProduct('10002').featureHierarchy, '1/SIZE/')">{{ $t("Size") }}: {{ $filters.getFeature(getProduct("10002").featureHierarchy, '1/SIZE/') }}</p>
</ion-label>
<ion-label slot="end" class="ion-text-right">
<h2>{{ 'Not in stock' }}</h2>
<p>{{ $t('Rejected by', { userName: 'user-name', rejectionTime: 'rejection-time' }) }}</p>
</ion-label>
</ion-item>
</ion-list>

<!-- Empty state -->
<div v-if="!([1,3].length)" class="empty-state">
<p>{{ $t('No records found.') }}</p>
</div>
</ion-content>
</template>

<script lang="ts">
import {
IonButton,
IonButtons,
IonContent,
IonHeader,
IonIcon,
IonItem,
IonThumbnail,
IonLabel,
IonList,
IonTitle,
IonToolbar,
modalController
} from '@ionic/vue';
import { defineComponent } from 'vue';
import { closeOutline } from 'ionicons/icons';
import { mapGetters, useStore } from "vuex";

export default defineComponent({
name: "OrderItemRejHistoryModal",
components: {
IonButton,
IonButtons,
IonContent,
IonHeader,
IonIcon,
IonItem,
IonThumbnail,
IonLabel,
IonList,
IonTitle,
IonToolbar,
},
computed: {
...mapGetters({
getProduct: 'product/getProduct',
order: "order/getCurrent",
rejectReasons: 'util/getRejectReasons',
rejectionHistory: 'order/getOrderItemRejectionHistory'
})
},
async mounted() {
await this.store.dispatch('order/getOrderItemRejHistory', { orderId: this.order.orderId, rejectReasons: this.rejectReasons.reduce((enumIds: [], reason: any) => [ ...enumIds, reason.enumId ], []) });
console.log('--- ', this.rejectionHistory);

},
methods: {
closeModal() {
modalController.dismiss({ dismissed: true });
}
},
setup() {
const store = useStore();

return {
closeOutline,
store
};
},
});
</script>
7 changes: 6 additions & 1 deletion src/components/ProductListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<p v-if="$filters.getFeature(getProduct(item.productId).featureHierarchy, '1/SIZE/')">{{ $t("Size") }}: {{ $filters.getFeature(getProduct(item.productId).featureHierarchy, '1/SIZE/') }}</p>
</ion-label>
<!-- Only show stock if its not a ship to store order -->
<ion-note v-if="!isShipToStoreOrder" slot="end">{{ getProductStock(item.productId) }} {{ $t("in stock") }}</ion-note>
<ion-note v-if="!isShipToStoreOrder" slot="end" :color="updateColor(getProductStock(item.productId))">{{ getProductStock(item.productId) }} {{ $t("in stock") }}</ion-note>
</ion-item>
</template>

Expand Down Expand Up @@ -46,6 +46,11 @@ export default {
getProduct: 'product/getProduct',
getProductStock: 'stock/getProductStock'
})
},
methods: {
updateColor(stock: number) {
return stock ? stock < 10 ? 'warning' : 'success' : 'danger';
}
}
}
</script>
Expand Down
116 changes: 116 additions & 0 deletions src/components/ReportAnIssueModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<template>
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-button @click="closeModal">
<ion-icon slot="icon-only" :icon="closeOutline" />
</ion-button>
</ion-buttons>
<ion-title>{{ $t("Report an issue") }}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-item lines="none">
<p>{{ $t('On rejecting this item, will be sent an email with alternate fulfillment options and this order item will be removed from your dashboard.', { customerName: order.customer?.name }) }}</p>
</ion-item>
<ion-list>
<ion-list-header>{{ $t("Select reason") }}</ion-list-header>
<ion-radio-group v-model="rejectReasonId">
<ion-item v-for="reason in unfillableReason" :key="reason.id">
<ion-radio slot="start" :value="reason.id"/>
<ion-label>{{ $t(reason.label) }}</ion-label>
</ion-item>
</ion-radio-group>
</ion-list>
<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button :disabled="!rejectReasonId" @click="confirmSave()">
<ion-icon :icon="saveOutline" />
</ion-fab-button>
</ion-fab>
</ion-content>
</template>

<script lang="ts">
import {
IonButton,
IonButtons,
IonContent,
IonFab,
IonFabButton,
IonHeader,
IonIcon,
IonItem,
IonLabel,
IonList,
IonListHeader,
IonTitle,
IonToolbar,
modalController,
IonRadio,
IonRadioGroup
} from '@ionic/vue';
import { defineComponent } from 'vue';
import { closeOutline, saveOutline } from 'ionicons/icons';
import { mapGetters, useStore } from 'vuex'

export default defineComponent({
name: "ReportAnIssueModal",
components: {
IonButton,
IonButtons,
IonContent,
IonFab,
IonFabButton,
IonHeader,
IonIcon,
IonItem,
IonLabel,
IonList,
IonListHeader,
IonTitle,
IonToolbar,
IonRadio,
IonRadioGroup
},
props: ['item'],
data () {
return {
unfillableReason: JSON.parse(process.env.VUE_APP_UNFILLABLE_REASONS),
rejectReasonId: ''
}
},
computed: {
...mapGetters({
order: "order/getCurrent"
})
},
methods: {
closeModal() {
modalController.dismiss({ dismissed: true });
},
confirmSave () {
this.store.dispatch('order/setUnfillableOrderOrItem', { orderId: this.order.orderId, part: { ...this.order.part, items: [{ ...this.item, reason: this.rejectReasonId }] } }).then((resp) => {
if (resp) {
// creating an current order copy by removing the selected item from the order.part
const order = { ...this.order, part: { ...this.order.part, items: this.order.part.items.filter((item: any) => !(item.orderItemSeqId === this.item.orderItemSeqId && item.productId === this.item.productId)) }};

// If this is the last item of the order then the order is fully rejected
if(this.order.part.items.length === 1) order.rejected = true;

this.store.dispatch('order/updateCurrent', { order });
}
this.closeModal();
})
}
},
setup() {
const store = useStore();

return {
closeOutline,
saveOutline,
store
};
}
});
</script>
8 changes: 8 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,19 @@
"No reason": "No reason",
"No picker assigned.": "No picker assigned.",
"No picker found": "No picker found",
"No records found.": "No records found.",
"No time zone found": "No time zone found",
"Open": "Open",
"OMS": "OMS",
"OMS instance": "OMS instance",
"On rejecting this item, will be sent an email with alternate fulfillment options and this order item will be removed from your dashboard.": "On rejecting this item, { customerName } will be sent an email with alternate fulfillment options and this order item will be removed from your dashboard.",
"Other stores inventory": "Other stores inventory",
"Order": "Order",
"Order delivered to": "Order delivered to { customerName }",
"Order details": "Order details",
"Order edit permissions": "Order edit permissions",
"Order is now ready to handover.": "Order is now ready to handover.",
"Order has been rejected.": "Order has been rejected.",
"Order marked as ready for pickup, an email notification has been sent to the customer": "Order marked as ready for pickup, an email notification has been sent to the customer",
"Order marked as ready for pickup but something went wrong while sending the email notification": "Order marked as ready for pickup but something went wrong while sending the email notification",
"Order not found": "Order not found",
Expand All @@ -80,6 +84,7 @@
"Order will be marked as completed. This action is irreversible.": "Order will be marked as completed. This action is irreversible.",
"Orders": "Orders",
"Orders Not Found": "Orders Not Found",
"Order item rejection history": "Order item rejection history",
"Other stores": "Other stores",
"Packed": "Packed",
"Packing Slip": "Packing Slip",
Expand All @@ -96,12 +101,15 @@
"Ready to create an app?": "Ready to create an app?",
"Ready to ship": "Ready to ship",
"Reject Order": "Reject Order",
"Rejected by": "Rejected by { username } | { rejectionTime }",
"Reason": "Reason",
"Report an issue": "Report an issue",
"Resend ready for pickup email": "Resend ready for pickup email",
"Search": "Search",
"Search Orders": "Search Orders",
"Search time zones": "Search time zones",
"Select facility": "Select facility",
"Select reason": "Select reason",
"Select time zone": "Select time zone",
"Select your preferred language.": "Select your preferred language.",
"Settings": "Settings",
Expand Down
8 changes: 8 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@
"No reason": "Sin razón",
"No picker assigned.": "No picker assigned.",
"No picker found": "No se encontró recolector",
"No records found.": "No records found.",
"No time zone found": "No se encontró zona horaria",
"Open": "Abierto",
"OMS": "OMS",
"OMS instance": "Instancia de OMS",
"On rejecting this item, will be sent an email with alternate fulfillment options and this order item will be removed from your dashboard.": "On rejecting this item, { customerName } will be sent an email with alternate fulfillment options and this order item will be removed from your dashboard.",
"Other stores inventory": "Inventario de otras tiendas",
"Order": "Orden",
"Order delivered to": "Orden entregada a {customerName}",
"Order details": "Detalles de la orden",
"Order edit permissions": "Permisos de edición de la orden",
"Order is now ready to handover.": "Order is now ready to handover.",
"Order has been rejected.": "Order has been rejected.",
"Order marked as ready for pickup, an email notification has been sent to the customer": "Pedido marcado como listo para recoger, se ha enviado una notificación por correo electrónico al cliente",
"Order marked as ready for pickup but something went wrong while sending the email notification": "Pedido marcado como listo para recoger pero algo salió mal al enviar la notificación por correo electrónico",
"Order not found": "Orden no encontrada",
Expand All @@ -79,6 +83,7 @@
"Order will be marked as completed. This action is irreversible.": "El pedido se marcará como completado. Esta acción es irreversible.",
"Orders": "Órdenes",
"Orders Not Found": "Órdenes no encontradas",
"Order item rejection history": "Order item rejection history",
"Other stores": "Otras tiendas",
"Packed": "Empacado",
"Packing Slip": "Remisión de embalaje",
Expand All @@ -95,12 +100,15 @@
"Ready to create an app?": "¿Listo para crear una aplicación?",
"Ready to ship": "Listo para enviar",
"Reject Order": "Rechazar pedido",
"Rejected by": "Rejected by { username } | { rejectionTime }",
"Reason": "Razón",
"Report an issue": "Report an issue",
"Resend ready for pickup email": "Reenviar correo electrónico de listo para recoger",
"Search": "Buscar",
"Search Orders": "Buscar pedidos",
"Search time zones": "Buscar zonas horarias",
"Select facility": "Seleccionar instalación",
"Select reason": "Select reason",
"Select time zone": "Seleccionar zona horaria",
"Select your preferred language.": "Selecciona tu idioma preferido.",
"Settings": "Configuraciones",
Expand Down
8 changes: 8 additions & 0 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@
"No reason": "理由なし",
"No picker assigned.": "No picker assigned.",
"No picker found": "受取人が見つかりません",
"No records found.": "No records found.",
"No time zone found": "タイムゾーンが見つかりません",
"Open": "オープン",
"OMS": "OMS",
"OMS instance": "OMSインスタンス",
"On rejecting this item, will be sent an email with alternate fulfillment options and this order item will be removed from your dashboard.": "On rejecting this item, { customerName } will be sent an email with alternate fulfillment options and this order item will be removed from your dashboard.",
"Other stores inventory": "その他店舗在庫",
"Order": "注文",
"Order delivered to": "注文は { customerName }様 に配達されました",
"Order details": "注文詳細",
"Order edit permissions": "注文の編集権限",
"Order is now ready to handover.": "Order is now ready to handover.",
"Order has been rejected.": "Order has been rejected.",
"Order marked as ready for pickup, an email notification has been sent to the customer": "注文された商品の受取準備完了とマークされ、Eメールによる通知がお客様に送信されました。",
"Order marked as ready for pickup but something went wrong while sending the email notification": "注文された商品の受取準備完了とマークされましたが、Eメールによる通知の送信中に何かしらの問題が発生しました。",
"Order not found": "注文が見つかりません",
Expand All @@ -79,6 +83,7 @@
"Order will be marked as completed. This action is irreversible.": "注文の完了がマークされます。この操作は元に戻せません。",
"Orders": "注文",
"Orders Not Found": "注文が見つかりません",
"Order item rejection history": "Order item rejection history",
"Other stores": "Other stores",
"Packed": "梱包済み",
"Packing slip": "納品書",
Expand All @@ -95,12 +100,15 @@
"Ready to create an app?": "アプリを作成する準備はできましたか?",
"Ready to ship": "出荷する準備ができました",
"Reject Order": "注文を拒否",
"Rejected by": "Rejected by { username } | { rejectionTime }",
"Reason": "理由",
"Report an issue": "Report an issue",
"Resend ready for pickup email": "受取準備完了メールの再送",
"Search": "検索",
"Search Orders": "注文の検索",
"Search time zones": "タイムゾーンの検索",
"Select facility": "拠点の検索",
"Select reason": "Select reason",
"Select time zone": "タイムゾーンを選択",
"Select your preferred language.": "お好みの言語の選択",
"Settings": "設定",
Expand Down
Loading