thm-p3-configurator 0.0.302 → 0.0.303
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.
|
@@ -240,12 +240,13 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
240
240
|
}, [isTmg, marketingChannels, channel === null || channel === void 0 ? void 0 : channel.channelId, dispatch]);
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
|
-
* @description Auto-set checkboxes when TowCenter branch or TMG
|
|
244
|
-
*
|
|
243
|
+
* @description Auto-set checkboxes when TowCenter branch or TMG organization
|
|
244
|
+
* - If TMG organization: always enable (ignore towCenterVestiging)
|
|
245
|
+
* - If NOT TMG: check isTowCenterBranch (from towCenterVestiging)
|
|
245
246
|
* User can manually toggle checkboxes after auto-enable
|
|
246
247
|
*/
|
|
247
248
|
(0, _react.useEffect)(() => {
|
|
248
|
-
const shouldEnable =
|
|
249
|
+
const shouldEnable = isTmg || isTowCenterBranch;
|
|
249
250
|
if (shouldEnable) {
|
|
250
251
|
dispatch({
|
|
251
252
|
type: _OrderSessionContext.orderSessionActions.SET_ANDER_AFLEVERADRES,
|
|
@@ -282,7 +283,7 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
282
283
|
}
|
|
283
284
|
});
|
|
284
285
|
}
|
|
285
|
-
}, [
|
|
286
|
+
}, [isTmg, isTowCenterBranch, dispatch, vehicle === null || vehicle === void 0 ? void 0 : vehicle.singleOrderOwnershipType]);
|
|
286
287
|
const initialChannel = (0, _react.useMemo)(() => {
|
|
287
288
|
if (!(channel !== null && channel !== void 0 && channel.channelId) || !(marketingChannels !== null && marketingChannels !== void 0 && marketingChannels.length)) return null;
|
|
288
289
|
const selectedChannel = marketingChannels === null || marketingChannels === void 0 ? void 0 : marketingChannels.find(marketingC => (marketingC === null || marketingC === void 0 ? void 0 : marketingC.entityId) === (channel === null || channel === void 0 ? void 0 : channel.channelId));
|
|
@@ -437,7 +438,7 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
437
438
|
}
|
|
438
439
|
|
|
439
440
|
// When TowCenter or TMG, ownership type is required (Niet van toepassing not allowed)
|
|
440
|
-
const isTowCenterOrTmg =
|
|
441
|
+
const isTowCenterOrTmg = isTmg || isTowCenterBranch;
|
|
441
442
|
if (isTowCenterOrTmg) {
|
|
442
443
|
validationSchema = validationSchema.shape({
|
|
443
444
|
singleOrderOwnershipType: (0, _yup.string)().required('Type is verplicht').notOneOf([_constants__.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE.Empty], 'Type is verplicht')
|
|
@@ -531,7 +532,7 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
531
532
|
})), /*#__PURE__*/_react.default.createElement(_RadioButtons.default, {
|
|
532
533
|
name: "singleOrderOwnershipType",
|
|
533
534
|
label: "Type:",
|
|
534
|
-
initialValue: (vehicle === null || vehicle === void 0 ? void 0 : vehicle.singleOrderOwnershipType) || (
|
|
535
|
+
initialValue: (vehicle === null || vehicle === void 0 ? void 0 : vehicle.singleOrderOwnershipType) || (isTmg || isTowCenterBranch ? _constants__.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE.Particulier : _constants__.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE.Empty),
|
|
535
536
|
onChange: val => {
|
|
536
537
|
dispatch({
|
|
537
538
|
type: _OrderSessionContext.orderSessionActions.SET_VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE,
|
|
@@ -540,10 +541,10 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
540
541
|
}
|
|
541
542
|
});
|
|
542
543
|
},
|
|
543
|
-
options:
|
|
544
|
-
isRequired:
|
|
544
|
+
options: isTmg || isTowCenterBranch ? Object.values(_constants__.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE).filter(option => option !== _constants__.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE.Empty) : Object.values(_constants__.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE),
|
|
545
|
+
isRequired: isTmg || isTowCenterBranch,
|
|
545
546
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['singleOrderOwnershipType']
|
|
546
|
-
}), (
|
|
547
|
+
}), (isTmg || isTowCenterBranch) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
547
548
|
className: (0, _helpers__.withStyle)('col-12 mb-2')
|
|
548
549
|
}, /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
549
550
|
name: "anderAfleveradres",
|
|
@@ -76,8 +76,7 @@ const NormalPageModalContent = _ref => {
|
|
|
76
76
|
const [_branches, _setBranches] = (0, _react.useState)([]);
|
|
77
77
|
const [{
|
|
78
78
|
licensePlate,
|
|
79
|
-
model
|
|
80
|
-
singleOrderFormulaCode
|
|
79
|
+
model
|
|
81
80
|
}] = (0, _OrderSessionContext.useOrderSession)();
|
|
82
81
|
const {
|
|
83
82
|
myBranches,
|
|
@@ -138,8 +137,7 @@ const NormalPageModalContent = _ref => {
|
|
|
138
137
|
const selectedBranchData = isTMGOrganization ? branches === null || branches === void 0 || (_branches$results = branches.results) === null || _branches$results === void 0 ? void 0 : _branches$results.find(b => b.entityId === value) : myBranches === null || myBranches === void 0 ? void 0 : myBranches.find(b => b.entityId === value);
|
|
139
138
|
if (selectedBranchData) {
|
|
140
139
|
const isTowCenter = (selectedBranchData === null || selectedBranchData === void 0 ? void 0 : selectedBranchData.towCenterVestiging) === true;
|
|
141
|
-
const
|
|
142
|
-
const shouldEnable = isTowCenter || isTmgFormula;
|
|
140
|
+
const shouldEnable = isTMGOrganization || isTowCenter;
|
|
143
141
|
dispatch({
|
|
144
142
|
type: _OrderSessionContext.orderSessionActions.SET_IS_TOW_CENTER_BRANCH,
|
|
145
143
|
payload: {
|
|
@@ -201,9 +199,6 @@ const SingleOrderModalContent = _ref3 => {
|
|
|
201
199
|
limit: 500,
|
|
202
200
|
offset: 0
|
|
203
201
|
});
|
|
204
|
-
const [{
|
|
205
|
-
singleOrderFormulaCode
|
|
206
|
-
}] = (0, _OrderSessionContext.useOrderSession)();
|
|
207
202
|
|
|
208
203
|
// Filter branches based on formula if not TMG
|
|
209
204
|
const filteredBranches = _react.default.useMemo(() => {
|
|
@@ -355,8 +350,7 @@ const InternalBranchSelectorModal = () => {
|
|
|
355
350
|
existingDossierId,
|
|
356
351
|
orderType,
|
|
357
352
|
licensePlate,
|
|
358
|
-
model
|
|
359
|
-
singleOrderFormulaCode
|
|
353
|
+
model
|
|
360
354
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
361
355
|
const {
|
|
362
356
|
branchById
|
|
@@ -384,9 +378,7 @@ const InternalBranchSelectorModal = () => {
|
|
|
384
378
|
(0, _react.useEffect)(() => {
|
|
385
379
|
if (!selectedBranch || !branchById) return;
|
|
386
380
|
const isTowCenter = (branchById === null || branchById === void 0 ? void 0 : branchById.towCenterVestiging) === true;
|
|
387
|
-
const
|
|
388
|
-
const shouldEnable = isTowCenter || isTmgFormula;
|
|
389
|
-
console.log(isTowCenter, isTmgFormula, shouldEnable);
|
|
381
|
+
const shouldEnable = isTMGOrganization || isTowCenter;
|
|
390
382
|
dispatch({
|
|
391
383
|
type: _OrderSessionContext.orderSessionActions.SET_IS_TOW_CENTER_BRANCH,
|
|
392
384
|
payload: {
|
|
@@ -420,7 +412,7 @@ const InternalBranchSelectorModal = () => {
|
|
|
420
412
|
}
|
|
421
413
|
});
|
|
422
414
|
}
|
|
423
|
-
}, [selectedBranch, branchById,
|
|
415
|
+
}, [selectedBranch, branchById, isTMGOrganization, dispatch]);
|
|
424
416
|
const handlePrimaryButtonClicked = () => {
|
|
425
417
|
dispatch({
|
|
426
418
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_BRANCH,
|