thm-p3-configurator 0.0.364 → 0.0.366
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.
|
@@ -26,7 +26,6 @@ var _DropdownInput = _interopRequireDefault(require("../../__components__/Form/D
|
|
|
26
26
|
var _Modal = _interopRequireDefault(require("../../__components__/Modal"));
|
|
27
27
|
var _FullPageSpinner = _interopRequireDefault(require("../../__components__/Spinners/FullPageSpinner"));
|
|
28
28
|
var _constants__ = require("../../__constants__");
|
|
29
|
-
var _AuthSessionContext = require("../../__context__/AuthSessionContext");
|
|
30
29
|
var _FormulaContext = require("../../__context__/FormulaContext");
|
|
31
30
|
var _OrderSessionContext = require("../../__context__/OrderSessionContext");
|
|
32
31
|
var _helpers__ = require("../../__helpers__");
|
|
@@ -112,7 +111,8 @@ const BranchDropdown = _ref2 => {
|
|
|
112
111
|
branches = [],
|
|
113
112
|
isLoading,
|
|
114
113
|
dispatch,
|
|
115
|
-
isTMGOrganization
|
|
114
|
+
isTMGOrganization,
|
|
115
|
+
branchTypes
|
|
116
116
|
} = _ref2;
|
|
117
117
|
const [_selectedBranchId, _setSelectedBranchId] = (0, _react.useState)();
|
|
118
118
|
const branchOptions = branches === null || branches === void 0 ? void 0 : branches.map(branch => ({
|
|
@@ -175,6 +175,9 @@ const MyBranchesSelect = _ref5 => {
|
|
|
175
175
|
formula,
|
|
176
176
|
dispatch
|
|
177
177
|
} = _ref5;
|
|
178
|
+
const {
|
|
179
|
+
branchTypes
|
|
180
|
+
} = (0, _queries.useBranchTypes)();
|
|
178
181
|
const {
|
|
179
182
|
myBranches,
|
|
180
183
|
isLoadingMyBranches
|
|
@@ -291,7 +294,6 @@ const InternalBranchSelectorModal = () => {
|
|
|
291
294
|
} = (0, _queries.useBranchTypes)();
|
|
292
295
|
const [_selectedBranchId, _setSelectedBranchId] = (0, _react.useState)();
|
|
293
296
|
const [isDismissed, setIsDismissed] = (0, _react.useState)(false);
|
|
294
|
-
const authSession = (0, _AuthSessionContext.useAuthSession)();
|
|
295
297
|
const isSingleOrderPage = (0, _useIsSingleOrder.default)();
|
|
296
298
|
const formula = (0, _FormulaContext.useFormula)();
|
|
297
299
|
const isTMGOrganization = (0, _useIsTmg.useIsTmg)();
|
|
@@ -299,14 +301,6 @@ const InternalBranchSelectorModal = () => {
|
|
|
299
301
|
_setSelectedBranchId(undefined);
|
|
300
302
|
setIsDismissed(false);
|
|
301
303
|
}, [isSingleOrderPage]);
|
|
302
|
-
const isLocation = _react.default.useMemo(() => {
|
|
303
|
-
var _authSession$branch;
|
|
304
|
-
const orgTypes = (authSession === null || authSession === void 0 || (_authSession$branch = authSession.branch) === null || _authSession$branch === void 0 ? void 0 : _authSession$branch.organisatietype) || [];
|
|
305
|
-
return orgTypes.some(typeId => {
|
|
306
|
-
var _branchTypes$byId3;
|
|
307
|
-
return (branchTypes === null || branchTypes === void 0 || (_branchTypes$byId3 = branchTypes.byId) === null || _branchTypes$byId3 === void 0 || (_branchTypes$byId3 = _branchTypes$byId3[typeId]) === null || _branchTypes$byId3 === void 0 ? void 0 : _branchTypes$byId3.title) === _constants__.LOCATION_TYPE;
|
|
308
|
-
});
|
|
309
|
-
}, [branchTypes, authSession]);
|
|
310
304
|
const [{
|
|
311
305
|
selectedBranch,
|
|
312
306
|
existingDossierId,
|
|
@@ -60,6 +60,7 @@ const getEmptySingleOrderCustomer = () => ({
|
|
|
60
60
|
lastName: '',
|
|
61
61
|
email: '',
|
|
62
62
|
phoneNumber: '',
|
|
63
|
+
note: '',
|
|
63
64
|
zipCode: '',
|
|
64
65
|
houseNumber: '',
|
|
65
66
|
houseNumberAddition: '',
|
|
@@ -114,6 +115,7 @@ const buildSingleOrderCustomerPayload = _ref3 => {
|
|
|
114
115
|
const baseCustomer = _objectSpread(_objectSpread({}, getEmptySingleOrderCustomer()), customer);
|
|
115
116
|
if (!webshop && !anderAfleveradres) {
|
|
116
117
|
return _objectSpread(_objectSpread({}, getEmptySingleOrderCustomer()), {}, {
|
|
118
|
+
note: (customer === null || customer === void 0 ? void 0 : customer.note) || '',
|
|
117
119
|
anderAfleveradres: false,
|
|
118
120
|
afhalenInWinkel: false,
|
|
119
121
|
anderFactuuradres: false
|
|
@@ -339,12 +339,14 @@ const InternalSingleOrderPage = () => {
|
|
|
339
339
|
vehicle,
|
|
340
340
|
ownershipType
|
|
341
341
|
});
|
|
342
|
-
const customerPayload = (0, _helpers__.buildSingleOrderCustomerPayload)({
|
|
342
|
+
const customerPayload = _objectSpread(_objectSpread({}, (0, _helpers__.buildSingleOrderCustomerPayload)({
|
|
343
343
|
customer,
|
|
344
344
|
webshop,
|
|
345
345
|
anderAfleveradres,
|
|
346
346
|
afhalenInWinkel,
|
|
347
347
|
ownershipType
|
|
348
|
+
})), {}, {
|
|
349
|
+
note: (customer === null || customer === void 0 ? void 0 : customer.note) || (internalNote === null || internalNote === void 0 ? void 0 : internalNote.internalNote) || ''
|
|
348
350
|
});
|
|
349
351
|
const businessContactPayload = (0, _helpers__.buildSingleOrderBusinessContactPayload)({
|
|
350
352
|
customer: customerPayload,
|