thm-p3-configurator 0.0.252 → 0.0.254

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.
@@ -29,7 +29,6 @@ var _TEST_ONLY_INTERNAL_ROUTES = _interopRequireDefault(require("./__pages__/int
29
29
  var _Experiments = _interopRequireDefault(require("./__services__/Experiments"));
30
30
  var _mainExternal = _interopRequireDefault(require("./__style__/main-external.scss"));
31
31
  var _main = _interopRequireDefault(require("./__style__/main.scss"));
32
- var _index = _interopRequireDefault(require("./__pages__/index"));
33
32
  function _interopRequireDefault(e) {
34
33
  return e && e.__esModule ? e : {
35
34
  default: e
@@ -70,7 +69,7 @@ const App = () => {
70
69
  (0, _Experiments.default)();
71
70
  });
72
71
  return /*#__PURE__*/_react.default.createElement(_SentryWrapper.default, null, /*#__PURE__*/_react.default.createElement(_FormulaContext.FormulaController, {
73
- defaultFormula: _constants__.CONFIGURATOR_FORMULAS.TMG
72
+ defaultFormula: _constants__.CONFIGURATOR_FORMULAS.TOW
74
73
  }, /*#__PURE__*/_react.default.createElement(_CountryContext.CountryController, {
75
74
  defaultCountry: APP_CONFIG.country
76
75
  }, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
@@ -24,12 +24,14 @@ const FORM_ERROR_MESSAGES = exports.FORM_ERROR_MESSAGES = {
24
24
  const BRANCH_FORMULAS = exports.BRANCH_FORMULAS = {
25
25
  Trekhaakcentrum: 'Trekhaakcentrum',
26
26
  TowMotiveGroup: 'TowMotive Group',
27
+ TowMotive: 'TowMotive',
27
28
  Trekhaakmontage: 'Trekhaakmontage'
28
29
  };
29
30
  const BRANCH_THEME_BY_FORMULA = exports.BRANCH_THEME_BY_FORMULA = {
30
31
  Trekhaakcentrum: 'thc',
31
32
  Trekhaakmontage: 'thm',
32
- TowMotiveGroup: 'tmg'
33
+ TowMotiveGroup: 'tmg',
34
+ TowMotive: 'tmg'
33
35
  };
34
36
  const PARTNER_PORTAL_PAGE_TITLES_BY_THEME = exports.PARTNER_PORTAL_PAGE_TITLES_BY_THEME = {
35
37
  [BRANCH_THEME_BY_FORMULA.Trekhaakmontage]: 'Trekhaakmontage - Partner Portal',
@@ -213,7 +215,8 @@ const CONFIGURATOR_FORMULAS = exports.CONFIGURATOR_FORMULAS = {
213
215
  THM: 'THM',
214
216
  THC: 'THC',
215
217
  TMG: 'TMG',
216
- TM: 'TMG',
218
+ TOW: 'TOW',
219
+ TM: 'TOW',
217
220
  TH: 'TH',
218
221
  TowMotive: 'TowMotive'
219
222
  };
@@ -239,14 +242,14 @@ const NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NO_PRODUCTS_CONTACT_DETAI
239
242
  companyName: 'TowMotive Group',
240
243
  logoAltText: 'TowMotive Group Logo'
241
244
  },
242
- [CONFIGURATOR_FORMULAS.TH]: {
245
+ [CONFIGURATOR_FORMULAS.TOW]: {
243
246
  email: 'order@towmotivegroup.com',
244
247
  phoneDisplay: '+31 85 - 203 0167',
245
248
  phoneHref: 'tel:+31852030167',
246
249
  companyName: 'TowMotive Group',
247
250
  logoAltText: 'TowMotive Group Logo'
248
251
  },
249
- [CONFIGURATOR_FORMULAS.TowMotive]: {
252
+ [CONFIGURATOR_FORMULAS.TH]: {
250
253
  email: 'order@towmotivegroup.com',
251
254
  phoneDisplay: '+31 85 - 203 0167',
252
255
  phoneHref: 'tel:+31852030167',
@@ -263,10 +266,12 @@ const TMG_ORGANIZATION_TYPE = exports.TMG_ORGANIZATION_TYPE = 'TowMotive Group';
263
266
  const mapBranchFormulaToConfiguratorFormula = branchFormula => {
264
267
  if (!branchFormula) return CONFIGURATOR_FORMULAS.THM;
265
268
  switch (branchFormula.toLowerCase()) {
266
- case 'towmotive':
269
+ case 'tow':
270
+ case 'tm':
267
271
  case 'th':
268
- return CONFIGURATOR_FORMULAS.TowMotive;
272
+ return CONFIGURATOR_FORMULAS.TOW;
269
273
  case 'tmg':
274
+ case 'towmotive group':
270
275
  return CONFIGURATOR_FORMULAS.TMG;
271
276
  case 'thc':
272
277
  return CONFIGURATOR_FORMULAS.THC;
@@ -256,9 +256,21 @@ const InternalBranchSelectorModal = () => {
256
256
  isLoadingMyBranches
257
257
  } = (0, _queries.useMyBranches)(formula);
258
258
  const shouldAutoSelect = _react.default.useMemo(() => {
259
- if (isSingleOrderPage) return false;
260
- return !existingDossierId && !isTMGOrganization && !selectedBranch && (myBranches === null || myBranches === void 0 ? void 0 : myBranches.length) === 1;
261
- }, [existingDossierId, isTMGOrganization, selectedBranch, myBranches, isSingleOrderPage]);
259
+ return !existingDossierId && !isTMGOrganization && !selectedBranch && (myBranches === null || myBranches === void 0 ? void 0 : myBranches.length) === 1 && !isLoadingMyBranches;
260
+ }, [existingDossierId, isTMGOrganization, selectedBranch, myBranches, isLoadingMyBranches]);
261
+ (0, _react.useEffect)(() => {
262
+ var _myBranches$;
263
+ if (!shouldAutoSelect) return;
264
+ const onlyBranchId = myBranches === null || myBranches === void 0 || (_myBranches$ = myBranches[0]) === null || _myBranches$ === void 0 ? void 0 : _myBranches$.entityId;
265
+ if (!onlyBranchId) return;
266
+ dispatch({
267
+ type: _OrderSessionContext.orderSessionActions.SET_SELECTED_BRANCH,
268
+ payload: {
269
+ branchId: onlyBranchId
270
+ }
271
+ });
272
+ _setSelectedBranchId(onlyBranchId);
273
+ }, [shouldAutoSelect, myBranches, dispatch]);
262
274
  const handlePrimaryButtonClicked = () => {
263
275
  dispatch({
264
276
  type: _OrderSessionContext.orderSessionActions.SET_SELECTED_BRANCH,
@@ -267,13 +279,18 @@ const InternalBranchSelectorModal = () => {
267
279
  }
268
280
  });
269
281
  };
270
- const shouldShowModalForSingleOrder = APP_CONFIG.internal && !selectedBranch && !existingDossierId && isSingleOrderPage;
282
+ const shouldShowModalForSingleOrder = APP_CONFIG.internal && !selectedBranch && !existingDossierId && isSingleOrderPage && !shouldAutoSelect;
271
283
  const shouldShowModalForOtherPages = APP_CONFIG.internal && !selectedBranch && !existingDossierId && !isSingleOrderPage && !isTMGOrganization && !shouldAutoSelect && !isLoadingMyBranches;
272
284
  if (isLoadingBranchTypes || isLoadingMyBranches) {
273
285
  return /*#__PURE__*/_react.default.createElement("div", {
274
286
  className: "thm-configurator-wrapper--offset"
275
287
  }, /*#__PURE__*/_react.default.createElement(_FullPageSpinner.default, null));
276
288
  }
289
+
290
+ // Skip modal entirely when auto-selecting the single available branch
291
+ if (shouldAutoSelect) {
292
+ return null;
293
+ }
277
294
  if ((shouldShowModalForSingleOrder || shouldShowModalForOtherPages) && isTMGOrganization && formula === _constants__.CONFIGURATOR_FORMULAS.TMG && !orderType) {
278
295
  return /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorModal.default, {
279
296
  isOpen: true
@@ -50,6 +50,7 @@ const useBranchTheme = () => {
50
50
  }
51
51
  case _constants__.BRANCH_FORMULAS.TowMotiveGroup:
52
52
  case _constants__.CONFIGURATOR_FORMULAS.TMG:
53
+ case _constants__.CONFIGURATOR_FORMULAS.TOW:
53
54
  case _constants__.CONFIGURATOR_FORMULAS.TH:
54
55
  case _constants__.CONFIGURATOR_FORMULAS.TowMotive:
55
56
  {
@@ -18,8 +18,8 @@ $secondary: #0f1223;
18
18
  $custom-secondary: #f8be2c87;
19
19
  $custom-primary: #f8bd2c;
20
20
  // TMG theme colors
21
- $tmg-primary: #000;
22
- $tmg-secondary: #41bbca;
21
+ $tmg-primary: #41bbca;
22
+ $tmg-secondary: #000;
23
23
  $success: $green;
24
24
  $info: $cyan;
25
25
  $warning: $yellow;
@@ -67,6 +67,18 @@ Configurator TMG theme
67
67
  border-color: $tmg-primary !important;
68
68
  }
69
69
 
70
+ .btn-outline-primary {
71
+ border-color: $tmg-primary;
72
+ color: $tmg-primary;
73
+
74
+ &:hover,
75
+ &.active {
76
+ background-color: $tmg-primary;
77
+ border-color: $tmg-primary;
78
+ color: white;
79
+ }
80
+ }
81
+
70
82
  .btn-outline-theme-primary {
71
83
  border-color: $tmg-primary;
72
84
  color: $tmg-primary;
@@ -93,6 +105,12 @@ Configurator TMG theme
93
105
  &:hover {
94
106
  @extend .bg-tmg-secondary;
95
107
  }
108
+
109
+ &.active {
110
+ background-color: $tmg-primary;
111
+ border-color: $tmg-primary;
112
+ color: white;
113
+ }
96
114
  }
97
115
 
98
116
  .list-check {
@@ -150,6 +168,21 @@ Configurator TMG theme
150
168
  border-color: $tmg-primary !important;
151
169
  }
152
170
  }
171
+
172
+ // Form select focus styling
173
+ .form-select {
174
+ &[class*='is-focused'] {
175
+ border-color: lighten($tmg-secondary, 10%) !important;
176
+ box-shadow: 0 0 0 0.2rem rgba($tmg-secondary, 0.5) !important;
177
+ }
178
+ }
179
+
180
+ // Form label styling
181
+ .form-label {
182
+ span {
183
+ color: $tmg-primary;
184
+ }
185
+ }
153
186
  }
154
187
  }
155
188
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.252",
3
+ "version": "0.0.254",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",