@commercetools-frontend/application-shell 24.11.0 → 24.12.0
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/{application-entry-point-c87294b0.cjs.dev.js → application-entry-point-18d8fba0.cjs.dev.js} +7 -4
- package/dist/{application-entry-point-10a5e1a5.esm.js → application-entry-point-1b23fb6b.esm.js} +6 -4
- package/dist/{application-entry-point-8c4b8e53.cjs.prod.js → application-entry-point-74a06151.cjs.prod.js} +4 -3
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +12 -11
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +12 -11
- package/dist/commercetools-frontend-application-shell.esm.js +12 -11
- package/dist/{custom-view-dev-host-6091b78a.esm.js → custom-view-dev-host-091163ea.esm.js} +20 -16
- package/dist/{custom-view-dev-host-40b33836.cjs.dev.js → custom-view-dev-host-17daf42a.cjs.dev.js} +21 -16
- package/dist/{custom-view-dev-host-3a171a01.cjs.prod.js → custom-view-dev-host-a682a499.cjs.prod.js} +21 -16
- package/dist/{index-a57c8458.cjs.dev.js → index-1d1cc31f.cjs.dev.js} +212 -363
- package/dist/{index-67a5d8e8.esm.js → index-1dadca21.esm.js} +213 -362
- package/dist/{index-614accc4.cjs.dev.js → index-25183095.cjs.dev.js} +2 -2
- package/dist/{index-7bdde97c.cjs.prod.js → index-3cfc1f1e.cjs.prod.js} +200 -343
- package/dist/{index-245e2980.cjs.prod.js → index-52c724ed.cjs.prod.js} +2 -2
- package/dist/{index-86039df7.esm.js → index-5aaa33bb.esm.js} +2 -2
- package/dist/{navbar-022383bd.cjs.dev.js → navbar-586f7774.cjs.dev.js} +111 -92
- package/dist/{navbar-844d350d.esm.js → navbar-88e0fd1f.esm.js} +110 -92
- package/dist/{navbar-acc2cd1b.cjs.prod.js → navbar-93183a2d.cjs.prod.js} +111 -92
- package/dist/oidc-258fc018.cjs.prod.js +115 -0
- package/dist/oidc-35e8e62a.esm.js +100 -0
- package/dist/oidc-87d116c1.cjs.dev.js +115 -0
- package/dist/{oidc-callback-5f3d5280.esm.js → oidc-callback-019d623d.esm.js} +16 -14
- package/dist/{oidc-callback-e07f0c20.cjs.dev.js → oidc-callback-47743232.cjs.dev.js} +16 -14
- package/dist/{oidc-callback-ce8cbdfe.cjs.prod.js → oidc-callback-6bdb3c6f.cjs.prod.js} +16 -14
- package/dist/{project-container-a11a31ca.cjs.dev.js → project-container-2245f020.cjs.dev.js} +53 -19
- package/dist/{project-container-fba09841.esm.js → project-container-7fce9e66.esm.js} +52 -19
- package/dist/{project-container-2d3d027a.cjs.prod.js → project-container-954dbf0f.cjs.prod.js} +53 -19
- package/dist/{project-expired-ede4d485.esm.js → project-expired-1b0845c5.esm.js} +12 -11
- package/dist/{project-expired-9620dee4.cjs.dev.js → project-expired-c941b592.cjs.dev.js} +12 -11
- package/dist/{project-expired-f38a712a.cjs.prod.js → project-expired-ee8b232c.cjs.prod.js} +12 -11
- package/dist/{project-not-found-093ab795.esm.js → project-not-found-340217f6.esm.js} +11 -10
- package/dist/{project-not-found-05683f8e.cjs.dev.js → project-not-found-9b7cfe88.cjs.dev.js} +11 -10
- package/dist/{project-not-found-cfa934da.cjs.prod.js → project-not-found-9cee9625.cjs.prod.js} +11 -10
- package/dist/{project-not-initialized-1d934ae7.esm.js → project-not-initialized-55fd8df4.esm.js} +12 -11
- package/dist/{project-not-initialized-b5a1400f.cjs.prod.js → project-not-initialized-7a058b68.cjs.prod.js} +12 -11
- package/dist/{project-not-initialized-1ed56a00.cjs.dev.js → project-not-initialized-7b3843a3.cjs.dev.js} +12 -11
- package/dist/{project-suspended-8e15a452.cjs.prod.js → project-suspended-12618898.cjs.prod.js} +11 -10
- package/dist/{project-suspended-e0722654.esm.js → project-suspended-529b09d6.esm.js} +11 -10
- package/dist/{project-suspended-68e80299.cjs.dev.js → project-suspended-78e94b85.cjs.dev.js} +11 -10
- package/dist/{redirect-to-login-12f467b8.cjs.prod.js → redirect-to-login-3e4a6434.cjs.prod.js} +13 -10
- package/dist/{redirect-to-login-3bee13ba.cjs.dev.js → redirect-to-login-66ea895a.cjs.dev.js} +13 -10
- package/dist/{redirect-to-login-2944c890.esm.js → redirect-to-login-edbfacbc.esm.js} +13 -10
- package/dist/{redirect-to-logout-2802852c.cjs.prod.js → redirect-to-logout-52a7810f.cjs.prod.js} +14 -12
- package/dist/{redirect-to-logout-5db48f16.esm.js → redirect-to-logout-5d5fc361.esm.js} +14 -12
- package/dist/{redirect-to-logout-74b72fe8.cjs.dev.js → redirect-to-logout-b331b037.cjs.dev.js} +14 -12
- package/dist/{redirector-72ccfbc2.cjs.dev.js → redirector-0efdd994.cjs.dev.js} +4 -3
- package/dist/{redirector-d856975f.esm.js → redirector-656c6ee7.esm.js} +4 -3
- package/dist/{redirector-0c72d0a4.cjs.prod.js → redirector-c858d578.cjs.prod.js} +4 -3
- package/dist/{requests-in-flight-loader-e25f4c31.esm.js → requests-in-flight-loader-20021ccc.esm.js} +11 -10
- package/dist/{requests-in-flight-loader-877c1541.cjs.prod.js → requests-in-flight-loader-64d2e12d.cjs.prod.js} +11 -10
- package/dist/{requests-in-flight-loader-bc904171.cjs.dev.js → requests-in-flight-loader-83cab813.cjs.dev.js} +11 -10
- package/dist/{service-page-project-switcher-af044ac6.cjs.dev.js → service-page-project-switcher-49dabe13.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-f3eac18a.esm.js → service-page-project-switcher-6cdd506b.esm.js} +1 -1
- package/dist/{service-page-project-switcher-1dad9871.cjs.prod.js → service-page-project-switcher-f1b43eb7.cjs.prod.js} +1 -1
- package/dist/{use-applications-menu-14a5a1f4.cjs.prod.js → use-applications-menu-48d924bd.cjs.prod.js} +47 -39
- package/dist/{use-applications-menu-823a2492.cjs.dev.js → use-applications-menu-7f548a7a.cjs.dev.js} +47 -39
- package/dist/{use-applications-menu-1514af11.esm.js → use-applications-menu-b871849c.esm.js} +44 -37
- package/dist/{user-settings-menu-d75f4958.cjs.prod.js → user-settings-menu-6660f508.cjs.prod.js} +29 -22
- package/dist/{user-settings-menu-f98bea89.esm.js → user-settings-menu-afa82f2a.esm.js} +29 -22
- package/dist/{user-settings-menu-6113cdd3.cjs.dev.js → user-settings-menu-f5c74042.cjs.dev.js} +29 -22
- package/package.json +16 -16
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +2 -1
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +2 -1
- package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +2 -1
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +26 -22
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +26 -22
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +20 -17
- package/dist/oidc-8827f9fe.cjs.dev.js +0 -98
- package/dist/oidc-b2520905.esm.js +0 -84
- package/dist/oidc-d74e6aa2.cjs.prod.js +0 -98
- package/dist/quick-access-9dd197bb.cjs.prod.js +0 -1875
- package/dist/quick-access-a665bbb7.cjs.dev.js +0 -1893
- package/dist/quick-access-dfc1f8a9.esm.js +0 -1865
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
var reactRouterDom = require('react-router-dom');
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-52c724ed.cjs.prod.js');
|
|
6
6
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
7
7
|
var _styled = require('@emotion/styled/base');
|
|
8
8
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
@@ -23,8 +23,9 @@ var constants = require('@commercetools-frontend/constants');
|
|
|
23
23
|
var i18n = require('@commercetools-frontend/i18n');
|
|
24
24
|
var reactNotifications = require('@commercetools-frontend/react-notifications');
|
|
25
25
|
var sentry = require('@commercetools-frontend/sentry');
|
|
26
|
-
var oidc = require('./oidc-
|
|
26
|
+
var oidc = require('./oidc-258fc018.cjs.prod.js');
|
|
27
27
|
require('@babel/runtime-corejs3/core-js-stable/url');
|
|
28
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
28
29
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
29
30
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
30
31
|
var reactIntl = require('react-intl');
|
|
@@ -32,6 +33,7 @@ var FlatButton = require('@commercetools-uikit/flat-button');
|
|
|
32
33
|
var icons = require('@commercetools-uikit/icons');
|
|
33
34
|
var location = require('./location-537e0660.cjs.prod.js');
|
|
34
35
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
36
|
+
var _taggedTemplateLiteral = require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
|
|
35
37
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
36
38
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
37
39
|
var memoize = require('memoize-one');
|
|
@@ -43,13 +45,6 @@ var CTLogoSVG = require('@commercetools-frontend/assets/images/ct-logo.svg');
|
|
|
43
45
|
var LoadingSpinner = require('@commercetools-uikit/loading-spinner');
|
|
44
46
|
var history = require('@commercetools-frontend/browser-history');
|
|
45
47
|
var l10n = require('@commercetools-frontend/l10n');
|
|
46
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
47
|
-
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
48
|
-
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
49
|
-
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
50
|
-
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
51
|
-
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
52
|
-
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
53
48
|
require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
54
49
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
55
50
|
var _Object$fromEntries = require('@babel/runtime-corejs3/core-js-stable/object/from-entries');
|
|
@@ -61,7 +56,14 @@ var launchdarklyAdapter = require('@flopflip/launchdarkly-adapter');
|
|
|
61
56
|
var reactBroadcast = require('@flopflip/react-broadcast');
|
|
62
57
|
var types = require('@flopflip/types');
|
|
63
58
|
var reactRedux = require('react-redux');
|
|
59
|
+
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
64
60
|
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
61
|
+
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
62
|
+
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
63
|
+
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
64
|
+
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
65
|
+
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
66
|
+
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
65
67
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
66
68
|
require('@commercetools-uikit/design-system/materials/resets.css');
|
|
67
69
|
var ssr = require('@commercetools-frontend/application-config/ssr');
|
|
@@ -85,6 +87,7 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
85
87
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
86
88
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
87
89
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
90
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
88
91
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
89
92
|
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
90
93
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -95,19 +98,19 @@ var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
|
95
98
|
var CTLogoSVG__default = /*#__PURE__*/_interopDefault(CTLogoSVG);
|
|
96
99
|
var LoadingSpinner__default = /*#__PURE__*/_interopDefault(LoadingSpinner);
|
|
97
100
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
98
|
-
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
99
101
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
100
102
|
var _Object$fromEntries__default = /*#__PURE__*/_interopDefault(_Object$fromEntries);
|
|
101
103
|
var _flagsInstanceProperty__default = /*#__PURE__*/_interopDefault(_flagsInstanceProperty);
|
|
102
104
|
var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
|
|
105
|
+
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
103
106
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
104
107
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
105
108
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
106
109
|
|
|
107
110
|
// NOTE: This string will be replaced on build time with the package version.
|
|
108
|
-
var version = "24.
|
|
111
|
+
var version = "24.12.0";
|
|
109
112
|
|
|
110
|
-
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-
|
|
113
|
+
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-64d2e12d.cjs.prod.js' /* webpackChunkName: "requests-in-flight-loader" */); }));
|
|
111
114
|
|
|
112
115
|
// Attempt to load the `projectKey` from localStorage
|
|
113
116
|
function selectProjectKeyFromLocalStorage() {
|
|
@@ -133,7 +136,7 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
133
136
|
* A full page reload is needed as the user's project may have changed (deletions and/or additions).
|
|
134
137
|
* As a result the project and user queries need refetching.
|
|
135
138
|
*/
|
|
136
|
-
const redirectToProject = key => location.location.replace(
|
|
139
|
+
const redirectToProject = key => location.location.replace("/".concat(key));
|
|
137
140
|
const BackToProject = props => {
|
|
138
141
|
const intl = reactIntl.useIntl();
|
|
139
142
|
return jsxRuntime.jsx(FlatButton__default["default"], {
|
|
@@ -144,14 +147,8 @@ const BackToProject = props => {
|
|
|
144
147
|
};
|
|
145
148
|
BackToProject.displayName = 'BackToProject';
|
|
146
149
|
|
|
147
|
-
|
|
148
|
-
0% {
|
|
149
|
-
background-color: ${designSystem.customProperties.colorNeutral};
|
|
150
|
-
}
|
|
151
|
-
100% {
|
|
152
|
-
background-color: ${designSystem.customProperties.colorNeutral95};
|
|
153
|
-
}
|
|
154
|
-
`;
|
|
150
|
+
var _templateObject;
|
|
151
|
+
const animationPulse = react$1.keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n background-color: ", ";\n }\n 100% {\n background-color: ", ";\n }\n"])), designSystem.customProperties.colorNeutral, designSystem.customProperties.colorNeutral95);
|
|
155
152
|
const getWidthBySize = props => {
|
|
156
153
|
switch (props.shape) {
|
|
157
154
|
case 'dot':
|
|
@@ -348,14 +345,15 @@ const ProjectSwitcher = props => {
|
|
|
348
345
|
onChange: event => {
|
|
349
346
|
const selectedProjectKey = event.target.value;
|
|
350
347
|
if (selectedProjectKey !== props.projectKey) {
|
|
351
|
-
|
|
348
|
+
var _window$app$__DEVELOP;
|
|
349
|
+
if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
|
|
352
350
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(selectedProjectKey);
|
|
353
351
|
}
|
|
354
352
|
|
|
355
353
|
// We simply redirect to a "new" browser page, instead of using the
|
|
356
354
|
// history router. This will simplify a lot of things and avoid possible
|
|
357
355
|
// problems like e.g. resetting the store/state.
|
|
358
|
-
redirectTo(
|
|
356
|
+
redirectTo("/".concat(selectedProjectKey));
|
|
359
357
|
}
|
|
360
358
|
},
|
|
361
359
|
options: data && data.user && mapProjectsToOptions(data.user.projects.results) || [],
|
|
@@ -386,7 +384,7 @@ ProjectSwitcher.displayName = 'ProjectSwitcher';
|
|
|
386
384
|
// eslint-disable-next-line import/prefer-default-export
|
|
387
385
|
const REQUESTS_IN_FLIGHT_LOADER_DOM_ID = 'loader-for-requests-in-flight';
|
|
388
386
|
|
|
389
|
-
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-
|
|
387
|
+
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-6660f508.cjs.prod.js' /* webpackChunkName: "user-settings-menu" */); }));
|
|
390
388
|
|
|
391
389
|
var _ref$1 = {
|
|
392
390
|
name: "zjik7",
|
|
@@ -401,7 +399,8 @@ var _ref3$1 = {
|
|
|
401
399
|
styles: "height:22px"
|
|
402
400
|
} ;
|
|
403
401
|
const AppBar = props => {
|
|
404
|
-
|
|
402
|
+
var _props$user$defaultPr, _props$user;
|
|
403
|
+
const previousProjectKey = getPreviousProjectKey((_props$user$defaultPr = (_props$user = props.user) === null || _props$user === void 0 ? void 0 : _props$user.defaultProjectKey) !== null && _props$user$defaultPr !== void 0 ? _props$user$defaultPr : undefined);
|
|
405
404
|
return jsxRuntime.jsxs("div", {
|
|
406
405
|
css: /*#__PURE__*/react$1.css("background-color:", designSystem.designTokens.colorSurface, ";box-shadow:0px 2px 5px 0px rgba(0, 0, 0, 0.15);padding:0 40px;min-height:", oidc.DIMENSIONS.header, ";position:relative;width:100%;z-index:20000;display:flex;align-items:center;justify-content:space-between;" + ("" ), "" ),
|
|
407
406
|
"data-test": "top-navigation",
|
|
@@ -426,7 +425,7 @@ const AppBar = props => {
|
|
|
426
425
|
const selectedProject = _findInstanceProperty__default["default"](_context = props.user.projects.results).call(_context, project => project.key === props.projectKeyFromUrl);
|
|
427
426
|
return jsxRuntime.jsxs("div", {
|
|
428
427
|
css: /*#__PURE__*/react$1.css("display:flex;gap:", designSystem.designTokens.spacing20, ";align-items:center;" + ("" ), "" ),
|
|
429
|
-
children: [selectedProject
|
|
428
|
+
children: [(selectedProject === null || selectedProject === void 0 ? void 0 : selectedProject.isProductionProject) && jsxRuntime.jsx("div", {
|
|
430
429
|
css: _ref3$1,
|
|
431
430
|
children: jsxRuntime.jsx(applicationComponents.ProjectStamp.IsProduction, {})
|
|
432
431
|
}), jsxRuntime.jsx(ProjectSwitcher
|
|
@@ -569,199 +568,11 @@ const FetchUser = props => {
|
|
|
569
568
|
};
|
|
570
569
|
FetchUser.displayName = 'FetchUser';
|
|
571
570
|
|
|
572
|
-
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-
|
|
573
|
-
|
|
574
|
-
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-2d3d027a.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
575
|
-
|
|
576
|
-
const getSelectedDataLocaleForProject = projectLocales => {
|
|
577
|
-
const cachedDataLocale = window.localStorage.getItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE);
|
|
578
|
-
// Make sure the cached locale is listed in the selected project
|
|
579
|
-
const isCachedDataLocaleIncludedInProjectLanguages = _includesInstanceProperty__default["default"](projectLocales).call(projectLocales, cachedDataLocale || '');
|
|
580
|
-
if (cachedDataLocale && isCachedDataLocaleIncludedInProjectLanguages) return cachedDataLocale;
|
|
581
|
-
// Pick the first locale from the list
|
|
582
|
-
const defaultDataLocaleForProject = projectLocales[0];
|
|
583
|
-
// Cache it
|
|
584
|
-
window.localStorage.setItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE, defaultDataLocaleForProject);
|
|
585
|
-
return defaultDataLocaleForProject;
|
|
586
|
-
};
|
|
587
|
-
const ProjectDataLocale = props => {
|
|
588
|
-
const _useState = react.useState(getSelectedDataLocaleForProject(props.locales)),
|
|
589
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
590
|
-
locale = _useState2[0],
|
|
591
|
-
setLocale = _useState2[1];
|
|
592
|
-
const handleSetProjectDataLocale = react.useCallback(locale => {
|
|
593
|
-
setLocale(locale);
|
|
594
|
-
// Cache it
|
|
595
|
-
window.localStorage.setItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE, locale);
|
|
596
|
-
}, []);
|
|
597
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
598
|
-
children: props.children({
|
|
599
|
-
locale,
|
|
600
|
-
setProjectDataLocale: handleSetProjectDataLocale
|
|
601
|
-
})
|
|
602
|
-
});
|
|
603
|
-
};
|
|
604
|
-
ProjectDataLocale.displayName = 'ProjectDataLocale';
|
|
605
|
-
|
|
606
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
607
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
608
|
-
let ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
609
|
-
function ErrorBoundary() {
|
|
610
|
-
var _this;
|
|
611
|
-
_classCallCheck(this, ErrorBoundary);
|
|
612
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
613
|
-
args[_key] = arguments[_key];
|
|
614
|
-
}
|
|
615
|
-
_this = _callSuper(this, ErrorBoundary, [...args]);
|
|
616
|
-
_this.state = {
|
|
617
|
-
hasError: false
|
|
618
|
-
};
|
|
619
|
-
return _this;
|
|
620
|
-
}
|
|
621
|
-
_inherits(ErrorBoundary, _Component);
|
|
622
|
-
return _createClass(ErrorBoundary, [{
|
|
623
|
-
key: "componentDidUpdate",
|
|
624
|
-
value: function componentDidUpdate(prevProps) {
|
|
625
|
-
const hasRouteChanged = prevProps.pathname !== this.props.pathname;
|
|
626
|
-
this.setState(prevState => hasRouteChanged && prevState.hasError ? {
|
|
627
|
-
hasError: false
|
|
628
|
-
} : null);
|
|
629
|
-
}
|
|
630
|
-
}, {
|
|
631
|
-
key: "componentDidCatch",
|
|
632
|
-
value: function componentDidCatch(error, errorInfo) {
|
|
633
|
-
// Note: In development mode componentDidCatch is not based on try-catch
|
|
634
|
-
// to catch exceptions. Thus exceptions caught here will also be caught in
|
|
635
|
-
// the global `error` event listener (setup-global-error-listener.js).
|
|
636
|
-
// see: https://github.com/facebook/react/issues/10474
|
|
637
|
-
sentry.reportErrorToSentry(error, {
|
|
638
|
-
extra: errorInfo
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
}, {
|
|
642
|
-
key: "render",
|
|
643
|
-
value: function render() {
|
|
644
|
-
if (this.state.hasError) {
|
|
645
|
-
return jsxRuntime.jsx(ErrorApologizer, {});
|
|
646
|
-
}
|
|
647
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
648
|
-
children: this.props.children
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
}], [{
|
|
652
|
-
key: "getDerivedStateFromError",
|
|
653
|
-
value: function getDerivedStateFromError(/* error */
|
|
654
|
-
) {
|
|
655
|
-
// Update state so the next render will show the fallback UI.
|
|
656
|
-
return {
|
|
657
|
-
hasError: true
|
|
658
|
-
};
|
|
659
|
-
}
|
|
660
|
-
}]);
|
|
661
|
-
}(react.Component);
|
|
571
|
+
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-93183a2d.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
|
|
662
572
|
|
|
663
|
-
const
|
|
664
|
-
target: "e1fuwyk10"
|
|
665
|
-
} )({
|
|
666
|
-
name: "xvk698",
|
|
667
|
-
styles: "position:absolute;left:0;bottom:0;top:0;right:0;background-color:rgba(0, 0, 0, 0.35);z-index:20001"
|
|
668
|
-
} );
|
|
573
|
+
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-954dbf0f.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
669
574
|
|
|
670
|
-
|
|
671
|
-
// we did not check yet
|
|
672
|
-
UNCHECKED: 'UNCHECKED',
|
|
673
|
-
// the project is indexed by pim-indexer
|
|
674
|
-
INDEXED: 'INDEXED',
|
|
675
|
-
// the project is not indexed by pim-indexer
|
|
676
|
-
NOT_INDEXED: 'NOT_INDEXED'
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
const QuickAccess = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./quick-access-9dd197bb.cjs.prod.js' /* webpackChunkName: "quick-access" */); }));
|
|
680
|
-
const QuickAccessTrigger = props => {
|
|
681
|
-
const _useState = react.useState(false),
|
|
682
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
683
|
-
isVisible = _useState2[0],
|
|
684
|
-
setIsVisible = _useState2[1];
|
|
685
|
-
const open = react.useCallback(() => {
|
|
686
|
-
setIsVisible(true);
|
|
687
|
-
}, []);
|
|
688
|
-
const close = react.useCallback(() => {
|
|
689
|
-
setIsVisible(false);
|
|
690
|
-
}, []);
|
|
691
|
-
// We store the information of whether a project is indexed by pim-indexer,
|
|
692
|
-
// to avoid having to refetch that information every time Quick Access is
|
|
693
|
-
// opened. We can't move the information to the quick-access.js component
|
|
694
|
-
// as that component unmounts and would lose its state.
|
|
695
|
-
//
|
|
696
|
-
// We need to know whether a project is indexed by pim-indexer to know
|
|
697
|
-
// whether we should query pim-search or whether we can skip that request.
|
|
698
|
-
//
|
|
699
|
-
// We don't need to update this information when the project key changes,
|
|
700
|
-
// as changing a project always results in a full page reload anyways.
|
|
701
|
-
const _useState3 = react.useState(pimIndexerStates.UNCHECKED),
|
|
702
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
703
|
-
pimIndexerState = _useState4[0],
|
|
704
|
-
setPimIndexerState = _useState4[1];
|
|
705
|
-
const handlePimIndexerStateChange = react.useCallback(nextPimIndexerState => {
|
|
706
|
-
setPimIndexerState(nextPimIndexerState);
|
|
707
|
-
}, []);
|
|
708
|
-
const keyHandler = react.useCallback(event => {
|
|
709
|
-
const hotKey = 'f';
|
|
710
|
-
// avoid interfering with any key combinations using modifier keys
|
|
711
|
-
if (event.ctrlKey || event.altKey || event.shiftKey || event.metaKey) return;
|
|
712
|
-
|
|
713
|
-
// Let users close QuickAccess by pressing Escape
|
|
714
|
-
if (event.key === 'Escape' && event.target.id === 'quick-access-search-input') {
|
|
715
|
-
close();
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
// Avoid interfering with any other elements. We only
|
|
720
|
-
// open the QuickAccess when nothing was focused, so target is document.body
|
|
721
|
-
if (event.target !== document.body &&
|
|
722
|
-
// tabIndex="-1" has a special meaning
|
|
723
|
-
// It will make the element focusable, while hiding it from the
|
|
724
|
-
// navigation. It is typically used for modals and overlays.
|
|
725
|
-
// react-modal uses it for example. We want to treat those elements
|
|
726
|
-
// similar to document.body.
|
|
727
|
-
// See https://stackoverflow.com/a/32912224
|
|
728
|
-
event.target.getAttribute('tabindex') !== '-1' &&
|
|
729
|
-
// Do not prevent Quick Access from opening when a link has focus
|
|
730
|
-
event.target.nodeName !== 'A') return;
|
|
731
|
-
if (event.key === hotKey) {
|
|
732
|
-
if (!isVisible) {
|
|
733
|
-
// prevent the letter from appearing in the search input when
|
|
734
|
-
// it is the key press that lead to opening Quick Access
|
|
735
|
-
event.preventDefault();
|
|
736
|
-
}
|
|
737
|
-
open();
|
|
738
|
-
}
|
|
739
|
-
return;
|
|
740
|
-
}, [close, isVisible, open]);
|
|
741
|
-
react.useEffect(() => {
|
|
742
|
-
document.addEventListener('keydown', keyHandler);
|
|
743
|
-
return () => {
|
|
744
|
-
document.removeEventListener('keydown', keyHandler);
|
|
745
|
-
};
|
|
746
|
-
}, [keyHandler]);
|
|
747
|
-
if (!isVisible) return null;
|
|
748
|
-
return jsxRuntime.jsx(ErrorBoundary, {
|
|
749
|
-
children: jsxRuntime.jsx(react.Suspense, {
|
|
750
|
-
fallback: jsxRuntime.jsx(ButlerContainer, {
|
|
751
|
-
tabIndex: -1
|
|
752
|
-
}),
|
|
753
|
-
children: jsxRuntime.jsx(QuickAccess, {
|
|
754
|
-
pimIndexerState: pimIndexerState,
|
|
755
|
-
onPimIndexerStateChange: handlePimIndexerStateChange,
|
|
756
|
-
onClose: close,
|
|
757
|
-
onChangeProjectDataLocale: props.onChangeProjectDataLocale
|
|
758
|
-
})
|
|
759
|
-
})
|
|
760
|
-
});
|
|
761
|
-
};
|
|
762
|
-
QuickAccessTrigger.displayName = 'QuickAccessTrigger';
|
|
763
|
-
|
|
764
|
-
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-2802852c.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
575
|
+
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-52a7810f.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
765
576
|
|
|
766
577
|
const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-e4ff7797.cjs.prod.js' /* webpackChunkName: "redirect-to-project-create" */); }));
|
|
767
578
|
|
|
@@ -773,15 +584,16 @@ var AllFeaturesQuery = { kind: "Document", definitions: [{ kind: "OperationDefin
|
|
|
773
584
|
// is no need to be concerned about security.
|
|
774
585
|
const ldClientSideIdProduction = '5979d95f6040390cd07b5e01';
|
|
775
586
|
function getUserContextForLaunchDarklyAdapter(user, projectKey) {
|
|
587
|
+
var _user$launchdarklyTra, _user$launchdarklyTra2, _user$launchdarklyTra3, _user$launchdarklyTra4, _user$launchdarklyTra5;
|
|
776
588
|
return {
|
|
777
589
|
kind: 'user',
|
|
778
|
-
key: user
|
|
779
|
-
project: projectKey
|
|
780
|
-
id: user
|
|
781
|
-
team: user
|
|
782
|
-
group: user
|
|
783
|
-
subgroup: user
|
|
784
|
-
cloudEnvironment: user
|
|
590
|
+
key: user === null || user === void 0 ? void 0 : user.id,
|
|
591
|
+
project: projectKey !== null && projectKey !== void 0 ? projectKey : '',
|
|
592
|
+
id: (_user$launchdarklyTra = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingId) !== null && _user$launchdarklyTra !== void 0 ? _user$launchdarklyTra : '',
|
|
593
|
+
team: (_user$launchdarklyTra2 = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingTeam) !== null && _user$launchdarklyTra2 !== void 0 ? _user$launchdarklyTra2 : [],
|
|
594
|
+
group: (_user$launchdarklyTra3 = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingGroup) !== null && _user$launchdarklyTra3 !== void 0 ? _user$launchdarklyTra3 : '',
|
|
595
|
+
subgroup: (_user$launchdarklyTra4 = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingSubgroup) !== null && _user$launchdarklyTra4 !== void 0 ? _user$launchdarklyTra4 : '',
|
|
596
|
+
cloudEnvironment: (_user$launchdarklyTra5 = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingCloudEnvironment) !== null && _user$launchdarklyTra5 !== void 0 ? _user$launchdarklyTra5 : ''
|
|
785
597
|
};
|
|
786
598
|
}
|
|
787
599
|
const parseFlags = fetchedFlags => {
|
|
@@ -813,47 +625,51 @@ const SetupFlopFlipProvider = props => {
|
|
|
813
625
|
}
|
|
814
626
|
}, [enableLongLivedFeatureFlags]);
|
|
815
627
|
const defaultFlags = react.useMemo(() => _objectSpread$9(_objectSpread$9({}, constants.featureFlags.DEFAULT_FLAGS), props.defaultFlags), [props.defaultFlags]);
|
|
816
|
-
const adapterArgs = react.useMemo(() =>
|
|
817
|
-
user
|
|
818
|
-
|
|
819
|
-
},
|
|
820
|
-
launchdarkly: {
|
|
821
|
-
cacheIdentifier: types.cacheIdentifiers.local,
|
|
822
|
-
cacheMode: getCacheMode(types.adapterIdentifiers.launchdarkly),
|
|
823
|
-
sdk: {
|
|
824
|
-
// Allow to overwrite the client ID, passed via the `additionalEnv` properties
|
|
825
|
-
// of the application config.
|
|
826
|
-
// This is mostly useful for internal usage on our staging environments.
|
|
827
|
-
clientSideId: props.ldClientSideId ?? ldClientSideIdProduction,
|
|
828
|
-
clientOptions: {
|
|
829
|
-
sendEventsOnlyForVariation: true
|
|
830
|
-
}
|
|
831
|
-
},
|
|
832
|
-
flags,
|
|
833
|
-
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
834
|
-
},
|
|
835
|
-
http: {
|
|
836
|
-
// polling interval set to 15 minutes
|
|
837
|
-
pollingIntervalMs: 1000 * 60 * 15,
|
|
838
|
-
cacheIdentifier: types.cacheIdentifiers.local,
|
|
839
|
-
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
628
|
+
const adapterArgs = react.useMemo(() => {
|
|
629
|
+
var _props$user, _props$ldClientSideId, _props$user2;
|
|
630
|
+
return {
|
|
840
631
|
user: {
|
|
841
|
-
key: props.user
|
|
632
|
+
key: (_props$user = props.user) === null || _props$user === void 0 ? void 0 : _props$user.id
|
|
842
633
|
},
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
634
|
+
launchdarkly: {
|
|
635
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
636
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.launchdarkly),
|
|
637
|
+
sdk: {
|
|
638
|
+
// Allow to overwrite the client ID, passed via the `additionalEnv` properties
|
|
639
|
+
// of the application config.
|
|
640
|
+
// This is mostly useful for internal usage on our staging environments.
|
|
641
|
+
clientSideId: (_props$ldClientSideId = props.ldClientSideId) !== null && _props$ldClientSideId !== void 0 ? _props$ldClientSideId : ldClientSideIdProduction,
|
|
642
|
+
clientOptions: {
|
|
643
|
+
sendEventsOnlyForVariation: true
|
|
851
644
|
}
|
|
852
|
-
}
|
|
853
|
-
|
|
645
|
+
},
|
|
646
|
+
flags,
|
|
647
|
+
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
648
|
+
},
|
|
649
|
+
http: {
|
|
650
|
+
// polling interval set to 15 minutes
|
|
651
|
+
pollingIntervalMs: 1000 * 60 * 15,
|
|
652
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
653
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
654
|
+
user: {
|
|
655
|
+
key: (_props$user2 = props.user) === null || _props$user2 === void 0 ? void 0 : _props$user2.id
|
|
656
|
+
},
|
|
657
|
+
execute: async adapterArgs => {
|
|
658
|
+
var _adapterArgs$user;
|
|
659
|
+
const response = await apolloClient.query({
|
|
660
|
+
query: AllFeaturesQuery,
|
|
661
|
+
errorPolicy: 'ignore',
|
|
662
|
+
fetchPolicy: 'network-only',
|
|
663
|
+
context: {
|
|
664
|
+
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
665
|
+
projectKey: (_adapterArgs$user = adapterArgs.user) === null || _adapterArgs$user === void 0 ? void 0 : _adapterArgs$user.project
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
return parseFlags(response.data);
|
|
669
|
+
}
|
|
854
670
|
}
|
|
855
|
-
}
|
|
856
|
-
}
|
|
671
|
+
};
|
|
672
|
+
}, [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
|
|
857
673
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
858
674
|
adapter: combineAdapters.adapter,
|
|
859
675
|
adapterArgs: adapterArgs,
|
|
@@ -964,16 +780,16 @@ const ApplicationShellAuthenticated = props => {
|
|
|
964
780
|
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
965
781
|
|
|
966
782
|
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
967
|
-
const staffBarLanguage = user
|
|
783
|
+
const staffBarLanguage = (user === null || user === void 0 ? void 0 : user.launchdarklyTrackingGroup) === 'commercetools' || (user === null || user === void 0 ? void 0 : user.launchdarklyTrackingGroup) === 'mailosaur' ? applicationShellConnectors.selectUserLanguageFromStorage() : undefined;
|
|
968
784
|
const normalizedUser = user ? _objectSpread$8(_objectSpread$8({}, user), {}, {
|
|
969
785
|
// set the staff bar language if applicable
|
|
970
|
-
language: staffBarLanguage
|
|
786
|
+
language: staffBarLanguage !== null && staffBarLanguage !== void 0 ? staffBarLanguage : user.language
|
|
971
787
|
}) : undefined;
|
|
972
788
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
973
789
|
user: normalizedUser,
|
|
974
790
|
environment: applicationEnvironment,
|
|
975
791
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
976
|
-
locale: normalizedUser
|
|
792
|
+
locale: normalizedUser === null || normalizedUser === void 0 ? void 0 : normalizedUser.language,
|
|
977
793
|
applicationMessages: props.applicationMessages,
|
|
978
794
|
children: _ref7 => {
|
|
979
795
|
let isLoadingLocaleData = _ref7.isLoading,
|
|
@@ -1007,39 +823,6 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1007
823
|
}), jsxRuntime.jsx(reactNotifications.NotificationsList, {
|
|
1008
824
|
domain: constants.DOMAINS.GLOBAL
|
|
1009
825
|
})]
|
|
1010
|
-
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1011
|
-
children: () => {
|
|
1012
|
-
if (!projectKeyFromUrl) return jsxRuntime.jsx(QuickAccessTrigger, {});
|
|
1013
|
-
return jsxRuntime.jsx(FetchProject, {
|
|
1014
|
-
projectKey: projectKeyFromUrl,
|
|
1015
|
-
children: _ref8 => {
|
|
1016
|
-
let isProjectLoading = _ref8.isLoading,
|
|
1017
|
-
project = _ref8.project;
|
|
1018
|
-
if (isProjectLoading || !project) return null;
|
|
1019
|
-
|
|
1020
|
-
// when used outside of a project context,
|
|
1021
|
-
// or when the project is expired or supsended
|
|
1022
|
-
const shouldUseProjectContext = !(project.suspension && project.suspension.isActive || project.expiry && project.expiry.isActive);
|
|
1023
|
-
if (!shouldUseProjectContext) return jsxRuntime.jsx(QuickAccessTrigger, {});
|
|
1024
|
-
return jsxRuntime.jsx(ProjectDataLocale, {
|
|
1025
|
-
locales: project.languages,
|
|
1026
|
-
children: _ref9 => {
|
|
1027
|
-
let dataLocale = _ref9.locale,
|
|
1028
|
-
setProjectDataLocale = _ref9.setProjectDataLocale;
|
|
1029
|
-
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
1030
|
-
user: normalizedUser,
|
|
1031
|
-
project: project,
|
|
1032
|
-
projectDataLocale: dataLocale,
|
|
1033
|
-
environment: applicationEnvironment,
|
|
1034
|
-
children: jsxRuntime.jsx(QuickAccessTrigger, {
|
|
1035
|
-
onChangeProjectDataLocale: setProjectDataLocale
|
|
1036
|
-
})
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
});
|
|
1040
|
-
}
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
826
|
}), jsxRuntime.jsx("header", {
|
|
1044
827
|
css: _ref3,
|
|
1045
828
|
children: jsxRuntime.jsx(AppBar, {
|
|
@@ -1062,9 +845,9 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1062
845
|
if (!projectKeyFromUrl) return null;
|
|
1063
846
|
return jsxRuntime.jsx(FetchProject, {
|
|
1064
847
|
projectKey: projectKeyFromUrl,
|
|
1065
|
-
children:
|
|
1066
|
-
let isLoadingProject =
|
|
1067
|
-
project =
|
|
848
|
+
children: _ref8 => {
|
|
849
|
+
let isLoadingProject = _ref8.isLoading,
|
|
850
|
+
project = _ref8.project;
|
|
1068
851
|
const isLoading = isLoadingUser || isLoadingLocaleData || isLoadingProject || !locale || !project;
|
|
1069
852
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
1070
853
|
user: normalizedUser,
|
|
@@ -1130,8 +913,8 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1130
913
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1131
914
|
exact: true,
|
|
1132
915
|
path: "/",
|
|
1133
|
-
children: (
|
|
1134
|
-
const previousProjectKey = getPreviousProjectKey(normalizedUser
|
|
916
|
+
children: (_normalizedUser$defau => {
|
|
917
|
+
const previousProjectKey = getPreviousProjectKey((_normalizedUser$defau = normalizedUser === null || normalizedUser === void 0 ? void 0 : normalizedUser.defaultProjectKey) !== null && _normalizedUser$defau !== void 0 ? _normalizedUser$defau : undefined);
|
|
1135
918
|
|
|
1136
919
|
/**
|
|
1137
920
|
* NOTE:
|
|
@@ -1144,7 +927,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1144
927
|
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1145
928
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
1146
929
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
1147
|
-
to:
|
|
930
|
+
to: "/".concat(previousProjectKey)
|
|
1148
931
|
});
|
|
1149
932
|
})()
|
|
1150
933
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
@@ -1320,31 +1103,37 @@ const withoutProjectKeyClaim = scope => {
|
|
|
1320
1103
|
return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, claim => !_startsWithInstanceProperty__default["default"](claim).call(claim, oidc.OIDC_CLAIMS.PROJECT_KEY)).join(' ');
|
|
1321
1104
|
};
|
|
1322
1105
|
const hasCachedAuthenticationState = () => {
|
|
1323
|
-
|
|
1106
|
+
var _window$app$__DEVELOP;
|
|
1107
|
+
if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
|
|
1324
1108
|
try {
|
|
1109
|
+
var _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP0, _window$app$__DEVELOP1;
|
|
1325
1110
|
let activeProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
|
|
1326
1111
|
if (activeProjectKey) {
|
|
1112
|
+
var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4;
|
|
1327
1113
|
// GIVEN The application is not requesting a project key,
|
|
1328
1114
|
// THEN we assume that the application does not need a project context.
|
|
1329
1115
|
// GIVEN The application is not requesting a project key,
|
|
1330
1116
|
// THEN we remove the cached project key.
|
|
1331
1117
|
// This is the case of an application like `account`.
|
|
1332
|
-
if (!window.app.__DEVELOPMENT__
|
|
1118
|
+
if (!((_window$app$__DEVELOP2 = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP2 !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP2.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.initialProjectKey)) {
|
|
1333
1119
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1334
1120
|
}
|
|
1335
1121
|
|
|
1336
1122
|
// If the project key we had in the storage does not match the one
|
|
1337
1123
|
// we have in the development config, then we need to discard it and
|
|
1338
1124
|
// use the one from the development config.
|
|
1339
|
-
if (window.app.__DEVELOPMENT__
|
|
1340
|
-
|
|
1125
|
+
if ((_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP3 !== void 0 && (_window$app$__DEVELOP3 = _window$app$__DEVELOP3.oidc) !== null && _window$app$__DEVELOP3 !== void 0 && _window$app$__DEVELOP3.initialProjectKey && ((_window$app$__DEVELOP4 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP4 === void 0 || (_window$app$__DEVELOP4 = _window$app$__DEVELOP4.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.initialProjectKey) !== activeProjectKey) {
|
|
1126
|
+
var _window$app$__DEVELOP5;
|
|
1127
|
+
activeProjectKey = (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 || (_window$app$__DEVELOP5 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : _window$app$__DEVELOP5.initialProjectKey;
|
|
1341
1128
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(activeProjectKey);
|
|
1342
1129
|
}
|
|
1343
1130
|
} else {
|
|
1344
|
-
|
|
1131
|
+
var _window$app$__DEVELOP6;
|
|
1132
|
+
if ((_window$app$__DEVELOP6 = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP6 !== void 0 && (_window$app$__DEVELOP6 = _window$app$__DEVELOP6.oidc) !== null && _window$app$__DEVELOP6 !== void 0 && _window$app$__DEVELOP6.initialProjectKey) {
|
|
1133
|
+
var _window$app$__DEVELOP7;
|
|
1345
1134
|
// Here we store the initial project key in local storage,
|
|
1346
1135
|
// so that it gets picked up when we initiate the login flow.
|
|
1347
|
-
applicationShellConnectors.oidcStorage.setActiveProjectKey(window.app.__DEVELOPMENT__
|
|
1136
|
+
applicationShellConnectors.oidcStorage.setActiveProjectKey((_window$app$__DEVELOP7 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP7 === void 0 || (_window$app$__DEVELOP7 = _window$app$__DEVELOP7.oidc) === null || _window$app$__DEVELOP7 === void 0 ? void 0 : _window$app$__DEVELOP7.initialProjectKey);
|
|
1348
1137
|
}
|
|
1349
1138
|
}
|
|
1350
1139
|
|
|
@@ -1359,11 +1148,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1359
1148
|
}
|
|
1360
1149
|
// Rebuild the requested OIDC scope to verify that it didn't change.
|
|
1361
1150
|
const requestedScope = oidc.buildOidcScope({
|
|
1362
|
-
projectKey: activeProjectKey
|
|
1363
|
-
oAuthScopes: window.app.__DEVELOPMENT__
|
|
1364
|
-
additionalOAuthScopes: window.app.__DEVELOPMENT__
|
|
1365
|
-
teamId: window.app.__DEVELOPMENT__
|
|
1366
|
-
applicationId: window.app.__DEVELOPMENT__
|
|
1151
|
+
projectKey: activeProjectKey !== null && activeProjectKey !== void 0 ? activeProjectKey : undefined,
|
|
1152
|
+
oAuthScopes: (_window$app$__DEVELOP8 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP8 === void 0 || (_window$app$__DEVELOP8 = _window$app$__DEVELOP8.oidc) === null || _window$app$__DEVELOP8 === void 0 ? void 0 : _window$app$__DEVELOP8.oAuthScopes,
|
|
1153
|
+
additionalOAuthScopes: (_window$app$__DEVELOP9 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP9 === void 0 || (_window$app$__DEVELOP9 = _window$app$__DEVELOP9.oidc) === null || _window$app$__DEVELOP9 === void 0 ? void 0 : _window$app$__DEVELOP9.additionalOAuthScopes,
|
|
1154
|
+
teamId: (_window$app$__DEVELOP0 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP0 === void 0 || (_window$app$__DEVELOP0 = _window$app$__DEVELOP0.oidc) === null || _window$app$__DEVELOP0 === void 0 ? void 0 : _window$app$__DEVELOP0.teamId,
|
|
1155
|
+
applicationId: (_window$app$__DEVELOP1 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP1 === void 0 || (_window$app$__DEVELOP1 = _window$app$__DEVELOP1.oidc) === null || _window$app$__DEVELOP1 === void 0 ? void 0 : _window$app$__DEVELOP1.applicationId
|
|
1367
1156
|
});
|
|
1368
1157
|
// Omit the project key from the check. This allows to switch projects
|
|
1369
1158
|
// without having to log in again.
|
|
@@ -1381,11 +1170,12 @@ const hasCachedAuthenticationState = () => {
|
|
|
1381
1170
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1382
1171
|
};
|
|
1383
1172
|
|
|
1384
|
-
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-
|
|
1173
|
+
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-6bdb3c6f.cjs.prod.js' /* webpackChunkName: "oidc-callback" */); }));
|
|
1385
1174
|
|
|
1386
1175
|
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1387
1176
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1388
1177
|
const Authenticated = props => {
|
|
1178
|
+
var _window$app$__DEVELOP;
|
|
1389
1179
|
// We attempt to see if the user was already authenticated by looking
|
|
1390
1180
|
// at the "cached" flag in local storage.
|
|
1391
1181
|
const cachedAuthenticationState = hasCachedAuthenticationState();
|
|
@@ -1399,7 +1189,7 @@ const Authenticated = props => {
|
|
|
1399
1189
|
|
|
1400
1190
|
// When using the OIDC workflow, we always return false, to trigger
|
|
1401
1191
|
// the redirect to the login page.
|
|
1402
|
-
if (window.app.__DEVELOPMENT__
|
|
1192
|
+
if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
|
|
1403
1193
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1404
1194
|
children: props.render({
|
|
1405
1195
|
isAuthenticated: false
|
|
@@ -1413,13 +1203,13 @@ const Authenticated = props => {
|
|
|
1413
1203
|
Authenticated.displayName = 'Authenticated';
|
|
1414
1204
|
const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1415
1205
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1416
|
-
path:
|
|
1206
|
+
path: "/account/oidc/callback",
|
|
1417
1207
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1418
1208
|
locale: props.locale,
|
|
1419
1209
|
applicationMessages: props.applicationMessages
|
|
1420
1210
|
})
|
|
1421
1211
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1422
|
-
path:
|
|
1212
|
+
path: "/:projectKey/:identifier/oidc/callback",
|
|
1423
1213
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1424
1214
|
locale: props.locale,
|
|
1425
1215
|
applicationMessages: props.applicationMessages
|
|
@@ -1430,6 +1220,63 @@ const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
|
1430
1220
|
});
|
|
1431
1221
|
AuthenticationRoutes.displayName = 'AuthenticationRoutes';
|
|
1432
1222
|
|
|
1223
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1224
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
1225
|
+
let ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
1226
|
+
function ErrorBoundary() {
|
|
1227
|
+
var _this;
|
|
1228
|
+
_classCallCheck(this, ErrorBoundary);
|
|
1229
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1230
|
+
args[_key] = arguments[_key];
|
|
1231
|
+
}
|
|
1232
|
+
_this = _callSuper(this, ErrorBoundary, [...args]);
|
|
1233
|
+
_this.state = {
|
|
1234
|
+
hasError: false
|
|
1235
|
+
};
|
|
1236
|
+
return _this;
|
|
1237
|
+
}
|
|
1238
|
+
_inherits(ErrorBoundary, _Component);
|
|
1239
|
+
return _createClass(ErrorBoundary, [{
|
|
1240
|
+
key: "componentDidUpdate",
|
|
1241
|
+
value: function componentDidUpdate(prevProps) {
|
|
1242
|
+
const hasRouteChanged = prevProps.pathname !== this.props.pathname;
|
|
1243
|
+
this.setState(prevState => hasRouteChanged && prevState.hasError ? {
|
|
1244
|
+
hasError: false
|
|
1245
|
+
} : null);
|
|
1246
|
+
}
|
|
1247
|
+
}, {
|
|
1248
|
+
key: "componentDidCatch",
|
|
1249
|
+
value: function componentDidCatch(error, errorInfo) {
|
|
1250
|
+
// Note: In development mode componentDidCatch is not based on try-catch
|
|
1251
|
+
// to catch exceptions. Thus exceptions caught here will also be caught in
|
|
1252
|
+
// the global `error` event listener (setup-global-error-listener.js).
|
|
1253
|
+
// see: https://github.com/facebook/react/issues/10474
|
|
1254
|
+
sentry.reportErrorToSentry(error, {
|
|
1255
|
+
extra: errorInfo
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
}, {
|
|
1259
|
+
key: "render",
|
|
1260
|
+
value: function render() {
|
|
1261
|
+
if (this.state.hasError) {
|
|
1262
|
+
return jsxRuntime.jsx(ErrorApologizer, {});
|
|
1263
|
+
}
|
|
1264
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1265
|
+
children: this.props.children
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
}], [{
|
|
1269
|
+
key: "getDerivedStateFromError",
|
|
1270
|
+
value: function getDerivedStateFromError(/* error */
|
|
1271
|
+
) {
|
|
1272
|
+
// Update state so the next render will show the fallback UI.
|
|
1273
|
+
return {
|
|
1274
|
+
hasError: true
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
}]);
|
|
1278
|
+
}(react.Component);
|
|
1279
|
+
|
|
1433
1280
|
function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1434
1281
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$3(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1435
1282
|
/**
|
|
@@ -1475,7 +1322,10 @@ const useCoercedEnvironmentValues = environment => {
|
|
|
1475
1322
|
};
|
|
1476
1323
|
|
|
1477
1324
|
const ApplicationShellProvider = props => {
|
|
1478
|
-
const apolloClient = react.useMemo(() =>
|
|
1325
|
+
const apolloClient = react.useMemo(() => {
|
|
1326
|
+
var _props$apolloClient;
|
|
1327
|
+
return (_props$apolloClient = props.apolloClient) !== null && _props$apolloClient !== void 0 ? _props$apolloClient : applicationShellConnectors.createApolloClient();
|
|
1328
|
+
}, [props.apolloClient]);
|
|
1479
1329
|
react.useEffect(() => {
|
|
1480
1330
|
applicationShellConnectors.setCachedApolloClient(apolloClient);
|
|
1481
1331
|
}, [apolloClient]);
|
|
@@ -1526,7 +1376,7 @@ const ApplicationShellProvider = props => {
|
|
|
1526
1376
|
};
|
|
1527
1377
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1528
1378
|
|
|
1529
|
-
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-
|
|
1379
|
+
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-3e4a6434.cjs.prod.js' /* webpackChunkName: "redirect-to-login" */); }));
|
|
1530
1380
|
|
|
1531
1381
|
const styles = {
|
|
1532
1382
|
name: "gx7yk8",
|
|
@@ -1549,7 +1399,8 @@ const StrictModeEnablement$1 = props => {
|
|
|
1549
1399
|
};
|
|
1550
1400
|
const ApplicationShell = props => {
|
|
1551
1401
|
react.useEffect(() => {
|
|
1552
|
-
|
|
1402
|
+
var _props$onRegisterErro;
|
|
1403
|
+
(_props$onRegisterErro = props.onRegisterErrorListeners) === null || _props$onRegisterErro === void 0 || _props$onRegisterErro.call(props, {
|
|
1553
1404
|
dispatch: index.internalReduxStore.dispatch
|
|
1554
1405
|
});
|
|
1555
1406
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1589,14 +1440,18 @@ const ApplicationShell = props => {
|
|
|
1589
1440
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1590
1441
|
ApplicationShell.version = version;
|
|
1591
1442
|
|
|
1592
|
-
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-
|
|
1443
|
+
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-a682a499.cjs.prod.js' /* webpackChunkName: "custom-view-dev-host" */); }));
|
|
1593
1444
|
|
|
1594
1445
|
function CustomViewFlopFlipProvider(props) {
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1446
|
+
var _props$user2;
|
|
1447
|
+
const adapterArgs = react.useMemo(() => {
|
|
1448
|
+
var _props$user;
|
|
1449
|
+
return {
|
|
1450
|
+
user: {
|
|
1451
|
+
key: (_props$user = props.user) === null || _props$user === void 0 ? void 0 : _props$user.id
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
}, [(_props$user2 = props.user) === null || _props$user2 === void 0 ? void 0 : _props$user2.id]);
|
|
1600
1455
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
1601
1456
|
adapter: memoryAdapter.adapter,
|
|
1602
1457
|
defaultFlags: _flagsInstanceProperty__default["default"](props),
|
|
@@ -1632,7 +1487,7 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1632
1487
|
return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1633
1488
|
}
|
|
1634
1489
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
1635
|
-
locale: user
|
|
1490
|
+
locale: (user === null || user === void 0 ? void 0 : user.language) || browserLocale,
|
|
1636
1491
|
applicationMessages: props.messages,
|
|
1637
1492
|
children: _ref2 => {
|
|
1638
1493
|
let isLoadingLocaleData = _ref2.isLoading,
|
|
@@ -1695,15 +1550,15 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1695
1550
|
const customViewsThemesOverrides = {
|
|
1696
1551
|
default: {
|
|
1697
1552
|
marginForCustomViewsSelectorAsTabular: '0',
|
|
1698
|
-
marginForPageContent:
|
|
1699
|
-
paddingForDetailPageHeader:
|
|
1553
|
+
marginForPageContent: "".concat(designSystem.designTokens.spacing50, " 0"),
|
|
1554
|
+
paddingForDetailPageHeader: "0 0 ".concat(designSystem.designTokens.spacing40, " 0"),
|
|
1700
1555
|
paddingForMainPageHeader: '0',
|
|
1701
1556
|
paddingForTabularPageHeader: '0'
|
|
1702
1557
|
}
|
|
1703
1558
|
};
|
|
1704
1559
|
|
|
1705
1560
|
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1706
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1561
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$1(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$1(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1707
1562
|
const browserLocale = getBrowserLocale(window);
|
|
1708
1563
|
function NotificationsContainer(props) {
|
|
1709
1564
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1760,6 +1615,7 @@ function CustomViewThemeProvider() {
|
|
|
1760
1615
|
*/
|
|
1761
1616
|
const isLocalProdMode = window.app.env === 'development';
|
|
1762
1617
|
function CustomViewShell(props) {
|
|
1618
|
+
var _window$app$__DEVELOP;
|
|
1763
1619
|
const _useState = react.useState(),
|
|
1764
1620
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1765
1621
|
hostContext = _useState2[0],
|
|
@@ -1775,20 +1631,21 @@ function CustomViewShell(props) {
|
|
|
1775
1631
|
if (event.data.eventName === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION) {
|
|
1776
1632
|
setHostContext(event.data.eventData.context);
|
|
1777
1633
|
} else {
|
|
1778
|
-
console.warn(
|
|
1634
|
+
console.warn("CustomViewShell: Unknown received event with name: ".concat(event.data.eventName), {
|
|
1779
1635
|
event
|
|
1780
1636
|
});
|
|
1781
1637
|
}
|
|
1782
1638
|
}, []);
|
|
1783
1639
|
const handleClose = react.useCallback(() => {
|
|
1784
|
-
|
|
1640
|
+
var _iFrameCommunicationP, _context;
|
|
1641
|
+
(_iFrameCommunicationP = iFrameCommunicationPort.current) === null || _iFrameCommunicationP === void 0 || _iFrameCommunicationP.postMessage({
|
|
1785
1642
|
origin: window.location.origin,
|
|
1786
|
-
source:
|
|
1643
|
+
source: _concatInstanceProperty__default["default"](_context = "".concat(constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX)).call(_context, hostContext === null || hostContext === void 0 ? void 0 : hostContext.customViewConfig.id),
|
|
1787
1644
|
destination: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
|
|
1788
1645
|
eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE,
|
|
1789
1646
|
eventData: {}
|
|
1790
1647
|
});
|
|
1791
|
-
}, [hostContext
|
|
1648
|
+
}, [hostContext === null || hostContext === void 0 ? void 0 : hostContext.customViewConfig.id]);
|
|
1792
1649
|
react.useEffect(() => {
|
|
1793
1650
|
const bootstrapMessageHandler = event => {
|
|
1794
1651
|
if ((event.origin === window.location.origin ||
|
|
@@ -1820,7 +1677,8 @@ function CustomViewShell(props) {
|
|
|
1820
1677
|
react.useEffect(() => {
|
|
1821
1678
|
// Close the channel when the component unmounts
|
|
1822
1679
|
return () => {
|
|
1823
|
-
|
|
1680
|
+
var _iFrameCommunicationP2;
|
|
1681
|
+
(_iFrameCommunicationP2 = iFrameCommunicationPort.current) === null || _iFrameCommunicationP2 === void 0 || _iFrameCommunicationP2.close();
|
|
1824
1682
|
iFrameCommunicationPort.current = undefined;
|
|
1825
1683
|
};
|
|
1826
1684
|
}, []);
|
|
@@ -1829,7 +1687,7 @@ function CustomViewShell(props) {
|
|
|
1829
1687
|
showLogo: true
|
|
1830
1688
|
});
|
|
1831
1689
|
}
|
|
1832
|
-
const hostUrl = isLocalProdMode ? window.app.__DEVELOPMENT__
|
|
1690
|
+
const hostUrl = isLocalProdMode ? (_window$app$__DEVELOP = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP === void 0 ? void 0 : _window$app$__DEVELOP.customViewHostUrl : hostContext.hostUrl;
|
|
1833
1691
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1834
1692
|
children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
|
|
1835
1693
|
environment: window.app,
|
|
@@ -1838,6 +1696,7 @@ function CustomViewShell(props) {
|
|
|
1838
1696
|
children: _ref => {
|
|
1839
1697
|
let isAuthenticated = _ref.isAuthenticated;
|
|
1840
1698
|
if (isAuthenticated) {
|
|
1699
|
+
var _context2;
|
|
1841
1700
|
return jsxRuntime.jsx(applicationShellConnectors.CustomViewContextProvider, {
|
|
1842
1701
|
hostUrl: hostUrl,
|
|
1843
1702
|
customViewConfig: hostContext.customViewConfig,
|
|
@@ -1856,7 +1715,7 @@ function CustomViewShell(props) {
|
|
|
1856
1715
|
notificationsGlobalRef: notificationsGlobalRef,
|
|
1857
1716
|
notificationsPageRef: notificationsPageRef
|
|
1858
1717
|
}), jsxRuntime.jsxs(reactRouterDom.Route, {
|
|
1859
|
-
path:
|
|
1718
|
+
path: _concatInstanceProperty__default["default"](_context2 = "/custom-views/".concat(hostContext.customViewConfig.id, "/projects/")).call(_context2, hostContext.projectKey),
|
|
1860
1719
|
children: [jsxRuntime.jsx(applicationComponents.ModalPageTopBar, {
|
|
1861
1720
|
onClose: handleClose,
|
|
1862
1721
|
hidePathLabel: true
|
|
@@ -1992,7 +1851,7 @@ function setupGlobalErrorListener() {
|
|
|
1992
1851
|
}
|
|
1993
1852
|
|
|
1994
1853
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1995
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1854
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1996
1855
|
|
|
1997
1856
|
/**
|
|
1998
1857
|
* The route path to match. Usually it starts with `/:projectKey/my-entry-point`.
|
|
@@ -2002,7 +1861,8 @@ const makeRoute = (routePath, routeOptions) => {
|
|
|
2002
1861
|
const getUrl = (nextParams, nextQueryParams) => {
|
|
2003
1862
|
const baseUrl = reactRouterDom.generatePath(routePath, _objectSpread(_objectSpread({}, routeOptions.params), nextParams));
|
|
2004
1863
|
if (nextQueryParams) {
|
|
2005
|
-
|
|
1864
|
+
var _context;
|
|
1865
|
+
return _concatInstanceProperty__default["default"](_context = "".concat(baseUrl, "?")).call(_context, nextQueryParams.toString());
|
|
2006
1866
|
}
|
|
2007
1867
|
return baseUrl;
|
|
2008
1868
|
};
|
|
@@ -2035,7 +1895,6 @@ exports.ApplicationLoader = ApplicationLoader;
|
|
|
2035
1895
|
exports.ApplicationPageTitle = ApplicationPageTitle;
|
|
2036
1896
|
exports.ApplicationShell = ApplicationShell;
|
|
2037
1897
|
exports.ApplicationShellProvider = ApplicationShellProvider;
|
|
2038
|
-
exports.ButlerContainer = ButlerContainer;
|
|
2039
1898
|
exports.ConfigureIntlProvider = ConfigureIntlProvider;
|
|
2040
1899
|
exports.CustomViewShellWrapper = CustomViewShellWrapper;
|
|
2041
1900
|
exports.ErrorApologizer = ErrorApologizer;
|
|
@@ -2043,7 +1902,6 @@ exports.ErrorBoundary = ErrorBoundary;
|
|
|
2043
1902
|
exports.FetchProject = FetchProject;
|
|
2044
1903
|
exports.FetchUser = FetchUser;
|
|
2045
1904
|
exports.InjectReducers = InjectReducers;
|
|
2046
|
-
exports.ProjectDataLocale = ProjectDataLocale;
|
|
2047
1905
|
exports.ProjectSwitcher = ProjectSwitcher;
|
|
2048
1906
|
exports.ProtectedRoute = ProtectedRoute;
|
|
2049
1907
|
exports.REQUESTS_IN_FLIGHT_LOADER_DOM_ID = REQUESTS_IN_FLIGHT_LOADER_DOM_ID;
|
|
@@ -2055,7 +1913,6 @@ exports.SuspendedProtectedRoute = SuspendedProtectedRoute;
|
|
|
2055
1913
|
exports.SuspendedRoute = SuspendedRoute;
|
|
2056
1914
|
exports.getBrowserLocale = getBrowserLocale;
|
|
2057
1915
|
exports.getPreviousProjectKey = getPreviousProjectKey;
|
|
2058
|
-
exports.pimIndexerStates = pimIndexerStates;
|
|
2059
1916
|
exports.setupGlobalErrorListener = setupGlobalErrorListener;
|
|
2060
1917
|
exports.useRoutesCreator = useRoutesCreator;
|
|
2061
1918
|
exports.version = version;
|