thm-p3-configurator 0.0.185 → 0.0.187
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.
|
@@ -12,6 +12,9 @@ function _interopRequireDefault(e) {
|
|
|
12
12
|
default: e
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
+
const publicOrderClient = _axios.default.create({
|
|
16
|
+
baseURL: APP_CONFIG.proxyUrl
|
|
17
|
+
});
|
|
15
18
|
const orderClient = _axios.default.create({
|
|
16
19
|
baseURL: APP_CONFIG.apiUrl
|
|
17
20
|
});
|
|
@@ -31,13 +34,13 @@ orderClient.interceptors.request.use(config => {
|
|
|
31
34
|
});
|
|
32
35
|
const orderApi = exports.orderApi = {
|
|
33
36
|
getArticles: filters => orderClient("api/public/articles?".concat(filters)),
|
|
34
|
-
getBrands: () =>
|
|
35
|
-
getBuildYears: brand =>
|
|
37
|
+
getBrands: () => publicOrderClient('api/public/v1/configurator/makes'),
|
|
38
|
+
getBuildYears: brand => publicOrderClient("api/public/v1/configurator/makes/".concat(brand, "/years")),
|
|
36
39
|
getModels: _ref => {
|
|
37
40
|
let {
|
|
38
41
|
brand,
|
|
39
42
|
year
|
|
40
43
|
} = _ref;
|
|
41
|
-
return
|
|
44
|
+
return publicOrderClient("api/public/v1/configurator/makes/".concat(brand, "/models").concat(year ? "?year=".concat(year) : ''));
|
|
42
45
|
}
|
|
43
46
|
};
|
|
@@ -86,7 +86,7 @@ const useBrandsQuery = () => {
|
|
|
86
86
|
const brandsQuery = (0, _reactQuery.useQuery)(['brands'], {
|
|
87
87
|
queryFn: () => _orderApi.orderApi.getBrands().then(res => {
|
|
88
88
|
var _res$data;
|
|
89
|
-
return (0, _helpers__.parseArrayToInputOptions)((_res$data = res
|
|
89
|
+
return (0, _helpers__.parseArrayToInputOptions)((_res$data = res === null || res === void 0 ? void 0 : res.data) !== null && _res$data !== void 0 ? _res$data : []);
|
|
90
90
|
})
|
|
91
91
|
});
|
|
92
92
|
return {
|
|
@@ -108,7 +108,7 @@ const useBuildYearsQuery = _ref => {
|
|
|
108
108
|
enabled: !!(brand !== null && brand !== void 0 && brand.length),
|
|
109
109
|
queryFn: () => _orderApi.orderApi.getBuildYears(brand).then(res => {
|
|
110
110
|
var _res$data2;
|
|
111
|
-
return (0, _helpers__.parseArrayToInputOptions)((_res$data2 = res
|
|
111
|
+
return (0, _helpers__.parseArrayToInputOptions)((_res$data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _res$data2 !== void 0 ? _res$data2 : []);
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
114
|
return {
|
|
@@ -219,7 +219,7 @@ const useModelsQuery = _ref2 => {
|
|
|
219
219
|
year
|
|
220
220
|
}).then(res => {
|
|
221
221
|
var _res$data3;
|
|
222
|
-
return (0, _helpers__.parseArrayToInputOptions)((_res$data3 = res
|
|
222
|
+
return (0, _helpers__.parseArrayToInputOptions)((_res$data3 = res === null || res === void 0 ? void 0 : res.data) !== null && _res$data3 !== void 0 ? _res$data3 : []);
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
});
|
|
@@ -133,6 +133,15 @@ const ManualSelectionForm = _ref => {
|
|
|
133
133
|
brand: brandOption.value
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
+
if (isFilter) {
|
|
137
|
+
dispatch({
|
|
138
|
+
type: _OrderSessionContext.orderSessionActions.SET_BUILD_YEAR,
|
|
139
|
+
payload: {
|
|
140
|
+
buildYear: null
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
setFilterModel(null);
|
|
144
|
+
}
|
|
136
145
|
};
|
|
137
146
|
const handleModelChange = modelOption => {
|
|
138
147
|
if (!isFilter) {
|
|
@@ -153,6 +162,9 @@ const ManualSelectionForm = _ref => {
|
|
|
153
162
|
buildYear: buildYearOption.value
|
|
154
163
|
}
|
|
155
164
|
});
|
|
165
|
+
if (isFilter) {
|
|
166
|
+
setFilterModel(null);
|
|
167
|
+
}
|
|
156
168
|
};
|
|
157
169
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
158
170
|
className: (0, _helpers__.withStyle)("form__column col-12")
|
|
@@ -95,15 +95,18 @@ const VehicleData = _ref => {
|
|
|
95
95
|
return isTmg || key !== 'kType' && key !== 'kMod';
|
|
96
96
|
}).map(_ref3 => {
|
|
97
97
|
let [key, value] = _ref3;
|
|
98
|
-
if (!value)
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
98
|
+
if (!value) return null;
|
|
101
99
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
102
100
|
key: key + value,
|
|
103
101
|
className: (0, _helpers__.withStyle)('d-flex align-items-center justify-content-between')
|
|
104
102
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
105
103
|
className: (0, _helpers__.withStyle)('fw-bold')
|
|
106
|
-
}, (0, _lodash.capitalize)(key), ":"), /*#__PURE__*/_react.default.createElement("div",
|
|
104
|
+
}, key === 'duration' ? 'Modeljaar' : (0, _lodash.capitalize)(key), ":"), /*#__PURE__*/_react.default.createElement("div", {
|
|
105
|
+
style: {
|
|
106
|
+
fontSize: '14px'
|
|
107
|
+
},
|
|
108
|
+
className: "text-truncate"
|
|
109
|
+
}, value));
|
|
107
110
|
})
|
|
108
111
|
});
|
|
109
112
|
};
|