@legalplace/wizardx-core 4.16.2 → 4.17.1

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.
@@ -38,42 +38,45 @@ function* setFetchModelToNonBlocking(firstCurrentAppState) {
38
38
  yield put(fetchModelNonBlockingAction());
39
39
  }
40
40
  function* getClientConfig(permalink, uniqid) {
41
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
41
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
42
42
  let clientConfigResponse = yield call(fetch, ...getClientConfigArguments(permalink, uniqid));
43
43
  if (clientConfigResponse === undefined) {
44
44
  throw new Error("Unable to fetch client config, we did not receive any response");
45
45
  }
46
46
  clientConfigResponse = yield call([clientConfigResponse, "json"]);
47
- const { apiEndpoint, userSpaceEndpoint } = clientConfigResponse.clientConfig.metadata || {};
47
+ const { apiEndpoint, userSpaceEndpoint, theme } = clientConfigResponse.clientConfig.metadata || {};
48
48
  if (!getConfig().disableRemoteConfig && (apiEndpoint || userSpaceEndpoint)) {
49
49
  updateConfig(Object.assign(Object.assign(Object.assign({}, getConfig()), (apiEndpoint && { apiEndpoint })), (userSpaceEndpoint && { userSpaceEndpoint })));
50
50
  }
51
+ if (((_a = theme === null || theme === void 0 ? void 0 : theme.params) === null || _a === void 0 ? void 0 : _a.hasPartner) && clientConfigResponse.clientConfig.name) {
52
+ updateConfig(Object.assign(Object.assign({}, getConfig()), { brand: Object.assign(Object.assign({}, getConfig().brand), { name: clientConfigResponse.clientConfig.name }) }));
53
+ }
51
54
  if (!getConfig().disableRemoteConfig &&
52
- ((_a = clientConfigResponse.clientConfig.metadata) === null || _a === void 0 ? void 0 : _a.plugins)) {
53
- yield call(loadPlugins, (_b = clientConfigResponse.clientConfig.metadata) === null || _b === void 0 ? void 0 : _b.plugins);
55
+ ((_b = clientConfigResponse.clientConfig.metadata) === null || _b === void 0 ? void 0 : _b.plugins)) {
56
+ yield call(loadPlugins, (_c = clientConfigResponse.clientConfig.metadata) === null || _c === void 0 ? void 0 : _c.plugins);
54
57
  }
55
58
  else
56
59
  yield call(loadPlugins);
57
- updateConfig(Object.assign(Object.assign({}, getConfig()), { authCookieDomain: ((_c = clientConfigResponse.clientConfig.metadata) === null || _c === void 0 ? void 0 : _c.authCookieDomain) ||
60
+ updateConfig(Object.assign(Object.assign({}, getConfig()), { authCookieDomain: ((_d = clientConfigResponse.clientConfig.metadata) === null || _d === void 0 ? void 0 : _d.authCookieDomain) ||
58
61
  process.env.REACT_APP_COOKIES_ALL_SUBDOMAIN }));
59
62
  if (/compactTheme/.test(window.location.href)) {
60
63
  yield call(setWizardTheme, { name: "compact" });
61
64
  }
62
65
  else if (!getConfig().disableRemoteConfig &&
63
- ((_e = (_d = clientConfigResponse.clientConfig.metadata) === null || _d === void 0 ? void 0 : _d.theme) === null || _e === void 0 ? void 0 : _e.name)) {
66
+ ((_f = (_e = clientConfigResponse.clientConfig.metadata) === null || _e === void 0 ? void 0 : _e.theme) === null || _f === void 0 ? void 0 : _f.name)) {
64
67
  yield call(setWizardTheme, clientConfigResponse.clientConfig.metadata.theme);
65
68
  }
66
69
  else {
67
70
  yield call(loadTheme);
68
71
  }
69
- if ((_g = (_f = clientConfigResponse.clientConfig.metadata) === null || _f === void 0 ? void 0 : _f.appStates) === null || _g === void 0 ? void 0 : _g.length) {
72
+ if ((_h = (_g = clientConfigResponse.clientConfig.metadata) === null || _g === void 0 ? void 0 : _g.appStates) === null || _h === void 0 ? void 0 : _h.length) {
70
73
  yield put(updateAvailableAppStatesAction(clientConfigResponse.clientConfig.metadata.appStates));
71
74
  }
72
- const availableAppStates = ((_h = clientConfigResponse.clientConfig.metadata) === null || _h === void 0 ? void 0 : _h.appStates) ||
75
+ const availableAppStates = ((_j = clientConfigResponse.clientConfig.metadata) === null || _j === void 0 ? void 0 : _j.appStates) ||
73
76
  getConfig().appStates;
74
77
  return {
75
78
  appStates: availableAppStates,
76
- enableShadowInstance: ((_j = clientConfigResponse.clientConfig.metadata) === null || _j === void 0 ? void 0 : _j.enableShadowInstance) || false,
79
+ enableShadowInstance: ((_k = clientConfigResponse.clientConfig.metadata) === null || _k === void 0 ? void 0 : _k.enableShadowInstance) || false,
77
80
  };
78
81
  }
79
82
  function* getWizardConfig(permalink, uniqidParam, prefix, queryParams) {
@@ -17,6 +17,7 @@ export interface ClientConfigResponse {
17
17
  prefix?: string;
18
18
  shortUrl?: boolean;
19
19
  metadata?: any;
20
+ name?: string;
20
21
  };
21
22
  }
22
23
  export interface WizardConfigResponse {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/wizardx-core",
3
- "version": "4.16.2",
3
+ "version": "4.17.1",
4
4
  "author": "Moncef Hammou (moncef@legalplace.fr)",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -24,7 +24,7 @@
24
24
  "@legalplace/lp-events": "1.14.0",
25
25
  "@legalplace/lplogic": "2.3.1",
26
26
  "@legalplace/model-healthcheck": "^1.1.5",
27
- "@legalplace/referencesparser": "^3.1.19",
27
+ "@legalplace/referencesparser": "^3.1.20",
28
28
  "@legalplace/storybook": "^2.171.0",
29
29
  "@legalplace/typeorm-constants": "^3.35.1",
30
30
  "@loadable/component": "^5.15.0",
@@ -54,11 +54,11 @@
54
54
  "xss": "^1.0.9"
55
55
  },
56
56
  "devDependencies": {
57
- "@legalplace/data-gouv": "^1.5.20",
57
+ "@legalplace/data-gouv": "^1.5.21",
58
58
  "@legalplace/eslint-config": "^2.2.0",
59
59
  "@legalplace/models-v3-types": "^5.11.10",
60
60
  "@legalplace/prettier-config": "^2.1.3",
61
- "@legalplace/typeorm-entities": "^5.30.7",
61
+ "@legalplace/typeorm-entities": "^5.30.8",
62
62
  "@swc-node/jest": "^1.3.2",
63
63
  "@swc/core": "^1.2.93",
64
64
  "@swc/jest": "^0.2.4",
@@ -96,5 +96,5 @@
96
96
  "*.test.ts",
97
97
  "*.test.tsx"
98
98
  ],
99
- "gitHead": "94d21f48a2078a4d232aba730b449dbc63cf8e07"
99
+ "gitHead": "64b0030676f20e0e8531a30517c4dd58cbb5e23c"
100
100
  }