From aa6c934a57efb74df43a61b73e2833cf768f667d Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 3 Nov 2023 12:54:44 +0530 Subject: [PATCH 1/5] Improved: order details page behaviour and texts --- src/components/RejectOrderModal.vue | 30 ++++++++--------------------- src/locales/en.json | 5 +++-- src/locales/es.json | 5 +++-- src/locales/ja.json | 5 +++-- src/store/modules/order/actions.ts | 11 +++++++---- src/utils/index.ts | 8 ++++++-- src/views/AssignPickerModal.vue | 14 ++++++++++++-- src/views/OrderDetail.vue | 25 ++++++++++++++---------- src/views/Orders.vue | 2 +- src/views/ShipToStoreOrders.vue | 2 +- 10 files changed, 59 insertions(+), 48 deletions(-) diff --git a/src/components/RejectOrderModal.vue b/src/components/RejectOrderModal.vue index 67a455489..47175ac87 100644 --- a/src/components/RejectOrderModal.vue +++ b/src/components/RejectOrderModal.vue @@ -91,28 +91,14 @@ export default defineComponent({ modalController.dismiss({ dismissed: true }); }, async confirmSave() { - const alert = await alertController - .create({ - header: translate('Reject Order'), - message: translate(`This order will be removed from your dashboard. This action cannot be undone.`, { space: '

' }), - buttons: [{ - text: translate('Cancel'), - role: 'cancel' - }, { - text: translate('Reject'), - handler: () => { - const part = { ...this.order.part, items: this.order.part.items.map((item: any) => ({ ...item, reason: this.rejectReasonId })) }; - this.store.dispatch('order/setUnfillableOrderOrItem', { orderId: this.order.orderId, part }).then((resp) => { - if (resp) { - // Mark current order as rejected - this.store.dispatch('order/updateCurrent', { order: { ...this.order, rejected: true } }) - } - this.closeModal(); - }) - }, - }] - }); - return alert.present(); + const part = { ...this.order.part, items: this.order.part.items.map((item: any) => ({ ...item, reason: this.rejectReasonId })) }; + this.store.dispatch('order/setUnfillableOrderOrItem', { orderId: this.order.orderId, part }).then((resp) => { + if (resp) { + // Mark current order as rejected + this.store.dispatch('order/updateCurrent', { order: { ...this.order, rejected: true } }) + } + this.closeModal(); + }) } }, setup() { diff --git a/src/locales/en.json b/src/locales/en.json index 6eac216d9..43c900c3c 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -25,6 +25,7 @@ "Configuration updated": "Configuration updated", "Confirm": "Confirm", "Copied": "Copied { text }", + "Copied to clipboard": "Copied to clipboard", "Copy": "Copy", "Depending on the reason you select for not fulfulling an item, an inventory variance will be recorded and all sales channels will be updated with new inventory levels. For example, by selecting “Not in stock” HotWax Commerce will stop routing orders for it to your store and customers will not be able to place BOPIS orders for it at your store on Shopify.": "Depending on the reason you select for not fulfulling an item, an inventory variance will be recorded and all sales channels will be updated with new inventory levels.{ space } For example, by selecting “Not in stock” HotWax Commerce will stop routing orders for it to your store and customers will not be able to place BOPIS orders for it at your store on Shopify.", "Delivery address": "Delivery address", @@ -90,6 +91,7 @@ "Order details": "Order details", "Order edit permissions": "Order edit permissions", "Order is now ready to handover.": "Order is now ready to handover.", + "Order is now ready to be shipped.": "Order is now ready to be shipped.", "Order is successfully handed over to customer.": "Order is successfully handed over to customer.", "Order is successfully shipped.": "Order is successfully shipped.", "Order has been rejected.": "Order has been rejected.", @@ -125,7 +127,7 @@ "Reason": "Reason", "Report an issue": "Report an issue", "Resend customer email": "Resend customer email", - "Resend ready for pickup email": "Resend ready for pickup email", + "Resend email": "Resend email", "Search": "Search", "Search Orders": "Search Orders", "Search time zones": "Search time zones", @@ -175,7 +177,6 @@ "Warehouse": "Warehouse", "will be removed from your dashboard. This action cannot be undone.": "{ productName } will be removed from your dashboard.{ space } This action cannot be undone.", "Worn Display": "Worn Display", - "This order will be removed from your dashboard. This action cannot be undone.": "This order will be removed from your dashboard.{ space } This action cannot be undone.", "Update notification preferences": "Update notification preferences", "View shipping orders along with pickup orders.": "View shipping orders along with pickup orders.", "You do not have permission to access this page": "You do not have permission to access this page", diff --git a/src/locales/es.json b/src/locales/es.json index f9686cbe6..e749af993 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -25,6 +25,7 @@ "Configuration updated": "Configuración actualizada", "Confirm": "Confirmar", "Copied": "Copiado { text }", + "Copied to clipboard": "Copied to clipboard", "Copy": "Copiar", "Depending on the reason you select for not fulfilling an item, an inventory variance will be recorded and all sales channels will be updated with new inventory levels. For example, by selecting “Not in stock” HotWax Commerce will stop routing orders for it to your store and customers will not be able to place BOPIS orders for it at your store on Shopify.": "Dependiendo de la razón que selecciones para no cumplir con un artículo, se registrará una variación de inventario y se actualizarán todos los canales de ventas con nuevos niveles de inventario. { space } Por ejemplo, al seleccionar “No disponible en el inventario” HotWax Commerce dejará de dirigir los pedidos para él a tu tienda y los clientes no podrán hacer pedidos BOPIS para él en tu tienda en Shopify.", "Delivery address": "Dirección de entrega", @@ -89,6 +90,7 @@ "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 is now ready to be shipped.": "Order is now ready to be shipped.", "Order is successfully handed over to customer.": "Order is successfully handed over to customer.", "Order is successfully shipped.": "Order is successfully shipped.", "Order has been rejected.": "Order has been rejected.", @@ -124,7 +126,7 @@ "Reason": "Razón", "Report an issue": "Report an issue", "Resend customer email": "Resend customer email", - "Resend ready for pickup email": "Reenviar correo electrónico de listo para recoger", + "Resend email": "Resend email", "Search": "Buscar", "Search Orders": "Buscar pedidos", "Search time zones": "Buscar zonas horarias", @@ -175,7 +177,6 @@ "Warehouse": "Almacén", "will be removed from your dashboard. This action cannot be undone.": "{ productName } will be removed from your dashboard.{ space } This action cannot be undone.", "Worn Display": "Pantalla desgastada", - "This order will be removed from your dashboard. This action cannot be undone.": "Este pedido será eliminado de tu panel de control.{ space } Esta acción no se puede deshacer.", "Update notification preferences": "Update notification preferences", "View shipping orders along with pickup orders.": "Ver órdenes de envío junto con órdenes de recogida.", "You do not have permission to access this page": "No tienes permiso para acceder a esta página", diff --git a/src/locales/ja.json b/src/locales/ja.json index 071b476a8..23ab1459d 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -25,6 +25,7 @@ "Configuration updated": "設定の更新", "Confirm": "決定", "Copied": "コピーされた{ text }", + "Copied to clipboard": "Copied to clipboard", "Copy": "コピー", "Depending on the reason you select for not fulfulling an item, an inventory variance will be recorded and all sales channels will be updated with new inventory levels. For example, by selecting “Not in stock” HotWax Commerce will stop routing orders for it to your store and customers will not be able to place BOPIS orders for it at your store on Shopify.": "アイテムをフルフィルメントしないために選択した理由に応じて、在庫差異が記録され、すべての販売チャネルが新しい在庫レベルで更新されます。{ space } たとえば、[在庫なし] を選択すると、HotWax Commerce はストアへの注文のルーティングを停止し、顧客は 貴方の Shopify のストアで BOPIS 注文を行うことができなくなります。", "Delivery address": "お届け先住所", @@ -89,6 +90,7 @@ "Order details": "注文詳細", "Order edit permissions": "注文の編集権限", "Order is now ready to handover.": "Order is now ready to handover.", + "Order is now ready to be shipped.": "Order is now ready to be shipped.", "Order is successfully handed over to customer.": "Order is successfully handed over to customer.", "Order is successfully shipped.": "Order is successfully shipped.", "Order has been rejected.": "Order has been rejected.", @@ -124,7 +126,7 @@ "Reason": "理由", "Report an issue": "Report an issue", "Resend customer email": "Resend customer email", - "Resend ready for pickup email": "受取準備完了メールの再送", + "Resend email": "Resend email", "Search": "検索", "Search Orders": "注文の検索", "Search time zones": "タイムゾーンの検索", @@ -174,7 +176,6 @@ "Warehouse": "倉庫", "will be removed from your dashboard. This action cannot be undone.": "{ productName } will be removed from your dashboard.{ space } This action cannot be undone.", "Worn Display": "すり切れたディスプレイ", - "This order will be removed from your dashboard. This action cannot be undone.": "この注文はダッシュボードから削除されます。{ space } この操作は元に戻せません。", "Update notification preferences": "Update notification preferences", "View shipping orders along with pickup orders.": "店舗受取の注文と一緒に配送注文を表示します", "You do not have permission to access this page": "このページにアクセスする権限がありません", diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 0d271bb87..25d2389b6 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -478,10 +478,13 @@ const actions: ActionTree ={ } }) } - // Added ready to handover because we need to show the user that the order has moved to the packed tab (ready to handover) - await dispatch('updateCurrent', { order : { ...payload.order, readyToHandover: true } }) - - showToast(translate("Order packed and ready for delivery")) + // Adding readyToHandover or readyToShip because we need to show the user that the order has moved to the packed tab + if(payload.order.part.shipmentMethodEnum.shipmentMethodEnumId === 'STOREPICKUP'){ + payload.order = { ...payload.order, readyToHandover: true } + }else { + payload.order = { ...payload.order, readyToShip: true } + } + await dispatch('updateCurrent', { order : payload.order }) } else { showToast(translate("Something went wrong")) } diff --git a/src/utils/index.ts b/src/utils/index.ts index dc4889dbf..db5e1b5d7 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -15,13 +15,17 @@ const showToast = async (message: string) => { return toast.present(); } -const copyToClipboard = async (text: any) => { +const copyToClipboard = async (text: any, showCopiedValue?: boolean) => { const { Clipboard } = Plugins; await Clipboard.write({ string: text, }).then(() => { - showToast(translate("Copied", { text })); + if(showCopiedValue) { + showToast(translate("Copied", { text })); + } else { + showToast(translate("Copied to clipboard")); + } }); } diff --git a/src/views/AssignPickerModal.vue b/src/views/AssignPickerModal.vue index 63e34d47c..02f3213d1 100644 --- a/src/views/AssignPickerModal.vue +++ b/src/views/AssignPickerModal.vue @@ -7,7 +7,6 @@ {{ translate("Assign Pickers") }} - {{ part.shipmentMethodEnum?.shipmentMethodEnumId === 'STOREPICKUP' ? translate("Ready for pickup") : translate("Ready to ship") }} @@ -38,6 +37,12 @@ /> + + + + + +