thm-p3-configurator 0.0.75 → 0.0.77
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/__components__/ProductCard/ProductCardSpecifications.js +3 -2
- package/dist/src/shared/__components__/ProductCard/ProductCardUsps.js +3 -2
- package/dist/src/shared/__components__/SingleOrderProductCard.js +58 -21
- package/dist/src/shared/__constants__/index.js +4 -2
- package/dist/src/shared/__containers__/BottomNavigationBar.js +36 -9
- package/dist/src/shared/__containers__/internal/InternalSingleOrderProductOverview.js +17 -4
- package/dist/src/shared/__context__/OrderSessionContext.js +12 -0
- package/dist/src/shared/__helpers__/singleOrderArticles.js +5 -6
- package/package.json +1 -1
|
@@ -17,13 +17,14 @@ function _interopRequireDefault(e) {
|
|
|
17
17
|
}
|
|
18
18
|
const ProductCardSpecifications = _ref => {
|
|
19
19
|
let {
|
|
20
|
-
specifications = []
|
|
20
|
+
specifications = [],
|
|
21
|
+
className = ''
|
|
21
22
|
} = _ref;
|
|
22
23
|
if (!specifications.length) {
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
25
26
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
26
|
-
className: (0, _helpers__.withStyle)(
|
|
27
|
+
className: (0, _helpers__.withStyle)("col-12 col-md-6 list-unstyled product-critera__text mt-2 mb-2 ".concat(className))
|
|
27
28
|
}, specifications.map(_ref2 => {
|
|
28
29
|
let {
|
|
29
30
|
key,
|
|
@@ -39,13 +39,14 @@ const ProductCardUspExclude = _ref3 => {
|
|
|
39
39
|
};
|
|
40
40
|
const ProductCardUSPS = _ref4 => {
|
|
41
41
|
let {
|
|
42
|
-
usps = []
|
|
42
|
+
usps = [],
|
|
43
|
+
className = ''
|
|
43
44
|
} = _ref4;
|
|
44
45
|
if (!usps.length) {
|
|
45
46
|
return null;
|
|
46
47
|
}
|
|
47
48
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
48
|
-
className: (0, _helpers__.withStyle)(
|
|
49
|
+
className: (0, _helpers__.withStyle)("list-check mt-2 col-12 col-md-6 ".concat(className))
|
|
49
50
|
}, usps.map((usp, key) => {
|
|
50
51
|
const {
|
|
51
52
|
type,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require("core-js/modules/es.symbol.description.js");
|
|
4
4
|
require("core-js/modules/es.weak-map.js");
|
|
5
5
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
6
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
6
7
|
require("core-js/modules/esnext.iterator.map.js");
|
|
7
8
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
8
9
|
require("core-js/modules/es.weak-map.js");
|
|
@@ -13,12 +14,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
13
14
|
exports.default = void 0;
|
|
14
15
|
require("core-js/modules/es.symbol.description.js");
|
|
15
16
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
17
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
16
18
|
require("core-js/modules/esnext.iterator.map.js");
|
|
17
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
20
|
+
var _queries = require("../__api__/queries");
|
|
18
21
|
var _NumericInput = _interopRequireDefault(require("../__components__/Form/NumericInput"));
|
|
19
22
|
var _helpers__ = require("../__helpers__");
|
|
20
23
|
var _OutlinedButton = _interopRequireDefault(require("./Buttons/OutlinedButton"));
|
|
21
24
|
var _PrimaryButton = _interopRequireDefault(require("./Buttons/PrimaryButton"));
|
|
25
|
+
var _ProductCardSpecifications = _interopRequireDefault(require("./ProductCard/ProductCardSpecifications"));
|
|
26
|
+
var _ProductCardUsps = _interopRequireDefault(require("./ProductCard/ProductCardUsps"));
|
|
22
27
|
function _interopRequireDefault(e) {
|
|
23
28
|
return e && e.__esModule ? e : {
|
|
24
29
|
default: e
|
|
@@ -77,26 +82,35 @@ const ProductSpecifications = _ref3 => {
|
|
|
77
82
|
} = _ref3;
|
|
78
83
|
return specifications && /*#__PURE__*/_react.default.createElement("div", {
|
|
79
84
|
className: (0, _helpers__.withStyle)('card-text mb-3')
|
|
80
|
-
}, /*#__PURE__*/_react.default.createElement("strong", null, "Specificaties: "), /*#__PURE__*/_react.default.createElement("br", null),
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, "Specificaties: "), /*#__PURE__*/_react.default.createElement("br", null), specifications.map((_ref4, index) => {
|
|
86
|
+
let {
|
|
87
|
+
key,
|
|
88
|
+
value
|
|
89
|
+
} = _ref4;
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
91
|
+
key: index
|
|
92
|
+
}, key, ": ", value, /*#__PURE__*/_react.default.createElement("br", null));
|
|
93
|
+
}));
|
|
83
94
|
};
|
|
84
|
-
const ProductActions =
|
|
95
|
+
const ProductActions = _ref5 => {
|
|
85
96
|
let {
|
|
86
97
|
isOutOfStock,
|
|
98
|
+
stock,
|
|
87
99
|
quantity,
|
|
88
100
|
productId,
|
|
89
101
|
handleQuantityChange,
|
|
90
102
|
handleSelected,
|
|
91
103
|
removeFromCart
|
|
92
|
-
} =
|
|
104
|
+
} = _ref5;
|
|
93
105
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
94
106
|
className: (0, _helpers__.withStyle)('d-flex justify-content-end')
|
|
95
107
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
96
108
|
className: (0, _helpers__.withStyle)('d-flex flex-column align-items-end')
|
|
97
|
-
}, isOutOfStock
|
|
109
|
+
}, isOutOfStock ? /*#__PURE__*/_react.default.createElement("div", {
|
|
98
110
|
className: (0, _helpers__.withStyle)('text-danger mb-1')
|
|
99
|
-
}, "Niet op voorraad")
|
|
111
|
+
}, "Niet op voorraad") : /*#__PURE__*/_react.default.createElement("div", {
|
|
112
|
+
className: (0, _helpers__.withStyle)('text-success mb-1')
|
|
113
|
+
}, stock, " op voorraad"), /*#__PURE__*/_react.default.createElement("div", {
|
|
100
114
|
className: (0, _helpers__.withStyle)('d-flex align-items-center')
|
|
101
115
|
}, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
|
|
102
116
|
className: (0, _helpers__.withStyle)('me-2 rounded'),
|
|
@@ -113,16 +127,14 @@ const ProductActions = _ref4 => {
|
|
|
113
127
|
label: "Verwijder"
|
|
114
128
|
}))));
|
|
115
129
|
};
|
|
116
|
-
const ProductCategories =
|
|
130
|
+
const ProductCategories = _ref6 => {
|
|
117
131
|
let {
|
|
118
132
|
productType = null,
|
|
119
133
|
productGroup = null,
|
|
120
134
|
productSubgroup = null,
|
|
121
135
|
articleNumber = null
|
|
122
|
-
} =
|
|
123
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
-
className: (0, _helpers__.withStyle)('mb-3')
|
|
125
|
-
}, articleNumber && /*#__PURE__*/_react.default.createElement("p", {
|
|
136
|
+
} = _ref6;
|
|
137
|
+
return /*#__PURE__*/_react.default.createElement("div", null, articleNumber && /*#__PURE__*/_react.default.createElement("p", {
|
|
126
138
|
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
127
139
|
}, /*#__PURE__*/_react.default.createElement("strong", null, "Artikelnummer:"), " ", articleNumber), productType && /*#__PURE__*/_react.default.createElement("p", {
|
|
128
140
|
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
@@ -132,10 +144,11 @@ const ProductCategories = _ref5 => {
|
|
|
132
144
|
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
133
145
|
}, /*#__PURE__*/_react.default.createElement("strong", null, "Subgroep:"), " ", productSubgroup));
|
|
134
146
|
};
|
|
135
|
-
const SingleOrderProductCard =
|
|
147
|
+
const SingleOrderProductCard = _ref7 => {
|
|
136
148
|
let {
|
|
137
149
|
productId,
|
|
138
150
|
isSelected,
|
|
151
|
+
stock,
|
|
139
152
|
isOutOfStock,
|
|
140
153
|
handleSelected,
|
|
141
154
|
productImage,
|
|
@@ -143,14 +156,33 @@ const SingleOrderProductCard = _ref6 => {
|
|
|
143
156
|
productGroup,
|
|
144
157
|
productSubgroup,
|
|
145
158
|
articleNumber,
|
|
159
|
+
productUsps,
|
|
146
160
|
productTitle,
|
|
147
|
-
productDescription,
|
|
148
161
|
productPrice,
|
|
149
162
|
productSpecifications,
|
|
150
163
|
quantity = 0,
|
|
151
164
|
handleQuantityChange,
|
|
152
|
-
removeFromCart
|
|
153
|
-
|
|
165
|
+
removeFromCart,
|
|
166
|
+
isModelArticle = false
|
|
167
|
+
} = _ref7;
|
|
168
|
+
const {
|
|
169
|
+
productFieldLabels
|
|
170
|
+
} = (0, _queries.useProductFieldLabels)();
|
|
171
|
+
const filteredProductSpecifications = productSpecifications.filter(_ref8 => {
|
|
172
|
+
let {
|
|
173
|
+
key
|
|
174
|
+
} = _ref8;
|
|
175
|
+
return productFieldLabels === null || productFieldLabels === void 0 ? void 0 : productFieldLabels[key];
|
|
176
|
+
}).map(_ref9 => {
|
|
177
|
+
let {
|
|
178
|
+
key,
|
|
179
|
+
value
|
|
180
|
+
} = _ref9;
|
|
181
|
+
return {
|
|
182
|
+
key: productFieldLabels[key],
|
|
183
|
+
value
|
|
184
|
+
};
|
|
185
|
+
});
|
|
154
186
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
155
187
|
key: productId + "-".concat(Date.now()),
|
|
156
188
|
className: (0, _helpers__.withStyle)("card card__horizontal card__link ".concat(isSelected ? 'active' : '', " container-fluid p-0 my-3"))
|
|
@@ -171,12 +203,17 @@ const SingleOrderProductCard = _ref6 => {
|
|
|
171
203
|
productGroup: productGroup,
|
|
172
204
|
productSubgroup: productSubgroup,
|
|
173
205
|
articleNumber: articleNumber
|
|
174
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
206
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
207
|
+
className: (0, _helpers__.withStyle)(isModelArticle ? 'd-flex justify-content-between' : '')
|
|
208
|
+
}, (productUsps === null || productUsps === void 0 ? void 0 : productUsps.length) > 0 && /*#__PURE__*/_react.default.createElement(_ProductCardUsps.default, {
|
|
209
|
+
usps: productUsps,
|
|
210
|
+
className: isModelArticle ? 'mr-2' : 'w-100'
|
|
211
|
+
}), (filteredProductSpecifications === null || filteredProductSpecifications === void 0 ? void 0 : filteredProductSpecifications.length) > 0 && /*#__PURE__*/_react.default.createElement(_ProductCardSpecifications.default, {
|
|
212
|
+
specifications: filteredProductSpecifications,
|
|
213
|
+
className: isModelArticle ? '' : 'w-100'
|
|
214
|
+
}))), /*#__PURE__*/_react.default.createElement(ProductActions, {
|
|
179
215
|
isOutOfStock: isOutOfStock,
|
|
216
|
+
stock: stock,
|
|
180
217
|
quantity: quantity,
|
|
181
218
|
productId: productId,
|
|
182
219
|
handleQuantityChange: handleQuantityChange,
|
|
@@ -84,12 +84,14 @@ const NAVIGATION_BUTTONS = exports.NAVIGATION_BUTTONS = {
|
|
|
84
84
|
to: '/configurator/offerte',
|
|
85
85
|
label: 'Mail mij de offerte',
|
|
86
86
|
type: 'prev',
|
|
87
|
-
shouldShowForDossierTypes: [DOSSIER_TYPES.Quotation]
|
|
87
|
+
shouldShowForDossierTypes: [DOSSIER_TYPES.Quotation],
|
|
88
|
+
setType: DOSSIER_TYPES.Quotation
|
|
88
89
|
}, {
|
|
89
90
|
to: '/configurator/montagelocatie',
|
|
90
91
|
label: 'Maak een afspraak',
|
|
91
92
|
type: 'next',
|
|
92
|
-
shouldShowForDossierTypes: [DOSSIER_TYPES.AppointmentRequest, DOSSIER_TYPES.PlannedAppointment]
|
|
93
|
+
shouldShowForDossierTypes: [DOSSIER_TYPES.AppointmentRequest, DOSSIER_TYPES.PlannedAppointment],
|
|
94
|
+
setType: DOSSIER_TYPES.PlannedAppointment
|
|
93
95
|
}, {
|
|
94
96
|
to: '/configurator/montagelocatie',
|
|
95
97
|
label: 'Wijzig de locatie',
|
|
@@ -86,17 +86,25 @@ const ButtonByType = _ref => {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
const BottomNavigationBar = () => {
|
|
89
|
-
var _history$location;
|
|
89
|
+
var _history$location, _history$location2;
|
|
90
90
|
const history = (0, _reactRouterDom.useHistory)();
|
|
91
91
|
const buttons = _constants__.NAVIGATION_BUTTONS === null || _constants__.NAVIGATION_BUTTONS === void 0 ? void 0 : _constants__.NAVIGATION_BUTTONS[history === null || history === void 0 || (_history$location = history.location) === null || _history$location === void 0 ? void 0 : _history$location.pathname];
|
|
92
|
-
|
|
92
|
+
let [{
|
|
93
93
|
selectedTowbar,
|
|
94
94
|
selectedCableset,
|
|
95
95
|
selectedCombiset,
|
|
96
96
|
selectedBranch,
|
|
97
97
|
existingDossierType,
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
existingDossierId,
|
|
99
|
+
allowLocationChange,
|
|
100
|
+
currentDossierType
|
|
101
|
+
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
102
|
+
if (!existingDossierType && (history === null || history === void 0 || (_history$location2 = history.location) === null || _history$location2 === void 0 ? void 0 : _history$location2.pathname) == '/configurator/overzicht') {
|
|
103
|
+
dispatch({
|
|
104
|
+
type: _OrderSessionContext.orderSessionActions.RESET_CURRENT_DOSSIER_TYPE
|
|
105
|
+
});
|
|
106
|
+
currentDossierType = null;
|
|
107
|
+
}
|
|
100
108
|
if (!(buttons !== null && buttons !== void 0 && buttons.length)) {
|
|
101
109
|
return null;
|
|
102
110
|
}
|
|
@@ -109,17 +117,21 @@ const BottomNavigationBar = () => {
|
|
|
109
117
|
}, APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement("div", {
|
|
110
118
|
className: (0, _helpers__.withStyle)('col-12 mt-2 mb-1')
|
|
111
119
|
}, /*#__PURE__*/_react.default.createElement(_InternalPriceCalculationSelector.default, null)), buttons.map(_ref2 => {
|
|
112
|
-
var _history$
|
|
120
|
+
var _history$location3;
|
|
113
121
|
let {
|
|
114
122
|
to,
|
|
115
123
|
label,
|
|
116
124
|
type,
|
|
117
|
-
shouldShowForDossierTypes = []
|
|
125
|
+
shouldShowForDossierTypes = [],
|
|
126
|
+
setType
|
|
118
127
|
} = _ref2;
|
|
119
128
|
// Note: restrict buttons depending on the existing dossier type (if we're editing a dossier)
|
|
120
129
|
if (existingDossierType && shouldShowForDossierTypes.length && !shouldShowForDossierTypes.includes(existingDossierType)) {
|
|
121
130
|
return null;
|
|
122
131
|
}
|
|
132
|
+
if (currentDossierType && !existingDossierType && shouldShowForDossierTypes.length && !shouldShowForDossierTypes.includes(currentDossierType)) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
123
135
|
if (label === _constants__.LOCATION_CHANGE_BUTTON_LABEL && to === '/configurator/montagelocatie' && allowLocationChange === false) {
|
|
124
136
|
return null;
|
|
125
137
|
}
|
|
@@ -129,15 +141,30 @@ const BottomNavigationBar = () => {
|
|
|
129
141
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
130
142
|
key: 'link-' + label,
|
|
131
143
|
className: (0, _helpers__.withStyle)("col-12 col-sm-auto d-flex order-2 order-sm-0 justify-content-".concat(buttons.length > 1 ? 'center' : 'end', " mt-1"))
|
|
132
|
-
}, /*#__PURE__*/_react.default.createElement(ButtonByType, {
|
|
144
|
+
}, /*#__PURE__*/_react.default.createElement(ButtonByType, _extends({}, setType && {
|
|
145
|
+
onClick: () => {
|
|
146
|
+
dispatch({
|
|
147
|
+
type: _OrderSessionContext.orderSessionActions.SET_CURRENT_DOSSIER_TYPE,
|
|
148
|
+
payload: {
|
|
149
|
+
currentDossierType: setType
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
console.log({
|
|
153
|
+
type: _OrderSessionContext.orderSessionActions.SET_CURRENT_DOSSIER_TYPE,
|
|
154
|
+
payload: {
|
|
155
|
+
currentDossierType: setType
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
133
160
|
type: type,
|
|
134
161
|
to: to,
|
|
135
162
|
label: label,
|
|
136
163
|
state: {
|
|
137
164
|
prevPathName: history.location.pathname
|
|
138
165
|
},
|
|
139
|
-
isDisabled: (!selectedCableset || !selectedTowbar) && !selectedCombiset && type === 'next' || type === 'next' && (history === null || history === void 0 || (_history$
|
|
140
|
-
}));
|
|
166
|
+
isDisabled: (!selectedCableset || !selectedTowbar) && !selectedCombiset && type === 'next' || type === 'next' && (history === null || history === void 0 || (_history$location3 = history.location) === null || _history$location3 === void 0 ? void 0 : _history$location3.pathname) === '/configurator/montagelocatie' && !selectedBranch
|
|
167
|
+
})));
|
|
141
168
|
})))));
|
|
142
169
|
};
|
|
143
170
|
var _default = exports.default = BottomNavigationBar;
|
|
@@ -26,10 +26,11 @@ var _DangerAlert = _interopRequireDefault(require("../../__components__/DangerAl
|
|
|
26
26
|
var _EmptyState = _interopRequireDefault(require("../../__components__/EmptyState"));
|
|
27
27
|
var _Pagination = _interopRequireDefault(require("../../__components__/Pagination"));
|
|
28
28
|
var _SingleOrderProductCard = _interopRequireDefault(require("../../__components__/SingleOrderProductCard"));
|
|
29
|
+
var _constants__ = require("../../__constants__");
|
|
29
30
|
var _FormulaContext = require("../../__context__/FormulaContext");
|
|
30
31
|
var _OrderSessionContext = require("../../__context__/OrderSessionContext");
|
|
31
32
|
var _helpers__ = require("../../__helpers__");
|
|
32
|
-
var
|
|
33
|
+
var _product = require("../../__helpers__/product");
|
|
33
34
|
function _interopRequireDefault(e) {
|
|
34
35
|
return e && e.__esModule ? e : {
|
|
35
36
|
default: e
|
|
@@ -124,20 +125,32 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
124
125
|
message: "Geen producten gevonden.",
|
|
125
126
|
subMessage: "Probeer een ander filter toe te passen."
|
|
126
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 ? void 0 : _articles$articles3.map(article => {
|
|
127
|
-
var _cart$find$quantity, _cart$find, _article$locationPric, _article$consumerPric;
|
|
128
|
+
var _cart$find$quantity, _cart$find, _article$locationPric, _article$locationPric2, _article$locationPric3, _article$consumerPric;
|
|
128
129
|
return /*#__PURE__*/_react.default.createElement(_SingleOrderProductCard.default, {
|
|
129
130
|
key: article.articleNumber,
|
|
131
|
+
isModelArticle: Boolean(model || licensePlate),
|
|
130
132
|
removeFromCart: () => _removeFromCart(article.articleNumber),
|
|
131
133
|
productId: article.articleNumber,
|
|
132
134
|
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,
|
|
133
135
|
isSelected: false,
|
|
134
|
-
|
|
136
|
+
stock: (_article$locationPric = article === null || article === void 0 || (_article$locationPric2 = article.locationPrices) === null || _article$locationPric2 === void 0 || (_article$locationPric2 = _article$locationPric2.stock) === null || _article$locationPric2 === void 0 ? void 0 : _article$locationPric2.quantity) !== null && _article$locationPric !== void 0 ? _article$locationPric : 0,
|
|
137
|
+
isOutOfStock: (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.status) == _constants__.StockStatus.OutOfStock,
|
|
135
138
|
handleSelected: () => handleQuantityChange(article.articleNumber, 1),
|
|
139
|
+
productUsps: [{
|
|
140
|
+
type: 'excl',
|
|
141
|
+
text: article === null || article === void 0 ? void 0 : article.excl
|
|
142
|
+
}, {
|
|
143
|
+
type: 'incl',
|
|
144
|
+
text: article === null || article === void 0 ? void 0 : article.incl
|
|
145
|
+
}, {
|
|
146
|
+
type: 'remark',
|
|
147
|
+
text: article === null || article === void 0 ? void 0 : article.remark
|
|
148
|
+
}],
|
|
136
149
|
articleNumber: article.articleNumber,
|
|
137
150
|
handleQuantityChange: handleQuantityChange,
|
|
138
|
-
productSpecifications: article === null || article === void 0 ? void 0 : article.specifications,
|
|
139
151
|
productDescription: article === null || article === void 0 ? void 0 : article.description,
|
|
140
152
|
productImage: article.image,
|
|
153
|
+
productSpecifications: (0, _product.extractProductSpecsArray)(article),
|
|
141
154
|
productTitle: article.name,
|
|
142
155
|
productPrice: Number(article === null || article === void 0 || (_article$consumerPric = article.consumerPrices) === null || _article$consumerPric === void 0 ? void 0 : _article$consumerPric.priceInclVat).toFixed(2),
|
|
143
156
|
productType: article === null || article === void 0 ? void 0 : article.type,
|
|
@@ -102,6 +102,7 @@ OrderSessionContext.displayName = 'OrderSessionContext';
|
|
|
102
102
|
const INITIAL_ORDER_SESSION_STATE = {
|
|
103
103
|
isTouched: false,
|
|
104
104
|
existingDossierId: null,
|
|
105
|
+
currentDossierType: null,
|
|
105
106
|
existingDossierType: null,
|
|
106
107
|
licensePlate: null,
|
|
107
108
|
buildYear: null,
|
|
@@ -174,6 +175,8 @@ const orderSessionActions = exports.orderSessionActions = {
|
|
|
174
175
|
SET_DURATION_OPTIONS: 'SET_DURATION_OPTIONS',
|
|
175
176
|
SET_EXECUTION1_OPTIONS: 'SET_EXECUTION1_OPTIONS',
|
|
176
177
|
SET_EXECUTION2_OPTIONS: 'SET_EXECUTION2_OPTIONS',
|
|
178
|
+
SET_CURRENT_DOSSIER_TYPE: 'SET_CURRENT_DOSSIER_TYPE',
|
|
179
|
+
RESET_CURRENT_DOSSIER_TYPE: 'RESET_CURRENT_DOSSIER_TYPE',
|
|
177
180
|
CLEAR_ANSWERS: 'CLEAR_ANSWERS',
|
|
178
181
|
SET_SELECTED_TOWBAR: 'SET_SELECTED_TOWBAR',
|
|
179
182
|
SET_SELECTED_CABLESET: 'SET_SELECTED_CABLESET',
|
|
@@ -335,6 +338,15 @@ const orderSessionReducer = (state, action) => {
|
|
|
335
338
|
model: null
|
|
336
339
|
});
|
|
337
340
|
}
|
|
341
|
+
case orderSessionActions.SET_CURRENT_DOSSIER_TYPE:
|
|
342
|
+
{
|
|
343
|
+
const {
|
|
344
|
+
currentDossierType
|
|
345
|
+
} = action.payload;
|
|
346
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
347
|
+
currentDossierType
|
|
348
|
+
});
|
|
349
|
+
}
|
|
338
350
|
case orderSessionActions.SET_LICENSE_PLATE:
|
|
339
351
|
{
|
|
340
352
|
const {
|
|
@@ -38,8 +38,8 @@ var _authenticatedProxyApi = require("../__api__/authenticatedProxyApi");
|
|
|
38
38
|
var _orderApi = require("../__api__/orderApi");
|
|
39
39
|
var _index = require("./index");
|
|
40
40
|
var _logoPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-primary.png"));
|
|
41
|
-
var _image = require("../__helpers__/image");
|
|
42
41
|
var _index2 = require("../__constants__/index");
|
|
42
|
+
var _image = require("../__helpers__/image");
|
|
43
43
|
function _interopRequireDefault(e) {
|
|
44
44
|
return e && e.__esModule ? e : {
|
|
45
45
|
default: e
|
|
@@ -217,8 +217,7 @@ const enrichArticlesWithBrandsAndPrices = async (articles, branchId, formula) =>
|
|
|
217
217
|
exports.enrichArticlesWithBrandsAndPrices = enrichArticlesWithBrandsAndPrices;
|
|
218
218
|
const formatModelArticle = article => {
|
|
219
219
|
var _ref3, _article$name, _ref4, _article$description$, _article$description, _article$boldDescript, _article$boldDescript2, _article$specificatio, _article$images, _article$images2, _article$articleNumbe, _article$type, _article$group, _article$subgroup;
|
|
220
|
-
|
|
221
|
-
return {
|
|
220
|
+
return _objectSpread(_objectSpread({}, article), {}, {
|
|
222
221
|
name: (_ref3 = (_article$name = article.name) !== null && _article$name !== void 0 ? _article$name : article === null || article === void 0 ? void 0 : article.title) !== null && _ref3 !== void 0 ? _ref3 : null,
|
|
223
222
|
description: (_ref4 = (_article$description$ = article === null || article === void 0 || (_article$description = article.description) === null || _article$description === void 0 || (_article$description = _article$description.ops) === null || _article$description === void 0 || (_article$description = _article$description[0]) === null || _article$description === void 0 ? void 0 : _article$description.insert) !== null && _article$description$ !== void 0 ? _article$description$ : article === null || article === void 0 ? void 0 : article.remark) !== null && _ref4 !== void 0 ? _ref4 : null,
|
|
224
223
|
subTitle: (_article$boldDescript = article === null || article === void 0 || (_article$boldDescript2 = article.boldDescription) === null || _article$boldDescript2 === void 0 || (_article$boldDescript2 = _article$boldDescript2.ops) === null || _article$boldDescript2 === void 0 || (_article$boldDescript2 = _article$boldDescript2[0]) === null || _article$boldDescript2 === void 0 ? void 0 : _article$boldDescript2.insert) !== null && _article$boldDescript !== void 0 ? _article$boldDescript : null,
|
|
@@ -230,7 +229,7 @@ const formatModelArticle = article => {
|
|
|
230
229
|
type: article === null || article === void 0 || (_article$type = article.type) === null || _article$type === void 0 ? void 0 : _article$type.title,
|
|
231
230
|
group: article === null || article === void 0 || (_article$group = article.group) === null || _article$group === void 0 ? void 0 : _article$group.title,
|
|
232
231
|
subgroup: article === null || article === void 0 || (_article$subgroup = article.subgroup) === null || _article$subgroup === void 0 ? void 0 : _article$subgroup.title
|
|
233
|
-
};
|
|
232
|
+
});
|
|
234
233
|
};
|
|
235
234
|
const formatGenericArticle = article => {
|
|
236
235
|
var _article$images3, _article$images4, _article$articleNumbe2, _article$type2, _article$group2, _article$subgroup2;
|
|
@@ -242,7 +241,7 @@ const formatGenericArticle = article => {
|
|
|
242
241
|
let [label, value] = _ref6;
|
|
243
242
|
return "".concat(label, ": ").concat(value);
|
|
244
243
|
}).join(' \n ');
|
|
245
|
-
return {
|
|
244
|
+
return _objectSpread(_objectSpread({}, article), {}, {
|
|
246
245
|
name: article.name,
|
|
247
246
|
description: null,
|
|
248
247
|
subTitle: null,
|
|
@@ -254,5 +253,5 @@ const formatGenericArticle = article => {
|
|
|
254
253
|
type: article === null || article === void 0 || (_article$type2 = article.type) === null || _article$type2 === void 0 ? void 0 : _article$type2.title,
|
|
255
254
|
group: article === null || article === void 0 || (_article$group2 = article.group) === null || _article$group2 === void 0 ? void 0 : _article$group2.title,
|
|
256
255
|
subgroup: article === null || article === void 0 || (_article$subgroup2 = article.subgroup) === null || _article$subgroup2 === void 0 ? void 0 : _article$subgroup2.title
|
|
257
|
-
};
|
|
256
|
+
});
|
|
258
257
|
};
|