thm-p3-configurator 0.0.58 → 0.0.60
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.
|
@@ -79,7 +79,7 @@ function _toPrimitive(t, r) {
|
|
|
79
79
|
return ("string" === r ? String : Number)(t);
|
|
80
80
|
}
|
|
81
81
|
const InternalSingleOrderProductOverview = _ref => {
|
|
82
|
-
var _articles$articles, _articles$articles2;
|
|
82
|
+
var _articles$articles, _articles$articles2, _articles$articles3;
|
|
83
83
|
let {
|
|
84
84
|
filters,
|
|
85
85
|
paginationChange,
|
|
@@ -103,6 +103,7 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
103
103
|
executionAnswer1,
|
|
104
104
|
executionAnswer2
|
|
105
105
|
});
|
|
106
|
+
const hasActiveFilters = Boolean(mergedFilters.articleNumber || mergedFilters.licensePlate || mergedFilters.model || mergedFilters.type || mergedFilters.group || mergedFilters.subgroup || mergedFilters.executionAnswer1 || mergedFilters.executionAnswer2 || mergedFilters.durationAnswer);
|
|
106
107
|
const {
|
|
107
108
|
articles,
|
|
108
109
|
areArticlesError,
|
|
@@ -112,10 +113,13 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
112
113
|
className: (0, _helpers__.withStyle)('flex-grow-1 h-100')
|
|
113
114
|
}, areArticlesError && /*#__PURE__*/_react.default.createElement(_DangerAlert.default, {
|
|
114
115
|
message: "Er is iets fout gegaan bij het ophalen van de producten. Zorg dat je toegang hebt tot de geselecteerde vestiging. Klik op bestelling herstarten om de vestiging te wijzigen."
|
|
115
|
-
}),
|
|
116
|
+
}), !hasActiveFilters && /*#__PURE__*/_react.default.createElement(_EmptyState.default, {
|
|
117
|
+
message: "Vind het product dat je zoekt",
|
|
118
|
+
subMessage: "Stel de filters in om de producten op te halen"
|
|
119
|
+
}), articles && hasActiveFilters && (articles === null || articles === void 0 || (_articles$articles = articles.articles) === null || _articles$articles === void 0 ? void 0 : _articles$articles.length) === 0 && /*#__PURE__*/_react.default.createElement(_EmptyState.default, {
|
|
116
120
|
message: "Geen producten gevonden.",
|
|
117
121
|
subMessage: "Probeer een ander filter toe te passen."
|
|
118
|
-
})
|
|
122
|
+
}), articles && hasActiveFilters && (articles === null || articles === void 0 || (_articles$articles2 = articles.articles) === null || _articles$articles2 === void 0 ? void 0 : _articles$articles2.length) > 0 && (articles === null || articles === void 0 || (_articles$articles3 = articles.articles) === null || _articles$articles3 === void 0 ? void 0 : _articles$articles3.map(article => {
|
|
119
123
|
var _cart$find$quantity, _cart$find, _article$locationPric, _article$locationPric2;
|
|
120
124
|
return /*#__PURE__*/_react.default.createElement(_SingleOrderProductCard.default, {
|
|
121
125
|
key: article.articleNumber,
|
|
@@ -132,12 +136,12 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
132
136
|
productTitle: article.name,
|
|
133
137
|
productPrice: Number(article === null || article === void 0 || (_article$locationPric2 = article.locationPrices) === null || _article$locationPric2 === void 0 ? void 0 : _article$locationPric2.priceInclVat).toFixed(2)
|
|
134
138
|
});
|
|
135
|
-
}), !articles && !areArticlesLoaded && !areArticlesError && /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
+
})), !articles && hasActiveFilters && !areArticlesLoaded && !areArticlesError && /*#__PURE__*/_react.default.createElement("div", {
|
|
136
140
|
className: (0, _helpers__.withStyle)('flex-grow-1 h-100')
|
|
137
141
|
}, /*#__PURE__*/_react.default.createElement(_EmptyState.default, {
|
|
138
142
|
message: "We zijn de producten aan het laden...",
|
|
139
143
|
subMessage: "Dit kan enkele seconden duren."
|
|
140
|
-
})), !licensePlate && !model && /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
144
|
+
})), !licensePlate && hasActiveFilters && !model && /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
141
145
|
className: (0, _helpers__.withStyle)('mt-4'),
|
|
142
146
|
count: articles === null || articles === void 0 ? void 0 : articles.totalArticles,
|
|
143
147
|
pageSize: 10,
|
|
@@ -39,6 +39,7 @@ var _orderApi = require("../__api__/orderApi");
|
|
|
39
39
|
var _index = require("./index");
|
|
40
40
|
var _logoPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-primary.png"));
|
|
41
41
|
var _image = require("../__helpers__/image");
|
|
42
|
+
var _index2 = require("../__constants__/index");
|
|
42
43
|
function _interopRequireDefault(e) {
|
|
43
44
|
return e && e.__esModule ? e : {
|
|
44
45
|
default: e
|
|
@@ -184,10 +185,13 @@ const enrichArticlesWithBrandsAndPrices = async (articles, branchId, formula) =>
|
|
|
184
185
|
brand: (_brandResponse$data$f = brandResponse.data.find(brand => brand.article === article.articleNumber)) === null || _brandResponse$data$f === void 0 ? void 0 : _brandResponse$data$f.articleBrandId
|
|
185
186
|
});
|
|
186
187
|
}).filter(article => article.brand);
|
|
187
|
-
const parts = articlesWithBrands.map(article =>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
const parts = articlesWithBrands.map(article => {
|
|
189
|
+
var _article$brand;
|
|
190
|
+
return {
|
|
191
|
+
partNumber: article.articleNumber,
|
|
192
|
+
brandNumber: (_article$brand = article.brand) !== null && _article$brand !== void 0 ? _article$brand : _index2.DEFAULT_ARTICLE_BRAND
|
|
193
|
+
};
|
|
194
|
+
});
|
|
191
195
|
const pricesResponse = await _orderApi.orderApi.getArticlePrices(new URLSearchParams({
|
|
192
196
|
branchId,
|
|
193
197
|
formula,
|
|
@@ -11,7 +11,7 @@ require("core-js/modules/es.string.includes.js");
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
const useIsSingleOrder = () => {
|
|
13
13
|
return (0, _react.useMemo)(() => {
|
|
14
|
-
return typeof window !== 'undefined' && window.location.pathname.includes('configurator/single-order');
|
|
14
|
+
return typeof window !== 'undefined' && (window.location.pathname.includes('configurator/single-order') || window.location.pathname.includes('configurator/losse-order'));
|
|
15
15
|
}, []);
|
|
16
16
|
};
|
|
17
17
|
exports.useIsSingleOrder = useIsSingleOrder;
|