From 19d017375a8655c1f0ab5e60fbbd674d1385b41c Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Wed, 6 Sep 2023 11:50:53 +0530 Subject: [PATCH 1/4] Implemented: alert message for Damaged , Worn display and Mismatch while reporting an issue in progress orders (#261). --- src/locales/en.json | 6 +++++- src/locales/es.json | 3 +++ src/views/InProgress.vue | 11 +++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index fd9d12d8..4498ff13 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -89,6 +89,9 @@ "Generate shipping label": "Generate shipping label", "Go to OMS": "Go to OMS", "Go to Launchpad": "Go to Launchpad", + "is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.", + "is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.", + "is identified as mismatched. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as mismatched. This order item will be unassigned from the store and sent to be rebrokered.", "item": "item", "items": "items", "Import": "Import", @@ -263,5 +266,6 @@ "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. 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 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 9b486fcf..addf6072 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -89,6 +89,9 @@ "Generate shipping label": "Generate shipping label", "Go to OMS": "Go to OMS", "Go to Launchpad": "Go to Launchpad", + "is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.", + "is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.", + "is identified as mismatched. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as mismatched. This order item will be unassigned from the store and sent to be rebrokered.", "item": "artículo", "items": "artículos", "Import": "Importar", diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index d845fdf1..c4a8851d 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -528,8 +528,15 @@ export default defineComponent({ // TODO: update alert message when itemsToReject contains a single item and also in some specific conditions let message; - if(!outOfStockItem) { - message = this.$t('Are you sure you want to perform this action?') + if (!outOfStockItem) { + const firstItem = itemsToReject[0]; + if (itemsToReject.length === 1) { + if (firstItem.rejectReason === "REJ_RSN_DAMAGED") message = this.$t('is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName }); + else if (firstItem.rejectReason === "WORN_DISPLAY") message = this.$t('is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName }); + else if (firstItem.rejectReason === "MISMATCH") message = this.$t('is identified as mismatched. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName }); + } else { + message = this.$t(', and other products were identified as unfulfillable.These items will be unassigned from this store and sent to be rebrokered.', { productName: firstItem.productName, products: itemsToReject.length - 1, space: '

' }); + } } else { const productName = outOfStockItem.productName From b65ff77191aad1c324efcaa11d5f7041a9345048 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Tue, 12 Sep 2023 15:05:03 +0530 Subject: [PATCH 2/4] Implemented: passed reject reason in translate options to be used in message rather having if conditions (#261) --- src/locales/en.json | 4 +--- src/locales/es.json | 7 +++---- src/views/InProgress.vue | 4 +--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 4498ff13..4231edaf 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -89,9 +89,7 @@ "Generate shipping label": "Generate shipping label", "Go to OMS": "Go to OMS", "Go to Launchpad": "Go to Launchpad", - "is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.", - "is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.", - "is identified as mismatched. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as mismatched. This order item will be unassigned from the 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", "Import": "Import", diff --git a/src/locales/es.json b/src/locales/es.json index addf6072..b3f28a79 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -89,9 +89,7 @@ "Generate shipping label": "Generate shipping label", "Go to OMS": "Go to OMS", "Go to Launchpad": "Go to Launchpad", - "is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.", - "is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.", - "is identified as mismatched. This order item will be unassigned from the store and sent to be rebrokered.": "{ productName } is identified as mismatched. This order item will be unassigned from the 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", "Import": "Importar", @@ -267,5 +265,6 @@ "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. 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 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/views/InProgress.vue b/src/views/InProgress.vue index c4a8851d..ae3e5da4 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -531,9 +531,7 @@ export default defineComponent({ if (!outOfStockItem) { const firstItem = itemsToReject[0]; if (itemsToReject.length === 1) { - if (firstItem.rejectReason === "REJ_RSN_DAMAGED") message = this.$t('is identified as damaged. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName }); - else if (firstItem.rejectReason === "WORN_DISPLAY") message = this.$t('is identified as worn display. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName }); - else if (firstItem.rejectReason === "MISMATCH") message = this.$t('is identified as mismatched. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName }); + message = this.$t('is identified as. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName, rejectReason: firstItem.rejectReason === "REJ_RSN_DAMAGED" ? 'damaged' : (firstItem.rejectReason === "WORN_DISPLAY" ? 'worn display' : 'mismatched')}); } else { message = this.$t(', and other products were identified as unfulfillable.These items will be unassigned from this store and sent to be rebrokered.', { productName: firstItem.productName, products: itemsToReject.length - 1, space: '

' }); } From 5d46ee0aa8ce2015bddb44038869953d7266257e Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Mon, 18 Sep 2023 10:34:43 +0530 Subject: [PATCH 3/4] Improved: logic behind displaying the reject reason in the alert (#261) --- src/locales/en.json | 2 +- src/locales/es.json | 2 +- src/views/InProgress.vue | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 4231edaf..ed9f985d 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -265,5 +265,5 @@ "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 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." + ", 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 b3f28a79..f2bc8183 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -266,5 +266,5 @@ "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 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." + ", 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/views/InProgress.vue b/src/views/InProgress.vue index ae3e5da4..8fdb4909 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -531,9 +531,9 @@ export default defineComponent({ if (!outOfStockItem) { const firstItem = itemsToReject[0]; if (itemsToReject.length === 1) { - message = this.$t('is identified as. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName, rejectReason: firstItem.rejectReason === "REJ_RSN_DAMAGED" ? 'damaged' : (firstItem.rejectReason === "WORN_DISPLAY" ? 'worn display' : 'mismatched')}); + message = this.$t('is identified as. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName, rejectReason: ((this.rejectReasons.find((rejectReason: {[key: string]: any}) => rejectReason.enumId === firstItem.rejectReason)).description).toLowerCase() }); } else { - message = this.$t(', and other products were identified as unfulfillable.These items will be unassigned from this store and sent to be rebrokered.', { productName: firstItem.productName, products: itemsToReject.length - 1, space: '

' }); + message = this.$t(', and other products were identified as unfulfillable. These items will be unassigned from this store and sent to be rebrokered.', { productName: firstItem.productName, products: itemsToReject.length - 1, space: '

' }); } } else { const productName = outOfStockItem.productName From 27cad3b0fd14b5cf5dc9da1e116639858db6d752 Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Mon, 18 Sep 2023 14:25:47 +0530 Subject: [PATCH 4/4] Improved: var naming firstItem to rejectedItem (#261) --- src/views/InProgress.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/InProgress.vue b/src/views/InProgress.vue index 8fdb4909..ef92cb8b 100644 --- a/src/views/InProgress.vue +++ b/src/views/InProgress.vue @@ -529,11 +529,13 @@ export default defineComponent({ // TODO: update alert message when itemsToReject contains a single item and also in some specific conditions let message; if (!outOfStockItem) { - const firstItem = itemsToReject[0]; + + // This variable is used in messages to display name of first rejected item from the itemsToReject array + const rejectedItem = itemsToReject[0]; if (itemsToReject.length === 1) { - message = this.$t('is identified as. This order item will be unassigned from the store and sent to be rebrokered.', { productName: firstItem.productName, rejectReason: ((this.rejectReasons.find((rejectReason: {[key: string]: any}) => rejectReason.enumId === firstItem.rejectReason)).description).toLowerCase() }); + message = this.$t('is identified as. This order item will be unassigned from the store and sent to be rebrokered.', { productName: rejectedItem.productName, rejectReason: ((this.rejectReasons.find((rejectReason: {[key: string]: any}) => rejectReason.enumId === rejectedItem.rejectReason)).description).toLowerCase() }); } else { - message = this.$t(', and other products were identified as unfulfillable. These items will be unassigned from this store and sent to be rebrokered.', { productName: firstItem.productName, products: itemsToReject.length - 1, space: '

' }); + message = this.$t(', and other products were identified as unfulfillable. These items will be unassigned from this store and sent to be rebrokered.', { productName: rejectedItem.productName, products: itemsToReject.length - 1, space: '

' }); } } else { const productName = outOfStockItem.productName