thm-p3-configurator 0.0.190 → 0.0.192
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.STATUS_ASSESSMENT = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.ORDER_SESSION_KEY = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCATION_TYPE = exports.LOCATION_CHANGE_BUTTON_LABEL = exports.LOCALE = exports.LEASE_TYPE_ID = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.CONFIGURATOR_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
|
|
6
|
+
exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.STATUS_ASSESSMENT = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.PARTNER_PORTAL_PAGE_TITLES_BY_THEME = exports.ORDER_SESSION_KEY = exports.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCATION_TYPE = exports.LOCATION_CHANGE_BUTTON_LABEL = exports.LOCALE = exports.LEASE_TYPE_ID = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.CONFIGURATOR_FORMULAS = exports.BRANCH_THEME_BY_FORMULA = exports.BRANCH_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
|
|
7
7
|
const DOSSIER_TYPES = exports.DOSSIER_TYPES = {
|
|
8
8
|
Quotation: 'quotation',
|
|
9
9
|
AppointmentRequest: 'appointment-request',
|
|
@@ -21,6 +21,21 @@ const FORM_ERROR_MESSAGES = exports.FORM_ERROR_MESSAGES = {
|
|
|
21
21
|
licensePlateMin: 'Kenteken moet minimaal 6 characters bevatten',
|
|
22
22
|
licensePlateMax: 'Kenteken mag maximaal 8 characters bevatten'
|
|
23
23
|
};
|
|
24
|
+
const BRANCH_FORMULAS = exports.BRANCH_FORMULAS = {
|
|
25
|
+
Trekhaakcentrum: 'Trekhaakcentrum',
|
|
26
|
+
TowMotiveGroup: 'TowMotive Group',
|
|
27
|
+
Trekhaakmontage: 'Trekhaakmontage'
|
|
28
|
+
};
|
|
29
|
+
const BRANCH_THEME_BY_FORMULA = exports.BRANCH_THEME_BY_FORMULA = {
|
|
30
|
+
Trekhaakcentrum: 'thc',
|
|
31
|
+
Trekhaakmontage: 'thm',
|
|
32
|
+
TowMotiveGroup: 'tmg'
|
|
33
|
+
};
|
|
34
|
+
const PARTNER_PORTAL_PAGE_TITLES_BY_THEME = exports.PARTNER_PORTAL_PAGE_TITLES_BY_THEME = {
|
|
35
|
+
[BRANCH_THEME_BY_FORMULA.Trekhaakmontage]: 'Trekhaakmontage - Partner Portal',
|
|
36
|
+
[BRANCH_THEME_BY_FORMULA.Trekhaakcentrum]: 'Trekhaakcentrum - Partner Portal',
|
|
37
|
+
[BRANCH_THEME_BY_FORMULA.TowMotiveGroup]: 'TowMotive Group - Partner Portal'
|
|
38
|
+
};
|
|
24
39
|
const DAY_NAMES = exports.DAY_NAMES = {
|
|
25
40
|
monday: 'Maandag',
|
|
26
41
|
tuesday: 'Dinsdag',
|
|
@@ -191,6 +206,29 @@ const CONFIGURATOR_FORMULAS = exports.CONFIGURATOR_FORMULAS = {
|
|
|
191
206
|
THC: 'THC',
|
|
192
207
|
TMG: 'TMG'
|
|
193
208
|
};
|
|
209
|
+
const NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = {
|
|
210
|
+
[CONFIGURATOR_FORMULAS.THM]: {
|
|
211
|
+
email: 'order@trekhaakcentrum.nl',
|
|
212
|
+
phoneDisplay: '+31 85 - 000 4123',
|
|
213
|
+
phoneHref: 'tel:+31850004123',
|
|
214
|
+
companyName: 'Trekhaakcentrum',
|
|
215
|
+
logoAltText: 'Trekhaakcentrum Logo'
|
|
216
|
+
},
|
|
217
|
+
[CONFIGURATOR_FORMULAS.THC]: {
|
|
218
|
+
email: 'order@trekhaakcentrum.nl',
|
|
219
|
+
phoneDisplay: '+31 85 - 000 4123',
|
|
220
|
+
phoneHref: 'tel:+31850004123',
|
|
221
|
+
companyName: 'Trekhaakcentrum',
|
|
222
|
+
logoAltText: 'Trekhaakcentrum Logo'
|
|
223
|
+
},
|
|
224
|
+
[CONFIGURATOR_FORMULAS.TMG]: {
|
|
225
|
+
email: 'order@towmotivegroup.com',
|
|
226
|
+
phoneDisplay: '+31 85 - 203 0167',
|
|
227
|
+
phoneHref: 'tel:+31852030167',
|
|
228
|
+
companyName: 'TowMotive Group',
|
|
229
|
+
logoAltText: 'TowMotive Group Logo'
|
|
230
|
+
}
|
|
231
|
+
};
|
|
194
232
|
const LOCATION_CHANGE_BUTTON_LABEL = exports.LOCATION_CHANGE_BUTTON_LABEL = 'Wijzig de locatie';
|
|
195
233
|
const TMG_ORGANIZATION_TYPE = exports.TMG_ORGANIZATION_TYPE = 'TowMotive Group';
|
|
196
234
|
const LOCATION_TYPE = exports.LOCATION_TYPE = 'Vestiging';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useBranchTheme = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _constants__ = require("../__constants__");
|
|
9
|
+
var _LocalStorageWorker = require("../__services__/LocalStorageWorker");
|
|
10
|
+
var _FormulaContext = require("../__context__/FormulaContext");
|
|
11
|
+
/**
|
|
12
|
+
* @description Returns the theme of the partner portal based on the currently selected branch
|
|
13
|
+
* - If the branch type is TowMotive group: return tmg theme
|
|
14
|
+
* - Otherwise, check the branch formula and return the corresponding theme
|
|
15
|
+
* - Caches the last used theme in localstorage and updates it when the current branch theme changes (to persist themes even when the user is logged out)
|
|
16
|
+
*/
|
|
17
|
+
const useBranchTheme = () => {
|
|
18
|
+
const formula = (0, _FormulaContext.useFormula)();
|
|
19
|
+
const cachedTheme = _LocalStorageWorker.lsw.get(_constants__.LAST_USED_THEME_KEY);
|
|
20
|
+
console.log(_constants__.BRANCH_FORMULAS);
|
|
21
|
+
console.log(formula.toLowerCase());
|
|
22
|
+
const currentTheme = (0, _react.useMemo)(() => {
|
|
23
|
+
if (!formula) {
|
|
24
|
+
return cachedTheme || _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakmontage;
|
|
25
|
+
}
|
|
26
|
+
switch (formula) {
|
|
27
|
+
case _constants__.BRANCH_FORMULAS.Trekhaakmontage:
|
|
28
|
+
{
|
|
29
|
+
return _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakmontage;
|
|
30
|
+
}
|
|
31
|
+
case _constants__.BRANCH_FORMULAS.Trekhaakcentrum:
|
|
32
|
+
{
|
|
33
|
+
return _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum;
|
|
34
|
+
}
|
|
35
|
+
case _constants__.BRANCH_FORMULAS.TowMotiveGroup:
|
|
36
|
+
{
|
|
37
|
+
return _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup;
|
|
38
|
+
}
|
|
39
|
+
default:
|
|
40
|
+
{
|
|
41
|
+
return cachedTheme;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, [cachedTheme, formula]);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @description Updates the last used theme value in LS with the current theme
|
|
48
|
+
*/
|
|
49
|
+
(0, _react.useEffect)(() => {
|
|
50
|
+
if (currentTheme) {
|
|
51
|
+
_LocalStorageWorker.lsw.set(_constants__.LAST_USED_THEME_KEY, currentTheme);
|
|
52
|
+
}
|
|
53
|
+
}, [currentTheme]);
|
|
54
|
+
return currentTheme;
|
|
55
|
+
};
|
|
56
|
+
exports.useBranchTheme = useBranchTheme;
|
|
@@ -49,6 +49,7 @@ function _interopRequireWildcard(e, r) {
|
|
|
49
49
|
const NoProductsPage = () => {
|
|
50
50
|
const mailLinkRef = (0, _react.useRef)(null);
|
|
51
51
|
const formula = (0, _FormulaContext.useFormula)();
|
|
52
|
+
const contactDetails = _constants__.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA[formula] || _constants__.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA[_constants__.CONFIGURATOR_FORMULAS.THM];
|
|
52
53
|
const handleClick = () => {
|
|
53
54
|
if (mailLinkRef.current) {
|
|
54
55
|
mailLinkRef.current.click();
|
|
@@ -59,7 +60,7 @@ const NoProductsPage = () => {
|
|
|
59
60
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
60
61
|
className: (0, _helpers__.withStyle)('thm-configurator-home__logo img-fluid'),
|
|
61
62
|
src: _logoPrimaryIcon.default,
|
|
62
|
-
alt:
|
|
63
|
+
alt: contactDetails.logoAltText
|
|
63
64
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
64
65
|
className: (0, _helpers__.withStyle)('container')
|
|
65
66
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -73,8 +74,8 @@ const NoProductsPage = () => {
|
|
|
73
74
|
className: (0, _helpers__.withStyle)('text-center mb-2')
|
|
74
75
|
}, "We hebben geen trekhaak voor uw auto in ons systeem kunnen vinden"), /*#__PURE__*/_react.default.createElement("p", {
|
|
75
76
|
className: (0, _helpers__.withStyle)('mb-4 text-center')
|
|
76
|
-
}, "Dit betekent niet dat er geen trekhaak op uw auto gemonteerd kan worden. Een van onze medewerkers kijkt graag met u mee naar de mogelijkheden. Neem hiervoor contact met ons op via mail
|
|
77
|
-
href: "mailto:
|
|
77
|
+
}, "Dit betekent niet dat er geen trekhaak op uw auto gemonteerd kan worden. Een van onze medewerkers kijkt graag met u mee naar de mogelijkheden. Neem hiervoor contact met ons op via mail", ' ', contactDetails.email, " of bel ons op", ' ', contactDetails.phoneDisplay, "."), /*#__PURE__*/_react.default.createElement("a", {
|
|
78
|
+
href: "mailto:".concat(contactDetails.email),
|
|
78
79
|
"aria-hidden": true,
|
|
79
80
|
hidden: true,
|
|
80
81
|
className: (0, _helpers__.withStyle)('d-none'),
|
|
@@ -84,7 +85,7 @@ const NoProductsPage = () => {
|
|
|
84
85
|
}, /*#__PURE__*/_react.default.createElement(_PrimaryButton.default, {
|
|
85
86
|
isDisabled: false,
|
|
86
87
|
onClick: handleClick,
|
|
87
|
-
label: "Mail
|
|
88
|
+
label: "Mail ".concat(contactDetails.email)
|
|
88
89
|
}), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
89
90
|
to: '/configurator',
|
|
90
91
|
variant: "outline-primary",
|
|
@@ -49,6 +49,7 @@ function _interopRequireWildcard(e, r) {
|
|
|
49
49
|
const InternalNoProductsPage = () => {
|
|
50
50
|
const mailLinkRef = (0, _react.useRef)(null);
|
|
51
51
|
const formula = (0, _FormulaContext.useFormula)();
|
|
52
|
+
const contactDetails = _constants__.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA[formula] || _constants__.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA[_constants__.CONFIGURATOR_FORMULAS.THM];
|
|
52
53
|
const handleClick = () => {
|
|
53
54
|
if (mailLinkRef.current) {
|
|
54
55
|
mailLinkRef.current.click();
|
|
@@ -71,8 +72,8 @@ const InternalNoProductsPage = () => {
|
|
|
71
72
|
className: (0, _helpers__.withStyle)('text-center mb-2')
|
|
72
73
|
}, "We hebben geen trekhaak voor uw auto in ons systeem kunnen vinden"), /*#__PURE__*/_react.default.createElement("p", {
|
|
73
74
|
className: (0, _helpers__.withStyle)('mb-4 text-center')
|
|
74
|
-
}, "Dit betekent niet dat er geen trekhaak op uw auto gemonteerd kan worden. Een van onze medewerkers kijkt graag met u mee naar de mogelijkheden. Neem hiervoor contact met ons op via mail
|
|
75
|
-
href: "mailto:
|
|
75
|
+
}, "Dit betekent niet dat er geen trekhaak op uw auto gemonteerd kan worden. Een van onze medewerkers kijkt graag met u mee naar de mogelijkheden. Neem hiervoor contact met ons op via mail ", contactDetails.email, " of bel ons op", ' ', contactDetails.phoneDisplay, "."), /*#__PURE__*/_react.default.createElement("a", {
|
|
76
|
+
href: "mailto:".concat(contactDetails.email),
|
|
76
77
|
"aria-hidden": true,
|
|
77
78
|
hidden: true,
|
|
78
79
|
className: (0, _helpers__.withStyle)('d-none'),
|
|
@@ -82,7 +83,7 @@ const InternalNoProductsPage = () => {
|
|
|
82
83
|
}, /*#__PURE__*/_react.default.createElement(_PrimaryButton.default, {
|
|
83
84
|
isDisabled: false,
|
|
84
85
|
onClick: handleClick,
|
|
85
|
-
label: "Mail
|
|
86
|
+
label: "Mail ".concat(contactDetails.email)
|
|
86
87
|
}), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
87
88
|
to: '/configurator',
|
|
88
89
|
variant: "outline-primary",
|