@crystaldesign/diva-seller 25.10.0-beta.2 → 25.10.0-beta.20
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/build/esm/index.js +603 -267
- package/build/types/seller/src/components/Basket/Step3Checkout.d.ts +1 -1
- package/build/types/seller/src/components/Basket/Step3Checkout.d.ts.map +1 -1
- package/build/types/seller/src/components/Basket/defaultSchema/step3.d.ts +86 -66
- package/build/types/seller/src/components/Basket/defaultSchema/step3.d.ts.map +1 -1
- package/build/types/seller/src/components/Basket/index.d.ts.map +1 -1
- package/build/types/seller/src/components/Basket/types.d.ts +11 -0
- package/build/types/seller/src/components/Basket/types.d.ts.map +1 -1
- package/build/types/seller/src/provider/context.d.ts +1 -0
- package/build/types/seller/src/provider/context.d.ts.map +1 -1
- package/build/types/seller/src/provider/hooks/useSellerStateData/index.d.ts +1 -0
- package/build/types/seller/src/provider/hooks/useSellerStateData/index.d.ts.map +1 -1
- package/build/types/seller/src/types.d.ts +1 -0
- package/build/types/seller/src/types.d.ts.map +1 -1
- package/build/types/seller/src/ui/Basket/CheckOut/SaveButtonsGroup.d.ts +2 -2
- package/build/types/seller/src/ui/Basket/CheckOut/SaveButtonsGroup.d.ts.map +1 -1
- package/build/types/seller/src/ui/Basket/CheckOut/index.d.ts +4 -2
- package/build/types/seller/src/ui/Basket/CheckOut/index.d.ts.map +1 -1
- package/build/types/seller/src/ui/Basket/CheckOut/statusMenu.d.ts.map +1 -1
- package/build/types/seller/src/ui/Basket/CheckOut/useCheckoutStep3.d.ts +19 -0
- package/build/types/seller/src/ui/Basket/CheckOut/useCheckoutStep3.d.ts.map +1 -0
- package/package.json +5 -5
package/build/esm/index.js
CHANGED
|
@@ -45,6 +45,7 @@ import Divider from '@mui/material/Divider';
|
|
|
45
45
|
import Alert from '@mui/material/Alert';
|
|
46
46
|
import AlertTitle from '@mui/material/AlertTitle/AlertTitle';
|
|
47
47
|
import Form from '@crystaldesign/forms';
|
|
48
|
+
import classnames from 'classnames';
|
|
48
49
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
49
50
|
import InputLabel from '@mui/material/InputLabel';
|
|
50
51
|
import Checkbox from '@mui/material/Checkbox';
|
|
@@ -60,8 +61,8 @@ import _toArray from '@babel/runtime/helpers/toArray';
|
|
|
60
61
|
import Box from '@mui/material/Box';
|
|
61
62
|
import StarBorderIcon from '@mui/icons-material/StarBorder';
|
|
62
63
|
import EditIcon from '@mui/icons-material/Edit';
|
|
64
|
+
import { useSellerState as useSellerState$1 } from '@crystaldesign/diva-seller/provider/SellerStateProvider';
|
|
63
65
|
import OrderEntry, { apiSaveRenderJobs, VariantSelector } from '@crystaldesign/order-entry';
|
|
64
|
-
import classnames from 'classnames';
|
|
65
66
|
import { InfoRounded, Remove, Add, Delete } from '@mui/icons-material';
|
|
66
67
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
67
68
|
import { Autoplay, Thumbs, Pagination, FreeMode, Mousewheel } from 'swiper/modules';
|
|
@@ -195,7 +196,10 @@ var SellerContext = /*#__PURE__*/createContext({
|
|
|
195
196
|
loadAnalyticScore: function loadAnalyticScore() {
|
|
196
197
|
return Promise.resolve({});
|
|
197
198
|
},
|
|
198
|
-
loadManualCustomDataFields: function loadManualCustomDataFields() {}
|
|
199
|
+
loadManualCustomDataFields: function loadManualCustomDataFields() {},
|
|
200
|
+
setOrdered: function setOrdered() {
|
|
201
|
+
return Promise.resolve({});
|
|
202
|
+
}
|
|
199
203
|
}
|
|
200
204
|
});
|
|
201
205
|
|
|
@@ -1434,9 +1438,9 @@ function _apiGetAffiliates() {
|
|
|
1434
1438
|
return _apiGetAffiliates.apply(this, arguments);
|
|
1435
1439
|
}
|
|
1436
1440
|
|
|
1437
|
-
function _createForOfIteratorHelper$
|
|
1438
|
-
function _unsupportedIterableToArray$
|
|
1439
|
-
function _arrayLikeToArray$
|
|
1441
|
+
function _createForOfIteratorHelper$4(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
1442
|
+
function _unsupportedIterableToArray$4(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$4(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; } }
|
|
1443
|
+
function _arrayLikeToArray$4(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1440
1444
|
function processData(_ref) {
|
|
1441
1445
|
var top = _ref.top,
|
|
1442
1446
|
skip = _ref.skip,
|
|
@@ -1502,7 +1506,7 @@ function isGlobalFiltered(d, filter) {
|
|
|
1502
1506
|
});
|
|
1503
1507
|
}
|
|
1504
1508
|
function orderFn(a, b, orderBy) {
|
|
1505
|
-
var _iterator = _createForOfIteratorHelper$
|
|
1509
|
+
var _iterator = _createForOfIteratorHelper$4(orderBy),
|
|
1506
1510
|
_step;
|
|
1507
1511
|
try {
|
|
1508
1512
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -1536,9 +1540,9 @@ function orderFn(a, b, orderBy) {
|
|
|
1536
1540
|
var _excluded$a = ["collectionId"],
|
|
1537
1541
|
_excluded2$2 = ["basetId"],
|
|
1538
1542
|
_excluded3$1 = ["catalogCodex", "accountId", "collectionId"];
|
|
1539
|
-
function _createForOfIteratorHelper$
|
|
1540
|
-
function _unsupportedIterableToArray$
|
|
1541
|
-
function _arrayLikeToArray$
|
|
1543
|
+
function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
1544
|
+
function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; } }
|
|
1545
|
+
function _arrayLikeToArray$3(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1542
1546
|
function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1543
1547
|
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1544
1548
|
var LOG$9 = getLogger('Seller', 'SellerStateData');
|
|
@@ -1562,7 +1566,8 @@ function useSellerStateData(_ref) {
|
|
|
1562
1566
|
toggleLoading = _useDivaCore$actions.toggleLoading,
|
|
1563
1567
|
getSessionGuid = _useDivaCore$actions.getSessionGuid,
|
|
1564
1568
|
updateCustomLogo = _useDivaCore$actions.updateCustomLogo,
|
|
1565
|
-
openModal = _useDivaCore$actions.openModal
|
|
1569
|
+
openModal = _useDivaCore$actions.openModal,
|
|
1570
|
+
sendEmail = _useDivaCore$actions.sendEmail;
|
|
1566
1571
|
var _useTranslation = useTranslation(),
|
|
1567
1572
|
i18n = _useTranslation.i18n,
|
|
1568
1573
|
t = _useTranslation.t;
|
|
@@ -1900,7 +1905,7 @@ function useSellerStateData(_ref) {
|
|
|
1900
1905
|
break;
|
|
1901
1906
|
}
|
|
1902
1907
|
catalogData = [];
|
|
1903
|
-
_iterator = _createForOfIteratorHelper$
|
|
1908
|
+
_iterator = _createForOfIteratorHelper$3(catalog);
|
|
1904
1909
|
_context5.prev = 12;
|
|
1905
1910
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
1906
1911
|
var _collection$enricherS3;
|
|
@@ -2745,6 +2750,102 @@ function useSellerStateData(_ref) {
|
|
|
2745
2750
|
});
|
|
2746
2751
|
}
|
|
2747
2752
|
};
|
|
2753
|
+
var setOrdered = /*#__PURE__*/function () {
|
|
2754
|
+
var _ref19 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(basket, sendOrderEmail) {
|
|
2755
|
+
var to, emails, _iterator2, _step2, mail, _basket$Client;
|
|
2756
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context11) {
|
|
2757
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
2758
|
+
case 0:
|
|
2759
|
+
if (!jwt) {
|
|
2760
|
+
_context11.next = 8;
|
|
2761
|
+
break;
|
|
2762
|
+
}
|
|
2763
|
+
if (!(sendOrderEmail && organization.settings.sendOrdersEmail)) {
|
|
2764
|
+
_context11.next = 6;
|
|
2765
|
+
break;
|
|
2766
|
+
}
|
|
2767
|
+
to = [organization.settings.sendOrdersEmail];
|
|
2768
|
+
if (configData !== null && configData !== void 0 && configData.sendOrderEmails) {
|
|
2769
|
+
emails = configData.sendOrderEmails.split(',');
|
|
2770
|
+
_iterator2 = _createForOfIteratorHelper$3(emails);
|
|
2771
|
+
try {
|
|
2772
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
2773
|
+
mail = _step2.value;
|
|
2774
|
+
if (mail == 'CLIENT') {
|
|
2775
|
+
if ((_basket$Client = basket.Client) !== null && _basket$Client !== void 0 && _basket$Client.email) to.push(basket.Client.email);
|
|
2776
|
+
} else if (mail == 'SELLER') {
|
|
2777
|
+
if (basket.SalespersonEmail) to.push(basket.SalespersonEmail);
|
|
2778
|
+
} else if (mail == 'ORGANIZATION') {
|
|
2779
|
+
if (organization !== null && organization !== void 0 && organization.email) to.push(organization.email);
|
|
2780
|
+
} else if (mail == 'USER') {
|
|
2781
|
+
if (currentUser !== null && currentUser !== void 0 && currentUser.mainEmail) to.push(currentUser.mainEmail);
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
} catch (err) {
|
|
2785
|
+
_iterator2.e(err);
|
|
2786
|
+
} finally {
|
|
2787
|
+
_iterator2.f();
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
try {
|
|
2791
|
+
toggleLoading('setOrdered');
|
|
2792
|
+
sendEmail({
|
|
2793
|
+
//dialogText: t('basket.checkout.modals.ordered'),
|
|
2794
|
+
showDialog: false,
|
|
2795
|
+
callback: function callback(success) {
|
|
2796
|
+
if (success) {
|
|
2797
|
+
basketHandler.setOrdered({
|
|
2798
|
+
serviceUrl: apiConfig.basketService,
|
|
2799
|
+
organizationId: currentOrganization === null || currentOrganization === void 0 ? void 0 : currentOrganization._id,
|
|
2800
|
+
jwt: jwt,
|
|
2801
|
+
divaNr: basket.DivaNr,
|
|
2802
|
+
documentVersion: basket.DocumentVersion
|
|
2803
|
+
});
|
|
2804
|
+
toggleLoading('setOrdered');
|
|
2805
|
+
openModal({
|
|
2806
|
+
title: t('basket.checkout.modals.ordered'),
|
|
2807
|
+
accept: true
|
|
2808
|
+
});
|
|
2809
|
+
toggleLoading('setOrdered');
|
|
2810
|
+
} else {
|
|
2811
|
+
openModal({
|
|
2812
|
+
title: t('basket.checkout.modals.orderederror'),
|
|
2813
|
+
accept: true
|
|
2814
|
+
});
|
|
2815
|
+
toggleLoading('setOrdered');
|
|
2816
|
+
}
|
|
2817
|
+
},
|
|
2818
|
+
content: {
|
|
2819
|
+
to: to.join(','),
|
|
2820
|
+
type: 'basket',
|
|
2821
|
+
variant: 'SEND',
|
|
2822
|
+
divaNr: basket.DivaNr,
|
|
2823
|
+
version: basket.DocumentVersion
|
|
2824
|
+
}
|
|
2825
|
+
});
|
|
2826
|
+
} catch (e) {
|
|
2827
|
+
console.error(e);
|
|
2828
|
+
}
|
|
2829
|
+
return _context11.abrupt("return");
|
|
2830
|
+
case 6:
|
|
2831
|
+
_context11.next = 8;
|
|
2832
|
+
return basketHandler.setOrdered({
|
|
2833
|
+
serviceUrl: apiConfig.basketService,
|
|
2834
|
+
organizationId: currentOrganization === null || currentOrganization === void 0 ? void 0 : currentOrganization._id,
|
|
2835
|
+
jwt: jwt,
|
|
2836
|
+
divaNr: basket.DivaNr,
|
|
2837
|
+
documentVersion: basket.DocumentVersion
|
|
2838
|
+
});
|
|
2839
|
+
case 8:
|
|
2840
|
+
case "end":
|
|
2841
|
+
return _context11.stop();
|
|
2842
|
+
}
|
|
2843
|
+
}, _callee10);
|
|
2844
|
+
}));
|
|
2845
|
+
return function setOrdered(_x17, _x18) {
|
|
2846
|
+
return _ref19.apply(this, arguments);
|
|
2847
|
+
};
|
|
2848
|
+
}();
|
|
2748
2849
|
return {
|
|
2749
2850
|
state: state,
|
|
2750
2851
|
setFirstLoginApiUrl: setFirstLoginApiUrl,
|
|
@@ -2770,7 +2871,8 @@ function useSellerStateData(_ref) {
|
|
|
2770
2871
|
resetForCache: resetForCache,
|
|
2771
2872
|
loadAnalyticScore: loadAnalyticScore,
|
|
2772
2873
|
setManualCustomDataFields: setManualCustomDataFields,
|
|
2773
|
-
setCloseOnSave: setCloseOnSave
|
|
2874
|
+
setCloseOnSave: setCloseOnSave,
|
|
2875
|
+
setOrdered: setOrdered
|
|
2774
2876
|
};
|
|
2775
2877
|
}
|
|
2776
2878
|
|
|
@@ -6028,8 +6130,8 @@ function styleInject(css, ref) {
|
|
|
6028
6130
|
|
|
6029
6131
|
var infocontainer$1 = "infocontainer-ir9gv";
|
|
6030
6132
|
var stepsContent = "steps-content-jDbLc";
|
|
6031
|
-
var css_248z$
|
|
6032
|
-
styleInject(css_248z$
|
|
6133
|
+
var css_248z$d = ".infocontainer-ir9gv {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.steps-content-jDbLc {\n margin-left: 10px;\n padding-top: 10px;\n padding-right: 10px;\n height: 100%;\n overflow-y: auto;\n}\n\n.steps-content-jDbLc #diva-order-entry-footer > span > div {\n width: 500px;\n}\n\n.steps-content-jDbLc #diva-order-entry-footer > span > div > span {\n margin-left: 110px;\n}\n";
|
|
6134
|
+
styleInject(css_248z$d);
|
|
6033
6135
|
|
|
6034
6136
|
function Step2ClientData(_ref) {
|
|
6035
6137
|
var _config$clientData, _config$clientData2;
|
|
@@ -6058,6 +6160,17 @@ function Step2ClientData(_ref) {
|
|
|
6058
6160
|
});
|
|
6059
6161
|
}
|
|
6060
6162
|
|
|
6163
|
+
var saveButton = "saveButton-vFkgp";
|
|
6164
|
+
var newPlanningButton = "newPlanningButton-rpBS2";
|
|
6165
|
+
var saveButtonGroup = "saveButtonGroup-r-Uwi";
|
|
6166
|
+
var checkout3Container = "checkout3Container-efdnR";
|
|
6167
|
+
var checkout3Header = "checkout3Header-Kph7T";
|
|
6168
|
+
var checkoutHeaderButtonGroup = "checkoutHeaderButtonGroup-ao8TM";
|
|
6169
|
+
var gdprCheckbox = "gdprCheckbox-jqVEK";
|
|
6170
|
+
var checkoutForm = "checkoutForm-wZEGN";
|
|
6171
|
+
var css_248z$c = ".saveButton-vFkgp {\n width: 25%;\n}\n\n.newPlanningButton-rpBS2 {\n width: 20%;\n}\n.saveButtonGroup-r-Uwi {\n text-align: right !important;\n}\n\n.checkout3Container-efdnR {\n display: flex;\n flex-direction: column;\n width: 95%;\n margin: 1rem;\n}\n\n.checkout3Header-Kph7T {\n display: flex;\n flex-direction: row;\n width: 50%;\n}\n\n.checkoutHeaderButtonGroup-ao8TM {\n margin-top: 0.4rem;\n margin-bottom: 1rem;\n margin-left: 1rem;\n width: 100%;\n}\n.gdprCheckbox-jqVEK {\n margin-left: 40px;\n}\n\n.checkoutForm-wZEGN {\n width: 100%;\n}\n";
|
|
6172
|
+
styleInject(css_248z$c);
|
|
6173
|
+
|
|
6061
6174
|
function StatusMenu(_ref) {
|
|
6062
6175
|
var visibleStatus = _ref.visibleStatus,
|
|
6063
6176
|
status = _ref.status,
|
|
@@ -6069,14 +6182,11 @@ function StatusMenu(_ref) {
|
|
|
6069
6182
|
var _useTranslation = useTranslation(),
|
|
6070
6183
|
t = _useTranslation.t;
|
|
6071
6184
|
return /*#__PURE__*/jsx("div", {
|
|
6072
|
-
|
|
6073
|
-
"float": 'left',
|
|
6074
|
-
marginTop: '0.4rem',
|
|
6075
|
-
marginLeft: '1rem'
|
|
6076
|
-
},
|
|
6185
|
+
className: checkoutHeaderButtonGroup,
|
|
6077
6186
|
children: /*#__PURE__*/jsx(ButtonGroup$1, {
|
|
6078
6187
|
color: "primary",
|
|
6079
6188
|
"aria-label": "outlined primary button group",
|
|
6189
|
+
fullWidth: true,
|
|
6080
6190
|
children: visibleStatus.filter(function (item) {
|
|
6081
6191
|
return typeof item == 'string';
|
|
6082
6192
|
}) //filter out old configuration,where it was an object
|
|
@@ -6111,80 +6221,57 @@ function SaveButtonsGroup(_ref) {
|
|
|
6111
6221
|
orderEmpty = _ref.orderEmpty,
|
|
6112
6222
|
status = _ref.status,
|
|
6113
6223
|
configSaveButtons = _ref.configSaveButtons,
|
|
6114
|
-
|
|
6224
|
+
validData = _ref.validData;
|
|
6115
6225
|
var _useTranslation = useTranslation(),
|
|
6116
6226
|
t = _useTranslation.t;
|
|
6117
6227
|
var classes = useStyles$1();
|
|
6118
6228
|
return /*#__PURE__*/jsxs("div", {
|
|
6119
6229
|
style: {
|
|
6120
|
-
marginTop: '0.4rem'
|
|
6121
|
-
marginLeft: '2.5rem'
|
|
6230
|
+
marginTop: '0.4rem'
|
|
6122
6231
|
},
|
|
6123
6232
|
children: [(configSaveButtons === null || configSaveButtons === void 0 ? void 0 : configSaveButtons.includes('SAVE')) && /*#__PURE__*/jsx(Button$1, {
|
|
6124
6233
|
variant: "contained",
|
|
6125
6234
|
size: "medium",
|
|
6126
6235
|
color: "primary",
|
|
6127
|
-
disabled: orderEmpty,
|
|
6236
|
+
disabled: orderEmpty || !validData,
|
|
6128
6237
|
onClick: function onClick() {
|
|
6129
6238
|
onClickSave();
|
|
6130
6239
|
},
|
|
6131
|
-
className: classes.margin,
|
|
6240
|
+
className: classnames(classes.margin, saveButton),
|
|
6132
6241
|
children: t('basket.checkout.actions.save')
|
|
6133
|
-
}),
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
onClick: function onClick() {
|
|
6151
|
-
onClickSave('open');
|
|
6152
|
-
},
|
|
6153
|
-
className: classes.margin,
|
|
6154
|
-
children: t('basket.checkout.actions.saveAndOpenNote', {
|
|
6155
|
-
type: t('data.' + status)
|
|
6156
|
-
})
|
|
6157
|
-
}), status == 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(Tooltip, {
|
|
6158
|
-
title: t('checkout.product.asfavbuttontooltip'),
|
|
6159
|
-
placement: "bottom",
|
|
6160
|
-
arrow: true,
|
|
6161
|
-
children: /*#__PURE__*/jsx(Button$1, {
|
|
6242
|
+
}), status == 'BASE_CONFIGURATION' && /*#__PURE__*/jsxs(Fragment, {
|
|
6243
|
+
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
6244
|
+
title: t('checkout.product.asfavbuttontooltip'),
|
|
6245
|
+
placement: "bottom",
|
|
6246
|
+
arrow: true,
|
|
6247
|
+
children: /*#__PURE__*/jsx(Button$1, {
|
|
6248
|
+
variant: "outlined",
|
|
6249
|
+
size: "medium",
|
|
6250
|
+
color: "primary",
|
|
6251
|
+
disabled: orderEmpty,
|
|
6252
|
+
onClick: function onClick() {
|
|
6253
|
+
onClickSave(undefined, false, true);
|
|
6254
|
+
},
|
|
6255
|
+
className: classes.margin,
|
|
6256
|
+
children: t('basket.checkout.actions.saveAsFavorite')
|
|
6257
|
+
})
|
|
6258
|
+
}), /*#__PURE__*/jsx(Button$1, {
|
|
6162
6259
|
variant: "outlined",
|
|
6163
6260
|
size: "medium",
|
|
6164
6261
|
color: "primary",
|
|
6165
6262
|
disabled: orderEmpty,
|
|
6166
6263
|
onClick: function onClick() {
|
|
6167
|
-
onClickSave(undefined, false, true);
|
|
6264
|
+
onClickSave(undefined, false, true, true);
|
|
6168
6265
|
},
|
|
6169
6266
|
className: classes.margin,
|
|
6170
|
-
children: t('basket.checkout.actions.
|
|
6171
|
-
})
|
|
6172
|
-
}), status == 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(Button$1, {
|
|
6173
|
-
variant: "outlined",
|
|
6174
|
-
size: "medium",
|
|
6175
|
-
color: "primary",
|
|
6176
|
-
disabled: orderEmpty,
|
|
6177
|
-
onClick: function onClick() {
|
|
6178
|
-
onClickSave(undefined, false, true, true);
|
|
6179
|
-
},
|
|
6180
|
-
className: classes.margin,
|
|
6181
|
-
children: t('basket.checkout.actions.saveAndOrderMedia')
|
|
6267
|
+
children: t('basket.checkout.actions.saveAndOrderMedia')
|
|
6268
|
+
})]
|
|
6182
6269
|
}), (configSaveButtons === null || configSaveButtons === void 0 ? void 0 : configSaveButtons.includes('NEW')) && /*#__PURE__*/jsx(Button$1, {
|
|
6183
6270
|
variant: "outlined",
|
|
6184
6271
|
size: "medium",
|
|
6185
6272
|
color: "primary",
|
|
6186
6273
|
onClick: startWithEmptyBasket,
|
|
6187
|
-
className: classes.margin,
|
|
6274
|
+
className: classnames(classes.margin, newPlanningButton),
|
|
6188
6275
|
children: t('basket.checkout.actions.newOrder')
|
|
6189
6276
|
})]
|
|
6190
6277
|
});
|
|
@@ -6736,10 +6823,121 @@ function InfoAlert(_ref2) {
|
|
|
6736
6823
|
});
|
|
6737
6824
|
}
|
|
6738
6825
|
|
|
6826
|
+
function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
6827
|
+
function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
|
|
6828
|
+
function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6829
|
+
var useCheckoutStep3 = function useCheckoutStep3(schema) {
|
|
6830
|
+
var _useState = useState(false),
|
|
6831
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
6832
|
+
basket3DExportChecked = _useState2[0],
|
|
6833
|
+
setBasket3DExportChecked = _useState2[1];
|
|
6834
|
+
var _useState3 = useState(false),
|
|
6835
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
6836
|
+
basketSendMailChecked = _useState4[0],
|
|
6837
|
+
setBasketSendMailChecked = _useState4[1];
|
|
6838
|
+
var _useState5 = useState(false),
|
|
6839
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
6840
|
+
basketSendOrderChecked = _useState6[0],
|
|
6841
|
+
setBasketSendOrderChecked = _useState6[1];
|
|
6842
|
+
var setVirtualFields = useCallback(function (key, value) {
|
|
6843
|
+
switch (key) {
|
|
6844
|
+
case 'Order3DExport':
|
|
6845
|
+
setBasket3DExportChecked(value);
|
|
6846
|
+
break;
|
|
6847
|
+
case 'SendMail':
|
|
6848
|
+
setBasketSendMailChecked(value);
|
|
6849
|
+
break;
|
|
6850
|
+
case 'SendOrder':
|
|
6851
|
+
setBasketSendOrderChecked(value);
|
|
6852
|
+
break;
|
|
6853
|
+
}
|
|
6854
|
+
}, []);
|
|
6855
|
+
var getVirtualFields = useCallback(function (key) {
|
|
6856
|
+
switch (key) {
|
|
6857
|
+
case 'Order3DExport':
|
|
6858
|
+
return basket3DExportChecked;
|
|
6859
|
+
case 'SendMail':
|
|
6860
|
+
return basketSendMailChecked;
|
|
6861
|
+
case 'SendOrder':
|
|
6862
|
+
return basketSendOrderChecked;
|
|
6863
|
+
default:
|
|
6864
|
+
return undefined;
|
|
6865
|
+
}
|
|
6866
|
+
}, [basket3DExportChecked, basketSendMailChecked, basketSendOrderChecked]);
|
|
6867
|
+
var getVirtualFieldsObject = useCallback(function () {
|
|
6868
|
+
var virtualFields = {};
|
|
6869
|
+
for (var key in schema.properties) {
|
|
6870
|
+
var _schema$properties;
|
|
6871
|
+
if ((_schema$properties = schema.properties) !== null && _schema$properties !== void 0 && (_schema$properties = _schema$properties[key]) !== null && _schema$properties !== void 0 && (_schema$properties = _schema$properties.properties) !== null && _schema$properties !== void 0 && _schema$properties.virtual) {
|
|
6872
|
+
virtualFields[key] = getVirtualFields(key);
|
|
6873
|
+
}
|
|
6874
|
+
}
|
|
6875
|
+
return virtualFields;
|
|
6876
|
+
}, [getVirtualFields, schema]);
|
|
6877
|
+
function validateRequiredFieldsFromSchema(schema, data) {
|
|
6878
|
+
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
6879
|
+
try {
|
|
6880
|
+
var requiredFields = schema.required || [];
|
|
6881
|
+
var _iterator = _createForOfIteratorHelper$2(requiredFields),
|
|
6882
|
+
_step;
|
|
6883
|
+
try {
|
|
6884
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6885
|
+
var field = _step.value;
|
|
6886
|
+
var value = data === null || data === void 0 ? void 0 : data[field];
|
|
6887
|
+
if (value === undefined || value === null || typeof value === 'string' && value.trim() === '') {
|
|
6888
|
+
return false;
|
|
6889
|
+
}
|
|
6890
|
+
}
|
|
6891
|
+
// Recursive through nested objects
|
|
6892
|
+
} catch (err) {
|
|
6893
|
+
_iterator.e(err);
|
|
6894
|
+
} finally {
|
|
6895
|
+
_iterator.f();
|
|
6896
|
+
}
|
|
6897
|
+
for (var _i = 0, _Object$entries = Object.entries(schema.properties || {}); _i < _Object$entries.length; _i++) {
|
|
6898
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
6899
|
+
key = _Object$entries$_i[0],
|
|
6900
|
+
propSchema = _Object$entries$_i[1];
|
|
6901
|
+
if (propSchema.type === 'object' && data !== null && data !== void 0 && data[key]) {
|
|
6902
|
+
var isValid = validateRequiredFieldsFromSchema(propSchema, data[key], path ? "".concat(path, ".").concat(key) : key);
|
|
6903
|
+
if (!isValid) {
|
|
6904
|
+
return false;
|
|
6905
|
+
}
|
|
6906
|
+
}
|
|
6907
|
+
}
|
|
6908
|
+
return true;
|
|
6909
|
+
} catch (error) {
|
|
6910
|
+
return false;
|
|
6911
|
+
}
|
|
6912
|
+
}
|
|
6913
|
+
function removeElementByKey(schema, key) {
|
|
6914
|
+
var parentElement = schema.elements.find(function (e) {
|
|
6915
|
+
return e.key === 'AdditionalOptions';
|
|
6916
|
+
});
|
|
6917
|
+
if (parentElement && Array.isArray(parentElement.elements)) {
|
|
6918
|
+
var index = parentElement.elements.findIndex(function (e) {
|
|
6919
|
+
return e.key === key;
|
|
6920
|
+
});
|
|
6921
|
+
if (index >= 0) {
|
|
6922
|
+
parentElement.elements.splice(index, 1);
|
|
6923
|
+
}
|
|
6924
|
+
}
|
|
6925
|
+
}
|
|
6926
|
+
return {
|
|
6927
|
+
setVirtualFields: setVirtualFields,
|
|
6928
|
+
getVirtualFields: getVirtualFields,
|
|
6929
|
+
getVirtualFieldsObject: getVirtualFieldsObject,
|
|
6930
|
+
basket3DExportChecked: basket3DExportChecked,
|
|
6931
|
+
basketSendMailChecked: basketSendMailChecked,
|
|
6932
|
+
basketSendOrderChecked: basketSendOrderChecked,
|
|
6933
|
+
validateRequiredFieldsFromSchema: validateRequiredFieldsFromSchema,
|
|
6934
|
+
removeElementByKey: removeElementByKey
|
|
6935
|
+
};
|
|
6936
|
+
};
|
|
6937
|
+
|
|
6739
6938
|
function ownKeys$v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6740
6939
|
function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6741
6940
|
function CheckOut(_ref) {
|
|
6742
|
-
var _basket$Client;
|
|
6743
6941
|
var schema = _ref.schema,
|
|
6744
6942
|
uiSchema = _ref.uiSchema,
|
|
6745
6943
|
renderService = _ref.renderService,
|
|
@@ -6755,19 +6953,28 @@ function CheckOut(_ref) {
|
|
|
6755
6953
|
productIsLoading = _ref.productIsLoading,
|
|
6756
6954
|
saveProduct = _ref.saveProduct,
|
|
6757
6955
|
updateProductData = _ref.updateProductData,
|
|
6758
|
-
gdpr = _ref.gdpr
|
|
6956
|
+
gdpr = _ref.gdpr,
|
|
6957
|
+
schemaSettings = _ref.schemaSettings;
|
|
6958
|
+
var _useCheckoutStep = useCheckoutStep3(schema),
|
|
6959
|
+
setVirtualFields = _useCheckoutStep.setVirtualFields,
|
|
6960
|
+
getVirtualFieldsObject = _useCheckoutStep.getVirtualFieldsObject,
|
|
6961
|
+
basket3DExportChecked = _useCheckoutStep.basket3DExportChecked,
|
|
6962
|
+
basketSendMailChecked = _useCheckoutStep.basketSendMailChecked,
|
|
6963
|
+
basketSendOrderChecked = _useCheckoutStep.basketSendOrderChecked,
|
|
6964
|
+
validateRequiredFieldsFromSchema = _useCheckoutStep.validateRequiredFieldsFromSchema,
|
|
6965
|
+
removeElementByKey = _useCheckoutStep.removeElementByKey;
|
|
6759
6966
|
var _useState = useState(false),
|
|
6760
6967
|
_useState2 = _slicedToArray(_useState, 2),
|
|
6761
6968
|
isSaving = _useState2[0],
|
|
6762
6969
|
setIsSaving = _useState2[1];
|
|
6763
6970
|
var _useState3 = useState(false),
|
|
6764
6971
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
var _useState5 = useState(
|
|
6972
|
+
productSaved = _useState4[0],
|
|
6973
|
+
setProductSaved = _useState4[1];
|
|
6974
|
+
var _useState5 = useState(true),
|
|
6768
6975
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
6769
|
-
|
|
6770
|
-
|
|
6976
|
+
validData = _useState6[0],
|
|
6977
|
+
setValidData = _useState6[1];
|
|
6771
6978
|
var _useTranslation = useTranslation(),
|
|
6772
6979
|
t = _useTranslation.t;
|
|
6773
6980
|
var _useSellerState = useSellerState(),
|
|
@@ -6776,8 +6983,7 @@ function CheckOut(_ref) {
|
|
|
6776
6983
|
_useDivaCore$actions = _useDivaCore.actions,
|
|
6777
6984
|
userHasPermission = _useDivaCore$actions.userHasPermission,
|
|
6778
6985
|
toggleLoading = _useDivaCore$actions.toggleLoading,
|
|
6779
|
-
openModal = _useDivaCore$actions.openModal
|
|
6780
|
-
organization = _useDivaCore.state.organization;
|
|
6986
|
+
openModal = _useDivaCore$actions.openModal;
|
|
6781
6987
|
var handleSave = useCallback(/*#__PURE__*/function () {
|
|
6782
6988
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(openPDF, sendMail, isFav) {
|
|
6783
6989
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -6815,8 +7021,12 @@ function CheckOut(_ref) {
|
|
|
6815
7021
|
return _context.abrupt("return");
|
|
6816
7022
|
case 17:
|
|
6817
7023
|
if (!isSaving) {
|
|
7024
|
+
openPDF = 'open';
|
|
6818
7025
|
setIsSaving(true);
|
|
6819
|
-
|
|
7026
|
+
if (basketSendMailChecked) {
|
|
7027
|
+
sendMail = true;
|
|
7028
|
+
}
|
|
7029
|
+
onClickSave(openPDF, sendMail, basket3DExportChecked, basketSendOrderChecked)["finally"](function () {
|
|
6820
7030
|
return setIsSaving(false);
|
|
6821
7031
|
});
|
|
6822
7032
|
}
|
|
@@ -6829,12 +7039,18 @@ function CheckOut(_ref) {
|
|
|
6829
7039
|
return function (_x, _x2, _x3) {
|
|
6830
7040
|
return _ref2.apply(this, arguments);
|
|
6831
7041
|
};
|
|
6832
|
-
}(), [isSaving, onClickSave, basket3DExportChecked]);
|
|
7042
|
+
}(), [isSaving, onClickSave, basket3DExportChecked, basketSendMailChecked, basketSendOrderChecked, toggleLoading, saveProduct, status, openModal, t]);
|
|
6833
7043
|
var onChangeForm = function onChangeForm(_ref3) {
|
|
6834
7044
|
var data = _ref3.data;
|
|
6835
7045
|
for (var key in data) {
|
|
7046
|
+
var _schema$properties;
|
|
7047
|
+
if ((_schema$properties = schema.properties) !== null && _schema$properties !== void 0 && (_schema$properties = _schema$properties[key]) !== null && _schema$properties !== void 0 && (_schema$properties = _schema$properties.properties) !== null && _schema$properties !== void 0 && _schema$properties.virtual) {
|
|
7048
|
+
setVirtualFields(key, data[key]);
|
|
7049
|
+
continue;
|
|
7050
|
+
}
|
|
6836
7051
|
basket[key] = data[key];
|
|
6837
7052
|
}
|
|
7053
|
+
setValidData(validateRequiredFieldsFromSchema(schema, data));
|
|
6838
7054
|
};
|
|
6839
7055
|
|
|
6840
7056
|
// for LEAFLET don't show printOptions, if there are any configured.
|
|
@@ -6849,22 +7065,23 @@ function CheckOut(_ref) {
|
|
|
6849
7065
|
finalSchema.elements.splice(index, 1);
|
|
6850
7066
|
}
|
|
6851
7067
|
}
|
|
7068
|
+
if (status !== 'ORDER' || !schemaSettings.showSendOrder) {
|
|
7069
|
+
removeElementByKey(finalSchema, 'SendOrder');
|
|
7070
|
+
}
|
|
7071
|
+
if (!schemaSettings.show3dExport) {
|
|
7072
|
+
removeElementByKey(finalSchema, 'Order3DExport');
|
|
7073
|
+
}
|
|
7074
|
+
if (schemaSettings.hideWWSButton) {
|
|
7075
|
+
removeElementByKey(finalSchema, 'SendIWOBasket');
|
|
7076
|
+
}
|
|
6852
7077
|
var permissionAnyHqRenderBox = userHasPermission('anyhqrenderbox');
|
|
6853
|
-
var handleCheckBoxChange = function handleCheckBoxChange(event) {
|
|
6854
|
-
setBasket3DExportChecked(event.target.checked);
|
|
6855
|
-
};
|
|
6856
7078
|
return /*#__PURE__*/jsxs("div", {
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
flexDirection: 'column'
|
|
6860
|
-
},
|
|
7079
|
+
id: "checkout3Container",
|
|
7080
|
+
className: checkout3Container,
|
|
6861
7081
|
children: [/*#__PURE__*/jsxs("div", {
|
|
7082
|
+
id: "checkout3Header",
|
|
7083
|
+
className: checkout3Header,
|
|
6862
7084
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
6863
|
-
style: {
|
|
6864
|
-
"float": 'left',
|
|
6865
|
-
marginLeft: '50px',
|
|
6866
|
-
width: 'fit-content'
|
|
6867
|
-
},
|
|
6868
7085
|
variant: "h4",
|
|
6869
7086
|
children: "Checkout"
|
|
6870
7087
|
}), /*#__PURE__*/jsx(StatusMenu, {
|
|
@@ -6881,45 +7098,19 @@ function CheckOut(_ref) {
|
|
|
6881
7098
|
handleSave: handleSave,
|
|
6882
7099
|
updateProductData: updateProductData,
|
|
6883
7100
|
disabled: basket.OrderSets.length > 1
|
|
6884
|
-
}), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsxs(
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
data: basket,
|
|
6893
|
-
onChange: onChangeForm,
|
|
6894
|
-
schema: schema,
|
|
6895
|
-
uischema: finalSchema,
|
|
6896
|
-
renderer: "material"
|
|
6897
|
-
})
|
|
7101
|
+
}), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsxs("div", {
|
|
7102
|
+
className: checkoutForm,
|
|
7103
|
+
children: [/*#__PURE__*/jsx(Form, {
|
|
7104
|
+
data: _objectSpread$v(_objectSpread$v({}, basket), getVirtualFieldsObject()),
|
|
7105
|
+
onChange: onChangeForm,
|
|
7106
|
+
schema: schema,
|
|
7107
|
+
uischema: finalSchema,
|
|
7108
|
+
renderer: "material"
|
|
6898
7109
|
}), !!renderService && permissionAnyHqRenderBox && (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && /*#__PURE__*/jsx(HqRenderBox, {
|
|
6899
7110
|
basket: basket,
|
|
6900
7111
|
config: renderService
|
|
6901
|
-
}), (
|
|
6902
|
-
|
|
6903
|
-
})) && (catalogData === null || catalogData === void 0 ? void 0 : catalogData.find(function (c) {
|
|
6904
|
-
return c.has3D;
|
|
6905
|
-
})) && organization.settings.enable3DExport && /*#__PURE__*/jsxs("div", {
|
|
6906
|
-
style: {
|
|
6907
|
-
marginLeft: '50px',
|
|
6908
|
-
width: '700px'
|
|
6909
|
-
},
|
|
6910
|
-
children: [/*#__PURE__*/jsx(FormControlLabel$1, {
|
|
6911
|
-
control: /*#__PURE__*/jsx(Checkbox$1, {
|
|
6912
|
-
onChange: handleCheckBoxChange
|
|
6913
|
-
}),
|
|
6914
|
-
label: t('basket.checkout.order3dexport')
|
|
6915
|
-
}), /*#__PURE__*/jsxs(Typography, {
|
|
6916
|
-
variant: "caption",
|
|
6917
|
-
children: ["(", t('basket.checkout.3dexport'), ")"]
|
|
6918
|
-
})]
|
|
6919
|
-
}), gdpr && !isEmpty(basket === null || basket === void 0 ? void 0 : basket.Client) && /*#__PURE__*/jsx(FormControlLabel$1, {
|
|
6920
|
-
style: {
|
|
6921
|
-
marginLeft: '40px'
|
|
6922
|
-
},
|
|
7112
|
+
}), gdpr && !isEmpty$1(basket === null || basket === void 0 ? void 0 : basket.Client) && /*#__PURE__*/jsx(FormControlLabel$1, {
|
|
7113
|
+
className: gdprCheckbox,
|
|
6923
7114
|
label: t('basket.checkout.gdpr'),
|
|
6924
7115
|
control: /*#__PURE__*/jsx(Checkbox$1, {
|
|
6925
7116
|
checked: basket === null || basket === void 0 ? void 0 : basket.Gdpr,
|
|
@@ -6930,17 +7121,20 @@ function CheckOut(_ref) {
|
|
|
6930
7121
|
})
|
|
6931
7122
|
})]
|
|
6932
7123
|
})]
|
|
6933
|
-
}), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
7124
|
+
}), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsx("div", {
|
|
7125
|
+
className: saveButtonGroup,
|
|
7126
|
+
children: /*#__PURE__*/jsx(SaveButtonsGroup, {
|
|
7127
|
+
orderEmpty: !basket.OrderSets || basket.OrderSets.length == 0 || gdpr && !isEmpty$1(basket === null || basket === void 0 ? void 0 : basket.Client) && !basket.Gdpr,
|
|
7128
|
+
onClickSave: handleSave,
|
|
7129
|
+
startWithEmptyBasket: startWithEmptyBasket,
|
|
7130
|
+
status: status,
|
|
7131
|
+
configSaveButtons: configSaveButtons,
|
|
7132
|
+
validData: validData
|
|
7133
|
+
})
|
|
6940
7134
|
})]
|
|
6941
7135
|
});
|
|
6942
7136
|
}
|
|
6943
|
-
function isEmpty(data) {
|
|
7137
|
+
function isEmpty$1(data) {
|
|
6944
7138
|
if (!data) {
|
|
6945
7139
|
return true;
|
|
6946
7140
|
}
|
|
@@ -6950,13 +7144,14 @@ function isEmpty(data) {
|
|
|
6950
7144
|
return false;
|
|
6951
7145
|
}
|
|
6952
7146
|
return Object.keys(data).every(function (k) {
|
|
6953
|
-
return isEmpty(data[k]);
|
|
7147
|
+
return isEmpty$1(data[k]);
|
|
6954
7148
|
});
|
|
6955
7149
|
}
|
|
6956
7150
|
|
|
6957
7151
|
function ownKeys$u(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6958
7152
|
function _objectSpread$u(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$u(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$u(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6959
|
-
var schema = function schema(
|
|
7153
|
+
var schema = function schema(settings) {
|
|
7154
|
+
var _settings$sendMail;
|
|
6960
7155
|
return {
|
|
6961
7156
|
type: 'object',
|
|
6962
7157
|
properties: _objectSpread$u(_objectSpread$u({
|
|
@@ -6988,12 +7183,35 @@ var schema = function schema(hideWWSButton) {
|
|
|
6988
7183
|
type: ['string', 'null'],
|
|
6989
7184
|
title: 'basket.checkout.form.sellerNr'
|
|
6990
7185
|
}
|
|
6991
|
-
}, !hideWWSButton ? {
|
|
7186
|
+
}, !settings.hideWWSButton ? {
|
|
6992
7187
|
SendIWOBasket: {
|
|
6993
7188
|
type: 'boolean',
|
|
6994
7189
|
title: 'basket.checkout.form.sendIwoBasket'
|
|
6995
7190
|
}
|
|
6996
7191
|
} : {}), {}, {
|
|
7192
|
+
Order3DExport: {
|
|
7193
|
+
type: 'boolean',
|
|
7194
|
+
title: 'basket.checkout.order3dexport',
|
|
7195
|
+
description: 'basket.checkout.3dexport',
|
|
7196
|
+
properties: {
|
|
7197
|
+
virtual: true
|
|
7198
|
+
}
|
|
7199
|
+
},
|
|
7200
|
+
SendMail: {
|
|
7201
|
+
type: 'boolean',
|
|
7202
|
+
title: 'basket.checkout.form.sendMail',
|
|
7203
|
+
readOnly: (_settings$sendMail = settings.sendMail) === null || _settings$sendMail === void 0 ? void 0 : _settings$sendMail.disabled,
|
|
7204
|
+
properties: {
|
|
7205
|
+
virtual: true
|
|
7206
|
+
}
|
|
7207
|
+
},
|
|
7208
|
+
SendOrder: {
|
|
7209
|
+
type: 'boolean',
|
|
7210
|
+
title: 'basket.checkout.form.sendOrder',
|
|
7211
|
+
properties: {
|
|
7212
|
+
virtual: true
|
|
7213
|
+
}
|
|
7214
|
+
},
|
|
6997
7215
|
PrintOptions: {
|
|
6998
7216
|
type: 'object',
|
|
6999
7217
|
properties: {
|
|
@@ -7046,154 +7264,222 @@ var schema = function schema(hideWWSButton) {
|
|
|
7046
7264
|
})
|
|
7047
7265
|
};
|
|
7048
7266
|
};
|
|
7049
|
-
var uiSchema = function uiSchema(
|
|
7267
|
+
var uiSchema = function uiSchema(settings) {
|
|
7050
7268
|
return {
|
|
7051
7269
|
type: 'VerticalLayout',
|
|
7052
7270
|
elements: [{
|
|
7053
|
-
|
|
7271
|
+
key: 'BasicData',
|
|
7272
|
+
type: 'Group',
|
|
7273
|
+
label: 'basket.checkout.form.basicData',
|
|
7054
7274
|
elements: [{
|
|
7055
|
-
type: '
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
}, {
|
|
7070
|
-
type: 'Control',
|
|
7071
|
-
scope: '#/properties/RetailerNr',
|
|
7072
|
-
rule: {
|
|
7073
|
-
effect: 'ENABLE',
|
|
7074
|
-
condition: {
|
|
7075
|
-
scope: '#/properties/RetailerName',
|
|
7076
|
-
schema: {
|
|
7077
|
-
"const": '----'
|
|
7275
|
+
type: 'HorizontalLayout',
|
|
7276
|
+
elements: [{
|
|
7277
|
+
type: 'Control',
|
|
7278
|
+
scope: '#/properties/RetailerOfferNum'
|
|
7279
|
+
}, {
|
|
7280
|
+
type: 'Control',
|
|
7281
|
+
scope: '#/properties/RetailerName',
|
|
7282
|
+
rule: {
|
|
7283
|
+
effect: 'ENABLE',
|
|
7284
|
+
condition: {
|
|
7285
|
+
scope: '#/properties/RetailerName',
|
|
7286
|
+
schema: {
|
|
7287
|
+
"const": '----'
|
|
7288
|
+
}
|
|
7078
7289
|
}
|
|
7079
7290
|
}
|
|
7080
|
-
}
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
scope: '#/properties/RetailerName',
|
|
7091
|
-
schema: {
|
|
7092
|
-
"const": '----'
|
|
7291
|
+
}, {
|
|
7292
|
+
type: 'Control',
|
|
7293
|
+
scope: '#/properties/RetailerNr',
|
|
7294
|
+
rule: {
|
|
7295
|
+
effect: 'ENABLE',
|
|
7296
|
+
condition: {
|
|
7297
|
+
scope: '#/properties/RetailerName',
|
|
7298
|
+
schema: {
|
|
7299
|
+
"const": '----'
|
|
7300
|
+
}
|
|
7093
7301
|
}
|
|
7094
7302
|
}
|
|
7095
|
-
}
|
|
7303
|
+
}]
|
|
7096
7304
|
}, {
|
|
7097
|
-
type: '
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7305
|
+
type: 'HorizontalLayout',
|
|
7306
|
+
elements: [{
|
|
7307
|
+
type: 'Control',
|
|
7308
|
+
scope: '#/properties/Salesperson',
|
|
7309
|
+
rule: !settings.enableSellerInfos ? {
|
|
7310
|
+
effect: 'ENABLE',
|
|
7311
|
+
condition: {
|
|
7312
|
+
scope: '#/properties/RetailerName',
|
|
7313
|
+
schema: {
|
|
7314
|
+
"const": '----'
|
|
7315
|
+
}
|
|
7105
7316
|
}
|
|
7106
|
-
}
|
|
7107
|
-
}
|
|
7317
|
+
} : undefined
|
|
7318
|
+
}, {
|
|
7319
|
+
type: 'Control',
|
|
7320
|
+
scope: '#/properties/SalespersonEmail',
|
|
7321
|
+
rule: !settings.enableSellerInfos ? {
|
|
7322
|
+
effect: 'ENABLE',
|
|
7323
|
+
condition: {
|
|
7324
|
+
scope: '#/properties/RetailerName',
|
|
7325
|
+
schema: {
|
|
7326
|
+
"const": '----'
|
|
7327
|
+
}
|
|
7328
|
+
}
|
|
7329
|
+
} : undefined
|
|
7330
|
+
}, {
|
|
7331
|
+
type: 'Control',
|
|
7332
|
+
scope: '#/properties/SalespersonNr',
|
|
7333
|
+
rule: !settings.enableSellerInfos ? {
|
|
7334
|
+
effect: 'ENABLE',
|
|
7335
|
+
condition: {
|
|
7336
|
+
scope: '#/properties/RetailerName',
|
|
7337
|
+
schema: {
|
|
7338
|
+
"const": '----'
|
|
7339
|
+
}
|
|
7340
|
+
}
|
|
7341
|
+
} : undefined
|
|
7342
|
+
}]
|
|
7108
7343
|
}, {
|
|
7109
7344
|
type: 'Control',
|
|
7110
|
-
scope: '#/properties/
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
scope: '#/properties/RetailerName',
|
|
7115
|
-
schema: {
|
|
7116
|
-
"const": '----'
|
|
7117
|
-
}
|
|
7118
|
-
}
|
|
7119
|
-
} : undefined
|
|
7345
|
+
scope: '#/properties/ClientRemark',
|
|
7346
|
+
options: {
|
|
7347
|
+
multi: true
|
|
7348
|
+
}
|
|
7120
7349
|
}]
|
|
7121
7350
|
}, {
|
|
7122
|
-
type: '
|
|
7123
|
-
scope: '#/properties/ClientRemark',
|
|
7124
|
-
options: {
|
|
7125
|
-
multi: true
|
|
7126
|
-
}
|
|
7127
|
-
}, {
|
|
7128
|
-
key: 'PrintOptions',
|
|
7129
|
-
type: 'Group',
|
|
7130
|
-
label: 'basket.checkout.form.printOptions',
|
|
7351
|
+
type: 'HorizontalLayout',
|
|
7131
7352
|
elements: [{
|
|
7132
|
-
|
|
7353
|
+
key: 'PrintOptions',
|
|
7354
|
+
type: 'Group',
|
|
7355
|
+
label: 'basket.checkout.form.printOptions',
|
|
7133
7356
|
elements: [{
|
|
7134
|
-
type: '
|
|
7357
|
+
type: 'HorizontalLayout',
|
|
7135
7358
|
elements: [{
|
|
7136
|
-
type: '
|
|
7137
|
-
|
|
7359
|
+
type: 'VerticalLayout',
|
|
7360
|
+
elements: [{
|
|
7361
|
+
type: 'Control',
|
|
7362
|
+
scope: '#/properties/PrintOptions/properties/PlanningSketch'
|
|
7363
|
+
}]
|
|
7138
7364
|
}, {
|
|
7139
|
-
type: '
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
}, {
|
|
7145
|
-
type: 'Control',
|
|
7146
|
-
scope: '#/properties/PrintOptions/properties/SalespersonData'
|
|
7365
|
+
type: 'VerticalLayout',
|
|
7366
|
+
elements: [{
|
|
7367
|
+
type: 'Control',
|
|
7368
|
+
scope: '#/properties/PrintOptions/properties/ModelName'
|
|
7369
|
+
}]
|
|
7147
7370
|
}]
|
|
7148
7371
|
}, {
|
|
7149
|
-
type: '
|
|
7372
|
+
type: 'HorizontalLayout',
|
|
7150
7373
|
elements: [{
|
|
7151
|
-
type: '
|
|
7152
|
-
|
|
7374
|
+
type: 'VerticalLayout',
|
|
7375
|
+
elements: [{
|
|
7376
|
+
type: 'Control',
|
|
7377
|
+
scope: '#/properties/PrintOptions/properties/CollectionLogo'
|
|
7378
|
+
}]
|
|
7153
7379
|
}, {
|
|
7154
|
-
type: '
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7380
|
+
type: 'VerticalLayout',
|
|
7381
|
+
elements: [{
|
|
7382
|
+
type: 'Control',
|
|
7383
|
+
scope: '#/properties/PrintOptions/properties/Remark'
|
|
7384
|
+
}]
|
|
7385
|
+
}]
|
|
7386
|
+
}, {
|
|
7387
|
+
type: 'HorizontalLayout',
|
|
7388
|
+
elements: [{
|
|
7389
|
+
type: 'VerticalLayout',
|
|
7390
|
+
elements: [{
|
|
7391
|
+
type: 'Control',
|
|
7392
|
+
scope: '#/properties/PrintOptions/properties/ClientpersonData'
|
|
7393
|
+
}]
|
|
7159
7394
|
}, {
|
|
7160
|
-
type: '
|
|
7161
|
-
|
|
7395
|
+
type: 'VerticalLayout',
|
|
7396
|
+
elements: [{
|
|
7397
|
+
type: 'Control',
|
|
7398
|
+
scope: '#/properties/PrintOptions/properties/Signature'
|
|
7399
|
+
}]
|
|
7162
7400
|
}]
|
|
7163
7401
|
}, {
|
|
7164
|
-
type: '
|
|
7402
|
+
type: 'HorizontalLayout',
|
|
7165
7403
|
elements: [{
|
|
7166
|
-
type: '
|
|
7167
|
-
|
|
7404
|
+
type: 'VerticalLayout',
|
|
7405
|
+
elements: [{
|
|
7406
|
+
type: 'Control',
|
|
7407
|
+
scope: '#/properties/PrintOptions/properties/Gdpr'
|
|
7408
|
+
}]
|
|
7168
7409
|
}, {
|
|
7169
|
-
type: '
|
|
7170
|
-
|
|
7410
|
+
type: 'VerticalLayout',
|
|
7411
|
+
elements: []
|
|
7412
|
+
}]
|
|
7413
|
+
}, {
|
|
7414
|
+
type: 'HorizontalLayout',
|
|
7415
|
+
elements: [{
|
|
7416
|
+
type: 'VerticalLayout',
|
|
7417
|
+
elements: [{
|
|
7418
|
+
type: 'Control',
|
|
7419
|
+
scope: '#/properties/PrintOptions/properties/Prices'
|
|
7420
|
+
}]
|
|
7171
7421
|
}, {
|
|
7172
|
-
type: '
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7422
|
+
type: 'VerticalLayout',
|
|
7423
|
+
elements: [{
|
|
7424
|
+
type: 'Control',
|
|
7425
|
+
scope: '#/properties/PrintOptions/properties/AllPrices',
|
|
7426
|
+
rule: {
|
|
7427
|
+
effect: 'HIDE',
|
|
7428
|
+
condition: {
|
|
7429
|
+
scope: '#/properties/PrintOptions/properties/Prices',
|
|
7430
|
+
schema: {
|
|
7431
|
+
not: {
|
|
7432
|
+
"const": true
|
|
7433
|
+
}
|
|
7181
7434
|
}
|
|
7182
7435
|
}
|
|
7183
7436
|
}
|
|
7184
|
-
}
|
|
7437
|
+
}]
|
|
7438
|
+
}]
|
|
7439
|
+
}, {
|
|
7440
|
+
type: 'HorizontalLayout',
|
|
7441
|
+
elements: [{
|
|
7442
|
+
type: 'VerticalLayout',
|
|
7443
|
+
elements: [{
|
|
7444
|
+
type: 'Control',
|
|
7445
|
+
scope: '#/properties/PrintOptions/properties/SalespersonData'
|
|
7446
|
+
}]
|
|
7447
|
+
}, {
|
|
7448
|
+
type: 'VerticalLayout',
|
|
7449
|
+
elements: [{
|
|
7450
|
+
type: 'Control',
|
|
7451
|
+
scope: '#/properties/PrintOptions/properties/OpvCodices'
|
|
7452
|
+
}]
|
|
7185
7453
|
}]
|
|
7186
7454
|
}]
|
|
7455
|
+
}, {
|
|
7456
|
+
key: 'AdditionalOptions',
|
|
7457
|
+
type: 'Group',
|
|
7458
|
+
label: 'basket.checkout.form.additionalOptions',
|
|
7459
|
+
elements: [].concat(_toConsumableArray(!settings.hideWWSButton ? [{
|
|
7460
|
+
type: 'Control',
|
|
7461
|
+
scope: '#/properties/SendIWOBasket'
|
|
7462
|
+
}] : []), [{
|
|
7463
|
+
key: 'SendOrder',
|
|
7464
|
+
type: 'Control',
|
|
7465
|
+
scope: '#/properties/SendOrder'
|
|
7466
|
+
}, {
|
|
7467
|
+
type: 'Control',
|
|
7468
|
+
scope: '#/properties/Order3DExport',
|
|
7469
|
+
options: {
|
|
7470
|
+
showUnfocusedDescription: true
|
|
7471
|
+
}
|
|
7472
|
+
}, {
|
|
7473
|
+
type: 'Control',
|
|
7474
|
+
scope: '#/properties/SendMail'
|
|
7475
|
+
}])
|
|
7187
7476
|
}]
|
|
7188
|
-
}]
|
|
7189
|
-
type: 'Control',
|
|
7190
|
-
scope: '#/properties/SendIWOBasket'
|
|
7191
|
-
}] : []))
|
|
7477
|
+
}]
|
|
7192
7478
|
};
|
|
7193
7479
|
};
|
|
7194
7480
|
|
|
7195
7481
|
function Step3Checkout(_ref) {
|
|
7196
|
-
var _config$checkout, _config$checkout2, _config$checkout3, _config$checkout4, _config$checkout5;
|
|
7482
|
+
var _config$checkout, _config$checkout2, _basket$Client, _config$checkout3, _config$checkout4, _config$checkout5, _config$checkout6;
|
|
7197
7483
|
var updateBasket = _ref.updateBasket,
|
|
7198
7484
|
startWithEmptyBasket = _ref.startWithEmptyBasket,
|
|
7199
7485
|
onClickSave = _ref.onClickSave,
|
|
@@ -7208,6 +7494,25 @@ function Step3Checkout(_ref) {
|
|
|
7208
7494
|
updateProductData = _ref.updateProductData;
|
|
7209
7495
|
var _useDivaCore = useDivaCore(),
|
|
7210
7496
|
organization = _useDivaCore.state.organization;
|
|
7497
|
+
var _useSellerState = useSellerState$1(),
|
|
7498
|
+
catalogData = _useSellerState.state.catalogData;
|
|
7499
|
+
var configSaveButtons = (config === null || config === void 0 || (_config$checkout = config.checkout) === null || _config$checkout === void 0 ? void 0 : _config$checkout.saveButtons) || ['SAVE', 'SAVE_AND_SEND', 'NEW'];
|
|
7500
|
+
var orderEmpty = !basket.OrderSets || basket.OrderSets.length == 0 || (config === null || config === void 0 || (_config$checkout2 = config.checkout) === null || _config$checkout2 === void 0 ? void 0 : _config$checkout2.checkGdpr) && !isEmpty(basket === null || basket === void 0 ? void 0 : basket.Client) && !basket.Gdpr;
|
|
7501
|
+
var userInfoPresent = !!((_basket$Client = basket.Client) !== null && _basket$Client !== void 0 && _basket$Client.email);
|
|
7502
|
+
var schemaSettings = {
|
|
7503
|
+
hideWWSButton: !organization.hasIwoFurn,
|
|
7504
|
+
enableSellerInfos: config === null || config === void 0 ? void 0 : config.enableSellerInfos,
|
|
7505
|
+
show3dExport: (catalogData === null || catalogData === void 0 ? void 0 : catalogData.find(function (c) {
|
|
7506
|
+
return !c.disable3DExport;
|
|
7507
|
+
})) && (catalogData === null || catalogData === void 0 ? void 0 : catalogData.find(function (c) {
|
|
7508
|
+
return c.has3D;
|
|
7509
|
+
})) && organization.settings.enable3DExport,
|
|
7510
|
+
showSendOrder: organization.settings.sendOrders ? true : false,
|
|
7511
|
+
sendMail: {
|
|
7512
|
+
show: configSaveButtons.includes('SAVE_AND_SEND'),
|
|
7513
|
+
disabled: orderEmpty || !userInfoPresent
|
|
7514
|
+
}
|
|
7515
|
+
};
|
|
7211
7516
|
return /*#__PURE__*/jsx(CheckOut, {
|
|
7212
7517
|
startWithEmptyBasket: startWithEmptyBasket,
|
|
7213
7518
|
onClickSave: onClickSave,
|
|
@@ -7215,18 +7520,32 @@ function Step3Checkout(_ref) {
|
|
|
7215
7520
|
setStatus: setStatus,
|
|
7216
7521
|
basket: basket,
|
|
7217
7522
|
statusArray: statusArray,
|
|
7218
|
-
schema: (config === null || config === void 0 || (_config$
|
|
7219
|
-
uiSchema: (config === null || config === void 0 || (_config$
|
|
7523
|
+
schema: (config === null || config === void 0 || (_config$checkout3 = config.checkout) === null || _config$checkout3 === void 0 ? void 0 : _config$checkout3.schema) || schema(schemaSettings),
|
|
7524
|
+
uiSchema: (config === null || config === void 0 || (_config$checkout4 = config.checkout) === null || _config$checkout4 === void 0 ? void 0 : _config$checkout4.uiSchema) || uiSchema(schemaSettings),
|
|
7525
|
+
schemaSettings: schemaSettings,
|
|
7220
7526
|
updateBasket: updateBasket,
|
|
7221
|
-
renderService: config === null || config === void 0 || (_config$
|
|
7222
|
-
configSaveButtons:
|
|
7223
|
-
gdpr: config === null || config === void 0 || (_config$
|
|
7527
|
+
renderService: config === null || config === void 0 || (_config$checkout5 = config.checkout) === null || _config$checkout5 === void 0 ? void 0 : _config$checkout5.renderService,
|
|
7528
|
+
configSaveButtons: configSaveButtons,
|
|
7529
|
+
gdpr: config === null || config === void 0 || (_config$checkout6 = config.checkout) === null || _config$checkout6 === void 0 ? void 0 : _config$checkout6.checkGdpr,
|
|
7224
7530
|
currentProduct: currentProduct,
|
|
7225
7531
|
productIsLoading: productIsLoading,
|
|
7226
7532
|
saveProduct: saveProduct,
|
|
7227
7533
|
updateProductData: updateProductData
|
|
7228
7534
|
});
|
|
7229
7535
|
}
|
|
7536
|
+
function isEmpty(data) {
|
|
7537
|
+
if (!data) {
|
|
7538
|
+
return true;
|
|
7539
|
+
}
|
|
7540
|
+
if (Object.keys(data).length === 0 && data.constructor === Object) {
|
|
7541
|
+
return true;
|
|
7542
|
+
} else if (data.constructor !== Object) {
|
|
7543
|
+
return false;
|
|
7544
|
+
}
|
|
7545
|
+
return Object.keys(data).every(function (k) {
|
|
7546
|
+
return isEmpty(data[k]);
|
|
7547
|
+
});
|
|
7548
|
+
}
|
|
7230
7549
|
|
|
7231
7550
|
function Step4Checkout(_ref) {
|
|
7232
7551
|
var currentProduct = _ref.currentProduct,
|
|
@@ -7483,7 +7802,8 @@ function Basket(_ref) {
|
|
|
7483
7802
|
openBasket = _useSellerState$actio.openBasket,
|
|
7484
7803
|
openModal = _useSellerState$actio.openModal,
|
|
7485
7804
|
sendEmail = _useSellerState$actio.sendEmail,
|
|
7486
|
-
resetBasketState = _useSellerState$actio.resetBasketState
|
|
7805
|
+
resetBasketState = _useSellerState$actio.resetBasketState,
|
|
7806
|
+
setOrdered = _useSellerState$actio.setOrdered;
|
|
7487
7807
|
var _useProduct = useProduct(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket),
|
|
7488
7808
|
currentProduct = _useProduct.currentProduct,
|
|
7489
7809
|
saveProduct = _useProduct.saveProduct,
|
|
@@ -7639,7 +7959,7 @@ function Basket(_ref) {
|
|
|
7639
7959
|
}
|
|
7640
7960
|
};
|
|
7641
7961
|
var onClickSave = /*#__PURE__*/function () {
|
|
7642
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(pdf, doSendEmail, export3D) {
|
|
7962
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(pdf, doSendEmail, export3D, sendOrder) {
|
|
7643
7963
|
var _configurationData$Ch, _configurationData$re;
|
|
7644
7964
|
var getPdf, response, _configurationData$Ch2, _ref3, pdfUrl, idx, o, d3dp, newRenderJob, _configurationData$Ch3, _configurationData$Ch4, _currentBasket$Client, _opener;
|
|
7645
7965
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -7663,7 +7983,7 @@ function Basket(_ref) {
|
|
|
7663
7983
|
break;
|
|
7664
7984
|
}
|
|
7665
7985
|
errorOnSaving(response);
|
|
7666
|
-
_context.next =
|
|
7986
|
+
_context.next = 44;
|
|
7667
7987
|
break;
|
|
7668
7988
|
case 12:
|
|
7669
7989
|
_ref3 = response, pdfUrl = _ref3.pdfUrl;
|
|
@@ -7741,11 +8061,25 @@ function Basket(_ref) {
|
|
|
7741
8061
|
autoHideDuration: (_configurationData$Ch3 = configurationData === null || configurationData === void 0 || (_configurationData$Ch4 = configurationData.Checkout) === null || _configurationData$Ch4 === void 0 ? void 0 : _configurationData$Ch4.pdfQRAutoHideDuration) !== null && _configurationData$Ch3 !== void 0 ? _configurationData$Ch3 : 1000 * 60 * 2
|
|
7742
8062
|
});
|
|
7743
8063
|
}
|
|
8064
|
+
if (!sendOrder) {
|
|
8065
|
+
_context.next = 40;
|
|
8066
|
+
break;
|
|
8067
|
+
}
|
|
8068
|
+
_context.next = 40;
|
|
8069
|
+
return setOrdered(currentBasket, true);
|
|
8070
|
+
case 40:
|
|
7744
8071
|
if (doSendEmail) {
|
|
7745
8072
|
sendEmail({
|
|
7746
8073
|
dialogText: t('basket.modals.email.text', {
|
|
7747
8074
|
divaNr: currentBasket.DivaNr + '-' + currentBasket.getDocumentVersion()
|
|
7748
8075
|
}),
|
|
8076
|
+
showDialog: true,
|
|
8077
|
+
dialogAcceptMailSend: pdf == 'open' ? t('modals.open_pdf_now') : undefined,
|
|
8078
|
+
mailSendCallback: function mailSendCallback() {
|
|
8079
|
+
if (pdf == 'open') {
|
|
8080
|
+
window.open(pdfUrl, '_blank');
|
|
8081
|
+
}
|
|
8082
|
+
},
|
|
7749
8083
|
content: {
|
|
7750
8084
|
type: 'basket',
|
|
7751
8085
|
to: ((_currentBasket$Client = currentBasket.Client) === null || _currentBasket$Client === void 0 ? void 0 : _currentBasket$Client.email) || '',
|
|
@@ -7762,17 +8096,19 @@ function Basket(_ref) {
|
|
|
7762
8096
|
}, '*');
|
|
7763
8097
|
window.close();
|
|
7764
8098
|
} else {
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
8099
|
+
if (!sendOrder) {
|
|
8100
|
+
openModal({
|
|
8101
|
+
title: t('modals.saving'),
|
|
8102
|
+
reject: t('modals.close'),
|
|
8103
|
+
accept: pdf == 'open' ? t('modals.open_now') : true,
|
|
8104
|
+
text: t('modals.saving_successful').replace('%1', currentBasket.DivaNr + '-' + currentBasket.getDocumentVersion()),
|
|
8105
|
+
callback: function callback(accepted) {
|
|
8106
|
+
if (accepted && pdf == 'open') {
|
|
8107
|
+
window.open(pdfUrl, '_blank');
|
|
8108
|
+
}
|
|
7773
8109
|
}
|
|
7774
|
-
}
|
|
7775
|
-
}
|
|
8110
|
+
});
|
|
8111
|
+
}
|
|
7776
8112
|
}
|
|
7777
8113
|
/* TODO used with SM integration in divaProtal
|
|
7778
8114
|
openModal({
|
|
@@ -7796,13 +8132,13 @@ function Basket(_ref) {
|
|
|
7796
8132
|
});
|
|
7797
8133
|
currentBasket.setDocumentVersion(currentBasket.getDocumentVersion() + 1);
|
|
7798
8134
|
setActBasketPage('Step1');
|
|
7799
|
-
case
|
|
8135
|
+
case 44:
|
|
7800
8136
|
case "end":
|
|
7801
8137
|
return _context.stop();
|
|
7802
8138
|
}
|
|
7803
8139
|
}, _callee, null, [[14, 32]]);
|
|
7804
8140
|
}));
|
|
7805
|
-
return function onClickSave(_x, _x2, _x3) {
|
|
8141
|
+
return function onClickSave(_x, _x2, _x3, _x4) {
|
|
7806
8142
|
return _ref2.apply(this, arguments);
|
|
7807
8143
|
};
|
|
7808
8144
|
}();
|