thm-p3-configurator 0.0.211 → 0.0.213
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/App.js +1 -1
- package/dist/src/shared/__api__/authenticatedProxyApi.js +3 -0
- package/dist/src/shared/__api__/queries.js +20 -10
- package/dist/src/shared/__containers__/internal/InternalSingleOrderFilters.js +44 -3
- package/dist/src/shared/__containers__/internal/InternalSingleOrderProductOverview.js +14 -11
- package/dist/src/shared/__helpers__/singleOrderArticles.js +8 -1
- package/dist/src/shared/__pages__/internal/InternalSingleOrderPage.js +2 -1
- package/dist/src/shared/__style__/configurator/_configurator-offset.scss +1 -1
- package/package.json +1 -1
package/dist/src/shared/App.js
CHANGED
|
@@ -75,6 +75,6 @@ const App = () => {
|
|
|
75
75
|
defaultCountry: APP_CONFIG.country
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
|
|
77
77
|
client: _queryClient.default
|
|
78
|
-
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_reactHotLoader.AppContainer, null, /*#__PURE__*/_react.default.createElement(_ActiveMarkerContext.ActiveMarkerProvider, null, /*#__PURE__*/_react.default.createElement(_StyleWrapper.default, null, !APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_Navbar.default, null), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalBranchSelectorModal.default, null), /*#__PURE__*/_react.default.createElement(
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_reactHotLoader.AppContainer, null, /*#__PURE__*/_react.default.createElement(_ActiveMarkerContext.ActiveMarkerProvider, null, /*#__PURE__*/_react.default.createElement(_StyleWrapper.default, null, !APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_Navbar.default, null), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalBranchSelectorModal.default, null), APP_CONFIG.nodeEnv === 'development' && APP_CONFIG.internal === true && /*#__PURE__*/_react.default.createElement(_TEST_ONLY_INTERNAL_ROUTES.default, null))))))))));
|
|
79
79
|
};
|
|
80
80
|
var _default = exports.default = App;
|
|
@@ -195,6 +195,9 @@ const authenticatedProxyApi = exports.authenticatedProxyApi = {
|
|
|
195
195
|
}
|
|
196
196
|
});
|
|
197
197
|
},
|
|
198
|
+
getPartBrands: () => authenticateClient("api/v1/configurator/part-brands", {
|
|
199
|
+
method: 'GET'
|
|
200
|
+
}),
|
|
198
201
|
getOrder: orderParameters => {
|
|
199
202
|
const basePath = APP_CONFIG.internal ? 'api/v1' : 'api/public/v1';
|
|
200
203
|
return authenticateClient("".concat(basePath, "/configurator/order?").concat(orderParameters), {
|
|
@@ -15,7 +15,7 @@ require("core-js/modules/esnext.iterator.filter.js");
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", {
|
|
16
16
|
value: true
|
|
17
17
|
});
|
|
18
|
-
exports.useSingleOrderCart = exports.useSingleOrderBranchesQuery = exports.useSingleOrderBranchTypes = exports.useSingleOrderArticles = exports.useQuestionsQuery = exports.useProductsQuery = exports.useProductFieldLabels = exports.usePrivateDossierByTypeAndIdQuery = exports.useMyBranches = exports.useModelsQuery = exports.useMarketingChannels = exports.useCountriesQuery = exports.useBuildYearsQuery = exports.useBrandsQuery = exports.useBranchesQuery = exports.useBranchesByType = exports.useBranchTypes = exports.useBranchByIdOrWidgetId = exports.useArticleTypes = exports.useArticleSubGroups = exports.useArticleGroups = exports.useActiveDiscounts = void 0;
|
|
18
|
+
exports.useSingleOrderCart = exports.useSingleOrderBranchesQuery = exports.useSingleOrderBranchTypes = exports.useSingleOrderArticles = exports.useQuestionsQuery = exports.useProductsQuery = exports.useProductFieldLabels = exports.usePrivateDossierByTypeAndIdQuery = exports.usePartBrands = exports.useMyBranches = exports.useModelsQuery = exports.useMarketingChannels = exports.useCountriesQuery = exports.useBuildYearsQuery = exports.useBrandsQuery = exports.useBranchesQuery = exports.useBranchesByType = exports.useBranchTypes = exports.useBranchByIdOrWidgetId = exports.useArticleTypes = exports.useArticleSubGroups = exports.useArticleGroups = exports.useActiveDiscounts = void 0;
|
|
19
19
|
require("core-js/modules/es.symbol.description.js");
|
|
20
20
|
require("core-js/modules/es.json.stringify.js");
|
|
21
21
|
require("core-js/modules/es.object.from-entries.js");
|
|
@@ -271,7 +271,7 @@ const useSingleOrderArticles = exports.useSingleOrderArticles = function useSing
|
|
|
271
271
|
({
|
|
272
272
|
articles,
|
|
273
273
|
totalCount
|
|
274
|
-
} = await (0, _singleOrderArticles.fetchArticlesByArticleNumbers)([articleNumber], articleNumber));
|
|
274
|
+
} = await (0, _singleOrderArticles.fetchArticlesByArticleNumbers)([articleNumber], articleNumber, filters.searchByParts, filters.brand));
|
|
275
275
|
}
|
|
276
276
|
if (totalCount === 0 || !articles.length) {
|
|
277
277
|
return {
|
|
@@ -748,26 +748,36 @@ const usePrivateDossierByTypeAndIdQuery = _ref4 => {
|
|
|
748
748
|
*/
|
|
749
749
|
exports.usePrivateDossierByTypeAndIdQuery = usePrivateDossierByTypeAndIdQuery;
|
|
750
750
|
const useActiveDiscounts = _ref5 => {
|
|
751
|
-
var _discountsQuery$data;
|
|
752
751
|
let {
|
|
753
752
|
formulaCode,
|
|
754
753
|
offset,
|
|
755
754
|
limit,
|
|
756
755
|
authSession
|
|
757
756
|
} = _ref5;
|
|
758
|
-
const
|
|
759
|
-
|
|
757
|
+
const activeDiscountsQuery = (0, _reactQuery.useQuery)(['activeDiscounts', formulaCode, offset, limit], {
|
|
758
|
+
enabled: !!formulaCode && !!authSession,
|
|
760
759
|
queryFn: () => _authenticatedProxyApi.authenticatedProxyApi.getActiveDiscounts({
|
|
761
760
|
formulaCode,
|
|
762
761
|
offset,
|
|
763
762
|
limit
|
|
764
|
-
})
|
|
763
|
+
}).then(res => res.data)
|
|
764
|
+
});
|
|
765
|
+
return {
|
|
766
|
+
isLoadingActiveDiscounts: activeDiscountsQuery.isLoading,
|
|
767
|
+
isActiveDiscountsError: activeDiscountsQuery.isError,
|
|
768
|
+
activeDiscounts: activeDiscountsQuery === null || activeDiscountsQuery === void 0 ? void 0 : activeDiscountsQuery.data
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
exports.useActiveDiscounts = useActiveDiscounts;
|
|
772
|
+
const usePartBrands = () => {
|
|
773
|
+
const partBrandsQuery = (0, _reactQuery.useQuery)(['part-brands'], {
|
|
774
|
+
queryFn: () => _authenticatedProxyApi.authenticatedProxyApi.getPartBrands().then(res => res.data),
|
|
765
775
|
retry: true
|
|
766
776
|
});
|
|
767
777
|
return {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
778
|
+
partBrands: (partBrandsQuery === null || partBrandsQuery === void 0 ? void 0 : partBrandsQuery.data) || [],
|
|
779
|
+
isLoadingPartBrands: partBrandsQuery.isLoading,
|
|
780
|
+
partBrandsError: partBrandsQuery.error
|
|
771
781
|
};
|
|
772
782
|
};
|
|
773
|
-
exports.
|
|
783
|
+
exports.usePartBrands = usePartBrands;
|
|
@@ -79,6 +79,11 @@ const InternalSingleOrderFilters = /*#__PURE__*/(0, _react.forwardRef)((_ref, re
|
|
|
79
79
|
isLoadingBranchTypes,
|
|
80
80
|
branchTypesError
|
|
81
81
|
} = (0, _queries.useBranchTypes)();
|
|
82
|
+
const {
|
|
83
|
+
partBrands,
|
|
84
|
+
isLoadingPartBrands,
|
|
85
|
+
partBrandsError
|
|
86
|
+
} = (0, _queries.usePartBrands)();
|
|
82
87
|
const {
|
|
83
88
|
branch
|
|
84
89
|
} = (0, _useAuthSession.useAuthSession)();
|
|
@@ -88,6 +93,8 @@ const InternalSingleOrderFilters = /*#__PURE__*/(0, _react.forwardRef)((_ref, re
|
|
|
88
93
|
const [selectedArticleSubGroup, setSelectedArticleSubGroup] = (0, _react.useState)('');
|
|
89
94
|
const [selectedArticleNumber, setSelectedArticleNumber] = (0, _react.useState)('');
|
|
90
95
|
const [showAllArticles, setShowAllArticles] = (0, _react.useState)(false);
|
|
96
|
+
const [searchByParts, setSearchByParts] = (0, _react.useState)(false);
|
|
97
|
+
const [selectedPartBrand, setSelectedPartBrand] = (0, _react.useState)('');
|
|
91
98
|
const resetLicensePlateFilters = () => {
|
|
92
99
|
if (licensePlate || model) {
|
|
93
100
|
dispatch({
|
|
@@ -101,6 +108,7 @@ const InternalSingleOrderFilters = /*#__PURE__*/(0, _react.forwardRef)((_ref, re
|
|
|
101
108
|
setSelectedArticleGroup('');
|
|
102
109
|
setSelectedArticleSubGroup('');
|
|
103
110
|
setSelectedArticleNumber('');
|
|
111
|
+
setSelectedPartBrand('');
|
|
104
112
|
setShowAllArticles(false);
|
|
105
113
|
if (!dontReset) {
|
|
106
114
|
resetFilters();
|
|
@@ -139,6 +147,12 @@ const InternalSingleOrderFilters = /*#__PURE__*/(0, _react.forwardRef)((_ref, re
|
|
|
139
147
|
onFilterChange('articleNumber', selectedArticleNumber);
|
|
140
148
|
}
|
|
141
149
|
}, [selectedArticleNumber]);
|
|
150
|
+
(0, _react.useEffect)(() => {
|
|
151
|
+
onFilterChange('searchByParts', searchByParts);
|
|
152
|
+
}, [searchByParts]);
|
|
153
|
+
(0, _react.useEffect)(() => {
|
|
154
|
+
onFilterChange('brand', selectedPartBrand);
|
|
155
|
+
}, [selectedPartBrand]);
|
|
142
156
|
const {
|
|
143
157
|
articleGroups,
|
|
144
158
|
isLoadingArticleGroups,
|
|
@@ -166,8 +180,10 @@ const InternalSingleOrderFilters = /*#__PURE__*/(0, _react.forwardRef)((_ref, re
|
|
|
166
180
|
message: "Er is iets fout gegaan bij het ophalen van de artikelsubgroepen."
|
|
167
181
|
}), articleTypesError && /*#__PURE__*/_react.default.createElement(_DangerAlert.default, {
|
|
168
182
|
message: "Er is iets fout gegaan bij het ophalen van de artikelsoorten."
|
|
183
|
+
}), partBrandsError && /*#__PURE__*/_react.default.createElement(_DangerAlert.default, {
|
|
184
|
+
message: "Er is iets fout gegaan bij het ophalen van de onderdeel merken."
|
|
169
185
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
-
className: (0, _helpers__.withStyle)(
|
|
186
|
+
className: (0, _helpers__.withStyle)("row row-cols-1 ".concat(searchByParts ? 'row-cols-md-5' : 'row-cols-md-4', " pb-3 px-2"))
|
|
171
187
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
172
188
|
className: (0, _helpers__.withStyle)('col')
|
|
173
189
|
}, /*#__PURE__*/_react.default.createElement(_DropdownInput.default, {
|
|
@@ -235,13 +251,38 @@ const InternalSingleOrderFilters = /*#__PURE__*/(0, _react.forwardRef)((_ref, re
|
|
|
235
251
|
setSelectedArticleNumber(value);
|
|
236
252
|
},
|
|
237
253
|
className: "w-100"
|
|
238
|
-
})), isTmg && /*#__PURE__*/_react.default.createElement(
|
|
254
|
+
})), isTmg && searchByParts && /*#__PURE__*/_react.default.createElement("div", {
|
|
255
|
+
className: (0, _helpers__.withStyle)('col')
|
|
256
|
+
}, /*#__PURE__*/_react.default.createElement(_DropdownInput.default, {
|
|
257
|
+
options: [{
|
|
258
|
+
label: 'Maak een keuze',
|
|
259
|
+
value: null
|
|
260
|
+
}, ...(partBrands && !isLoadingPartBrands && partBrands.length > 0 ? partBrands.map(partBrand => ({
|
|
261
|
+
label: partBrand.title,
|
|
262
|
+
value: partBrand.entityId
|
|
263
|
+
})) : [])],
|
|
264
|
+
initialValue: selectedPartBrand,
|
|
265
|
+
label: "Onderdeel merken",
|
|
266
|
+
placeholder: "Maak een keuze",
|
|
267
|
+
onChange: option => {
|
|
268
|
+
resetLicensePlateFilters();
|
|
269
|
+
setSelectedPartBrand(option.value);
|
|
270
|
+
},
|
|
271
|
+
className: "w-100"
|
|
272
|
+
})), isTmg && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
239
273
|
name: 'showAllArticles',
|
|
240
274
|
initialValue: showAllArticles,
|
|
241
275
|
onChange: value => {
|
|
242
276
|
setShowAllArticles(value);
|
|
243
277
|
},
|
|
244
278
|
label: "Toon alle artikelen"
|
|
245
|
-
})
|
|
279
|
+
}), /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
280
|
+
name: 'searchByParts',
|
|
281
|
+
initialValue: searchByParts,
|
|
282
|
+
onChange: value => {
|
|
283
|
+
setSearchByParts(value);
|
|
284
|
+
},
|
|
285
|
+
label: "Zoeken op onderdelen"
|
|
286
|
+
})))));
|
|
246
287
|
});
|
|
247
288
|
var _default = exports.default = InternalSingleOrderFilters;
|
|
@@ -8,7 +8,6 @@ require("core-js/modules/esnext.iterator.find.js");
|
|
|
8
8
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
9
9
|
require("core-js/modules/esnext.iterator.map.js");
|
|
10
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
12
11
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
13
12
|
Object.defineProperty(exports, "__esModule", {
|
|
14
13
|
value: true
|
|
@@ -17,12 +16,12 @@ exports.default = void 0;
|
|
|
17
16
|
require("core-js/modules/es.symbol.description.js");
|
|
18
17
|
require("core-js/modules/es.number.to-fixed.js");
|
|
19
18
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
19
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
20
20
|
require("core-js/modules/esnext.iterator.find.js");
|
|
21
21
|
require("core-js/modules/esnext.iterator.map.js");
|
|
22
22
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
23
|
var _react = _interopRequireDefault(require("react"));
|
|
24
24
|
var _queries = require("../../__api__/queries");
|
|
25
|
-
var _DangerAlert = _interopRequireDefault(require("../../__components__/DangerAlert"));
|
|
26
25
|
var _EmptyState = _interopRequireDefault(require("../../__components__/EmptyState"));
|
|
27
26
|
var _Pagination = _interopRequireDefault(require("../../__components__/Pagination"));
|
|
28
27
|
var _SingleOrderProductCard = _interopRequireDefault(require("../../__components__/SingleOrderProductCard"));
|
|
@@ -110,7 +109,7 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
110
109
|
executionAnswer1,
|
|
111
110
|
executionAnswer2
|
|
112
111
|
});
|
|
113
|
-
const hasActiveFilters = Boolean(mergedFilters.articleNumber || mergedFilters.licensePlate || mergedFilters.model || mergedFilters.type || mergedFilters.group || mergedFilters.subgroup || mergedFilters.executionAnswer1 || mergedFilters.executionAnswer2 || mergedFilters.durationAnswer);
|
|
112
|
+
const hasActiveFilters = Boolean(mergedFilters.articleNumber || mergedFilters.licensePlate || mergedFilters.model || mergedFilters.type || mergedFilters.group || mergedFilters.subgroup || mergedFilters.brand || mergedFilters.searchByParts || mergedFilters.executionAnswer1 || mergedFilters.executionAnswer2 || mergedFilters.durationAnswer);
|
|
114
113
|
const {
|
|
115
114
|
articles,
|
|
116
115
|
areArticlesError,
|
|
@@ -124,8 +123,12 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
124
123
|
}), 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, {
|
|
125
124
|
message: "Geen producten gevonden.",
|
|
126
125
|
subMessage: "Probeer een ander filter toe te passen."
|
|
127
|
-
}), 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
|
|
128
|
-
var
|
|
126
|
+
}), 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 || (_articles$articles3 = _articles$articles3.filter(article => {
|
|
127
|
+
var _article$locationPric;
|
|
128
|
+
const productPrice = Number(article === null || article === void 0 || (_article$locationPric = article.locationPrices) === null || _article$locationPric === void 0 ? void 0 : _article$locationPric.priceExclVat);
|
|
129
|
+
return isTmg || productPrice > 0;
|
|
130
|
+
})) === null || _articles$articles3 === void 0 ? void 0 : _articles$articles3.map(article => {
|
|
131
|
+
var _cart$find$quantity, _cart$find, _article$locationPric2, _article$locationPric3, _article$locationPric4, _article$locationPric7, _article$locationPric8;
|
|
129
132
|
return /*#__PURE__*/_react.default.createElement(_SingleOrderProductCard.default, {
|
|
130
133
|
isTmg: isTmg,
|
|
131
134
|
branchId: selectedBranch,
|
|
@@ -137,11 +140,11 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
137
140
|
productId: article.articleNumber,
|
|
138
141
|
quantity: (_cart$find$quantity = (_cart$find = cart.find(product => product.articleNumber === article.articleNumber)) === null || _cart$find === void 0 ? void 0 : _cart$find.quantity) !== null && _cart$find$quantity !== void 0 ? _cart$find$quantity : 0,
|
|
139
142
|
isSelected: false,
|
|
140
|
-
stock: (_article$
|
|
141
|
-
isOutOfStock: (article === null || article === void 0 || (_article$
|
|
143
|
+
stock: (_article$locationPric2 = article === null || article === void 0 || (_article$locationPric3 = article.locationPrices) === null || _article$locationPric3 === void 0 || (_article$locationPric3 = _article$locationPric3.stock) === null || _article$locationPric3 === void 0 ? void 0 : _article$locationPric3.quantity) !== null && _article$locationPric2 !== void 0 ? _article$locationPric2 : 0,
|
|
144
|
+
isOutOfStock: (article === null || article === void 0 || (_article$locationPric4 = article.locationPrices) === null || _article$locationPric4 === void 0 || (_article$locationPric4 = _article$locationPric4.stock) === null || _article$locationPric4 === void 0 ? void 0 : _article$locationPric4.status) == _constants__.StockStatus.OutOfStock,
|
|
142
145
|
handleSelected: () => {
|
|
143
|
-
var _article$
|
|
144
|
-
return handleQuantityChange(article.articleNumber, 1, article === null || article === void 0 || (_article$
|
|
146
|
+
var _article$locationPric5, _article$locationPric6;
|
|
147
|
+
return handleQuantityChange(article.articleNumber, 1, article === null || article === void 0 || (_article$locationPric5 = article.locationPrices) === null || _article$locationPric5 === void 0 ? void 0 : _article$locationPric5.priceExclVat, article === null || article === void 0 || (_article$locationPric6 = article.locationPrices) === null || _article$locationPric6 === void 0 ? void 0 : _article$locationPric6.priceInclVat);
|
|
145
148
|
},
|
|
146
149
|
productUsps: [{
|
|
147
150
|
type: 'excl',
|
|
@@ -159,8 +162,8 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
159
162
|
productImage: article.image,
|
|
160
163
|
productSpecifications: (0, _product.extractProductSpecsArray)(article),
|
|
161
164
|
productTitle: article.name,
|
|
162
|
-
productPrice: Number(article === null || article === void 0 || (_article$
|
|
163
|
-
productPriceInclVat: Number(article === null || article === void 0 || (_article$
|
|
165
|
+
productPrice: Number(article === null || article === void 0 || (_article$locationPric7 = article.locationPrices) === null || _article$locationPric7 === void 0 ? void 0 : _article$locationPric7.priceExclVat).toFixed(2),
|
|
166
|
+
productPriceInclVat: Number(article === null || article === void 0 || (_article$locationPric8 = article.locationPrices) === null || _article$locationPric8 === void 0 ? void 0 : _article$locationPric8.priceInclVat).toFixed(2),
|
|
164
167
|
productType: article === null || article === void 0 ? void 0 : article.type,
|
|
165
168
|
productGroup: article === null || article === void 0 ? void 0 : article.group,
|
|
166
169
|
productSubgroup: article === null || article === void 0 ? void 0 : article.subgroup
|
|
@@ -94,6 +94,7 @@ function _toPrimitive(t, r) {
|
|
|
94
94
|
*/
|
|
95
95
|
const fetchArticlesByFilters = async filters => {
|
|
96
96
|
const articlesParamsString = new URLSearchParams((0, _index.removeNullishProps)(filters)).toString();
|
|
97
|
+
console.log('articlesParamsString:', articlesParamsString);
|
|
97
98
|
const response = await _authenticatedProxyApi.authenticatedProxyApi.getArticles(articlesParamsString);
|
|
98
99
|
if (!(response !== null && response !== void 0 && response.data)) {
|
|
99
100
|
throw new Error('No articles found');
|
|
@@ -157,10 +158,16 @@ const fetchArticlesByLicensePlateAndModel = async (filters, formula, branchId) =
|
|
|
157
158
|
exports.fetchArticlesByLicensePlateAndModel = fetchArticlesByLicensePlateAndModel;
|
|
158
159
|
const fetchArticlesByArticleNumbers = exports.fetchArticlesByArticleNumbers = async function fetchArticlesByArticleNumbers(articleNumbers) {
|
|
159
160
|
let term = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
160
|
-
|
|
161
|
+
let searchByParts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
162
|
+
let brand = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
163
|
+
const articleParamsString = new URLSearchParams(_objectSpread(_objectSpread(_objectSpread({
|
|
161
164
|
articleNumbers: JSON.stringify(articleNumbers)
|
|
162
165
|
}, term ? {
|
|
163
166
|
term
|
|
167
|
+
} : {}), searchByParts ? {
|
|
168
|
+
searchByParts
|
|
169
|
+
} : {}), brand ? {
|
|
170
|
+
brand
|
|
164
171
|
} : {})).toString();
|
|
165
172
|
const response = await _authenticatedProxyApi.authenticatedProxyApi.getArticles(articleParamsString);
|
|
166
173
|
if (!(response !== null && response !== void 0 && response.data)) {
|
|
@@ -168,7 +168,7 @@ const InternalSingleOrderPage = () => {
|
|
|
168
168
|
const handleSelectedFilterChange = (0, _react.useCallback)((filter, value) => {
|
|
169
169
|
filters.licensePlate = null;
|
|
170
170
|
filters.model = null;
|
|
171
|
-
if (['type', 'group', 'subgroup', 'articleNumber'].includes(filter)) {
|
|
171
|
+
if (['type', 'group', 'subgroup', 'articleNumber', 'brand'].includes(filter)) {
|
|
172
172
|
dispatch({
|
|
173
173
|
type: _OrderSessionContext.orderSessionActions.RESET_LICENSEPLATE_FILTERS
|
|
174
174
|
});
|
|
@@ -190,6 +190,7 @@ const InternalSingleOrderPage = () => {
|
|
|
190
190
|
group: null,
|
|
191
191
|
subgroup: null,
|
|
192
192
|
articleNumber: null,
|
|
193
|
+
brand: null,
|
|
193
194
|
model: null,
|
|
194
195
|
page: 1
|
|
195
196
|
});
|