@crystaldesign/diva-seller 25.10.0-beta.9 → 25.11.0-beta.2
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 +629 -266
- 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,100 @@ 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
|
+
showDialog: false,
|
|
2794
|
+
callback: function callback(success) {
|
|
2795
|
+
if (success) {
|
|
2796
|
+
basketHandler.setOrdered({
|
|
2797
|
+
serviceUrl: apiConfig.basketService,
|
|
2798
|
+
organizationId: currentOrganization === null || currentOrganization === void 0 ? void 0 : currentOrganization._id,
|
|
2799
|
+
jwt: jwt,
|
|
2800
|
+
divaNr: basket.DivaNr,
|
|
2801
|
+
documentVersion: basket.DocumentVersion - 1 //actual document version
|
|
2802
|
+
});
|
|
2803
|
+
toggleLoading('setOrdered');
|
|
2804
|
+
openModal({
|
|
2805
|
+
title: t('basket.checkout.modals.ordered'),
|
|
2806
|
+
accept: true
|
|
2807
|
+
});
|
|
2808
|
+
} else {
|
|
2809
|
+
toggleLoading('setOrdered');
|
|
2810
|
+
openModal({
|
|
2811
|
+
title: t('basket.checkout.modals.orderederror'),
|
|
2812
|
+
accept: true
|
|
2813
|
+
});
|
|
2814
|
+
}
|
|
2815
|
+
},
|
|
2816
|
+
content: {
|
|
2817
|
+
to: to.join(','),
|
|
2818
|
+
type: 'basket',
|
|
2819
|
+
variant: 'SEND',
|
|
2820
|
+
divaNr: basket.DivaNr,
|
|
2821
|
+
version: basket.DocumentVersion
|
|
2822
|
+
}
|
|
2823
|
+
});
|
|
2824
|
+
} catch (e) {
|
|
2825
|
+
console.error(e);
|
|
2826
|
+
}
|
|
2827
|
+
return _context11.abrupt("return");
|
|
2828
|
+
case 6:
|
|
2829
|
+
_context11.next = 8;
|
|
2830
|
+
return basketHandler.setOrdered({
|
|
2831
|
+
serviceUrl: apiConfig.basketService,
|
|
2832
|
+
organizationId: currentOrganization === null || currentOrganization === void 0 ? void 0 : currentOrganization._id,
|
|
2833
|
+
jwt: jwt,
|
|
2834
|
+
divaNr: basket.DivaNr,
|
|
2835
|
+
documentVersion: basket.DocumentVersion - 1
|
|
2836
|
+
});
|
|
2837
|
+
case 8:
|
|
2838
|
+
case "end":
|
|
2839
|
+
return _context11.stop();
|
|
2840
|
+
}
|
|
2841
|
+
}, _callee10);
|
|
2842
|
+
}));
|
|
2843
|
+
return function setOrdered(_x17, _x18) {
|
|
2844
|
+
return _ref19.apply(this, arguments);
|
|
2845
|
+
};
|
|
2846
|
+
}();
|
|
2748
2847
|
return {
|
|
2749
2848
|
state: state,
|
|
2750
2849
|
setFirstLoginApiUrl: setFirstLoginApiUrl,
|
|
@@ -2770,7 +2869,8 @@ function useSellerStateData(_ref) {
|
|
|
2770
2869
|
resetForCache: resetForCache,
|
|
2771
2870
|
loadAnalyticScore: loadAnalyticScore,
|
|
2772
2871
|
setManualCustomDataFields: setManualCustomDataFields,
|
|
2773
|
-
setCloseOnSave: setCloseOnSave
|
|
2872
|
+
setCloseOnSave: setCloseOnSave,
|
|
2873
|
+
setOrdered: setOrdered
|
|
2774
2874
|
};
|
|
2775
2875
|
}
|
|
2776
2876
|
|
|
@@ -6028,8 +6128,8 @@ function styleInject(css, ref) {
|
|
|
6028
6128
|
|
|
6029
6129
|
var infocontainer$1 = "infocontainer-ir9gv";
|
|
6030
6130
|
var stepsContent = "steps-content-jDbLc";
|
|
6031
|
-
var css_248z$
|
|
6032
|
-
styleInject(css_248z$
|
|
6131
|
+
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";
|
|
6132
|
+
styleInject(css_248z$d);
|
|
6033
6133
|
|
|
6034
6134
|
function Step2ClientData(_ref) {
|
|
6035
6135
|
var _config$clientData, _config$clientData2;
|
|
@@ -6058,6 +6158,18 @@ function Step2ClientData(_ref) {
|
|
|
6058
6158
|
});
|
|
6059
6159
|
}
|
|
6060
6160
|
|
|
6161
|
+
var saveButton = "saveButton-vFkgp";
|
|
6162
|
+
var newPlanningButton = "newPlanningButton-rpBS2";
|
|
6163
|
+
var saveButtonGroup = "saveButtonGroup-r-Uwi";
|
|
6164
|
+
var checkout3Container = "checkout3Container-efdnR";
|
|
6165
|
+
var checkout3Header = "checkout3Header-Kph7T";
|
|
6166
|
+
var checkoutHeaderButtonGroup = "checkoutHeaderButtonGroup-ao8TM";
|
|
6167
|
+
var gdprCheckbox = "gdprCheckbox-jqVEK";
|
|
6168
|
+
var checkoutForm = "checkoutForm-wZEGN";
|
|
6169
|
+
var checkoutStatusButton = "checkoutStatusButton-aTyfj";
|
|
6170
|
+
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 max-width: 1600px;\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.checkoutStatusButton-aTyfj {\n min-width: 100px !important;\n}\n\n@media (max-width: 600px) {\n .checkout3Header-Kph7T {\n justify-content: center;\n flex-direction: column;\n width: 100%;\n }\n .checkoutStatusButton-aTyfj {\n min-width: 70px !important;\n }\n .checkoutHeaderButtonGroup-ao8TM {\n margin-top: 0.4rem;\n margin-bottom: 1rem;\n margin-left: 0;\n width: 100%;\n }\n}\n";
|
|
6171
|
+
styleInject(css_248z$c);
|
|
6172
|
+
|
|
6061
6173
|
function StatusMenu(_ref) {
|
|
6062
6174
|
var visibleStatus = _ref.visibleStatus,
|
|
6063
6175
|
status = _ref.status,
|
|
@@ -6069,19 +6181,17 @@ function StatusMenu(_ref) {
|
|
|
6069
6181
|
var _useTranslation = useTranslation(),
|
|
6070
6182
|
t = _useTranslation.t;
|
|
6071
6183
|
return /*#__PURE__*/jsx("div", {
|
|
6072
|
-
|
|
6073
|
-
"float": 'left',
|
|
6074
|
-
marginTop: '0.4rem',
|
|
6075
|
-
marginLeft: '1rem'
|
|
6076
|
-
},
|
|
6184
|
+
className: checkoutHeaderButtonGroup,
|
|
6077
6185
|
children: /*#__PURE__*/jsx(ButtonGroup$1, {
|
|
6078
6186
|
color: "primary",
|
|
6079
6187
|
"aria-label": "outlined primary button group",
|
|
6188
|
+
fullWidth: true,
|
|
6080
6189
|
children: visibleStatus.filter(function (item) {
|
|
6081
6190
|
return typeof item == 'string';
|
|
6082
6191
|
}) //filter out old configuration,where it was an object
|
|
6083
6192
|
.map(function (item) {
|
|
6084
6193
|
return /*#__PURE__*/jsx(Button, {
|
|
6194
|
+
className: checkoutStatusButton,
|
|
6085
6195
|
variant: status == item ? 'contained' : 'outlined',
|
|
6086
6196
|
size: "small",
|
|
6087
6197
|
onClick: function onClick() {
|
|
@@ -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,145 @@ 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 = findElementByKey(schema, 'AdditionalOptions');
|
|
6915
|
+
if (parentElement && Array.isArray(parentElement.elements)) {
|
|
6916
|
+
var index = parentElement.elements.findIndex(function (e) {
|
|
6917
|
+
return e.key === key;
|
|
6918
|
+
});
|
|
6919
|
+
if (index >= 0) {
|
|
6920
|
+
parentElement.elements.splice(index, 1);
|
|
6921
|
+
}
|
|
6922
|
+
}
|
|
6923
|
+
}
|
|
6924
|
+
function findElementByKey(schema, targetKey) {
|
|
6925
|
+
if (Array.isArray(schema)) {
|
|
6926
|
+
var _iterator2 = _createForOfIteratorHelper$2(schema),
|
|
6927
|
+
_step2;
|
|
6928
|
+
try {
|
|
6929
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
6930
|
+
var item = _step2.value;
|
|
6931
|
+
var found = findElementByKey(item, targetKey);
|
|
6932
|
+
if (found) return found;
|
|
6933
|
+
}
|
|
6934
|
+
} catch (err) {
|
|
6935
|
+
_iterator2.e(err);
|
|
6936
|
+
} finally {
|
|
6937
|
+
_iterator2.f();
|
|
6938
|
+
}
|
|
6939
|
+
} else {
|
|
6940
|
+
if (schema.key === targetKey) {
|
|
6941
|
+
return schema;
|
|
6942
|
+
}
|
|
6943
|
+
if (schema.elements && Array.isArray(schema.elements)) {
|
|
6944
|
+
var foundInChildren = findElementByKey(schema.elements, targetKey);
|
|
6945
|
+
if (foundInChildren) return foundInChildren;
|
|
6946
|
+
}
|
|
6947
|
+
}
|
|
6948
|
+
return null;
|
|
6949
|
+
}
|
|
6950
|
+
return {
|
|
6951
|
+
setVirtualFields: setVirtualFields,
|
|
6952
|
+
getVirtualFields: getVirtualFields,
|
|
6953
|
+
getVirtualFieldsObject: getVirtualFieldsObject,
|
|
6954
|
+
basket3DExportChecked: basket3DExportChecked,
|
|
6955
|
+
basketSendMailChecked: basketSendMailChecked,
|
|
6956
|
+
basketSendOrderChecked: basketSendOrderChecked,
|
|
6957
|
+
validateRequiredFieldsFromSchema: validateRequiredFieldsFromSchema,
|
|
6958
|
+
removeElementByKey: removeElementByKey
|
|
6959
|
+
};
|
|
6960
|
+
};
|
|
6961
|
+
|
|
6739
6962
|
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
6963
|
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
6964
|
function CheckOut(_ref) {
|
|
6742
|
-
var _basket$Client;
|
|
6743
6965
|
var schema = _ref.schema,
|
|
6744
6966
|
uiSchema = _ref.uiSchema,
|
|
6745
6967
|
renderService = _ref.renderService,
|
|
@@ -6755,19 +6977,28 @@ function CheckOut(_ref) {
|
|
|
6755
6977
|
productIsLoading = _ref.productIsLoading,
|
|
6756
6978
|
saveProduct = _ref.saveProduct,
|
|
6757
6979
|
updateProductData = _ref.updateProductData,
|
|
6758
|
-
gdpr = _ref.gdpr
|
|
6980
|
+
gdpr = _ref.gdpr,
|
|
6981
|
+
schemaSettings = _ref.schemaSettings;
|
|
6982
|
+
var _useCheckoutStep = useCheckoutStep3(schema),
|
|
6983
|
+
setVirtualFields = _useCheckoutStep.setVirtualFields,
|
|
6984
|
+
getVirtualFieldsObject = _useCheckoutStep.getVirtualFieldsObject,
|
|
6985
|
+
basket3DExportChecked = _useCheckoutStep.basket3DExportChecked,
|
|
6986
|
+
basketSendMailChecked = _useCheckoutStep.basketSendMailChecked,
|
|
6987
|
+
basketSendOrderChecked = _useCheckoutStep.basketSendOrderChecked,
|
|
6988
|
+
validateRequiredFieldsFromSchema = _useCheckoutStep.validateRequiredFieldsFromSchema,
|
|
6989
|
+
removeElementByKey = _useCheckoutStep.removeElementByKey;
|
|
6759
6990
|
var _useState = useState(false),
|
|
6760
6991
|
_useState2 = _slicedToArray(_useState, 2),
|
|
6761
6992
|
isSaving = _useState2[0],
|
|
6762
6993
|
setIsSaving = _useState2[1];
|
|
6763
6994
|
var _useState3 = useState(false),
|
|
6764
6995
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
6765
|
-
|
|
6766
|
-
|
|
6996
|
+
productSaved = _useState4[0],
|
|
6997
|
+
setProductSaved = _useState4[1];
|
|
6767
6998
|
var _useState5 = useState(false),
|
|
6768
6999
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
6769
|
-
|
|
6770
|
-
|
|
7000
|
+
validData = _useState6[0],
|
|
7001
|
+
setValidData = _useState6[1];
|
|
6771
7002
|
var _useTranslation = useTranslation(),
|
|
6772
7003
|
t = _useTranslation.t;
|
|
6773
7004
|
var _useSellerState = useSellerState(),
|
|
@@ -6776,8 +7007,10 @@ function CheckOut(_ref) {
|
|
|
6776
7007
|
_useDivaCore$actions = _useDivaCore.actions,
|
|
6777
7008
|
userHasPermission = _useDivaCore$actions.userHasPermission,
|
|
6778
7009
|
toggleLoading = _useDivaCore$actions.toggleLoading,
|
|
6779
|
-
openModal = _useDivaCore$actions.openModal
|
|
6780
|
-
|
|
7010
|
+
openModal = _useDivaCore$actions.openModal;
|
|
7011
|
+
useEffect(function () {
|
|
7012
|
+
setValidData(validateRequiredFieldsFromSchema(schema, basket));
|
|
7013
|
+
}, []);
|
|
6781
7014
|
var handleSave = useCallback(/*#__PURE__*/function () {
|
|
6782
7015
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(openPDF, sendMail, isFav) {
|
|
6783
7016
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -6815,8 +7048,12 @@ function CheckOut(_ref) {
|
|
|
6815
7048
|
return _context.abrupt("return");
|
|
6816
7049
|
case 17:
|
|
6817
7050
|
if (!isSaving) {
|
|
7051
|
+
openPDF = 'open';
|
|
6818
7052
|
setIsSaving(true);
|
|
6819
|
-
|
|
7053
|
+
if (basketSendMailChecked) {
|
|
7054
|
+
sendMail = true;
|
|
7055
|
+
}
|
|
7056
|
+
onClickSave(openPDF, sendMail, basket3DExportChecked, basketSendOrderChecked)["finally"](function () {
|
|
6820
7057
|
return setIsSaving(false);
|
|
6821
7058
|
});
|
|
6822
7059
|
}
|
|
@@ -6829,12 +7066,18 @@ function CheckOut(_ref) {
|
|
|
6829
7066
|
return function (_x, _x2, _x3) {
|
|
6830
7067
|
return _ref2.apply(this, arguments);
|
|
6831
7068
|
};
|
|
6832
|
-
}(), [isSaving, onClickSave, basket3DExportChecked]);
|
|
7069
|
+
}(), [isSaving, onClickSave, basket3DExportChecked, basketSendMailChecked, basketSendOrderChecked, toggleLoading, saveProduct, status, openModal, t]);
|
|
6833
7070
|
var onChangeForm = function onChangeForm(_ref3) {
|
|
6834
7071
|
var data = _ref3.data;
|
|
6835
7072
|
for (var key in data) {
|
|
7073
|
+
var _schema$properties;
|
|
7074
|
+
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) {
|
|
7075
|
+
setVirtualFields(key, data[key]);
|
|
7076
|
+
continue;
|
|
7077
|
+
}
|
|
6836
7078
|
basket[key] = data[key];
|
|
6837
7079
|
}
|
|
7080
|
+
setValidData(validateRequiredFieldsFromSchema(schema, data));
|
|
6838
7081
|
};
|
|
6839
7082
|
|
|
6840
7083
|
// for LEAFLET don't show printOptions, if there are any configured.
|
|
@@ -6849,22 +7092,23 @@ function CheckOut(_ref) {
|
|
|
6849
7092
|
finalSchema.elements.splice(index, 1);
|
|
6850
7093
|
}
|
|
6851
7094
|
}
|
|
7095
|
+
if (status !== 'ORDER' || !schemaSettings.showSendOrder) {
|
|
7096
|
+
removeElementByKey(finalSchema, 'SendOrder');
|
|
7097
|
+
}
|
|
7098
|
+
if (!schemaSettings.show3dExport) {
|
|
7099
|
+
removeElementByKey(finalSchema, 'Order3DExport');
|
|
7100
|
+
}
|
|
7101
|
+
if (schemaSettings.hideWWSButton) {
|
|
7102
|
+
removeElementByKey(finalSchema, 'SendIWOBasket');
|
|
7103
|
+
}
|
|
6852
7104
|
var permissionAnyHqRenderBox = userHasPermission('anyhqrenderbox');
|
|
6853
|
-
var handleCheckBoxChange = function handleCheckBoxChange(event) {
|
|
6854
|
-
setBasket3DExportChecked(event.target.checked);
|
|
6855
|
-
};
|
|
6856
7105
|
return /*#__PURE__*/jsxs("div", {
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
flexDirection: 'column'
|
|
6860
|
-
},
|
|
7106
|
+
id: "checkout3Container",
|
|
7107
|
+
className: checkout3Container,
|
|
6861
7108
|
children: [/*#__PURE__*/jsxs("div", {
|
|
7109
|
+
id: "checkout3Header",
|
|
7110
|
+
className: checkout3Header,
|
|
6862
7111
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
6863
|
-
style: {
|
|
6864
|
-
"float": 'left',
|
|
6865
|
-
marginLeft: '50px',
|
|
6866
|
-
width: 'fit-content'
|
|
6867
|
-
},
|
|
6868
7112
|
variant: "h4",
|
|
6869
7113
|
children: "Checkout"
|
|
6870
7114
|
}), /*#__PURE__*/jsx(StatusMenu, {
|
|
@@ -6881,45 +7125,19 @@ function CheckOut(_ref) {
|
|
|
6881
7125
|
handleSave: handleSave,
|
|
6882
7126
|
updateProductData: updateProductData,
|
|
6883
7127
|
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
|
-
})
|
|
7128
|
+
}), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsxs("div", {
|
|
7129
|
+
className: checkoutForm,
|
|
7130
|
+
children: [/*#__PURE__*/jsx(Form, {
|
|
7131
|
+
data: _objectSpread$v(_objectSpread$v({}, basket), getVirtualFieldsObject()),
|
|
7132
|
+
onChange: onChangeForm,
|
|
7133
|
+
schema: schema,
|
|
7134
|
+
uischema: finalSchema,
|
|
7135
|
+
renderer: "material"
|
|
6898
7136
|
}), !!renderService && permissionAnyHqRenderBox && (catalogData === null || catalogData === void 0 ? void 0 : catalogData[0].has3D) && /*#__PURE__*/jsx(HqRenderBox, {
|
|
6899
7137
|
basket: basket,
|
|
6900
7138
|
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
|
-
},
|
|
7139
|
+
}), gdpr && !isEmpty$1(basket === null || basket === void 0 ? void 0 : basket.Client) && /*#__PURE__*/jsx(FormControlLabel$1, {
|
|
7140
|
+
className: gdprCheckbox,
|
|
6923
7141
|
label: t('basket.checkout.gdpr'),
|
|
6924
7142
|
control: /*#__PURE__*/jsx(Checkbox$1, {
|
|
6925
7143
|
checked: basket === null || basket === void 0 ? void 0 : basket.Gdpr,
|
|
@@ -6930,17 +7148,20 @@ function CheckOut(_ref) {
|
|
|
6930
7148
|
})
|
|
6931
7149
|
})]
|
|
6932
7150
|
})]
|
|
6933
|
-
}), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsx(
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
7151
|
+
}), status !== 'BASE_CONFIGURATION' && /*#__PURE__*/jsx("div", {
|
|
7152
|
+
className: saveButtonGroup,
|
|
7153
|
+
children: /*#__PURE__*/jsx(SaveButtonsGroup, {
|
|
7154
|
+
orderEmpty: !basket.OrderSets || basket.OrderSets.length == 0 || gdpr && !isEmpty$1(basket === null || basket === void 0 ? void 0 : basket.Client) && !basket.Gdpr,
|
|
7155
|
+
onClickSave: handleSave,
|
|
7156
|
+
startWithEmptyBasket: startWithEmptyBasket,
|
|
7157
|
+
status: status,
|
|
7158
|
+
configSaveButtons: configSaveButtons,
|
|
7159
|
+
validData: validData
|
|
7160
|
+
})
|
|
6940
7161
|
})]
|
|
6941
7162
|
});
|
|
6942
7163
|
}
|
|
6943
|
-
function isEmpty(data) {
|
|
7164
|
+
function isEmpty$1(data) {
|
|
6944
7165
|
if (!data) {
|
|
6945
7166
|
return true;
|
|
6946
7167
|
}
|
|
@@ -6950,13 +7171,14 @@ function isEmpty(data) {
|
|
|
6950
7171
|
return false;
|
|
6951
7172
|
}
|
|
6952
7173
|
return Object.keys(data).every(function (k) {
|
|
6953
|
-
return isEmpty(data[k]);
|
|
7174
|
+
return isEmpty$1(data[k]);
|
|
6954
7175
|
});
|
|
6955
7176
|
}
|
|
6956
7177
|
|
|
6957
7178
|
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
7179
|
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(
|
|
7180
|
+
var schema = function schema(settings) {
|
|
7181
|
+
var _settings$sendMail;
|
|
6960
7182
|
return {
|
|
6961
7183
|
type: 'object',
|
|
6962
7184
|
properties: _objectSpread$u(_objectSpread$u({
|
|
@@ -6988,12 +7210,35 @@ var schema = function schema(hideWWSButton) {
|
|
|
6988
7210
|
type: ['string', 'null'],
|
|
6989
7211
|
title: 'basket.checkout.form.sellerNr'
|
|
6990
7212
|
}
|
|
6991
|
-
}, !hideWWSButton ? {
|
|
7213
|
+
}, !settings.hideWWSButton ? {
|
|
6992
7214
|
SendIWOBasket: {
|
|
6993
7215
|
type: 'boolean',
|
|
6994
7216
|
title: 'basket.checkout.form.sendIwoBasket'
|
|
6995
7217
|
}
|
|
6996
7218
|
} : {}), {}, {
|
|
7219
|
+
Order3DExport: {
|
|
7220
|
+
type: 'boolean',
|
|
7221
|
+
title: 'basket.checkout.order3dexport',
|
|
7222
|
+
description: 'basket.checkout.3dexport',
|
|
7223
|
+
properties: {
|
|
7224
|
+
virtual: true
|
|
7225
|
+
}
|
|
7226
|
+
},
|
|
7227
|
+
SendMail: {
|
|
7228
|
+
type: 'boolean',
|
|
7229
|
+
title: 'basket.checkout.form.sendMail',
|
|
7230
|
+
readOnly: (_settings$sendMail = settings.sendMail) === null || _settings$sendMail === void 0 ? void 0 : _settings$sendMail.disabled,
|
|
7231
|
+
properties: {
|
|
7232
|
+
virtual: true
|
|
7233
|
+
}
|
|
7234
|
+
},
|
|
7235
|
+
SendOrder: {
|
|
7236
|
+
type: 'boolean',
|
|
7237
|
+
title: 'basket.checkout.form.sendOrder',
|
|
7238
|
+
properties: {
|
|
7239
|
+
virtual: true
|
|
7240
|
+
}
|
|
7241
|
+
},
|
|
6997
7242
|
PrintOptions: {
|
|
6998
7243
|
type: 'object',
|
|
6999
7244
|
properties: {
|
|
@@ -7046,154 +7291,222 @@ var schema = function schema(hideWWSButton) {
|
|
|
7046
7291
|
})
|
|
7047
7292
|
};
|
|
7048
7293
|
};
|
|
7049
|
-
var uiSchema = function uiSchema(
|
|
7294
|
+
var uiSchema = function uiSchema(settings) {
|
|
7050
7295
|
return {
|
|
7051
7296
|
type: 'VerticalLayout',
|
|
7052
7297
|
elements: [{
|
|
7053
|
-
|
|
7298
|
+
key: 'BasicData',
|
|
7299
|
+
type: 'Group',
|
|
7300
|
+
label: 'basket.checkout.form.basicData',
|
|
7054
7301
|
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": '----'
|
|
7302
|
+
type: 'HorizontalLayout',
|
|
7303
|
+
elements: [{
|
|
7304
|
+
type: 'Control',
|
|
7305
|
+
scope: '#/properties/RetailerOfferNum'
|
|
7306
|
+
}, {
|
|
7307
|
+
type: 'Control',
|
|
7308
|
+
scope: '#/properties/RetailerName',
|
|
7309
|
+
rule: {
|
|
7310
|
+
effect: 'ENABLE',
|
|
7311
|
+
condition: {
|
|
7312
|
+
scope: '#/properties/RetailerName',
|
|
7313
|
+
schema: {
|
|
7314
|
+
"const": '----'
|
|
7315
|
+
}
|
|
7078
7316
|
}
|
|
7079
7317
|
}
|
|
7080
|
-
}
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
scope: '#/properties/RetailerName',
|
|
7091
|
-
schema: {
|
|
7092
|
-
"const": '----'
|
|
7318
|
+
}, {
|
|
7319
|
+
type: 'Control',
|
|
7320
|
+
scope: '#/properties/RetailerNr',
|
|
7321
|
+
rule: {
|
|
7322
|
+
effect: 'ENABLE',
|
|
7323
|
+
condition: {
|
|
7324
|
+
scope: '#/properties/RetailerName',
|
|
7325
|
+
schema: {
|
|
7326
|
+
"const": '----'
|
|
7327
|
+
}
|
|
7093
7328
|
}
|
|
7094
7329
|
}
|
|
7095
|
-
}
|
|
7330
|
+
}]
|
|
7096
7331
|
}, {
|
|
7097
|
-
type: '
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7332
|
+
type: 'HorizontalLayout',
|
|
7333
|
+
elements: [{
|
|
7334
|
+
type: 'Control',
|
|
7335
|
+
scope: '#/properties/Salesperson',
|
|
7336
|
+
rule: !settings.enableSellerInfos ? {
|
|
7337
|
+
effect: 'ENABLE',
|
|
7338
|
+
condition: {
|
|
7339
|
+
scope: '#/properties/RetailerName',
|
|
7340
|
+
schema: {
|
|
7341
|
+
"const": '----'
|
|
7342
|
+
}
|
|
7105
7343
|
}
|
|
7106
|
-
}
|
|
7107
|
-
}
|
|
7344
|
+
} : undefined
|
|
7345
|
+
}, {
|
|
7346
|
+
type: 'Control',
|
|
7347
|
+
scope: '#/properties/SalespersonEmail',
|
|
7348
|
+
rule: !settings.enableSellerInfos ? {
|
|
7349
|
+
effect: 'ENABLE',
|
|
7350
|
+
condition: {
|
|
7351
|
+
scope: '#/properties/RetailerName',
|
|
7352
|
+
schema: {
|
|
7353
|
+
"const": '----'
|
|
7354
|
+
}
|
|
7355
|
+
}
|
|
7356
|
+
} : undefined
|
|
7357
|
+
}, {
|
|
7358
|
+
type: 'Control',
|
|
7359
|
+
scope: '#/properties/SalespersonNr',
|
|
7360
|
+
rule: !settings.enableSellerInfos ? {
|
|
7361
|
+
effect: 'ENABLE',
|
|
7362
|
+
condition: {
|
|
7363
|
+
scope: '#/properties/RetailerName',
|
|
7364
|
+
schema: {
|
|
7365
|
+
"const": '----'
|
|
7366
|
+
}
|
|
7367
|
+
}
|
|
7368
|
+
} : undefined
|
|
7369
|
+
}]
|
|
7108
7370
|
}, {
|
|
7109
7371
|
type: 'Control',
|
|
7110
|
-
scope: '#/properties/
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
scope: '#/properties/RetailerName',
|
|
7115
|
-
schema: {
|
|
7116
|
-
"const": '----'
|
|
7117
|
-
}
|
|
7118
|
-
}
|
|
7119
|
-
} : undefined
|
|
7372
|
+
scope: '#/properties/ClientRemark',
|
|
7373
|
+
options: {
|
|
7374
|
+
multi: true
|
|
7375
|
+
}
|
|
7120
7376
|
}]
|
|
7121
7377
|
}, {
|
|
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',
|
|
7378
|
+
type: 'HorizontalLayout',
|
|
7131
7379
|
elements: [{
|
|
7132
|
-
|
|
7380
|
+
key: 'PrintOptions',
|
|
7381
|
+
type: 'Group',
|
|
7382
|
+
label: 'basket.checkout.form.printOptions',
|
|
7133
7383
|
elements: [{
|
|
7134
|
-
type: '
|
|
7384
|
+
type: 'HorizontalLayout',
|
|
7135
7385
|
elements: [{
|
|
7136
|
-
type: '
|
|
7137
|
-
|
|
7386
|
+
type: 'VerticalLayout',
|
|
7387
|
+
elements: [{
|
|
7388
|
+
type: 'Control',
|
|
7389
|
+
scope: '#/properties/PrintOptions/properties/PlanningSketch'
|
|
7390
|
+
}]
|
|
7138
7391
|
}, {
|
|
7139
|
-
type: '
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
}, {
|
|
7145
|
-
type: 'Control',
|
|
7146
|
-
scope: '#/properties/PrintOptions/properties/SalespersonData'
|
|
7392
|
+
type: 'VerticalLayout',
|
|
7393
|
+
elements: [{
|
|
7394
|
+
type: 'Control',
|
|
7395
|
+
scope: '#/properties/PrintOptions/properties/ModelName'
|
|
7396
|
+
}]
|
|
7147
7397
|
}]
|
|
7148
7398
|
}, {
|
|
7149
|
-
type: '
|
|
7399
|
+
type: 'HorizontalLayout',
|
|
7150
7400
|
elements: [{
|
|
7151
|
-
type: '
|
|
7152
|
-
|
|
7401
|
+
type: 'VerticalLayout',
|
|
7402
|
+
elements: [{
|
|
7403
|
+
type: 'Control',
|
|
7404
|
+
scope: '#/properties/PrintOptions/properties/CollectionLogo'
|
|
7405
|
+
}]
|
|
7153
7406
|
}, {
|
|
7154
|
-
type: '
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7407
|
+
type: 'VerticalLayout',
|
|
7408
|
+
elements: [{
|
|
7409
|
+
type: 'Control',
|
|
7410
|
+
scope: '#/properties/PrintOptions/properties/Remark'
|
|
7411
|
+
}]
|
|
7412
|
+
}]
|
|
7413
|
+
}, {
|
|
7414
|
+
type: 'HorizontalLayout',
|
|
7415
|
+
elements: [{
|
|
7416
|
+
type: 'VerticalLayout',
|
|
7417
|
+
elements: [{
|
|
7418
|
+
type: 'Control',
|
|
7419
|
+
scope: '#/properties/PrintOptions/properties/ClientpersonData'
|
|
7420
|
+
}]
|
|
7159
7421
|
}, {
|
|
7160
|
-
type: '
|
|
7161
|
-
|
|
7422
|
+
type: 'VerticalLayout',
|
|
7423
|
+
elements: [{
|
|
7424
|
+
type: 'Control',
|
|
7425
|
+
scope: '#/properties/PrintOptions/properties/Signature'
|
|
7426
|
+
}]
|
|
7162
7427
|
}]
|
|
7163
7428
|
}, {
|
|
7164
|
-
type: '
|
|
7429
|
+
type: 'HorizontalLayout',
|
|
7165
7430
|
elements: [{
|
|
7166
|
-
type: '
|
|
7167
|
-
|
|
7431
|
+
type: 'VerticalLayout',
|
|
7432
|
+
elements: [{
|
|
7433
|
+
type: 'Control',
|
|
7434
|
+
scope: '#/properties/PrintOptions/properties/Gdpr'
|
|
7435
|
+
}]
|
|
7168
7436
|
}, {
|
|
7169
|
-
type: '
|
|
7170
|
-
|
|
7437
|
+
type: 'VerticalLayout',
|
|
7438
|
+
elements: []
|
|
7439
|
+
}]
|
|
7440
|
+
}, {
|
|
7441
|
+
type: 'HorizontalLayout',
|
|
7442
|
+
elements: [{
|
|
7443
|
+
type: 'VerticalLayout',
|
|
7444
|
+
elements: [{
|
|
7445
|
+
type: 'Control',
|
|
7446
|
+
scope: '#/properties/PrintOptions/properties/Prices'
|
|
7447
|
+
}]
|
|
7171
7448
|
}, {
|
|
7172
|
-
type: '
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7449
|
+
type: 'VerticalLayout',
|
|
7450
|
+
elements: [{
|
|
7451
|
+
type: 'Control',
|
|
7452
|
+
scope: '#/properties/PrintOptions/properties/AllPrices',
|
|
7453
|
+
rule: {
|
|
7454
|
+
effect: 'HIDE',
|
|
7455
|
+
condition: {
|
|
7456
|
+
scope: '#/properties/PrintOptions/properties/Prices',
|
|
7457
|
+
schema: {
|
|
7458
|
+
not: {
|
|
7459
|
+
"const": true
|
|
7460
|
+
}
|
|
7181
7461
|
}
|
|
7182
7462
|
}
|
|
7183
7463
|
}
|
|
7184
|
-
}
|
|
7464
|
+
}]
|
|
7465
|
+
}]
|
|
7466
|
+
}, {
|
|
7467
|
+
type: 'HorizontalLayout',
|
|
7468
|
+
elements: [{
|
|
7469
|
+
type: 'VerticalLayout',
|
|
7470
|
+
elements: [{
|
|
7471
|
+
type: 'Control',
|
|
7472
|
+
scope: '#/properties/PrintOptions/properties/SalespersonData'
|
|
7473
|
+
}]
|
|
7474
|
+
}, {
|
|
7475
|
+
type: 'VerticalLayout',
|
|
7476
|
+
elements: [{
|
|
7477
|
+
type: 'Control',
|
|
7478
|
+
scope: '#/properties/PrintOptions/properties/OpvCodices'
|
|
7479
|
+
}]
|
|
7185
7480
|
}]
|
|
7186
7481
|
}]
|
|
7482
|
+
}, {
|
|
7483
|
+
key: 'AdditionalOptions',
|
|
7484
|
+
type: 'Group',
|
|
7485
|
+
label: 'basket.checkout.form.additionalOptions',
|
|
7486
|
+
elements: [].concat(_toConsumableArray(!settings.hideWWSButton ? [{
|
|
7487
|
+
type: 'Control',
|
|
7488
|
+
scope: '#/properties/SendIWOBasket'
|
|
7489
|
+
}] : []), [{
|
|
7490
|
+
key: 'SendOrder',
|
|
7491
|
+
type: 'Control',
|
|
7492
|
+
scope: '#/properties/SendOrder'
|
|
7493
|
+
}, {
|
|
7494
|
+
type: 'Control',
|
|
7495
|
+
scope: '#/properties/Order3DExport',
|
|
7496
|
+
options: {
|
|
7497
|
+
showUnfocusedDescription: true
|
|
7498
|
+
}
|
|
7499
|
+
}, {
|
|
7500
|
+
type: 'Control',
|
|
7501
|
+
scope: '#/properties/SendMail'
|
|
7502
|
+
}])
|
|
7187
7503
|
}]
|
|
7188
|
-
}]
|
|
7189
|
-
type: 'Control',
|
|
7190
|
-
scope: '#/properties/SendIWOBasket'
|
|
7191
|
-
}] : []))
|
|
7504
|
+
}]
|
|
7192
7505
|
};
|
|
7193
7506
|
};
|
|
7194
7507
|
|
|
7195
7508
|
function Step3Checkout(_ref) {
|
|
7196
|
-
var _config$checkout, _config$checkout2, _config$checkout3, _config$checkout4, _config$checkout5;
|
|
7509
|
+
var _config$checkout, _config$checkout2, _basket$Client, _config$checkout3, _config$checkout4, _config$checkout5, _config$checkout6;
|
|
7197
7510
|
var updateBasket = _ref.updateBasket,
|
|
7198
7511
|
startWithEmptyBasket = _ref.startWithEmptyBasket,
|
|
7199
7512
|
onClickSave = _ref.onClickSave,
|
|
@@ -7208,6 +7521,25 @@ function Step3Checkout(_ref) {
|
|
|
7208
7521
|
updateProductData = _ref.updateProductData;
|
|
7209
7522
|
var _useDivaCore = useDivaCore(),
|
|
7210
7523
|
organization = _useDivaCore.state.organization;
|
|
7524
|
+
var _useSellerState = useSellerState$1(),
|
|
7525
|
+
catalogData = _useSellerState.state.catalogData;
|
|
7526
|
+
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'];
|
|
7527
|
+
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;
|
|
7528
|
+
var userInfoPresent = !!((_basket$Client = basket.Client) !== null && _basket$Client !== void 0 && _basket$Client.email);
|
|
7529
|
+
var schemaSettings = {
|
|
7530
|
+
hideWWSButton: !organization.hasIwoFurn,
|
|
7531
|
+
enableSellerInfos: config === null || config === void 0 ? void 0 : config.enableSellerInfos,
|
|
7532
|
+
show3dExport: (catalogData === null || catalogData === void 0 ? void 0 : catalogData.find(function (c) {
|
|
7533
|
+
return !c.disable3DExport;
|
|
7534
|
+
})) && (catalogData === null || catalogData === void 0 ? void 0 : catalogData.find(function (c) {
|
|
7535
|
+
return c.has3D;
|
|
7536
|
+
})) && organization.settings.enable3DExport,
|
|
7537
|
+
showSendOrder: organization.settings.sendOrders ? true : false,
|
|
7538
|
+
sendMail: {
|
|
7539
|
+
show: configSaveButtons.includes('SAVE_AND_SEND'),
|
|
7540
|
+
disabled: orderEmpty || !userInfoPresent
|
|
7541
|
+
}
|
|
7542
|
+
};
|
|
7211
7543
|
return /*#__PURE__*/jsx(CheckOut, {
|
|
7212
7544
|
startWithEmptyBasket: startWithEmptyBasket,
|
|
7213
7545
|
onClickSave: onClickSave,
|
|
@@ -7215,18 +7547,32 @@ function Step3Checkout(_ref) {
|
|
|
7215
7547
|
setStatus: setStatus,
|
|
7216
7548
|
basket: basket,
|
|
7217
7549
|
statusArray: statusArray,
|
|
7218
|
-
schema: (config === null || config === void 0 || (_config$
|
|
7219
|
-
uiSchema: (config === null || config === void 0 || (_config$
|
|
7550
|
+
schema: (config === null || config === void 0 || (_config$checkout3 = config.checkout) === null || _config$checkout3 === void 0 ? void 0 : _config$checkout3.schema) || schema(schemaSettings),
|
|
7551
|
+
uiSchema: (config === null || config === void 0 || (_config$checkout4 = config.checkout) === null || _config$checkout4 === void 0 ? void 0 : _config$checkout4.uiSchema) || uiSchema(schemaSettings),
|
|
7552
|
+
schemaSettings: schemaSettings,
|
|
7220
7553
|
updateBasket: updateBasket,
|
|
7221
|
-
renderService: config === null || config === void 0 || (_config$
|
|
7222
|
-
configSaveButtons:
|
|
7223
|
-
gdpr: config === null || config === void 0 || (_config$
|
|
7554
|
+
renderService: config === null || config === void 0 || (_config$checkout5 = config.checkout) === null || _config$checkout5 === void 0 ? void 0 : _config$checkout5.renderService,
|
|
7555
|
+
configSaveButtons: configSaveButtons,
|
|
7556
|
+
gdpr: config === null || config === void 0 || (_config$checkout6 = config.checkout) === null || _config$checkout6 === void 0 ? void 0 : _config$checkout6.checkGdpr,
|
|
7224
7557
|
currentProduct: currentProduct,
|
|
7225
7558
|
productIsLoading: productIsLoading,
|
|
7226
7559
|
saveProduct: saveProduct,
|
|
7227
7560
|
updateProductData: updateProductData
|
|
7228
7561
|
});
|
|
7229
7562
|
}
|
|
7563
|
+
function isEmpty(data) {
|
|
7564
|
+
if (!data) {
|
|
7565
|
+
return true;
|
|
7566
|
+
}
|
|
7567
|
+
if (Object.keys(data).length === 0 && data.constructor === Object) {
|
|
7568
|
+
return true;
|
|
7569
|
+
} else if (data.constructor !== Object) {
|
|
7570
|
+
return false;
|
|
7571
|
+
}
|
|
7572
|
+
return Object.keys(data).every(function (k) {
|
|
7573
|
+
return isEmpty(data[k]);
|
|
7574
|
+
});
|
|
7575
|
+
}
|
|
7230
7576
|
|
|
7231
7577
|
function Step4Checkout(_ref) {
|
|
7232
7578
|
var currentProduct = _ref.currentProduct,
|
|
@@ -7483,7 +7829,8 @@ function Basket(_ref) {
|
|
|
7483
7829
|
openBasket = _useSellerState$actio.openBasket,
|
|
7484
7830
|
openModal = _useSellerState$actio.openModal,
|
|
7485
7831
|
sendEmail = _useSellerState$actio.sendEmail,
|
|
7486
|
-
resetBasketState = _useSellerState$actio.resetBasketState
|
|
7832
|
+
resetBasketState = _useSellerState$actio.resetBasketState,
|
|
7833
|
+
setOrdered = _useSellerState$actio.setOrdered;
|
|
7487
7834
|
var _useProduct = useProduct(currentBasketState === null || currentBasketState === void 0 ? void 0 : currentBasketState.basket),
|
|
7488
7835
|
currentProduct = _useProduct.currentProduct,
|
|
7489
7836
|
saveProduct = _useProduct.saveProduct,
|
|
@@ -7639,7 +7986,7 @@ function Basket(_ref) {
|
|
|
7639
7986
|
}
|
|
7640
7987
|
};
|
|
7641
7988
|
var onClickSave = /*#__PURE__*/function () {
|
|
7642
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(pdf, doSendEmail, export3D) {
|
|
7989
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(pdf, doSendEmail, export3D, sendOrder) {
|
|
7643
7990
|
var _configurationData$Ch, _configurationData$re;
|
|
7644
7991
|
var getPdf, response, _configurationData$Ch2, _ref3, pdfUrl, idx, o, d3dp, newRenderJob, _configurationData$Ch3, _configurationData$Ch4, _currentBasket$Client, _opener;
|
|
7645
7992
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -7663,7 +8010,7 @@ function Basket(_ref) {
|
|
|
7663
8010
|
break;
|
|
7664
8011
|
}
|
|
7665
8012
|
errorOnSaving(response);
|
|
7666
|
-
_context.next =
|
|
8013
|
+
_context.next = 44;
|
|
7667
8014
|
break;
|
|
7668
8015
|
case 12:
|
|
7669
8016
|
_ref3 = response, pdfUrl = _ref3.pdfUrl;
|
|
@@ -7741,11 +8088,25 @@ function Basket(_ref) {
|
|
|
7741
8088
|
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
8089
|
});
|
|
7743
8090
|
}
|
|
8091
|
+
if (!sendOrder) {
|
|
8092
|
+
_context.next = 40;
|
|
8093
|
+
break;
|
|
8094
|
+
}
|
|
8095
|
+
_context.next = 40;
|
|
8096
|
+
return setOrdered(currentBasket, true);
|
|
8097
|
+
case 40:
|
|
7744
8098
|
if (doSendEmail) {
|
|
7745
8099
|
sendEmail({
|
|
7746
8100
|
dialogText: t('basket.modals.email.text', {
|
|
7747
8101
|
divaNr: currentBasket.DivaNr + '-' + currentBasket.getDocumentVersion()
|
|
7748
8102
|
}),
|
|
8103
|
+
showDialog: true,
|
|
8104
|
+
dialogAcceptMailSend: pdf == 'open' ? t('modals.open_pdf_now') : undefined,
|
|
8105
|
+
mailSendCallback: function mailSendCallback() {
|
|
8106
|
+
if (pdf == 'open') {
|
|
8107
|
+
window.open(pdfUrl, '_blank');
|
|
8108
|
+
}
|
|
8109
|
+
},
|
|
7749
8110
|
content: {
|
|
7750
8111
|
type: 'basket',
|
|
7751
8112
|
to: ((_currentBasket$Client = currentBasket.Client) === null || _currentBasket$Client === void 0 ? void 0 : _currentBasket$Client.email) || '',
|
|
@@ -7762,17 +8123,19 @@ function Basket(_ref) {
|
|
|
7762
8123
|
}, '*');
|
|
7763
8124
|
window.close();
|
|
7764
8125
|
} else {
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
8126
|
+
if (!sendOrder) {
|
|
8127
|
+
openModal({
|
|
8128
|
+
title: t('modals.saving'),
|
|
8129
|
+
reject: t('modals.close'),
|
|
8130
|
+
accept: pdf == 'open' ? t('modals.open_now') : true,
|
|
8131
|
+
text: t('modals.saving_successful').replace('%1', currentBasket.DivaNr + '-' + currentBasket.getDocumentVersion()),
|
|
8132
|
+
callback: function callback(accepted) {
|
|
8133
|
+
if (accepted && pdf == 'open') {
|
|
8134
|
+
window.open(pdfUrl, '_blank');
|
|
8135
|
+
}
|
|
7773
8136
|
}
|
|
7774
|
-
}
|
|
7775
|
-
}
|
|
8137
|
+
});
|
|
8138
|
+
}
|
|
7776
8139
|
}
|
|
7777
8140
|
/* TODO used with SM integration in divaProtal
|
|
7778
8141
|
openModal({
|
|
@@ -7796,13 +8159,13 @@ function Basket(_ref) {
|
|
|
7796
8159
|
});
|
|
7797
8160
|
currentBasket.setDocumentVersion(currentBasket.getDocumentVersion() + 1);
|
|
7798
8161
|
setActBasketPage('Step1');
|
|
7799
|
-
case
|
|
8162
|
+
case 44:
|
|
7800
8163
|
case "end":
|
|
7801
8164
|
return _context.stop();
|
|
7802
8165
|
}
|
|
7803
8166
|
}, _callee, null, [[14, 32]]);
|
|
7804
8167
|
}));
|
|
7805
|
-
return function onClickSave(_x, _x2, _x3) {
|
|
8168
|
+
return function onClickSave(_x, _x2, _x3, _x4) {
|
|
7806
8169
|
return _ref2.apply(this, arguments);
|
|
7807
8170
|
};
|
|
7808
8171
|
}();
|