@commercetools-frontend/application-shell 27.10.0 → 27.11.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/{index-245e2980.cjs.prod.js → application-entry-point-516fd72c.cjs.prod.js} +70 -4
- package/dist/{index-86039df7.esm.js → application-entry-point-e20cafdb.esm.js} +81 -7
- package/dist/{index-614accc4.cjs.dev.js → application-entry-point-e5623556.cjs.dev.js} +80 -4
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +14 -13
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +14 -13
- package/dist/commercetools-frontend-application-shell.esm.js +12 -11
- package/dist/{custom-view-dev-host-c5cae7af.cjs.prod.js → custom-view-dev-host-24cfaf96.cjs.prod.js} +6 -5
- package/dist/{custom-view-dev-host-8925c254.esm.js → custom-view-dev-host-802ebe34.esm.js} +6 -5
- package/dist/{custom-view-dev-host-16c18b8b.cjs.dev.js → custom-view-dev-host-c2b65fe2.cjs.dev.js} +6 -5
- package/dist/declarations/src/types/generated/mc.d.ts +121 -0
- package/dist/declarations-connectors/src/components/application-context/application-context.d.ts +4 -0
- package/dist/declarations-connectors/src/types/generated/mc.d.ts +121 -0
- package/dist/index-177f89cf.esm.js +2075 -0
- package/dist/index-3244236c.cjs.dev.js +2136 -0
- package/dist/{index-ce507805.cjs.prod.js → index-fc58c6bb.cjs.prod.js} +138 -77
- package/dist/{navbar-f4b2552d.cjs.prod.js → navbar-4bc16e7b.cjs.prod.js} +53 -10
- package/dist/{navbar-59504b51.cjs.dev.js → navbar-5c41b7a0.cjs.dev.js} +56 -10
- package/dist/{navbar-9eb6c972.esm.js → navbar-5e436a16.esm.js} +57 -11
- package/dist/{oidc-callback-ec951044.cjs.dev.js → oidc-callback-1c6e8104.cjs.dev.js} +7 -6
- package/dist/{oidc-callback-5b213b4f.cjs.prod.js → oidc-callback-b0d573ac.cjs.prod.js} +7 -6
- package/dist/{oidc-callback-1836d6f9.esm.js → oidc-callback-b409680a.esm.js} +7 -6
- package/dist/{project-container-d44394a1.cjs.prod.js → project-container-4f14fd7c.cjs.prod.js} +12 -13
- package/dist/{project-container-7f13b722.esm.js → project-container-b73d2651.esm.js} +12 -13
- package/dist/{project-container-bd7b1263.cjs.dev.js → project-container-b75269ed.cjs.dev.js} +12 -13
- package/dist/{project-expired-200d21fc.cjs.dev.js → project-expired-1cda3b7e.cjs.dev.js} +8 -7
- package/dist/{project-expired-b0f48929.esm.js → project-expired-cb01ca7d.esm.js} +8 -7
- package/dist/{project-expired-fbd3b921.cjs.prod.js → project-expired-f19a3356.cjs.prod.js} +8 -7
- package/dist/{project-not-found-2c4da477.cjs.prod.js → project-not-found-52441a8a.cjs.prod.js} +8 -7
- package/dist/{project-not-found-6a2f3959.cjs.dev.js → project-not-found-548c0653.cjs.dev.js} +8 -7
- package/dist/{project-not-found-2b48a462.esm.js → project-not-found-69a22191.esm.js} +8 -7
- package/dist/{project-not-initialized-d1532d05.cjs.prod.js → project-not-initialized-6c2babc1.cjs.prod.js} +8 -7
- package/dist/{project-not-initialized-a4cdccae.cjs.dev.js → project-not-initialized-bc2258f1.cjs.dev.js} +8 -7
- package/dist/{project-not-initialized-8324ddc0.esm.js → project-not-initialized-f0168385.esm.js} +8 -7
- package/dist/{project-suspended-0450891d.cjs.prod.js → project-suspended-31c52b75.cjs.prod.js} +8 -7
- package/dist/{project-suspended-42ac696c.cjs.dev.js → project-suspended-6a83941a.cjs.dev.js} +8 -7
- package/dist/{project-suspended-ab7faf16.esm.js → project-suspended-ef485212.esm.js} +8 -7
- package/dist/{redirect-to-login-6675c038.cjs.prod.js → redirect-to-login-18f6e1b8.cjs.prod.js} +1 -1
- package/dist/{redirect-to-login-8a61864c.cjs.dev.js → redirect-to-login-4dbf1c4e.cjs.dev.js} +1 -1
- package/dist/{redirect-to-login-b79d0910.esm.js → redirect-to-login-79be7369.esm.js} +2 -2
- package/dist/{redirect-to-logout-4de14b5d.esm.js → redirect-to-logout-404ac2d3.esm.js} +9 -8
- package/dist/{redirect-to-logout-37258f53.cjs.dev.js → redirect-to-logout-4ccdb9c6.cjs.dev.js} +8 -7
- package/dist/{redirect-to-logout-71e8db26.cjs.prod.js → redirect-to-logout-a42e3df6.cjs.prod.js} +8 -7
- package/dist/{redirect-to-project-create-9249e554.esm.js → redirect-to-project-create-3a88851c.esm.js} +2 -1
- package/dist/{redirect-to-project-create-e4ff7797.cjs.prod.js → redirect-to-project-create-603634dd.cjs.prod.js} +2 -1
- package/dist/{redirect-to-project-create-f4f01842.cjs.dev.js → redirect-to-project-create-611ee583.cjs.dev.js} +2 -1
- package/dist/{requests-in-flight-loader-60a2553f.cjs.dev.js → requests-in-flight-loader-324287e5.cjs.dev.js} +8 -7
- package/dist/{requests-in-flight-loader-b33d695b.cjs.prod.js → requests-in-flight-loader-7cc3150d.cjs.prod.js} +8 -7
- package/dist/{requests-in-flight-loader-dd13291f.esm.js → requests-in-flight-loader-f969e2f0.esm.js} +8 -7
- package/dist/{service-page-project-switcher-70a8155d.cjs.prod.js → service-page-project-switcher-87f8935d.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-db1d0801.esm.js → service-page-project-switcher-a55a912e.esm.js} +1 -1
- package/dist/{service-page-project-switcher-974235d0.cjs.dev.js → service-page-project-switcher-c91f0690.cjs.dev.js} +1 -1
- package/dist/{use-applications-menu-bd718ac8.cjs.dev.js → use-applications-menu-3526c994.cjs.prod.js} +3 -1
- package/dist/{use-applications-menu-8984efa1.cjs.prod.js → use-applications-menu-c36dd4d1.cjs.dev.js} +3 -1
- package/dist/{use-applications-menu-bc2b9a66.esm.js → use-applications-menu-ed43547f.esm.js} +3 -1
- package/dist/{user-settings-menu-2235add2.cjs.prod.js → user-settings-menu-06f023d0.cjs.prod.js} +3 -3
- package/dist/user-settings-menu-5ff9536e.cjs.dev.js +345 -0
- package/dist/user-settings-menu-64158494.esm.js +320 -0
- package/package.json +17 -17
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +6 -6
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +6 -6
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +4 -4
- package/dist/application-entry-point-10a5e1a5.esm.js +0 -82
- package/dist/application-entry-point-8c4b8e53.cjs.prod.js +0 -86
- package/dist/application-entry-point-c87294b0.cjs.dev.js +0 -96
- package/dist/index-ac7ed4f7.esm.js +0 -2014
- package/dist/index-c7140b1c.cjs.dev.js +0 -2075
- package/dist/user-settings-menu-a1d0ba8e.esm.js +0 -320
- package/dist/user-settings-menu-b8359b8b.cjs.dev.js +0 -345
|
@@ -2,29 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
var reactRouterDom = require('react-router-dom');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var _styled = require('@emotion/styled/base');
|
|
8
|
-
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
9
|
-
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
10
|
-
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
5
|
+
var constants = require('@commercetools-frontend/constants');
|
|
6
|
+
var applicationEntryPoint = require('./application-entry-point-516fd72c.cjs.prod.js');
|
|
11
7
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
12
8
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
13
|
-
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
14
9
|
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
15
10
|
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
16
11
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
17
12
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
18
13
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
14
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
15
|
+
var _styled = require('@emotion/styled/base');
|
|
16
|
+
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
17
|
+
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
18
|
+
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
19
|
+
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
20
|
+
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
19
21
|
var react$1 = require('@emotion/react');
|
|
20
22
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
21
23
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
22
|
-
var constants = require('@commercetools-frontend/constants');
|
|
23
24
|
var i18n = require('@commercetools-frontend/i18n');
|
|
24
25
|
var reactNotifications = require('@commercetools-frontend/react-notifications');
|
|
25
26
|
var sentry = require('@commercetools-frontend/sentry');
|
|
26
27
|
var oidc = require('./oidc-0cba182b.cjs.prod.js');
|
|
27
28
|
require('@babel/runtime-corejs3/core-js-stable/url');
|
|
29
|
+
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
28
30
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
29
31
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
30
32
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
@@ -34,7 +36,6 @@ var icons = require('@commercetools-uikit/icons');
|
|
|
34
36
|
var location = require('./location-537e0660.cjs.prod.js');
|
|
35
37
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
36
38
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
37
|
-
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
38
39
|
var memoize = require('memoize-one');
|
|
39
40
|
var reactSelect = require('react-select');
|
|
40
41
|
var AccessibleHidden = require('@commercetools-uikit/accessible-hidden');
|
|
@@ -55,7 +56,6 @@ var launchdarklyAdapter = require('@flopflip/launchdarkly-adapter');
|
|
|
55
56
|
var reactBroadcast = require('@flopflip/react-broadcast');
|
|
56
57
|
var types = require('@flopflip/types');
|
|
57
58
|
var reactRedux = require('react-redux');
|
|
58
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
59
59
|
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
60
60
|
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
61
61
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
@@ -74,22 +74,22 @@ var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
|
74
74
|
|
|
75
75
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
76
76
|
|
|
77
|
-
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
78
|
-
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
79
|
-
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
80
|
-
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
81
77
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
82
78
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
83
|
-
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
84
79
|
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
|
|
85
80
|
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
86
81
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
87
82
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
88
83
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
84
|
+
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
85
|
+
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
86
|
+
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
87
|
+
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
88
|
+
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
89
|
+
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
89
90
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
90
91
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
91
92
|
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
92
|
-
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
93
93
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
94
94
|
var AccessibleHidden__default = /*#__PURE__*/_interopDefault(AccessibleHidden);
|
|
95
95
|
var SelectInput__default = /*#__PURE__*/_interopDefault(SelectInput);
|
|
@@ -107,9 +107,9 @@ var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
|
107
107
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
108
108
|
|
|
109
109
|
// NOTE: This string will be replaced on build time with the package version.
|
|
110
|
-
var version = "27.
|
|
110
|
+
var version = "27.11.0";
|
|
111
111
|
|
|
112
|
-
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-
|
|
112
|
+
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-7cc3150d.cjs.prod.js' /* webpackChunkName: "requests-in-flight-loader" */); }));
|
|
113
113
|
|
|
114
114
|
// Attempt to load the `projectKey` from localStorage
|
|
115
115
|
function selectProjectKeyFromLocalStorage() {
|
|
@@ -123,6 +123,25 @@ const getPreviousProjectKey = defaultProjectKeyOfUser => {
|
|
|
123
123
|
return;
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
+
// Resolves the project key the application runs in, which is usually the one
|
|
127
|
+
// in the URL. On paths like `/agent-sphere` the project key is not part of the
|
|
128
|
+
// URL, so it falls back to the previously used project.
|
|
129
|
+
const selectProjectKeyInContext = _ref => {
|
|
130
|
+
let pathname = _ref.pathname,
|
|
131
|
+
defaultProjectKeyOfUser = _ref.defaultProjectKeyOfUser;
|
|
132
|
+
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(pathname);
|
|
133
|
+
if (projectKeyFromUrl) {
|
|
134
|
+
return projectKeyFromUrl;
|
|
135
|
+
}
|
|
136
|
+
const _pathname$split = pathname.split('/'),
|
|
137
|
+
_pathname$split2 = _slicedToArray(_pathname$split, 2),
|
|
138
|
+
topLevelPath = _pathname$split2[1];
|
|
139
|
+
if (constants.isProjectKeylessApplicationEntryPointInProjectContext(topLevelPath)) {
|
|
140
|
+
return getPreviousProjectKey(defaultProjectKeyOfUser);
|
|
141
|
+
}
|
|
142
|
+
return undefined;
|
|
143
|
+
};
|
|
144
|
+
|
|
126
145
|
const PERFORMANCE_MARKS = {
|
|
127
146
|
SKELETON_VISIBLE: 'mc:skeleton-visible',
|
|
128
147
|
SHELL_CHROME_MOUNTED: 'mc:shell-chrome-mounted',
|
|
@@ -412,8 +431,9 @@ ProjectSwitcher.displayName = 'ProjectSwitcher';
|
|
|
412
431
|
// eslint-disable-next-line import/prefer-default-export
|
|
413
432
|
const REQUESTS_IN_FLIGHT_LOADER_DOM_ID = 'loader-for-requests-in-flight';
|
|
414
433
|
|
|
415
|
-
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-
|
|
434
|
+
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-06f023d0.cjs.prod.js' /* webpackChunkName: "user-settings-menu" */); }));
|
|
416
435
|
|
|
436
|
+
const isStaticRouteWithoutProjectContext = topLevelPath => Boolean(topLevelPath) && constants.isStaticUrlPathInPositionOfProjectKey(topLevelPath) && !constants.isProjectKeylessApplicationEntryPointInProjectContext(topLevelPath);
|
|
417
437
|
var _ref$2 = {
|
|
418
438
|
name: "zjik7",
|
|
419
439
|
styles: "display:flex"
|
|
@@ -427,6 +447,11 @@ var _ref3$1 = {
|
|
|
427
447
|
styles: "height:22px"
|
|
428
448
|
} ;
|
|
429
449
|
const AppBar = props => {
|
|
450
|
+
const _useLocation = reactRouterDom.useLocation(),
|
|
451
|
+
pathname = _useLocation.pathname;
|
|
452
|
+
const _pathname$split = pathname.split('/'),
|
|
453
|
+
_pathname$split2 = _slicedToArray(_pathname$split, 2),
|
|
454
|
+
topLevelPath = _pathname$split2[1];
|
|
430
455
|
const previousProjectKey = getPreviousProjectKey(props.user?.defaultProjectKey ?? undefined);
|
|
431
456
|
return jsxRuntime.jsxs("div", {
|
|
432
457
|
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;" + ("" ), "" ),
|
|
@@ -446,10 +471,12 @@ const AppBar = props => {
|
|
|
446
471
|
});
|
|
447
472
|
}
|
|
448
473
|
// The `<ProjectSwitcher>` should be rendered only if the
|
|
449
|
-
// user is fetched and the user has projects while the app runs in
|
|
450
|
-
|
|
474
|
+
// user is fetched and the user has projects while the app runs in a
|
|
475
|
+
// project context. Static routes like `/account` have no project
|
|
476
|
+
// context, even when a previously used project key is available.
|
|
477
|
+
if (props.user.projects.total > 0 && props.projectKey && !isStaticRouteWithoutProjectContext(topLevelPath)) {
|
|
451
478
|
var _context;
|
|
452
|
-
const selectedProject = _findInstanceProperty__default["default"](_context = props.user.projects.results).call(_context, project => project.key === props.
|
|
479
|
+
const selectedProject = _findInstanceProperty__default["default"](_context = props.user.projects.results).call(_context, project => project.key === props.projectKey);
|
|
453
480
|
return jsxRuntime.jsxs("div", {
|
|
454
481
|
css: /*#__PURE__*/react$1.css("display:flex;gap:", designSystem.designTokens.spacing20, ";align-items:center;" + ("" ), "" ),
|
|
455
482
|
children: [selectedProject?.isProductionProject && jsxRuntime.jsx("div", {
|
|
@@ -462,11 +489,13 @@ const AppBar = props => {
|
|
|
462
489
|
// This is fine becase the user has still the possibility to "switch"
|
|
463
490
|
// to a project.
|
|
464
491
|
, {
|
|
465
|
-
projectKey: props.
|
|
492
|
+
projectKey: props.projectKey
|
|
466
493
|
})]
|
|
467
494
|
});
|
|
468
495
|
}
|
|
469
|
-
if (!props.user.defaultProjectKey)
|
|
496
|
+
if (!props.user.defaultProjectKey) {
|
|
497
|
+
return null;
|
|
498
|
+
}
|
|
470
499
|
return jsxRuntime.jsx(BackToProject, {
|
|
471
500
|
projectKey: previousProjectKey
|
|
472
501
|
});
|
|
@@ -620,7 +649,7 @@ const FetchProject = props => {
|
|
|
620
649
|
};
|
|
621
650
|
FetchProject.displayName = 'FetchProject';
|
|
622
651
|
|
|
623
|
-
var LoggedInUserQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchLoggedInUser" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "user" }, name: { kind: "Name", value: "me" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gravatarHash" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "language" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "numberFormat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "timeZone" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingGroup" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingSubgroup" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingTeam" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingCloudEnvironment" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "defaultProjectKey" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "businessRole" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "projects" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "suspension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "expiry" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "isProductionProject" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "idTokenUserInfo" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "iss" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "sub" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "aud" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "exp" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "iat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "additionalClaims" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end:
|
|
652
|
+
var LoggedInUserQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchLoggedInUser" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "user" }, name: { kind: "Name", value: "me" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gravatarHash" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "language" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "numberFormat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "timeZone" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingGroup" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingSubgroup" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingTeam" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "launchdarklyTrackingCloudEnvironment" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "defaultProjectKey" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "isAdminOfAnyOrganization" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "businessRole" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "projects" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "suspension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "expiry" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "isActive" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "isProductionProject" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "idTokenUserInfo" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "iss" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "sub" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "aud" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "exp" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "iat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "additionalClaims" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 721, source: { body: "query FetchLoggedInUser {\n user: me {\n id\n email\n createdAt\n gravatarHash\n firstName\n lastName\n language\n numberFormat\n timeZone\n launchdarklyTrackingId\n launchdarklyTrackingGroup\n launchdarklyTrackingSubgroup\n launchdarklyTrackingTeam\n launchdarklyTrackingCloudEnvironment\n defaultProjectKey\n isAdminOfAnyOrganization\n businessRole\n projects {\n total\n results {\n name\n key\n suspension {\n isActive\n }\n expiry {\n isActive\n }\n isProductionProject\n }\n }\n idTokenUserInfo {\n iss\n sub\n aud\n exp\n iat\n email\n name\n additionalClaims\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
624
653
|
const FetchUser = props => {
|
|
625
654
|
const _useMcQuery = applicationShellConnectors.useMcQuery(LoggedInUserQuery, {
|
|
626
655
|
context: {
|
|
@@ -646,7 +675,7 @@ const FetchUser = props => {
|
|
|
646
675
|
};
|
|
647
676
|
FetchUser.displayName = 'FetchUser';
|
|
648
677
|
|
|
649
|
-
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-
|
|
678
|
+
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-4bc16e7b.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
|
|
650
679
|
|
|
651
680
|
const PerformanceMark = _ref => {
|
|
652
681
|
let mark = _ref.mark;
|
|
@@ -656,11 +685,11 @@ const PerformanceMark = _ref => {
|
|
|
656
685
|
return null;
|
|
657
686
|
};
|
|
658
687
|
|
|
659
|
-
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-
|
|
688
|
+
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-4f14fd7c.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
660
689
|
|
|
661
|
-
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-
|
|
690
|
+
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-a42e3df6.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
662
691
|
|
|
663
|
-
const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-
|
|
692
|
+
const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-603634dd.cjs.prod.js' /* webpackChunkName: "redirect-to-project-create" */); }));
|
|
664
693
|
|
|
665
694
|
function ownKeys$9(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; }
|
|
666
695
|
function _objectSpread$9(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$9(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$9(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
@@ -780,7 +809,7 @@ const ThemeSwitcher = () => {
|
|
|
780
809
|
};
|
|
781
810
|
|
|
782
811
|
function ownKeys$8(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; }
|
|
783
|
-
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
812
|
+
function _objectSpread$8(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$8(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$8(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
784
813
|
const getHasUnauthorizedError = graphQLErrors => _findInstanceProperty__default["default"](graphQLErrors).call(graphQLErrors, gqlError => gqlError.extensions && gqlError.extensions.code && gqlError.extensions.code === 'UNAUTHENTICATED');
|
|
785
814
|
const getHasUserBeenDeletedError = graphQLErrors => _findInstanceProperty__default["default"](graphQLErrors).call(graphQLErrors, gqlError => {
|
|
786
815
|
var _context;
|
|
@@ -866,7 +895,6 @@ const ApplicationShellAuthenticated = props => {
|
|
|
866
895
|
}
|
|
867
896
|
});
|
|
868
897
|
}
|
|
869
|
-
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
870
898
|
|
|
871
899
|
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
872
900
|
const staffBarLanguage = user?.launchdarklyTrackingGroup === 'commercetools' || user?.launchdarklyTrackingGroup === 'mailosaur' ? applicationShellConnectors.selectUserLanguageFromStorage() : undefined;
|
|
@@ -874,6 +902,10 @@ const ApplicationShellAuthenticated = props => {
|
|
|
874
902
|
// set the staff bar language if applicable
|
|
875
903
|
language: staffBarLanguage ?? user.language
|
|
876
904
|
}) : undefined;
|
|
905
|
+
const projectKeyInContext = selectProjectKeyInContext({
|
|
906
|
+
pathname: location.pathname,
|
|
907
|
+
defaultProjectKeyOfUser: normalizedUser?.defaultProjectKey ?? undefined
|
|
908
|
+
});
|
|
877
909
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
878
910
|
user: normalizedUser,
|
|
879
911
|
environment: applicationEnvironment,
|
|
@@ -881,6 +913,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
881
913
|
locale: normalizedUser?.language,
|
|
882
914
|
applicationMessages: props.applicationMessages,
|
|
883
915
|
children: _ref7 => {
|
|
916
|
+
var _context2;
|
|
884
917
|
let isLoadingLocaleData = _ref7.isLoading,
|
|
885
918
|
locale = _ref7.locale,
|
|
886
919
|
messages = _ref7.messages;
|
|
@@ -895,7 +928,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
895
928
|
mark: PERFORMANCE_MARKS.INTL_READY
|
|
896
929
|
}), jsxRuntime.jsx(SetupFlopFlipProvider, {
|
|
897
930
|
user: normalizedUser,
|
|
898
|
-
projectKey:
|
|
931
|
+
projectKey: projectKeyInContext,
|
|
899
932
|
ldClientSideId: applicationEnvironment.ldClientSideId,
|
|
900
933
|
flags: props.featureFlags,
|
|
901
934
|
defaultFlags: props.defaultFeatureFlags,
|
|
@@ -921,24 +954,20 @@ const ApplicationShellAuthenticated = props => {
|
|
|
921
954
|
css: _ref3,
|
|
922
955
|
children: jsxRuntime.jsx(AppBar, {
|
|
923
956
|
user: normalizedUser,
|
|
924
|
-
|
|
957
|
+
projectKey: projectKeyInContext
|
|
925
958
|
})
|
|
926
959
|
}), jsxRuntime.jsx("aside", {
|
|
927
960
|
css: _ref2,
|
|
928
961
|
children: (() => {
|
|
929
962
|
// The <NavBar> should only be rendered within a project
|
|
930
963
|
// context, therefore when there is a `projectKey`.
|
|
931
|
-
//
|
|
932
|
-
//
|
|
933
|
-
//
|
|
934
|
-
//
|
|
935
|
-
|
|
936
|
-
// redirect to `/:projectKey`). Therefore, we should not
|
|
937
|
-
// rely on the value in localStorage to determine which
|
|
938
|
-
// `projectKey` is currently used.
|
|
939
|
-
if (!projectKeyFromUrl) return null;
|
|
964
|
+
// On `/account` routes there is none, so we don't render it.
|
|
965
|
+
// NOTE: for paths that run in a project context without
|
|
966
|
+
// carrying the `projectKey` in the URL (e.g. `/agent-sphere`),
|
|
967
|
+
// the key is resolved from the previously used project.
|
|
968
|
+
if (!projectKeyInContext) return null;
|
|
940
969
|
return jsxRuntime.jsx(FetchProject, {
|
|
941
|
-
projectKey:
|
|
970
|
+
projectKey: projectKeyInContext,
|
|
942
971
|
children: _ref8 => {
|
|
943
972
|
let isLoadingProject = _ref8.isLoading,
|
|
944
973
|
project = _ref8.project;
|
|
@@ -952,7 +981,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
952
981
|
,
|
|
953
982
|
children: jsxRuntime.jsx(Navbar, {
|
|
954
983
|
applicationLocale: locale,
|
|
955
|
-
projectKey:
|
|
984
|
+
projectKey: projectKeyInContext,
|
|
956
985
|
project: project,
|
|
957
986
|
environment: applicationEnvironment,
|
|
958
987
|
onMenuItemClick: props.onMenuItemClick,
|
|
@@ -983,16 +1012,16 @@ const ApplicationShellAuthenticated = props => {
|
|
|
983
1012
|
, {
|
|
984
1013
|
ref: layoutRefs,
|
|
985
1014
|
offsetTop: oidc.DIMENSIONS.header,
|
|
986
|
-
offsetLeft:
|
|
987
|
-
offsetLeftOnExpandedMenu:
|
|
1015
|
+
offsetLeft: projectKeyInContext ? oidc.NAVBAR.widthLeftNavigation : '0px',
|
|
1016
|
+
offsetLeftOnExpandedMenu: projectKeyInContext ? oidc.NAVBAR.widthLeftNavigationWhenExpanded : '0px'
|
|
988
1017
|
}), jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
989
1018
|
children: [jsxRuntime.jsx(reactRouterDom.Route, {
|
|
990
1019
|
path: "/profile",
|
|
991
1020
|
render: () => jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
992
|
-
to:
|
|
1021
|
+
to: `/${constants.STATIC_URL_PATHS.ACCOUNT}/profile`
|
|
993
1022
|
})
|
|
994
1023
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
995
|
-
path: "
|
|
1024
|
+
path: _mapInstanceProperty__default["default"](_context2 = _filterInstanceProperty__default["default"](constants.PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS).call(constants.PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS, entryPointUriPath => !constants.isProjectKeylessApplicationEntryPointInProjectContext(entryPointUriPath))).call(_context2, entryPointUriPath => `/${entryPointUriPath}`),
|
|
996
1025
|
children:
|
|
997
1026
|
/**
|
|
998
1027
|
* In case the AppShell uses the `render` function, we assume it's one of two cases:
|
|
@@ -1005,21 +1034,50 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1005
1034
|
*/
|
|
1006
1035
|
props.render ? jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1007
1036
|
children: props.render()
|
|
1008
|
-
}) : jsxRuntime.jsx(
|
|
1037
|
+
}) : jsxRuntime.jsx(applicationEntryPoint.RouteCatchAll, {})
|
|
1038
|
+
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1039
|
+
path: _mapInstanceProperty__default["default"](constants.PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS_IN_PROJECT_CONTEXT).call(constants.PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS_IN_PROJECT_CONTEXT, entryPointUriPath => `/${entryPointUriPath}`),
|
|
1040
|
+
children: constants.isProjectKeylessApplicationEntryPointInProjectContext(applicationEnvironment.entryPointUriPath) ? jsxRuntime.jsx(applicationEntryPoint.ApplicationEntryPoint, {
|
|
1041
|
+
environment: applicationEnvironment
|
|
1042
|
+
// There is no project in ApplicationContext on this
|
|
1043
|
+
// path, so the default View-permission check cannot
|
|
1044
|
+
// succeed. Access is gated in the app via a user flag.
|
|
1045
|
+
,
|
|
1046
|
+
disableRoutePermissionCheck: true,
|
|
1047
|
+
render: props.render,
|
|
1048
|
+
children: props.children
|
|
1049
|
+
}) : props.render ?
|
|
1050
|
+
/**
|
|
1051
|
+
* Same as `/account`: a `render` app implements its own
|
|
1052
|
+
* catch-all. A `children` Custom Application must reload
|
|
1053
|
+
* so the proxy can hand the request to agent-sphere.
|
|
1054
|
+
*/
|
|
1055
|
+
jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1056
|
+
children: props.render()
|
|
1057
|
+
}) : jsxRuntime.jsx(applicationEntryPoint.RouteCatchAll, {})
|
|
1009
1058
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1010
1059
|
exact: true,
|
|
1011
1060
|
path: "/",
|
|
1012
1061
|
children: (() => {
|
|
1062
|
+
const entryPointUriPath = applicationEnvironment.entryPointUriPath;
|
|
1013
1063
|
const previousProjectKey = getPreviousProjectKey(normalizedUser?.defaultProjectKey ?? undefined);
|
|
1014
1064
|
|
|
1015
1065
|
/**
|
|
1016
1066
|
* NOTE:
|
|
1067
|
+
* Given the application does not run on a `/:projectKey` route
|
|
1068
|
+
* (e.g. `agent-sphere`), the application redirects to its own
|
|
1069
|
+
* entry point instead of to a project.
|
|
1017
1070
|
* Given the user has not been loaded a loading spinner is shown.
|
|
1018
1071
|
* Given the user was not working on a project previously nor has a default
|
|
1019
1072
|
* project, the user will be prompted to create one.
|
|
1020
1073
|
* Given the user was working on a project previously or has a default
|
|
1021
1074
|
* project, the application will redirect to that project.
|
|
1022
1075
|
*/
|
|
1076
|
+
if (constants.isProjectKeylessApplicationEntryPoint(entryPointUriPath)) {
|
|
1077
|
+
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
1078
|
+
to: `/${entryPointUriPath}`
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1023
1081
|
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1024
1082
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
1025
1083
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
@@ -1057,7 +1115,6 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1057
1115
|
ApplicationShellAuthenticated.displayName = 'ApplicationShellAuthenticated';
|
|
1058
1116
|
|
|
1059
1117
|
const maxTitleCharLength = 24;
|
|
1060
|
-
const staticPaths = ['account', 'login'];
|
|
1061
1118
|
const getPageTitle = (pathname, additionalParts) => {
|
|
1062
1119
|
const _pathname$split = pathname.split('/'),
|
|
1063
1120
|
_pathname$split2 = _slicedToArray(_pathname$split, 3),
|
|
@@ -1069,7 +1126,7 @@ const getPageTitle = (pathname, additionalParts) => {
|
|
|
1069
1126
|
}
|
|
1070
1127
|
return [_sliceInstanceProperty__default["default"](titlePart).call(titlePart, 0, maxTitleCharLength / 2), _sliceInstanceProperty__default["default"](titlePart).call(titlePart, titlePart.length - maxTitleCharLength / 2)].join('...');
|
|
1071
1128
|
});
|
|
1072
|
-
if (
|
|
1129
|
+
if (constants.isStaticUrlPathInPositionOfProjectKey(projectKeyOrStaticPath)) {
|
|
1073
1130
|
return [...(customTitleParts || []), projectKeyOrStaticPath, 'Merchant Center'].join(' - ');
|
|
1074
1131
|
}
|
|
1075
1132
|
return [...(customTitleParts || []), entryPointUriPath, projectKeyOrStaticPath, 'Merchant Center'].join(' - ');
|
|
@@ -1207,7 +1264,7 @@ const hasCachedAuthenticationState = () => {
|
|
|
1207
1264
|
// THEN we assume that the application does not need a project context.
|
|
1208
1265
|
// GIVEN The application is not requesting a project key,
|
|
1209
1266
|
// THEN we remove the cached project key.
|
|
1210
|
-
// This is the case of
|
|
1267
|
+
// This is the case of a project-keyless application like `account` or `agent-sphere`.
|
|
1211
1268
|
if (!window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
|
|
1212
1269
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1213
1270
|
}
|
|
@@ -1260,7 +1317,7 @@ const hasCachedAuthenticationState = () => {
|
|
|
1260
1317
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1261
1318
|
};
|
|
1262
1319
|
|
|
1263
|
-
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-
|
|
1320
|
+
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-b0d573ac.cjs.prod.js' /* webpackChunkName: "oidc-callback" */); }));
|
|
1264
1321
|
|
|
1265
1322
|
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; }
|
|
1266
1323
|
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; }
|
|
@@ -1290,23 +1347,27 @@ const Authenticated = props => {
|
|
|
1290
1347
|
return jsxRuntime.jsx(AmILoggedIn, _objectSpread$4({}, props));
|
|
1291
1348
|
};
|
|
1292
1349
|
Authenticated.displayName = 'Authenticated';
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
})
|
|
1350
|
+
const projectKeylessOidcCallbackPaths = [..._mapInstanceProperty__default["default"](constants.PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS).call(constants.PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS, entryPointUriPath => `/${entryPointUriPath}/oidc/callback`),
|
|
1351
|
+
// Nested apps under a project-keyless-in-project-context prefix
|
|
1352
|
+
// (e.g. `/agent-sphere/registry/oidc/callback`).
|
|
1353
|
+
..._mapInstanceProperty__default["default"](constants.PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS_IN_PROJECT_CONTEXT).call(constants.PROJECT_KEYLESS_APPLICATION_ENTRY_POINTS_IN_PROJECT_CONTEXT, entryPointUriPath => `/${entryPointUriPath}/:app/oidc/callback`)];
|
|
1354
|
+
const AuthenticationRoutes = props => {
|
|
1355
|
+
const oidcCallback = jsxRuntime.jsx(OidcCallback, {
|
|
1356
|
+
locale: props.locale,
|
|
1357
|
+
applicationMessages: props.applicationMessages
|
|
1358
|
+
});
|
|
1359
|
+
return jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1360
|
+
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1361
|
+
path: projectKeylessOidcCallbackPaths,
|
|
1362
|
+
children: oidcCallback
|
|
1363
|
+
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1364
|
+
path: `/:projectKey/:identifier/oidc/callback`,
|
|
1365
|
+
children: oidcCallback
|
|
1366
|
+
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1367
|
+
children: jsxRuntime.jsx(Authenticated, _objectSpread$4({}, props))
|
|
1368
|
+
})]
|
|
1369
|
+
});
|
|
1370
|
+
};
|
|
1310
1371
|
AuthenticationRoutes.displayName = 'AuthenticationRoutes';
|
|
1311
1372
|
|
|
1312
1373
|
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)); }
|
|
@@ -1423,7 +1484,7 @@ const ApplicationShellProvider = props => {
|
|
|
1423
1484
|
children: jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
1424
1485
|
environment: coercedEnvironmentValues,
|
|
1425
1486
|
children: jsxRuntime.jsx(reactRedux.Provider, {
|
|
1426
|
-
store:
|
|
1487
|
+
store: applicationEntryPoint.internalReduxStore,
|
|
1427
1488
|
children: jsxRuntime.jsx(react$2.ApolloProvider, {
|
|
1428
1489
|
client: apolloClient,
|
|
1429
1490
|
children: jsxRuntime.jsxs(reactRouterDom.Router, {
|
|
@@ -1462,7 +1523,7 @@ const ApplicationShellProvider = props => {
|
|
|
1462
1523
|
};
|
|
1463
1524
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1464
1525
|
|
|
1465
|
-
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-
|
|
1526
|
+
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-18f6e1b8.cjs.prod.js' /* webpackChunkName: "redirect-to-login" */); }));
|
|
1466
1527
|
|
|
1467
1528
|
const styles = {
|
|
1468
1529
|
name: "gx7yk8",
|
|
@@ -1486,7 +1547,7 @@ const StrictModeEnablement$1 = props => {
|
|
|
1486
1547
|
const ApplicationShell = props => {
|
|
1487
1548
|
react.useEffect(() => {
|
|
1488
1549
|
props.onRegisterErrorListeners?.({
|
|
1489
|
-
dispatch:
|
|
1550
|
+
dispatch: applicationEntryPoint.internalReduxStore.dispatch
|
|
1490
1551
|
});
|
|
1491
1552
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1492
1553
|
}, []); // <-- run only once, when component mounts
|
|
@@ -1502,7 +1563,7 @@ const ApplicationShell = props => {
|
|
|
1502
1563
|
if (isAuthenticated) {
|
|
1503
1564
|
return jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1504
1565
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1505
|
-
path:
|
|
1566
|
+
path: `/${constants.STATIC_URL_PATHS.LOGOUT}`,
|
|
1506
1567
|
children: jsxRuntime.jsx(RedirectToLogout, {})
|
|
1507
1568
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1508
1569
|
children: jsxRuntime.jsx(ApplicationShellAuthenticated, {
|
|
@@ -1525,7 +1586,7 @@ const ApplicationShell = props => {
|
|
|
1525
1586
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1526
1587
|
ApplicationShell.version = version;
|
|
1527
1588
|
|
|
1528
|
-
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-
|
|
1589
|
+
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-24cfaf96.cjs.prod.js' /* webpackChunkName: "custom-view-dev-host" */); }));
|
|
1529
1590
|
|
|
1530
1591
|
function CustomViewFlopFlipProvider(props) {
|
|
1531
1592
|
const adapterArgs = react.useMemo(() => ({
|
|
@@ -1912,7 +1973,7 @@ function setupGlobalErrorListener() {
|
|
|
1912
1973
|
window.addEventListener('unhandledrejection', event => {
|
|
1913
1974
|
if (shouldErrorBeTracked(event)) {
|
|
1914
1975
|
const errorId = sentry.reportErrorToSentry(event);
|
|
1915
|
-
|
|
1976
|
+
applicationEntryPoint.internalReduxStore.dispatch(actionsGlobal.showUnexpectedErrorNotification({
|
|
1916
1977
|
errorId
|
|
1917
1978
|
}));
|
|
1918
1979
|
}
|
|
@@ -1922,7 +1983,7 @@ function setupGlobalErrorListener() {
|
|
|
1922
1983
|
window.addEventListener('error', errorEvent => {
|
|
1923
1984
|
if (shouldErrorBeTracked(errorEvent)) {
|
|
1924
1985
|
const errorId = sentry.reportErrorToSentry(errorEvent);
|
|
1925
|
-
|
|
1986
|
+
applicationEntryPoint.internalReduxStore.dispatch(actionsGlobal.showUnexpectedErrorNotification({
|
|
1926
1987
|
errorId
|
|
1927
1988
|
}));
|
|
1928
1989
|
}
|