@salesgenterp/ui-components 0.4.526 → 0.4.528

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12518,6 +12518,29 @@ var Step3 = function Step3(_ref) {
12518
12518
  })));
12519
12519
  };
12520
12520
 
12521
+ var erSessionStorage = {
12522
+ setItem: function setItem(key, value) {
12523
+ sessionStorage.setItem(key, value);
12524
+ },
12525
+ getItem: function getItem(key) {
12526
+ return sessionStorage.getItem(key);
12527
+ },
12528
+ removeItem: function removeItem(key) {
12529
+ sessionStorage.removeItem(key);
12530
+ },
12531
+ setJSONItem: function setJSONItem(key, value) {
12532
+ value = JSON.stringify(value);
12533
+ sessionStorage.setItem(key, value);
12534
+ },
12535
+ getJSONItem: function getJSONItem(key) {
12536
+ var returnValue = {};
12537
+ try {
12538
+ returnValue = JSON.parse(sessionStorage.getItem(key));
12539
+ } catch (e) {}
12540
+ return returnValue;
12541
+ }
12542
+ };
12543
+
12521
12544
  var _templateObject$N, _templateObject2$y;
12522
12545
  var ConsentForm = function ConsentForm(_ref) {
12523
12546
  var apiEndPoint = _ref.apiEndPoint,
@@ -12762,7 +12785,7 @@ var PaypalComponent = function PaypalComponent(_ref) {
12762
12785
  window.paypal.Buttons({
12763
12786
  createOrder: function createOrder(data, actions) {
12764
12787
  var _ref2;
12765
- if (erLocalStorage.getItem('checkoutIsTermsAccepted') !== 'true') {
12788
+ if (erSessionStorage.getItem('checkoutIsTermsAccepted') !== 'true') {
12766
12789
  throw {
12767
12790
  message: 'Please accept terms and conditions.'
12768
12791
  };
@@ -12840,7 +12863,8 @@ var Step4 = function Step4(_ref) {
12840
12863
  orderTotal = _ref.orderTotal,
12841
12864
  paymentWithPaypal = _ref.paymentWithPaypal,
12842
12865
  selectedPaymentMethod = _ref.selectedPaymentMethod,
12843
- doNotShowPrice = _ref.doNotShowPrice;
12866
+ doNotShowPrice = _ref.doNotShowPrice,
12867
+ doNotPlaceOrder = _ref.doNotPlaceOrder;
12844
12868
  var _React$useState = React__default.useState(false),
12845
12869
  checked = _React$useState[0],
12846
12870
  setChecked = _React$useState[1];
@@ -13123,7 +13147,7 @@ var Step4 = function Step4(_ref) {
13123
13147
  setChecked(function (checked) {
13124
13148
  return !checked;
13125
13149
  });
13126
- erLocalStorage.setItem('checkoutIsTermsAccepted', !checked);
13150
+ erSessionStorage.setItem('checkoutIsTermsAccepted', !checked);
13127
13151
  },
13128
13152
  required: true
13129
13153
  }), /*#__PURE__*/React__default.createElement("p", null, "I Accept the \xA0", /*#__PURE__*/React__default.createElement("span", {
@@ -13157,8 +13181,12 @@ var Step4 = function Step4(_ref) {
13157
13181
  onClick: function onClick(e) {
13158
13182
  try {
13159
13183
  e.preventDefault();
13160
- var _temp2 = function () {
13184
+ return Promise.resolve(function () {
13161
13185
  if (checked) {
13186
+ if (doNotPlaceOrder) {
13187
+ alert('Cannot place the order, please contact the support.');
13188
+ return;
13189
+ }
13162
13190
  var _temp = function (_customer$customerDto) {
13163
13191
  if (taxExempt && !(customer !== null && customer !== void 0 && (_customer$customerDto = customer.customerDto) !== null && _customer$customerDto !== void 0 && _customer$customerDto.taxable) && shippingInformation !== null && shippingInformation !== void 0 && shippingInformation.id) {
13164
13192
  setOpenConsentForm(true);
@@ -13170,8 +13198,7 @@ var Step4 = function Step4(_ref) {
13170
13198
  } else {
13171
13199
  alert('please accept the privacy policy');
13172
13200
  }
13173
- }();
13174
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
13201
+ }());
13175
13202
  } catch (e) {
13176
13203
  return Promise.reject(e);
13177
13204
  }
@@ -13239,7 +13266,9 @@ var CheckoutPageComponentWrapper = function CheckoutPageComponentWrapper(_ref) {
13239
13266
  placeQuotation = _ref$placeQuotation === void 0 ? false : _ref$placeQuotation,
13240
13267
  _ref$disabledAddAddre = _ref.disabledAddAddressOption,
13241
13268
  disabledAddAddressOption = _ref$disabledAddAddre === void 0 ? false : _ref$disabledAddAddre,
13242
- beforeAddNewCardText = _ref.beforeAddNewCardText;
13269
+ beforeAddNewCardText = _ref.beforeAddNewCardText,
13270
+ _ref$doNotPlaceOrder = _ref.doNotPlaceOrder,
13271
+ doNotPlaceOrder = _ref$doNotPlaceOrder === void 0 ? false : _ref$doNotPlaceOrder;
13243
13272
  var _useAllSystemFeatureV = useAllSystemFeatureValues({
13244
13273
  apiEndPoint: apiEndPoint,
13245
13274
  token: token
@@ -14024,7 +14053,8 @@ var CheckoutPageComponentWrapper = function CheckoutPageComponentWrapper(_ref) {
14024
14053
  orderTotal: orderTotal,
14025
14054
  paymentWithPaypal: paymentWithPaypal,
14026
14055
  selectedPaymentMethod: selectedPaymentMethod,
14027
- doNotShowPrice: doNotShowPrice
14056
+ doNotShowPrice: doNotShowPrice,
14057
+ doNotPlaceOrder: doNotPlaceOrder
14028
14058
  })));
14029
14059
  }))))), /*#__PURE__*/React__default.createElement(CheckoutSummary, {
14030
14060
  billingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto13 = customer.customerDto) === null || _customer$customerDto13 === void 0 ? void 0 : (_customer$customerDto14 = _customer$customerDto13.customerStoreAddressList) === null || _customer$customerDto14 === void 0 ? void 0 : _customer$customerDto14.find(function (item) {