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

Implemented: toast messages for the success and failure of product scan (#309) #323

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Changes from all commits
Commits
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/locales/en.json
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
"Facility": "Facility",
"Location": "Location",
"Failed to receive some of the items": "Failed to receive some of the items",
"Failed to scan:": "Failed to scan: {itemName}",
"Failed to update product identifier preference": "Failed to update product identifier preference",
"facility location": "facility location",
"Facility locations were not found corresponding to destination facility of return shipment. Please add facility locations to avoid receive return shipment failure.": "Facility locations were not found corresponding to destination facility of return shipment. Please add facility locations to avoid receive return shipment failure.",
@@ -59,7 +60,6 @@
"primary identifier": "primary identifier",
"Primary Product Identifier": "Primary Product Identifier",
"Proceed": "Proceed",
"Product not found": "Product not found",
"Product Identifier": "Product Identifier",
"Product identifier preference updated": "Product identifier preference updated",
"Purchase Order": "Purchase Order",
@@ -86,6 +86,7 @@
"Scan ASN to start receiving": "Scan ASN to start receiving",
"Scan barcodes to receive them": "Scan barcodes to receive them",
"Scan items": "Scan items",
"Scanned successfully.": "Scanned {itemName} successfully.",
"secondary identifier": "secondary identifier",
"Search": "Search",
"Search purchase orders": "Search purchase orders",
7 changes: 4 additions & 3 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
@@ -42,13 +42,14 @@
},
async updateProductCount({ commit, state }, payload ) {
const item = state.current.items.find((item: any) => item.internalName === payload);

if (item) {
item.quantityAccepted = item.quantityAccepted ? parseInt(item.quantityAccepted) + 1 : 1;
commit(types.ORDER_CURRENT_UPDATED, state.current )
showToast(translate("Scanned successfully.", { itemName: payload }))
} else {
showToast(translate("Product not found"));
showToast(translate("Failed to scan:", { itemName: payload }))
}

commit(types.ORDER_CURRENT_UPDATED, state.current )
},
async addOrderItem ({ commit }, payload) {
const product = {
@@ -110,7 +111,7 @@
}
return resp;
},
async createPurchaseShipment({ commit }, payload) {

Check warning on line 114 in src/store/modules/order/actions.ts

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'commit' is defined but never used

Check warning on line 114 in src/store/modules/order/actions.ts

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'commit' is defined but never used
let resp;
try {
const params = {
7 changes: 4 additions & 3 deletions src/store/modules/return/actions.ts
Original file line number Diff line number Diff line change
@@ -34,13 +34,14 @@ const actions: ActionTree<ReturnState, RootState> = {
},
async updateReturnProductCount ({ commit, state }, payload) {
const item = state.current.items.find((item: any) => item.sku === payload);

if (item) {
item.quantityAccepted = item.quantityAccepted ? parseInt(item.quantityAccepted) + 1 : 1;
commit(types.RETURN_CURRENT_UPDATED, state);
showToast(translate("Scanned successfully.", { itemName: payload }))
} else {
showToast(translate("Product not found"));
showToast(translate("Failed to scan:", { itemName: payload }))
}

commit(types.RETURN_CURRENT_UPDATED, state);
},
async setCurrent ({ commit, state }, payload) {
let resp;
7 changes: 4 additions & 3 deletions src/store/modules/shipment/actions.ts
Original file line number Diff line number Diff line change
@@ -44,13 +44,14 @@

async updateShipmentProductCount ({ commit, state }, payload) {
const item = state.current.items.find((item: any) => item.sku === payload);

if (item) {
item.quantityAccepted = item.quantityAccepted ? parseInt(item.quantityAccepted) + 1 : 1;
commit(types.SHIPMENT_CURRENT_UPDATED, state);
showToast(translate("Scanned successfully.", { itemName: payload }))
} else {
showToast(translate("Product not found"));
showToast(translate("Failed to scan:", { itemName: payload }))
}

commit(types.SHIPMENT_CURRENT_UPDATED, state);
},
async setCurrent ({ commit }, payload) {
let resp;
@@ -93,7 +94,7 @@
return Promise.reject(new Error(err))
}
},
receiveShipmentItem ({ commit }, payload) {

Check warning on line 97 in src/store/modules/shipment/actions.ts

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'commit' is defined but never used

Check warning on line 97 in src/store/modules/shipment/actions.ts

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'commit' is defined but never used
return Promise.all(payload.items.map(async (item: any) => {
const params = {
shipmentId: payload.shipmentId,
Loading