From a03d5e1c9c19e927f49f9430418312e8b68dbea6 Mon Sep 17 00:00:00 2001 From: Ivan Ray Altomera Date: Wed, 17 Jul 2019 14:29:55 +0800 Subject: [PATCH 1/2] feat: pop-up when order will be cancelled --- src/container/SalesContainer/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/container/SalesContainer/index.js b/src/container/SalesContainer/index.js index 086876f..7464e63 100644 --- a/src/container/SalesContainer/index.js +++ b/src/container/SalesContainer/index.js @@ -199,8 +199,13 @@ export default class SalesContainer extends React.Component { }; onDeleteClick = () => { - const { changeValue } = this.props.stateStore; - changeValue("deleteDialogVisible", true, "Sales"); + const { changeValue, isViewingOrder } = this.props.stateStore; + + if (isViewingOrder) { + showAlert("Error", "Unable to clear items. You can either void the line and/or cancel the order.", null); + } else { + changeValue("deleteDialogVisible", true, "Sales"); + } }; onDeleteReceiptLine = () => { From 0df2a6865959de709731ddbc7f0a23a676cb5632 Mon Sep 17 00:00:00 2001 From: Ivan Ray Altomera Date: Wed, 17 Jul 2019 14:30:24 +0800 Subject: [PATCH 2/2] fix: eslint --- src/container/SalesContainer/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/container/SalesContainer/index.js b/src/container/SalesContainer/index.js index 7464e63..bcc92ae 100644 --- a/src/container/SalesContainer/index.js +++ b/src/container/SalesContainer/index.js @@ -202,7 +202,11 @@ export default class SalesContainer extends React.Component { const { changeValue, isViewingOrder } = this.props.stateStore; if (isViewingOrder) { - showAlert("Error", "Unable to clear items. You can either void the line and/or cancel the order.", null); + showAlert( + "Error", + "Unable to clear items. You can either void the line and/or cancel the order.", + null, + ); } else { changeValue("deleteDialogVisible", true, "Sales"); }