thm-p3-configurator 0.0.136 → 0.0.138
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/dist/src/shared/__api__/queries.js +1 -1
- package/dist/src/shared/__components__/Buttons/OutlinedButton.js +3 -1
- package/dist/src/shared/__components__/LocationsSelector/LocationList.js +1 -1
- package/dist/src/shared/__components__/SingleOrderProductCard.js +93 -7
- package/dist/src/shared/__containers__/QuestionsForm.js +7 -3
- package/dist/src/shared/__containers__/internal/InternalSingleOrderProductOverview.js +3 -0
- package/dist/src/shared/__helpers__/singleOrderArticles.js +27 -7
- package/dist/src/shared/__pages__/LicensePlatePage.js +4 -2
- package/dist/src/shared/__pages__/internal/InternalLicensePlatePage.js +4 -2
- package/package.json +1 -1
|
@@ -240,7 +240,7 @@ const useModelsQuery = _ref2 => {
|
|
|
240
240
|
exports.useModelsQuery = useModelsQuery;
|
|
241
241
|
const useSingleOrderArticles = exports.useSingleOrderArticles = function useSingleOrderArticles() {
|
|
242
242
|
let filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
243
|
-
let formula = arguments.length > 1 ? arguments[1] :
|
|
243
|
+
let formula = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
244
244
|
let branchId = arguments.length > 2 ? arguments[2] : undefined;
|
|
245
245
|
const articlesQuery = (0, _reactQuery.useQuery)(['singleOrderArticles', filters, branchId], {
|
|
246
246
|
queryFn: async () => {
|
|
@@ -43,10 +43,12 @@ const OutlinedButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
43
43
|
onClick,
|
|
44
44
|
label,
|
|
45
45
|
icon,
|
|
46
|
-
className
|
|
46
|
+
className,
|
|
47
|
+
style
|
|
47
48
|
} = _ref;
|
|
48
49
|
return /*#__PURE__*/_react.default.createElement("button", {
|
|
49
50
|
className: (0, _helpers__.withStyle)("btn btn-outline-primary ".concat(isNarrow ? 'btn-narrow' : '', " ").concat(className || '')),
|
|
51
|
+
style: style,
|
|
50
52
|
type: type,
|
|
51
53
|
ref: ref,
|
|
52
54
|
disabled: isDisabled,
|
|
@@ -163,7 +163,7 @@ const LocationList = _ref => {
|
|
|
163
163
|
}, /*#__PURE__*/_react.default.createElement("h5", null, userLocation ? 'Dichtsbijzijnde montagelocaties' : 'Montagelocaties'), isLoading && /*#__PURE__*/_react.default.createElement(LocationsLoading, null), !isLoading && !locationIds.length && /*#__PURE__*/_react.default.createElement(NoLocationFound, null), sortedLocations.map(location => /*#__PURE__*/_react.default.createElement(_LocationListItem.default, {
|
|
164
164
|
ref: location.entityId === activeMarkerId || location.entityId === selectedBranch ? selectedRef : null,
|
|
165
165
|
openingHours: location.openingstijden,
|
|
166
|
-
title: location.
|
|
166
|
+
title: location.naamVestiging,
|
|
167
167
|
city: location.city,
|
|
168
168
|
distance: location.distance ? location.distance : null,
|
|
169
169
|
id: location.entityId,
|
|
@@ -1,28 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.promise.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
3
5
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
4
6
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
7
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
5
8
|
require("core-js/modules/esnext.iterator.map.js");
|
|
9
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
+
require("core-js/modules/es.weak-map.js");
|
|
6
11
|
Object.defineProperty(exports, "__esModule", {
|
|
7
12
|
value: true
|
|
8
13
|
});
|
|
9
14
|
exports.default = void 0;
|
|
15
|
+
require("core-js/modules/es.promise.js");
|
|
10
16
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
11
17
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
18
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
12
19
|
require("core-js/modules/esnext.iterator.map.js");
|
|
13
|
-
|
|
20
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
21
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
22
|
var _queries = require("../__api__/queries");
|
|
15
23
|
var _NumericInput = _interopRequireDefault(require("../__components__/Form/NumericInput"));
|
|
16
24
|
var _helpers__ = require("../__helpers__");
|
|
25
|
+
var _singleOrderArticles = require("../__helpers__/singleOrderArticles");
|
|
17
26
|
var _OutlinedButton = _interopRequireDefault(require("./Buttons/OutlinedButton"));
|
|
18
27
|
var _PrimaryButton = _interopRequireDefault(require("./Buttons/PrimaryButton"));
|
|
19
28
|
var _ProductCardSpecifications = _interopRequireDefault(require("./ProductCard/ProductCardSpecifications"));
|
|
20
29
|
var _ProductCardUsps = _interopRequireDefault(require("./ProductCard/ProductCardUsps"));
|
|
30
|
+
var _constants__ = require("../__constants__");
|
|
21
31
|
function _interopRequireDefault(e) {
|
|
22
32
|
return e && e.__esModule ? e : {
|
|
23
33
|
default: e
|
|
24
34
|
};
|
|
25
35
|
}
|
|
36
|
+
function _getRequireWildcardCache(e) {
|
|
37
|
+
if ("function" != typeof WeakMap) return null;
|
|
38
|
+
var r = new WeakMap(),
|
|
39
|
+
t = new WeakMap();
|
|
40
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
|
|
41
|
+
return e ? t : r;
|
|
42
|
+
})(e);
|
|
43
|
+
}
|
|
44
|
+
function _interopRequireWildcard(e, r) {
|
|
45
|
+
if (!r && e && e.__esModule) return e;
|
|
46
|
+
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
47
|
+
default: e
|
|
48
|
+
};
|
|
49
|
+
var t = _getRequireWildcardCache(r);
|
|
50
|
+
if (t && t.has(e)) return t.get(e);
|
|
51
|
+
var n = {
|
|
52
|
+
__proto__: null
|
|
53
|
+
},
|
|
54
|
+
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
55
|
+
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
56
|
+
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
57
|
+
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
58
|
+
}
|
|
59
|
+
return n.default = e, t && t.set(e, n), n;
|
|
60
|
+
}
|
|
26
61
|
const ProductImage = _ref => {
|
|
27
62
|
let {
|
|
28
63
|
productImage
|
|
@@ -46,6 +81,8 @@ const ProductActions = _ref2 => {
|
|
|
46
81
|
handleSelected,
|
|
47
82
|
removeFromCart,
|
|
48
83
|
productPrice,
|
|
84
|
+
showPartStockLevel,
|
|
85
|
+
setShowPartStockLevel,
|
|
49
86
|
productPriceInclVat
|
|
50
87
|
} = _ref2;
|
|
51
88
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -58,7 +95,13 @@ const ProductActions = _ref2 => {
|
|
|
58
95
|
className: (0, _helpers__.withStyle)('text-success mb-1')
|
|
59
96
|
}, isTmg ? "".concat(stock, " op voorraad") : 'Op voorraad'), /*#__PURE__*/_react.default.createElement("div", {
|
|
60
97
|
className: (0, _helpers__.withStyle)('d-flex align-items-center')
|
|
61
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement(_OutlinedButton.default, {
|
|
99
|
+
style: {
|
|
100
|
+
marginRight: '1rem'
|
|
101
|
+
},
|
|
102
|
+
onClick: () => setShowPartStockLevel(!showPartStockLevel),
|
|
103
|
+
label: "Voorkeurs voorraad"
|
|
104
|
+
}), /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
|
|
62
105
|
className: (0, _helpers__.withStyle)('me-2 rounded'),
|
|
63
106
|
width: "100px",
|
|
64
107
|
height: "55px",
|
|
@@ -78,7 +121,10 @@ const ProductCategories = _ref3 => {
|
|
|
78
121
|
productType = null,
|
|
79
122
|
productGroup = null,
|
|
80
123
|
productSubgroup = null,
|
|
81
|
-
articleNumber = null
|
|
124
|
+
articleNumber = null,
|
|
125
|
+
preferredPart = null,
|
|
126
|
+
partStockLevels = null,
|
|
127
|
+
showPartStockLevel = false
|
|
82
128
|
} = _ref3;
|
|
83
129
|
return /*#__PURE__*/_react.default.createElement("div", null, articleNumber && /*#__PURE__*/_react.default.createElement("p", {
|
|
84
130
|
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
@@ -88,7 +134,13 @@ const ProductCategories = _ref3 => {
|
|
|
88
134
|
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
89
135
|
}, /*#__PURE__*/_react.default.createElement("strong", null, "Groep:"), " ", productGroup), productSubgroup && /*#__PURE__*/_react.default.createElement("p", {
|
|
90
136
|
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
91
|
-
}, /*#__PURE__*/_react.default.createElement("strong", null, "Subgroep:"), " ", productSubgroup)
|
|
137
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, "Subgroep:"), " ", productSubgroup), preferredPart && /*#__PURE__*/_react.default.createElement("p", {
|
|
138
|
+
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
139
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, "Voorkeur onderdeel:"), " ", preferredPart.preferredPart), showPartStockLevel && partStockLevels && /*#__PURE__*/_react.default.createElement("p", {
|
|
140
|
+
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement("small", {
|
|
142
|
+
className: (0, _helpers__.withStyle)(partStockLevels.status === _constants__.StockStatus.OutOfStock ? 'text-danger' : 'text-success')
|
|
143
|
+
}, partStockLevels.status === _constants__.StockStatus.OutOfStock ? 'Niet op voorraad' : 'Op voorraad'), partStockLevels.quantity ? /*#__PURE__*/_react.default.createElement("small", null, ": ".concat(partStockLevels.quantity)) : ''));
|
|
92
144
|
};
|
|
93
145
|
const SingleOrderProductCard = _ref4 => {
|
|
94
146
|
let {
|
|
@@ -96,6 +148,7 @@ const SingleOrderProductCard = _ref4 => {
|
|
|
96
148
|
isSelected,
|
|
97
149
|
stock,
|
|
98
150
|
isOutOfStock,
|
|
151
|
+
formula,
|
|
99
152
|
handleSelected,
|
|
100
153
|
productImage,
|
|
101
154
|
productType,
|
|
@@ -111,11 +164,39 @@ const SingleOrderProductCard = _ref4 => {
|
|
|
111
164
|
handleQuantityChange,
|
|
112
165
|
removeFromCart,
|
|
113
166
|
isModelArticle = false,
|
|
114
|
-
isTmg = false
|
|
167
|
+
isTmg = false,
|
|
168
|
+
parts = [],
|
|
169
|
+
branchId
|
|
115
170
|
} = _ref4;
|
|
116
171
|
const {
|
|
117
172
|
productFieldLabels
|
|
118
173
|
} = (0, _queries.useProductFieldLabels)();
|
|
174
|
+
const [preferredPart, setPreferredPart] = (0, _react.useState)(null);
|
|
175
|
+
const [partStockLevels, setPartStockLevels] = (0, _react.useState)([]);
|
|
176
|
+
const [showPartStockLevel, setShowPartStockLevel] = (0, _react.useState)(false);
|
|
177
|
+
(0, _react.useEffect)(() => {
|
|
178
|
+
if (showPartStockLevel) {
|
|
179
|
+
const fetchStockLevels = async () => {
|
|
180
|
+
const preferredPart = parts.find(part => part.isPreferred === true);
|
|
181
|
+
if (preferredPart) {
|
|
182
|
+
const partStockLevel = await (0, _singleOrderArticles.fetchPartStockLevels)({
|
|
183
|
+
partNumber: preferredPart.partNumber,
|
|
184
|
+
brandNumber: preferredPart.partBrandId
|
|
185
|
+
}, branchId, !isTmg ? formula : null);
|
|
186
|
+
setPartStockLevels(partStockLevel);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
fetchStockLevels();
|
|
190
|
+
}
|
|
191
|
+
}, [showPartStockLevel, parts, branchId, isTmg, formula]);
|
|
192
|
+
(0, _react.useEffect)(() => {
|
|
193
|
+
if (parts && parts.length > 0) {
|
|
194
|
+
const preferred = parts.find(part => part.isPreferred === true);
|
|
195
|
+
if (preferred) {
|
|
196
|
+
setPreferredPart(preferred);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}, [parts]);
|
|
119
200
|
const filteredProductSpecifications = productSpecifications.filter(_ref5 => {
|
|
120
201
|
let {
|
|
121
202
|
key
|
|
@@ -146,11 +227,14 @@ const SingleOrderProductCard = _ref4 => {
|
|
|
146
227
|
className: (0, _helpers__.withStyle)('card-title mb-3')
|
|
147
228
|
}, productTitle, /*#__PURE__*/_react.default.createElement("span", {
|
|
148
229
|
className: (0, _helpers__.withStyle)('ms-2')
|
|
149
|
-
}, "\u20AC", productPrice)), (productType || productGroup || productSubgroup || articleNumber) && /*#__PURE__*/_react.default.createElement(ProductCategories, {
|
|
230
|
+
}, "\u20AC", productPrice)), (productType || productGroup || productSubgroup || articleNumber || preferredPart) && /*#__PURE__*/_react.default.createElement(ProductCategories, {
|
|
150
231
|
productType: productType,
|
|
151
232
|
productGroup: productGroup,
|
|
152
233
|
productSubgroup: productSubgroup,
|
|
153
|
-
articleNumber: articleNumber
|
|
234
|
+
articleNumber: articleNumber,
|
|
235
|
+
preferredPart: preferredPart,
|
|
236
|
+
partStockLevels: partStockLevels,
|
|
237
|
+
showPartStockLevel: showPartStockLevel
|
|
154
238
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
155
239
|
className: (0, _helpers__.withStyle)(isModelArticle ? 'd-flex justify-content-between' : '')
|
|
156
240
|
}, (productUsps === null || productUsps === void 0 ? void 0 : productUsps.length) > 0 && /*#__PURE__*/_react.default.createElement(_ProductCardUsps.default, {
|
|
@@ -160,6 +244,8 @@ const SingleOrderProductCard = _ref4 => {
|
|
|
160
244
|
specifications: filteredProductSpecifications,
|
|
161
245
|
className: isModelArticle ? '' : 'w-100'
|
|
162
246
|
}))), /*#__PURE__*/_react.default.createElement(ProductActions, {
|
|
247
|
+
showPartStockLevel: showPartStockLevel,
|
|
248
|
+
setShowPartStockLevel: setShowPartStockLevel,
|
|
163
249
|
isOutOfStock: isOutOfStock,
|
|
164
250
|
stock: stock,
|
|
165
251
|
isTmg: isTmg,
|
|
@@ -294,19 +294,23 @@ const QuestionsForm = _ref => {
|
|
|
294
294
|
});
|
|
295
295
|
return;
|
|
296
296
|
} else {
|
|
297
|
-
|
|
297
|
+
if (questionsError) {
|
|
298
|
+
onPrev(1);
|
|
299
|
+
} else {
|
|
300
|
+
history.push('/configurator/trekhaakpakket');
|
|
301
|
+
}
|
|
298
302
|
}
|
|
299
303
|
}
|
|
300
304
|
}
|
|
301
305
|
}, [isLoadingQuestions, durationOptions, execution1Options, execution2Options, execution2AnswerOptions, execution1AnswerOptions, durationQuestion, isFilter]);
|
|
302
306
|
if (questionsError === _constants__.API_ERROR_CODES.notFound || questionsError === _constants__.API_ERROR_CODES.notFoundAldoc) {
|
|
303
307
|
return /*#__PURE__*/_react.default.createElement(_reactRouter.Redirect, {
|
|
304
|
-
to: "/configurator
|
|
308
|
+
to: "/configurator?notFound=true"
|
|
305
309
|
});
|
|
306
310
|
}
|
|
307
311
|
if (questionsError) {
|
|
308
312
|
return /*#__PURE__*/_react.default.createElement(_reactRouter.Redirect, {
|
|
309
|
-
to: "/configurator
|
|
313
|
+
to: "/configurator?notFound=true"
|
|
310
314
|
});
|
|
311
315
|
}
|
|
312
316
|
if (isLoadingQuestions) {
|
|
@@ -130,7 +130,10 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
130
130
|
var _cart$find$quantity, _cart$find, _article$locationPric, _article$locationPric2, _article$locationPric3, _article$locationPric6, _article$locationPric7;
|
|
131
131
|
return /*#__PURE__*/_react.default.createElement(_SingleOrderProductCard.default, {
|
|
132
132
|
isTmg: isTmg,
|
|
133
|
+
branchId: selectedBranch,
|
|
133
134
|
key: article.articleNumber,
|
|
135
|
+
formula: formula,
|
|
136
|
+
parts: article === null || article === void 0 ? void 0 : article.parts,
|
|
134
137
|
isModelArticle: Boolean(model || licensePlate),
|
|
135
138
|
removeFromCart: () => _removeFromCart(article.articleNumber),
|
|
136
139
|
productId: article.articleNumber,
|
|
@@ -19,7 +19,7 @@ require("core-js/modules/esnext.iterator.for-each.js");
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", {
|
|
20
20
|
value: true
|
|
21
21
|
});
|
|
22
|
-
exports.fetchArticlesByLicensePlateAndModel = exports.fetchArticlesByFilters = exports.fetchArticlesByArticleNumbers = exports.enrichArticlesWithBrandsAndPrices = void 0;
|
|
22
|
+
exports.fetchPartStockLevels = exports.fetchArticlesByLicensePlateAndModel = exports.fetchArticlesByFilters = exports.fetchArticlesByArticleNumbers = exports.enrichArticlesWithBrandsAndPrices = void 0;
|
|
23
23
|
require("core-js/modules/es.symbol.description.js");
|
|
24
24
|
require("core-js/modules/es.array.flat-map.js");
|
|
25
25
|
require("core-js/modules/es.array.unscopables.flat-map.js");
|
|
@@ -35,7 +35,6 @@ require("core-js/modules/esnext.iterator.map.js");
|
|
|
35
35
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
36
36
|
require("core-js/modules/web.url-search-params.js");
|
|
37
37
|
var _authenticatedProxyApi = require("../__api__/authenticatedProxyApi");
|
|
38
|
-
var _orderApi = require("../__api__/orderApi");
|
|
39
38
|
var _index = require("./index");
|
|
40
39
|
var _logoPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-primary.png"));
|
|
41
40
|
var _index2 = require("../__constants__/index");
|
|
@@ -163,6 +162,28 @@ const fetchArticlesByArticleNumbers = async articleNumbers => {
|
|
|
163
162
|
};
|
|
164
163
|
};
|
|
165
164
|
|
|
165
|
+
/**
|
|
166
|
+
*
|
|
167
|
+
* @description fetch the stock levels of the parts
|
|
168
|
+
* @param {Object} parts - The parts
|
|
169
|
+
*/
|
|
170
|
+
exports.fetchArticlesByArticleNumbers = fetchArticlesByArticleNumbers;
|
|
171
|
+
const fetchPartStockLevels = exports.fetchPartStockLevels = async function fetchPartStockLevels(part, branchId) {
|
|
172
|
+
var _response$data$data;
|
|
173
|
+
let formula = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
174
|
+
const partParamsString = new URLSearchParams((0, _index.removeNullishProps)({
|
|
175
|
+
branchId,
|
|
176
|
+
formula,
|
|
177
|
+
parts: JSON.stringify([part])
|
|
178
|
+
})).toString();
|
|
179
|
+
const response = await _authenticatedProxyApi.authenticatedProxyApi.getArticlePrices(partParamsString);
|
|
180
|
+
if (!(response !== null && response !== void 0 && response.data)) {
|
|
181
|
+
throw new Error('No response from the API');
|
|
182
|
+
}
|
|
183
|
+
const stockLevel = (_response$data$data = response.data.data) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data.locationPrices) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data[0]) === null || _response$data$data === void 0 ? void 0 : _response$data$data.stock;
|
|
184
|
+
return stockLevel;
|
|
185
|
+
};
|
|
186
|
+
|
|
166
187
|
/**
|
|
167
188
|
* @description Enrich articles with brands and prices
|
|
168
189
|
* @param {Object} articles - The articles
|
|
@@ -170,8 +191,8 @@ const fetchArticlesByArticleNumbers = async articleNumbers => {
|
|
|
170
191
|
* @param {string} formula - The formula
|
|
171
192
|
* @returns {Object} The articles
|
|
172
193
|
*/
|
|
173
|
-
exports.
|
|
174
|
-
|
|
194
|
+
const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPrices = async function enrichArticlesWithBrandsAndPrices(articles, branchId) {
|
|
195
|
+
let formula = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
175
196
|
const articleNumbers = articles.map(article => article.articleNumber);
|
|
176
197
|
const articleBrandQueryString = new URLSearchParams({
|
|
177
198
|
articleNumbers: JSON.stringify(articleNumbers)
|
|
@@ -193,11 +214,11 @@ const enrichArticlesWithBrandsAndPrices = async (articles, branchId, formula) =>
|
|
|
193
214
|
brandNumber: (_article$brand = article.brand) !== null && _article$brand !== void 0 ? _article$brand : _index2.DEFAULT_ARTICLE_BRAND
|
|
194
215
|
};
|
|
195
216
|
});
|
|
196
|
-
const pricesResponse = await _authenticatedProxyApi.authenticatedProxyApi.getArticlePrices(new URLSearchParams({
|
|
217
|
+
const pricesResponse = await _authenticatedProxyApi.authenticatedProxyApi.getArticlePrices(new URLSearchParams((0, _index.removeNullishProps)({
|
|
197
218
|
branchId,
|
|
198
219
|
formula,
|
|
199
220
|
parts: JSON.stringify(parts)
|
|
200
|
-
}).toString());
|
|
221
|
+
})).toString());
|
|
201
222
|
if (!(pricesResponse !== null && pricesResponse !== void 0 && pricesResponse.data)) {
|
|
202
223
|
throw new Error('No prices available for the given articles');
|
|
203
224
|
}
|
|
@@ -214,7 +235,6 @@ const enrichArticlesWithBrandsAndPrices = async (articles, branchId, formula) =>
|
|
|
214
235
|
locationPrices: pricesMap.location[article.articleNumber]
|
|
215
236
|
}));
|
|
216
237
|
};
|
|
217
|
-
exports.enrichArticlesWithBrandsAndPrices = enrichArticlesWithBrandsAndPrices;
|
|
218
238
|
const formatModelArticle = article => {
|
|
219
239
|
var _ref3, _article$name, _ref4, _article$description$, _article$description, _article$boldDescript, _article$boldDescript2, _article$specificatio, _article$images, _article$images2, _article$articleNumbe;
|
|
220
240
|
return _objectSpread(_objectSpread({}, article), {}, {
|
|
@@ -73,7 +73,7 @@ const LicensePlatePage = () => {
|
|
|
73
73
|
const [activeStep, setActiveStep] = (0, _react.useState)(0);
|
|
74
74
|
const [orderSession, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
75
75
|
const formula = (0, _FormulaContext.useFormula)();
|
|
76
|
-
const [licensePlateURL, widgetOrEntityId, discountCode, franchiseName] = (0, _useSearchParam.default)(['licensePlate', 'vestigingRecId', 'discountCode', 'naamKeten']);
|
|
76
|
+
const [licensePlateURL, widgetOrEntityId, discountCode, franchiseName, notFound] = (0, _useSearchParam.default)(['licensePlate', 'vestigingRecId', 'discountCode', 'naamKeten', 'notFound']);
|
|
77
77
|
const {
|
|
78
78
|
branchById,
|
|
79
79
|
isLoadingBranchById
|
|
@@ -162,7 +162,9 @@ const LicensePlatePage = () => {
|
|
|
162
162
|
isCentered: true,
|
|
163
163
|
isScrollable: true,
|
|
164
164
|
title: 'Wij zoeken naar de beste oplossing'
|
|
165
|
-
}, widgetOrEntityId && isLoadingBranchById && /*#__PURE__*/_react.default.createElement(_TextSpinner.default, null),
|
|
165
|
+
}, widgetOrEntityId && isLoadingBranchById && /*#__PURE__*/_react.default.createElement(_TextSpinner.default, null), notFound === 'true' && /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
+
className: (0, _helpers__.withStyle)('alert alert-danger mb-3')
|
|
167
|
+
}, /*#__PURE__*/_react.default.createElement("small", null, "Het opgegeven kenteken kon niet worden gevonden. Probeer een ander kenteken of zoek via merk.")), Steps[activeStep], /*#__PURE__*/_react.default.createElement("div", {
|
|
166
168
|
className: (0, _helpers__.withStyle)('align-items-center justify-content-center text-center mt-2')
|
|
167
169
|
}, /*#__PURE__*/_react.default.createElement(_FormSteps.default, {
|
|
168
170
|
count: Steps.length,
|
|
@@ -73,7 +73,7 @@ const InternalLicensePlatePage = () => {
|
|
|
73
73
|
const [session, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
74
74
|
const originalLicensePlate = (0, _react.useRef)();
|
|
75
75
|
const formula = (0, _FormulaContext.useFormula)();
|
|
76
|
-
const [licensePlateURL, discountCode, persistSession] = (0, _useSearchParam.default)(['licensePlate', 'discountCode', 'persistSession']);
|
|
76
|
+
const [licensePlateURL, discountCode, persistSession, notFound] = (0, _useSearchParam.default)(['licensePlate', 'discountCode', 'persistSession', 'notFound']);
|
|
77
77
|
const history = (0, _reactRouter.useHistory)();
|
|
78
78
|
(0, _queries.useProductFieldLabels)(); // Prefetch
|
|
79
79
|
|
|
@@ -136,7 +136,9 @@ const InternalLicensePlatePage = () => {
|
|
|
136
136
|
isCentered: true,
|
|
137
137
|
isScrollable: true,
|
|
138
138
|
title: 'Wij zoeken naar de beste oplossing'
|
|
139
|
-
},
|
|
139
|
+
}, notFound === 'true' && /*#__PURE__*/_react.default.createElement("div", {
|
|
140
|
+
className: (0, _helpers__.withStyle)('alert alert-danger mb-3')
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement("small", null, "Het opgegeven kenteken kon niet worden gevonden. Probeer een ander kenteken of zoek via merk.")), Steps[activeStep], /*#__PURE__*/_react.default.createElement("div", {
|
|
140
142
|
className: (0, _helpers__.withStyle)('align-items-center justify-content-center text-center mt-2')
|
|
141
143
|
}, /*#__PURE__*/_react.default.createElement(_FormSteps.default, {
|
|
142
144
|
count: Steps.length,
|