@commercetools-frontend/application-shell 24.10.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-5039dc1d.esm.js → custom-view-dev-host-091163ea.esm.js} +20 -16
- package/dist/{custom-view-dev-host-b5e3a16a.cjs.dev.js → custom-view-dev-host-17daf42a.cjs.dev.js} +21 -16
- package/dist/{custom-view-dev-host-21561a3a.cjs.prod.js → custom-view-dev-host-a682a499.cjs.prod.js} +21 -16
- package/dist/declarations-connectors/src/index.d.ts +1 -1
- package/dist/declarations-connectors/src/utils/index.d.ts +1 -0
- package/dist/declarations-connectors/src/utils/select-user-language-from-storage/index.d.ts +1 -0
- package/dist/declarations-connectors/src/utils/select-user-language-from-storage/select-user-language-from-storage.d.ts +1 -0
- package/dist/{index-17f02024.cjs.dev.js → index-1d1cc31f.cjs.dev.js} +225 -368
- package/dist/{index-e4de734f.esm.js → index-1dadca21.esm.js} +227 -368
- package/dist/{index-614accc4.cjs.dev.js → index-25183095.cjs.dev.js} +2 -2
- package/dist/{index-11b385bb.cjs.prod.js → index-3cfc1f1e.cjs.prod.js} +213 -348
- 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-c014b1b0.esm.js → oidc-callback-019d623d.esm.js} +16 -14
- package/dist/{oidc-callback-ad64d7f6.cjs.dev.js → oidc-callback-47743232.cjs.dev.js} +16 -14
- package/dist/{oidc-callback-9beece27.cjs.prod.js → oidc-callback-6bdb3c6f.cjs.prod.js} +16 -14
- package/dist/{project-container-3e3c7013.cjs.dev.js → project-container-2245f020.cjs.dev.js} +53 -19
- package/dist/{project-container-e11b2fc6.esm.js → project-container-7fce9e66.esm.js} +52 -19
- package/dist/{project-container-f1710162.cjs.prod.js → project-container-954dbf0f.cjs.prod.js} +53 -19
- package/dist/{project-expired-39589063.esm.js → project-expired-1b0845c5.esm.js} +12 -11
- package/dist/{project-expired-f29e6d47.cjs.dev.js → project-expired-c941b592.cjs.dev.js} +12 -11
- package/dist/{project-expired-59169760.cjs.prod.js → project-expired-ee8b232c.cjs.prod.js} +12 -11
- package/dist/{project-not-found-88730a64.esm.js → project-not-found-340217f6.esm.js} +11 -10
- package/dist/{project-not-found-d968ede6.cjs.dev.js → project-not-found-9b7cfe88.cjs.dev.js} +11 -10
- package/dist/{project-not-found-625f0e91.cjs.prod.js → project-not-found-9cee9625.cjs.prod.js} +11 -10
- package/dist/{project-not-initialized-6d69541c.esm.js → project-not-initialized-55fd8df4.esm.js} +12 -11
- package/dist/{project-not-initialized-22d54dab.cjs.prod.js → project-not-initialized-7a058b68.cjs.prod.js} +12 -11
- package/dist/{project-not-initialized-f346dc17.cjs.dev.js → project-not-initialized-7b3843a3.cjs.dev.js} +12 -11
- package/dist/{project-suspended-d48e7d51.cjs.prod.js → project-suspended-12618898.cjs.prod.js} +11 -10
- package/dist/{project-suspended-be2e3265.esm.js → project-suspended-529b09d6.esm.js} +11 -10
- package/dist/{project-suspended-6a886974.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-645e12ca.cjs.prod.js → redirect-to-logout-52a7810f.cjs.prod.js} +14 -12
- package/dist/{redirect-to-logout-0196921c.esm.js → redirect-to-logout-5d5fc361.esm.js} +14 -12
- package/dist/{redirect-to-logout-477ea146.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-82b93073.esm.js → requests-in-flight-loader-20021ccc.esm.js} +11 -10
- package/dist/{requests-in-flight-loader-08cfa2ce.cjs.prod.js → requests-in-flight-loader-64d2e12d.cjs.prod.js} +11 -10
- package/dist/{requests-in-flight-loader-fb6a69f6.cjs.dev.js → requests-in-flight-loader-83cab813.cjs.dev.js} +11 -10
- package/dist/{service-page-project-switcher-2d65c6f7.cjs.dev.js → service-page-project-switcher-49dabe13.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-1e41f587.esm.js → service-page-project-switcher-6cdd506b.esm.js} +1 -1
- package/dist/{service-page-project-switcher-2746dbcc.cjs.prod.js → service-page-project-switcher-f1b43eb7.cjs.prod.js} +1 -1
- package/dist/{use-applications-menu-823a2492.cjs.dev.js → use-applications-menu-48d924bd.cjs.prod.js} +47 -39
- package/dist/{use-applications-menu-14a5a1f4.cjs.prod.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 +22 -22
- 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-67db2a39.cjs.dev.js +0 -1893
- package/dist/quick-access-8c34e976.esm.js +0 -1865
- package/dist/quick-access-9001b324.cjs.prod.js +0 -1875
|
@@ -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-f1710162.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);
|
|
662
|
-
|
|
663
|
-
const ButlerContainer = /*#__PURE__*/_styled__default["default"]("div", {
|
|
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
|
-
} );
|
|
669
|
-
|
|
670
|
-
var pimIndexerStates = {
|
|
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-9001b324.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
|
-
}
|
|
571
|
+
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-93183a2d.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
|
|
718
572
|
|
|
719
|
-
|
|
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';
|
|
573
|
+
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-954dbf0f.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
763
574
|
|
|
764
|
-
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./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,
|
|
@@ -944,6 +760,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
944
760
|
}
|
|
945
761
|
// Since we do not know the locale of the user, we pick it from the
|
|
946
762
|
// user's browser to attempt to match the language for the correct translations.
|
|
763
|
+
|
|
947
764
|
const userLocale = getBrowserLocale(window);
|
|
948
765
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
949
766
|
locale: userLocale,
|
|
@@ -961,11 +778,18 @@ const ApplicationShellAuthenticated = props => {
|
|
|
961
778
|
});
|
|
962
779
|
}
|
|
963
780
|
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
781
|
+
|
|
782
|
+
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
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;
|
|
784
|
+
const normalizedUser = user ? _objectSpread$8(_objectSpread$8({}, user), {}, {
|
|
785
|
+
// set the staff bar language if applicable
|
|
786
|
+
language: staffBarLanguage !== null && staffBarLanguage !== void 0 ? staffBarLanguage : user.language
|
|
787
|
+
}) : undefined;
|
|
964
788
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
965
|
-
user:
|
|
789
|
+
user: normalizedUser,
|
|
966
790
|
environment: applicationEnvironment,
|
|
967
791
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
968
|
-
locale:
|
|
792
|
+
locale: normalizedUser === null || normalizedUser === void 0 ? void 0 : normalizedUser.language,
|
|
969
793
|
applicationMessages: props.applicationMessages,
|
|
970
794
|
children: _ref7 => {
|
|
971
795
|
let isLoadingLocaleData = _ref7.isLoading,
|
|
@@ -979,14 +803,14 @@ const ApplicationShellAuthenticated = props => {
|
|
|
979
803
|
messages
|
|
980
804
|
}), {}, {
|
|
981
805
|
children: jsxRuntime.jsx(SetupFlopFlipProvider, {
|
|
982
|
-
user:
|
|
806
|
+
user: normalizedUser,
|
|
983
807
|
projectKey: projectKeyFromUrl,
|
|
984
808
|
ldClientSideId: applicationEnvironment.ldClientSideId,
|
|
985
809
|
flags: props.featureFlags,
|
|
986
810
|
defaultFlags: props.defaultFeatureFlags,
|
|
987
811
|
children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
988
812
|
children: [jsxRuntime.jsx(ThemeSwitcher, {}), jsxRuntime.jsx(RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
|
|
989
|
-
user:
|
|
813
|
+
user: normalizedUser
|
|
990
814
|
}), jsxRuntime.jsxs("div", {
|
|
991
815
|
css: /*#__PURE__*/react$1.css("height:100vh;display:grid;grid-template-rows:auto ", oidc.DIMENSIONS.header, " 1fr;grid-template-columns:min-content 1fr;" + ("" ), "" ),
|
|
992
816
|
children: [jsxRuntime.jsxs("div", {
|
|
@@ -999,43 +823,10 @@ const ApplicationShellAuthenticated = props => {
|
|
|
999
823
|
}), jsxRuntime.jsx(reactNotifications.NotificationsList, {
|
|
1000
824
|
domain: constants.DOMAINS.GLOBAL
|
|
1001
825
|
})]
|
|
1002
|
-
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1003
|
-
children: () => {
|
|
1004
|
-
if (!projectKeyFromUrl) return jsxRuntime.jsx(QuickAccessTrigger, {});
|
|
1005
|
-
return jsxRuntime.jsx(FetchProject, {
|
|
1006
|
-
projectKey: projectKeyFromUrl,
|
|
1007
|
-
children: _ref8 => {
|
|
1008
|
-
let isProjectLoading = _ref8.isLoading,
|
|
1009
|
-
project = _ref8.project;
|
|
1010
|
-
if (isProjectLoading || !project) return null;
|
|
1011
|
-
|
|
1012
|
-
// when used outside of a project context,
|
|
1013
|
-
// or when the project is expired or supsended
|
|
1014
|
-
const shouldUseProjectContext = !(project.suspension && project.suspension.isActive || project.expiry && project.expiry.isActive);
|
|
1015
|
-
if (!shouldUseProjectContext) return jsxRuntime.jsx(QuickAccessTrigger, {});
|
|
1016
|
-
return jsxRuntime.jsx(ProjectDataLocale, {
|
|
1017
|
-
locales: project.languages,
|
|
1018
|
-
children: _ref9 => {
|
|
1019
|
-
let dataLocale = _ref9.locale,
|
|
1020
|
-
setProjectDataLocale = _ref9.setProjectDataLocale;
|
|
1021
|
-
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
1022
|
-
user: user,
|
|
1023
|
-
project: project,
|
|
1024
|
-
projectDataLocale: dataLocale,
|
|
1025
|
-
environment: applicationEnvironment,
|
|
1026
|
-
children: jsxRuntime.jsx(QuickAccessTrigger, {
|
|
1027
|
-
onChangeProjectDataLocale: setProjectDataLocale
|
|
1028
|
-
})
|
|
1029
|
-
});
|
|
1030
|
-
}
|
|
1031
|
-
});
|
|
1032
|
-
}
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
826
|
}), jsxRuntime.jsx("header", {
|
|
1036
827
|
css: _ref3,
|
|
1037
828
|
children: jsxRuntime.jsx(AppBar, {
|
|
1038
|
-
user:
|
|
829
|
+
user: normalizedUser,
|
|
1039
830
|
projectKeyFromUrl: projectKeyFromUrl
|
|
1040
831
|
})
|
|
1041
832
|
}), jsxRuntime.jsx("aside", {
|
|
@@ -1054,12 +845,12 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1054
845
|
if (!projectKeyFromUrl) return null;
|
|
1055
846
|
return jsxRuntime.jsx(FetchProject, {
|
|
1056
847
|
projectKey: projectKeyFromUrl,
|
|
1057
|
-
children:
|
|
1058
|
-
let isLoadingProject =
|
|
1059
|
-
project =
|
|
848
|
+
children: _ref8 => {
|
|
849
|
+
let isLoadingProject = _ref8.isLoading,
|
|
850
|
+
project = _ref8.project;
|
|
1060
851
|
const isLoading = isLoadingUser || isLoadingLocaleData || isLoadingProject || !locale || !project;
|
|
1061
852
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
1062
|
-
user:
|
|
853
|
+
user: normalizedUser,
|
|
1063
854
|
environment: applicationEnvironment
|
|
1064
855
|
// NOTE: do not pass the `project` into the application context.
|
|
1065
856
|
// The permissions for the Navbar are resolved separately, within
|
|
@@ -1122,8 +913,8 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1122
913
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1123
914
|
exact: true,
|
|
1124
915
|
path: "/",
|
|
1125
|
-
children: (
|
|
1126
|
-
const previousProjectKey = getPreviousProjectKey(
|
|
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);
|
|
1127
918
|
|
|
1128
919
|
/**
|
|
1129
920
|
* NOTE:
|
|
@@ -1133,17 +924,17 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1133
924
|
* Given the user was working on a project previously or has a default
|
|
1134
925
|
* project, the application will redirect to that project.
|
|
1135
926
|
*/
|
|
1136
|
-
if (!
|
|
927
|
+
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1137
928
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
1138
929
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
1139
|
-
to:
|
|
930
|
+
to: "/".concat(previousProjectKey)
|
|
1140
931
|
});
|
|
1141
932
|
})()
|
|
1142
933
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1143
934
|
exact: false,
|
|
1144
935
|
path: "/:projectKey",
|
|
1145
936
|
children: jsxRuntime.jsx(ProjectContainer, {
|
|
1146
|
-
user:
|
|
937
|
+
user: normalizedUser,
|
|
1147
938
|
environment: applicationEnvironment,
|
|
1148
939
|
disableRoutePermissionCheck: props.disableRoutePermissionCheck
|
|
1149
940
|
// This effectively renders the
|
|
@@ -1312,31 +1103,37 @@ const withoutProjectKeyClaim = scope => {
|
|
|
1312
1103
|
return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, claim => !_startsWithInstanceProperty__default["default"](claim).call(claim, oidc.OIDC_CLAIMS.PROJECT_KEY)).join(' ');
|
|
1313
1104
|
};
|
|
1314
1105
|
const hasCachedAuthenticationState = () => {
|
|
1315
|
-
|
|
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) {
|
|
1316
1108
|
try {
|
|
1109
|
+
var _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP0, _window$app$__DEVELOP1;
|
|
1317
1110
|
let activeProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
|
|
1318
1111
|
if (activeProjectKey) {
|
|
1112
|
+
var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4;
|
|
1319
1113
|
// GIVEN The application is not requesting a project key,
|
|
1320
1114
|
// THEN we assume that the application does not need a project context.
|
|
1321
1115
|
// GIVEN The application is not requesting a project key,
|
|
1322
1116
|
// THEN we remove the cached project key.
|
|
1323
1117
|
// This is the case of an application like `account`.
|
|
1324
|
-
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)) {
|
|
1325
1119
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1326
1120
|
}
|
|
1327
1121
|
|
|
1328
1122
|
// If the project key we had in the storage does not match the one
|
|
1329
1123
|
// we have in the development config, then we need to discard it and
|
|
1330
1124
|
// use the one from the development config.
|
|
1331
|
-
if (window.app.__DEVELOPMENT__
|
|
1332
|
-
|
|
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;
|
|
1333
1128
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(activeProjectKey);
|
|
1334
1129
|
}
|
|
1335
1130
|
} else {
|
|
1336
|
-
|
|
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;
|
|
1337
1134
|
// Here we store the initial project key in local storage,
|
|
1338
1135
|
// so that it gets picked up when we initiate the login flow.
|
|
1339
|
-
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);
|
|
1340
1137
|
}
|
|
1341
1138
|
}
|
|
1342
1139
|
|
|
@@ -1351,11 +1148,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1351
1148
|
}
|
|
1352
1149
|
// Rebuild the requested OIDC scope to verify that it didn't change.
|
|
1353
1150
|
const requestedScope = oidc.buildOidcScope({
|
|
1354
|
-
projectKey: activeProjectKey
|
|
1355
|
-
oAuthScopes: window.app.__DEVELOPMENT__
|
|
1356
|
-
additionalOAuthScopes: window.app.__DEVELOPMENT__
|
|
1357
|
-
teamId: window.app.__DEVELOPMENT__
|
|
1358
|
-
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
|
|
1359
1156
|
});
|
|
1360
1157
|
// Omit the project key from the check. This allows to switch projects
|
|
1361
1158
|
// without having to log in again.
|
|
@@ -1373,11 +1170,12 @@ const hasCachedAuthenticationState = () => {
|
|
|
1373
1170
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1374
1171
|
};
|
|
1375
1172
|
|
|
1376
|
-
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" */); }));
|
|
1377
1174
|
|
|
1378
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; }
|
|
1379
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; }
|
|
1380
1177
|
const Authenticated = props => {
|
|
1178
|
+
var _window$app$__DEVELOP;
|
|
1381
1179
|
// We attempt to see if the user was already authenticated by looking
|
|
1382
1180
|
// at the "cached" flag in local storage.
|
|
1383
1181
|
const cachedAuthenticationState = hasCachedAuthenticationState();
|
|
@@ -1391,7 +1189,7 @@ const Authenticated = props => {
|
|
|
1391
1189
|
|
|
1392
1190
|
// When using the OIDC workflow, we always return false, to trigger
|
|
1393
1191
|
// the redirect to the login page.
|
|
1394
|
-
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) {
|
|
1395
1193
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1396
1194
|
children: props.render({
|
|
1397
1195
|
isAuthenticated: false
|
|
@@ -1405,13 +1203,13 @@ const Authenticated = props => {
|
|
|
1405
1203
|
Authenticated.displayName = 'Authenticated';
|
|
1406
1204
|
const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1407
1205
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1408
|
-
path:
|
|
1206
|
+
path: "/account/oidc/callback",
|
|
1409
1207
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1410
1208
|
locale: props.locale,
|
|
1411
1209
|
applicationMessages: props.applicationMessages
|
|
1412
1210
|
})
|
|
1413
1211
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1414
|
-
path:
|
|
1212
|
+
path: "/:projectKey/:identifier/oidc/callback",
|
|
1415
1213
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1416
1214
|
locale: props.locale,
|
|
1417
1215
|
applicationMessages: props.applicationMessages
|
|
@@ -1422,6 +1220,63 @@ const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
|
1422
1220
|
});
|
|
1423
1221
|
AuthenticationRoutes.displayName = 'AuthenticationRoutes';
|
|
1424
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
|
+
|
|
1425
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; }
|
|
1426
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; }
|
|
1427
1282
|
/**
|
|
@@ -1467,7 +1322,10 @@ const useCoercedEnvironmentValues = environment => {
|
|
|
1467
1322
|
};
|
|
1468
1323
|
|
|
1469
1324
|
const ApplicationShellProvider = props => {
|
|
1470
|
-
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]);
|
|
1471
1329
|
react.useEffect(() => {
|
|
1472
1330
|
applicationShellConnectors.setCachedApolloClient(apolloClient);
|
|
1473
1331
|
}, [apolloClient]);
|
|
@@ -1518,7 +1376,7 @@ const ApplicationShellProvider = props => {
|
|
|
1518
1376
|
};
|
|
1519
1377
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1520
1378
|
|
|
1521
|
-
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" */); }));
|
|
1522
1380
|
|
|
1523
1381
|
const styles = {
|
|
1524
1382
|
name: "gx7yk8",
|
|
@@ -1541,7 +1399,8 @@ const StrictModeEnablement$1 = props => {
|
|
|
1541
1399
|
};
|
|
1542
1400
|
const ApplicationShell = props => {
|
|
1543
1401
|
react.useEffect(() => {
|
|
1544
|
-
|
|
1402
|
+
var _props$onRegisterErro;
|
|
1403
|
+
(_props$onRegisterErro = props.onRegisterErrorListeners) === null || _props$onRegisterErro === void 0 || _props$onRegisterErro.call(props, {
|
|
1545
1404
|
dispatch: index.internalReduxStore.dispatch
|
|
1546
1405
|
});
|
|
1547
1406
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1581,14 +1440,18 @@ const ApplicationShell = props => {
|
|
|
1581
1440
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1582
1441
|
ApplicationShell.version = version;
|
|
1583
1442
|
|
|
1584
|
-
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" */); }));
|
|
1585
1444
|
|
|
1586
1445
|
function CustomViewFlopFlipProvider(props) {
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
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]);
|
|
1592
1455
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
1593
1456
|
adapter: memoryAdapter.adapter,
|
|
1594
1457
|
defaultFlags: _flagsInstanceProperty__default["default"](props),
|
|
@@ -1624,7 +1487,7 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1624
1487
|
return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1625
1488
|
}
|
|
1626
1489
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
1627
|
-
locale: user
|
|
1490
|
+
locale: (user === null || user === void 0 ? void 0 : user.language) || browserLocale,
|
|
1628
1491
|
applicationMessages: props.messages,
|
|
1629
1492
|
children: _ref2 => {
|
|
1630
1493
|
let isLoadingLocaleData = _ref2.isLoading,
|
|
@@ -1687,15 +1550,15 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1687
1550
|
const customViewsThemesOverrides = {
|
|
1688
1551
|
default: {
|
|
1689
1552
|
marginForCustomViewsSelectorAsTabular: '0',
|
|
1690
|
-
marginForPageContent:
|
|
1691
|
-
paddingForDetailPageHeader:
|
|
1553
|
+
marginForPageContent: "".concat(designSystem.designTokens.spacing50, " 0"),
|
|
1554
|
+
paddingForDetailPageHeader: "0 0 ".concat(designSystem.designTokens.spacing40, " 0"),
|
|
1692
1555
|
paddingForMainPageHeader: '0',
|
|
1693
1556
|
paddingForTabularPageHeader: '0'
|
|
1694
1557
|
}
|
|
1695
1558
|
};
|
|
1696
1559
|
|
|
1697
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; }
|
|
1698
|
-
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; }
|
|
1699
1562
|
const browserLocale = getBrowserLocale(window);
|
|
1700
1563
|
function NotificationsContainer(props) {
|
|
1701
1564
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1752,6 +1615,7 @@ function CustomViewThemeProvider() {
|
|
|
1752
1615
|
*/
|
|
1753
1616
|
const isLocalProdMode = window.app.env === 'development';
|
|
1754
1617
|
function CustomViewShell(props) {
|
|
1618
|
+
var _window$app$__DEVELOP;
|
|
1755
1619
|
const _useState = react.useState(),
|
|
1756
1620
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1757
1621
|
hostContext = _useState2[0],
|
|
@@ -1767,20 +1631,21 @@ function CustomViewShell(props) {
|
|
|
1767
1631
|
if (event.data.eventName === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION) {
|
|
1768
1632
|
setHostContext(event.data.eventData.context);
|
|
1769
1633
|
} else {
|
|
1770
|
-
console.warn(
|
|
1634
|
+
console.warn("CustomViewShell: Unknown received event with name: ".concat(event.data.eventName), {
|
|
1771
1635
|
event
|
|
1772
1636
|
});
|
|
1773
1637
|
}
|
|
1774
1638
|
}, []);
|
|
1775
1639
|
const handleClose = react.useCallback(() => {
|
|
1776
|
-
|
|
1640
|
+
var _iFrameCommunicationP, _context;
|
|
1641
|
+
(_iFrameCommunicationP = iFrameCommunicationPort.current) === null || _iFrameCommunicationP === void 0 || _iFrameCommunicationP.postMessage({
|
|
1777
1642
|
origin: window.location.origin,
|
|
1778
|
-
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),
|
|
1779
1644
|
destination: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
|
|
1780
1645
|
eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE,
|
|
1781
1646
|
eventData: {}
|
|
1782
1647
|
});
|
|
1783
|
-
}, [hostContext
|
|
1648
|
+
}, [hostContext === null || hostContext === void 0 ? void 0 : hostContext.customViewConfig.id]);
|
|
1784
1649
|
react.useEffect(() => {
|
|
1785
1650
|
const bootstrapMessageHandler = event => {
|
|
1786
1651
|
if ((event.origin === window.location.origin ||
|
|
@@ -1812,7 +1677,8 @@ function CustomViewShell(props) {
|
|
|
1812
1677
|
react.useEffect(() => {
|
|
1813
1678
|
// Close the channel when the component unmounts
|
|
1814
1679
|
return () => {
|
|
1815
|
-
|
|
1680
|
+
var _iFrameCommunicationP2;
|
|
1681
|
+
(_iFrameCommunicationP2 = iFrameCommunicationPort.current) === null || _iFrameCommunicationP2 === void 0 || _iFrameCommunicationP2.close();
|
|
1816
1682
|
iFrameCommunicationPort.current = undefined;
|
|
1817
1683
|
};
|
|
1818
1684
|
}, []);
|
|
@@ -1821,7 +1687,7 @@ function CustomViewShell(props) {
|
|
|
1821
1687
|
showLogo: true
|
|
1822
1688
|
});
|
|
1823
1689
|
}
|
|
1824
|
-
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;
|
|
1825
1691
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1826
1692
|
children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
|
|
1827
1693
|
environment: window.app,
|
|
@@ -1830,6 +1696,7 @@ function CustomViewShell(props) {
|
|
|
1830
1696
|
children: _ref => {
|
|
1831
1697
|
let isAuthenticated = _ref.isAuthenticated;
|
|
1832
1698
|
if (isAuthenticated) {
|
|
1699
|
+
var _context2;
|
|
1833
1700
|
return jsxRuntime.jsx(applicationShellConnectors.CustomViewContextProvider, {
|
|
1834
1701
|
hostUrl: hostUrl,
|
|
1835
1702
|
customViewConfig: hostContext.customViewConfig,
|
|
@@ -1848,7 +1715,7 @@ function CustomViewShell(props) {
|
|
|
1848
1715
|
notificationsGlobalRef: notificationsGlobalRef,
|
|
1849
1716
|
notificationsPageRef: notificationsPageRef
|
|
1850
1717
|
}), jsxRuntime.jsxs(reactRouterDom.Route, {
|
|
1851
|
-
path:
|
|
1718
|
+
path: _concatInstanceProperty__default["default"](_context2 = "/custom-views/".concat(hostContext.customViewConfig.id, "/projects/")).call(_context2, hostContext.projectKey),
|
|
1852
1719
|
children: [jsxRuntime.jsx(applicationComponents.ModalPageTopBar, {
|
|
1853
1720
|
onClose: handleClose,
|
|
1854
1721
|
hidePathLabel: true
|
|
@@ -1984,7 +1851,7 @@ function setupGlobalErrorListener() {
|
|
|
1984
1851
|
}
|
|
1985
1852
|
|
|
1986
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; }
|
|
1987
|
-
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; }
|
|
1988
1855
|
|
|
1989
1856
|
/**
|
|
1990
1857
|
* The route path to match. Usually it starts with `/:projectKey/my-entry-point`.
|
|
@@ -1994,7 +1861,8 @@ const makeRoute = (routePath, routeOptions) => {
|
|
|
1994
1861
|
const getUrl = (nextParams, nextQueryParams) => {
|
|
1995
1862
|
const baseUrl = reactRouterDom.generatePath(routePath, _objectSpread(_objectSpread({}, routeOptions.params), nextParams));
|
|
1996
1863
|
if (nextQueryParams) {
|
|
1997
|
-
|
|
1864
|
+
var _context;
|
|
1865
|
+
return _concatInstanceProperty__default["default"](_context = "".concat(baseUrl, "?")).call(_context, nextQueryParams.toString());
|
|
1998
1866
|
}
|
|
1999
1867
|
return baseUrl;
|
|
2000
1868
|
};
|
|
@@ -2027,7 +1895,6 @@ exports.ApplicationLoader = ApplicationLoader;
|
|
|
2027
1895
|
exports.ApplicationPageTitle = ApplicationPageTitle;
|
|
2028
1896
|
exports.ApplicationShell = ApplicationShell;
|
|
2029
1897
|
exports.ApplicationShellProvider = ApplicationShellProvider;
|
|
2030
|
-
exports.ButlerContainer = ButlerContainer;
|
|
2031
1898
|
exports.ConfigureIntlProvider = ConfigureIntlProvider;
|
|
2032
1899
|
exports.CustomViewShellWrapper = CustomViewShellWrapper;
|
|
2033
1900
|
exports.ErrorApologizer = ErrorApologizer;
|
|
@@ -2035,7 +1902,6 @@ exports.ErrorBoundary = ErrorBoundary;
|
|
|
2035
1902
|
exports.FetchProject = FetchProject;
|
|
2036
1903
|
exports.FetchUser = FetchUser;
|
|
2037
1904
|
exports.InjectReducers = InjectReducers;
|
|
2038
|
-
exports.ProjectDataLocale = ProjectDataLocale;
|
|
2039
1905
|
exports.ProjectSwitcher = ProjectSwitcher;
|
|
2040
1906
|
exports.ProtectedRoute = ProtectedRoute;
|
|
2041
1907
|
exports.REQUESTS_IN_FLIGHT_LOADER_DOM_ID = REQUESTS_IN_FLIGHT_LOADER_DOM_ID;
|
|
@@ -2047,7 +1913,6 @@ exports.SuspendedProtectedRoute = SuspendedProtectedRoute;
|
|
|
2047
1913
|
exports.SuspendedRoute = SuspendedRoute;
|
|
2048
1914
|
exports.getBrowserLocale = getBrowserLocale;
|
|
2049
1915
|
exports.getPreviousProjectKey = getPreviousProjectKey;
|
|
2050
|
-
exports.pimIndexerStates = pimIndexerStates;
|
|
2051
1916
|
exports.setupGlobalErrorListener = setupGlobalErrorListener;
|
|
2052
1917
|
exports.useRoutesCreator = useRoutesCreator;
|
|
2053
1918
|
exports.version = version;
|