diff --git a/src/adapter/index.ts b/src/adapter/index.ts index 0ec8f0c2..f120d007 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -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, hasError, initialise, resetConfig, diff --git a/src/components/EditPickersModal.vue b/src/components/EditPickersModal.vue index e72a33ad..12badbaa 100644 --- a/src/components/EditPickersModal.vue +++ b/src/components/EditPickersModal.vue @@ -179,9 +179,9 @@ export default defineComponent({ } }, async confirmSave() { - const message = this.$t("Are you sure you want to remove the current pickers from the picklist and replace them with new pickers?"); + const message = this.$t("Replace current pickers with new selection?"); const alert = await alertController.create({ - header: this.$t("Edit pickers"), + header: this.$t("Replace pickers"), message, buttons: [ { diff --git a/src/locales/en.json b/src/locales/en.json index 5cd5e7ce..619fb770 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,7 +1,6 @@ { "All": "All", "App": "App", - "Are you sure you want to remove the current pickers from the picklist and replace them with new pickers?": "Are you sure you want to remove the current pickers from the picklist and replace them with new pickers?", "A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.": "A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.", "doesn't have any completed orders right now.": "{facilityName} doesn't have any completed orders right now.", "doesn't have any orders in progress right now.": "{facilityName} doesn't have any orders in progress right now.", @@ -40,9 +39,6 @@ "Dismiss": "Dismiss", "Delete": "Delete", "Delete mapping": "Delete mapping", - "Download": "Download", - "Download orders that are packed and haven't been shipped yet. Use the downloaded file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.": "Download orders that are packed and haven't been shipped yet. Use the downloaded file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.", - "Download packed orders": "Download packed orders", "eCom Store": "eCom Store", "Edit packaging": "Edit packaging", "Edit pickers": "Edit pickers", @@ -52,7 +48,10 @@ "Enter mapping name": "Enter mapping name", "Enter value": "Enter value", "EXIM": "EXIM", + "Export": "Export", "Export Orders": "Export Orders", + "Export orders that are packed and haven't been shipped yet. Use the exported file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.": "Export orders that are packed and haven't been shipped yet. Use the exported file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.", + "Export packed orders": "Export packed orders", "Facility": "Facility", "Facility Address 1": "Facility Address 1", "Facility Address 2": "Facility Address 2", @@ -89,6 +88,8 @@ "Generate shipping label": "Generate shipping label", "Go to OMS": "Go to OMS", "Go to Launchpad": "Go to Launchpad", + "is identified as unfulfillable. other containing this product will be unassigned from this store and sent to be rebrokered.": "{ productName } is identified as unfulfillable. { space } { orders } other { orderText } containing this product will be unassigned from this store and sent to be rebrokered.", + "is identified as unfulfillable. This order item will be unassigned from this store and sent to be rebrokered.": "{ productName } is identified as unfulfillable. { space } This order item will be unassigned from this store and sent to be rebrokered.", "is identified as. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as { rejectReason }. This order item will be unassigned from the store and sent to be rebrokered.", "item": "item", "items": "items", @@ -180,6 +181,8 @@ "Rejecting has been started. All outstanding orders will be rejected shortly.": "Rejecting has been started. All outstanding orders will be rejected shortly.", "Regenerate Shipping Label": "Regenerate Shipping Label", "Replace": "Replace", + "Replace pickers": "Replace pickers", + "Replace current pickers with new selection?": "Replace current pickers with new selection?", "Report": "Report", "Report an issue": "Report an issue", "Result Size": "Result Size", @@ -265,6 +268,7 @@ "You are shipping orders. You cannot unpack and edit orders after they have been shipped. Are you sure you are ready to ship this orders?": "You are shipping { count } order. { space } You cannot unpack and edit orders after they have been shipped. Are you sure you are ready to ship this order? | You are shipping { count } orders. { space } You cannot unpack and edit orders after they have been shipped. Are you sure you are ready to ship these orders?", "You do not have permission to access this page": "You do not have permission to access this page", "Zip Code": "Zip Code", - ", and other products are identified as unfulfillable. other orders containing these products will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products are identified as unfulfillable. { space } { orders } other orders containing these products will be unassigned from this store and sent to be rebrokered.", + ", and other products are identified as unfulfillable. These order items will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products are identified as unfulfillable. { space } These order items will be unassigned from this store and sent to be rebrokered.", + ", and other products are identified as unfulfillable. other containing these products will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products are identified as unfulfillable. { space } { orders } other { orderText } containing these products will be unassigned from this store and sent to be rebrokered.", ", and other products were identified as unfulfillable. These items will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products were identified as unfulfillable. { space } These items will be unassigned from this store and sent to be rebrokered." } \ No newline at end of file diff --git a/src/locales/es.json b/src/locales/es.json index 0b6b50aa..dec0ccca 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1,7 +1,6 @@ { "All": "All", "App": "App", - "Are you sure you want to remove the current pickers from the picklist and replace them with new pickers?": "Are you sure you want to remove the current pickers from the picklist and replace them with new pickers?", "A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.": "A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.", "doesn't have any completed orders right now.": "{facilityName} no tiene ningún pedido completado en este moment.", "doesn't have any orders in progress right now.": "{facilityName} no tiene ningún pedido en curso en este moment.", @@ -40,9 +39,6 @@ "Dismiss": "Dismiss", "Delete": "Delete", "Delete mapping": "Delete mapping", - "Download": "Descargar", - "Download orders that are packed and haven't been shipped yet. Use the downloaded file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.": "Descarga los pedidos que están empacados y aún no se han enviado. Utiliza el archivo descargado para enviar los detalles de los pedidos empacados a una empresa de transporte donde se generarán las etiquetas de envío y los códigos de seguimiento.", - "Download packed orders": "Descargar pedidos empacados", "eCom Store": "Tienda eCom", "Edit packaging": "Editar empaque", "Edit pickers": "Edit pickers", @@ -52,7 +48,10 @@ "Enter mapping name": "Enter mapping name", "Enter value": "Ingresar valor", "EXIM": "EXIM", + "Export": "Export", "Export Orders": "Export Orders", + "Export orders that are packed and haven't been shipped yet. Use the exported file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.": "Export orders that are packed and haven't been shipped yet. Use the exported file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.", + "Export packed orders": "Export packed orders", "Facility": "Facility", "Facility Address 1": "Facility Address 1", "Facility Address 2": "Facility Address 2", @@ -89,6 +88,8 @@ "Generate shipping label": "Generate shipping label", "Go to OMS": "Go to OMS", "Go to Launchpad": "Go to Launchpad", + "is identified as unfulfillable. other containing this product will be unassigned from this store and sent to be rebrokered.": "{ productName } is identified as unfulfillable. { space } { orders } other { orderText } containing this product will be unassigned from this store and sent to be rebrokered.", + "is identified as unfulfillable. This order item will be unassigned from this store and sent to be rebrokered.": "{ productName } is identified as unfulfillable. { space } This order item will be unassigned from this store and sent to be rebrokered.", "is identified as. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as { rejectReason }. This order item will be unassigned from the store and sent to be rebrokered.", "item": "artículo", "items": "artículos", @@ -181,6 +182,8 @@ "Rejecting has been started. All outstanding orders will be rejected shortly.": "Rejecting has been started. All outstanding orders will be rejected shortly.", "Regenerate Shipping Label": "Regenerate Shipping Label", "Replace": "Replace", + "Replace pickers": "Replace pickers", + "Replace current pickers with new selection?": "Replace current pickers with new selection?", "Report": "Reporte", "Report an issue": "Reportar un problema", "Result Size": "Tamaño del Resultado", @@ -266,6 +269,7 @@ "You are packing orders. Select additional documents that you would like to print.": "Estás empacando {count} pedidos. {space} Selecciona documentos adicionales que te gustaría imprimir.", "You are shipping orders. You cannot unpack and edit orders after they have been shipped. Are you sure you are ready to ship this orders?": "Estás enviando {count} pedido. {space} No puedes desempacar ni editar los pedidos una vez que se hayan enviado. ¿Estás seguro/a de que estás listo/a para enviar este pedido? | Estás enviando {count} pedidos. {space} No puedes desempacar ni editar los pedidos una vez que se hayan enviado. ¿Estás seguro/a de que estás listo/a para enviar estos pedidos?", "Zip Code": "Zip Code", - ", and other products are identified as unfulfillable. other orders containing these products will be unassigned from this store and sent to be rebrokered.": "{productName}, y {products} otros productos se identificaron como no realizables. {space} {orders} otros pedidos que contienen estos productos serán desasignados de esta tienda y enviados para ser reasignados.", + ", and other products are identified as unfulfillable. These order items will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products are identified as unfulfillable. { space } These order items will be unassigned from this store and sent to be rebrokered.", + ", and other products are identified as unfulfillable. other containing these products will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products are identified as unfulfillable. { space } { orders } other { orderText } containing these products will be unassigned from this store and sent to be rebrokered.", ", and other products were identified as unfulfillable. These items will be unassigned from this store and sent to be rebrokered.": "{ productName }, and { products } other products were identified as unfulfillable. { space } These items will be unassigned from this store and sent to be rebrokered." } diff --git a/src/main.ts b/src/main.ts index a7934e93..1c4c7dda 100644 --- a/src/main.ts +++ b/src/main.ts @@ -32,6 +32,7 @@ import permissionRules from '@/authorization/Rules'; import permissionActions from '@/authorization/Actions'; import { dxpComponents } from '@hotwax/dxp-components'; import { login, logout, loader } from './user-utils'; +import { getConfig, initialise } from './adapter'; const app = createApp(App) .use(IonicVue, { @@ -52,7 +53,9 @@ const app = createApp(App) login, logout, loader, - appLoginUrl: process.env.VUE_APP_LOGIN_URL as string + appLoginUrl: process.env.VUE_APP_LOGIN_URL as string, + getConfig, + initialise }); router.isReady().then(() => { diff --git a/src/views/DownloadPackedOrders.vue b/src/views/DownloadPackedOrders.vue index c8f6bd99..6177784d 100644 --- a/src/views/DownloadPackedOrders.vue +++ b/src/views/DownloadPackedOrders.vue @@ -3,7 +3,7 @@ - {{ $t("Download packed orders") }} + {{ $t("Export packed orders") }} @@ -51,7 +51,7 @@ - {{ $t("Download") }} + {{ $t("Export") }} diff --git a/src/views/Exim.vue b/src/views/Exim.vue index 8cf13a34..e3e0cdbd 100644 --- a/src/views/Exim.vue +++ b/src/views/Exim.vue @@ -12,18 +12,18 @@ - {{ $t("Download") }} + {{ $t("Export") }} {{ $t('Packed Orders') }} - {{ $t("Download orders that are packed and haven't been shipped yet. Use the downloaded file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.") }} + {{ $t("Export orders that are packed and haven't been shipped yet. Use the exported file to send the packed order details to a carrier where shipping labels and tracking codes will be generated.") }}
- {{ $t('Download') }} + {{ $t('Export') }}
diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index e53fd7a8..23afb1e8 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -539,12 +539,20 @@ export default defineComponent({ } } else { const productName = outOfStockItem.productName - - // TODO: ordersCount is not correct as current we are identifying orders count by only checking items visible on UI and not other orders - const ordersCount = this.inProgressOrders.list.map((order: any) => order.items.filter((item: any) => item.productSku === outOfStockItem.productSku))?.filter((item: any) => item.length).length - - // displaying product count decrement by 1 as we are displaying one product sku directly. - message = this.$t(", and other products are identified as unfulfillable. other orders containing these products will be unassigned from this store and sent to be rebrokered.", {productName, products: itemsToReject.length - 1, space: '

', orders: ordersCount}) + const itemsToRejectNotInStock = itemsToReject.filter((item: any) => item.rejectReason === 'NOT_IN_STOCK'); + + // TODO: ordersCount is not correct as current we are identifying orders count by only checking items visible on UI and not other orders + const ordersCount = this.inProgressOrders.list.map((inProgressOrder: any) => inProgressOrder.items.filter((item: any) => itemsToRejectNotInStock.some((outOfStockItem: any) => outOfStockItem.productSku === item.productSku) && item.orderId !== order.orderId))?.filter((item: any) => item.length).length; + + if (itemsToReject.length === 1 && ordersCount) { + message = this.$t("is identified as unfulfillable. other containing this product will be unassigned from this store and sent to be rebrokered.", { productName, space: '

', orders: ordersCount, orderText: ordersCount > 1 ? 'orders' : 'order' }) + } else if (itemsToReject.length === 1 && !ordersCount) { + message = this.$t("is identified as unfulfillable. This order item will be unassigned from this store and sent to be rebrokered.", { productName, space: '

' }) + } else if (itemsToReject.length > 1 && ordersCount) { + message = this.$t(", and other products are identified as unfulfillable. other containing these products will be unassigned from this store and sent to be rebrokered.", { productName, products: itemsToReject.length - 1, space: '

', orders: ordersCount, orderText: ordersCount > 1 ? 'orders' : 'order' }) + } else { + message = this.$t(", and other products are identified as unfulfillable. These order items will be unassigned from this store and sent to be rebrokered.", { productName, products: itemsToReject.length - 1, space: '

' }) + } } const alert = await alertController .create({