Skip to content

Commit

Permalink
Merge pull request #262 from sanskar345/fulfillment-pwa/#260
Browse files Browse the repository at this point in the history
Implemented: alert messages for Not in stock product selection scenarios while reporting an issue in progress orders, Improved namings in exim page like dowload change to import and Improved message and header of edit picker confirmation alert (#260)
  • Loading branch information
ravilodhi authored Sep 18, 2023
2 parents 9c946b3 + 3f68e2f commit 9ab011c
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 25 deletions.
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,
hasError,
initialise,
resetConfig,
Expand Down
4 changes: 2 additions & 2 deletions src/components/EditPickersModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down
14 changes: 9 additions & 5 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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."
}
14 changes: 9 additions & 5 deletions src/locales/es.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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."
}
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -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(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/views/DownloadPackedOrders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ion-header :translucent="true">
<ion-toolbar>
<ion-back-button slot="start" default-href="/exim" />
<ion-title>{{ $t("Download packed orders") }}</ion-title>
<ion-title>{{ $t("Export packed orders") }}</ion-title>
</ion-toolbar>
</ion-header>

Expand Down Expand Up @@ -51,7 +51,7 @@
</ion-list>

<ion-button size="large" :disabled="!content.length" color="medium" @click="download" expand="block">
{{ $t("Download") }}
{{ $t("Export") }}
</ion-button>

</main>
Expand Down
6 changes: 3 additions & 3 deletions src/views/Exim.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
<ion-card>
<ion-card-header>
<ion-card-subtitle>
{{ $t("Download") }}
{{ $t("Export") }}
</ion-card-subtitle>
<ion-card-title>
{{ $t('Packed Orders') }}
</ion-card-title>
</ion-card-header>
<ion-card-content>
{{ $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.") }}
</ion-card-content>
<div class="border-top">
<ion-button fill="clear" @click="downloadPackedOrders">
{{ $t('Download') }}
{{ $t('Export') }}
<ion-icon slot="end" :icon="downloadOutline" />
</ion-button>
</div>
Expand Down
20 changes: 14 additions & 6 deletions src/views/InProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<br /><br />', 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: '<br /><br />', 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: '<br /><br />' })
} 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: '<br /><br />', 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: '<br /><br />' })
}
}
const alert = await alertController
.create({
Expand Down

0 comments on commit 9ab011c

Please sign in to comment.