@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.
@@ -12514,6 +12514,29 @@ var Step3 = function Step3(_ref) {
12514
12514
  })));
12515
12515
  };
12516
12516
 
12517
+ var erSessionStorage = {
12518
+ setItem: function setItem(key, value) {
12519
+ sessionStorage.setItem(key, value);
12520
+ },
12521
+ getItem: function getItem(key) {
12522
+ return sessionStorage.getItem(key);
12523
+ },
12524
+ removeItem: function removeItem(key) {
12525
+ sessionStorage.removeItem(key);
12526
+ },
12527
+ setJSONItem: function setJSONItem(key, value) {
12528
+ value = JSON.stringify(value);
12529
+ sessionStorage.setItem(key, value);
12530
+ },
12531
+ getJSONItem: function getJSONItem(key) {
12532
+ var returnValue = {};
12533
+ try {
12534
+ returnValue = JSON.parse(sessionStorage.getItem(key));
12535
+ } catch (e) {}
12536
+ return returnValue;
12537
+ }
12538
+ };
12539
+
12517
12540
  var _templateObject$N, _templateObject2$y;
12518
12541
  var ConsentForm = function ConsentForm(_ref) {
12519
12542
  var apiEndPoint = _ref.apiEndPoint,
@@ -12758,7 +12781,7 @@ var PaypalComponent = function PaypalComponent(_ref) {
12758
12781
  window.paypal.Buttons({
12759
12782
  createOrder: function createOrder(data, actions) {
12760
12783
  var _ref2;
12761
- if (erLocalStorage.getItem('checkoutIsTermsAccepted') !== 'true') {
12784
+ if (erSessionStorage.getItem('checkoutIsTermsAccepted') !== 'true') {
12762
12785
  throw {
12763
12786
  message: 'Please accept terms and conditions.'
12764
12787
  };
@@ -12836,7 +12859,8 @@ var Step4 = function Step4(_ref) {
12836
12859
  orderTotal = _ref.orderTotal,
12837
12860
  paymentWithPaypal = _ref.paymentWithPaypal,
12838
12861
  selectedPaymentMethod = _ref.selectedPaymentMethod,
12839
- doNotShowPrice = _ref.doNotShowPrice;
12862
+ doNotShowPrice = _ref.doNotShowPrice,
12863
+ doNotPlaceOrder = _ref.doNotPlaceOrder;
12840
12864
  var _React$useState = React__default.useState(false),
12841
12865
  checked = _React$useState[0],
12842
12866
  setChecked = _React$useState[1];
@@ -13119,7 +13143,7 @@ var Step4 = function Step4(_ref) {
13119
13143
  setChecked(function (checked) {
13120
13144
  return !checked;
13121
13145
  });
13122
- erLocalStorage.setItem('checkoutIsTermsAccepted', !checked);
13146
+ erSessionStorage.setItem('checkoutIsTermsAccepted', !checked);
13123
13147
  },
13124
13148
  required: true
13125
13149
  }), /*#__PURE__*/React__default.createElement("p", null, "I Accept the \xA0", /*#__PURE__*/React__default.createElement("span", {
@@ -13153,8 +13177,12 @@ var Step4 = function Step4(_ref) {
13153
13177
  onClick: function onClick(e) {
13154
13178
  try {
13155
13179
  e.preventDefault();
13156
- var _temp2 = function () {
13180
+ return Promise.resolve(function () {
13157
13181
  if (checked) {
13182
+ if (doNotPlaceOrder) {
13183
+ alert('Cannot place the order, please contact the support.');
13184
+ return;
13185
+ }
13158
13186
  var _temp = function (_customer$customerDto) {
13159
13187
  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) {
13160
13188
  setOpenConsentForm(true);
@@ -13166,8 +13194,7 @@ var Step4 = function Step4(_ref) {
13166
13194
  } else {
13167
13195
  alert('please accept the privacy policy');
13168
13196
  }
13169
- }();
13170
- return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
13197
+ }());
13171
13198
  } catch (e) {
13172
13199
  return Promise.reject(e);
13173
13200
  }
@@ -13235,7 +13262,9 @@ var CheckoutPageComponentWrapper = function CheckoutPageComponentWrapper(_ref) {
13235
13262
  placeQuotation = _ref$placeQuotation === void 0 ? false : _ref$placeQuotation,
13236
13263
  _ref$disabledAddAddre = _ref.disabledAddAddressOption,
13237
13264
  disabledAddAddressOption = _ref$disabledAddAddre === void 0 ? false : _ref$disabledAddAddre,
13238
- beforeAddNewCardText = _ref.beforeAddNewCardText;
13265
+ beforeAddNewCardText = _ref.beforeAddNewCardText,
13266
+ _ref$doNotPlaceOrder = _ref.doNotPlaceOrder,
13267
+ doNotPlaceOrder = _ref$doNotPlaceOrder === void 0 ? false : _ref$doNotPlaceOrder;
13239
13268
  var _useAllSystemFeatureV = useAllSystemFeatureValues({
13240
13269
  apiEndPoint: apiEndPoint,
13241
13270
  token: token
@@ -14020,7 +14049,8 @@ var CheckoutPageComponentWrapper = function CheckoutPageComponentWrapper(_ref) {
14020
14049
  orderTotal: orderTotal,
14021
14050
  paymentWithPaypal: paymentWithPaypal,
14022
14051
  selectedPaymentMethod: selectedPaymentMethod,
14023
- doNotShowPrice: doNotShowPrice
14052
+ doNotShowPrice: doNotShowPrice,
14053
+ doNotPlaceOrder: doNotPlaceOrder
14024
14054
  })));
14025
14055
  }))))), /*#__PURE__*/React__default.createElement(CheckoutSummary, {
14026
14056
  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) {