@commercetools-frontend/application-shell 27.9.6 → 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 +16 -13
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +16 -13
- package/dist/commercetools-frontend-application-shell.esm.js +13 -11
- package/dist/{custom-view-dev-host-c2737d42.cjs.prod.js → custom-view-dev-host-24cfaf96.cjs.prod.js} +7 -5
- package/dist/{custom-view-dev-host-ad35a3bf.esm.js → custom-view-dev-host-802ebe34.esm.js} +7 -5
- package/dist/{custom-view-dev-host-78890fd6.cjs.dev.js → custom-view-dev-host-c2b65fe2.cjs.dev.js} +7 -5
- package/dist/declarations/src/index.d.ts +2 -0
- package/dist/declarations/src/types/generated/mc.d.ts +121 -0
- package/dist/declarations/src/utils/performance-marks/index.d.ts +2 -0
- package/dist/declarations/src/utils/performance-marks/performance-marks.d.ts +12 -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-d0720856.esm.js → index-177f89cf.esm.js} +197 -87
- package/dist/{index-917cbf00.cjs.dev.js → index-3244236c.cjs.dev.js} +207 -95
- package/dist/{index-b0d1d33f.cjs.prod.js → index-fc58c6bb.cjs.prod.js} +194 -82
- 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-0c6b42b0.cjs.dev.js → oidc-callback-1c6e8104.cjs.dev.js} +8 -6
- package/dist/{oidc-callback-b6b2b136.cjs.prod.js → oidc-callback-b0d573ac.cjs.prod.js} +8 -6
- package/dist/{oidc-callback-97081f64.esm.js → oidc-callback-b409680a.esm.js} +8 -6
- package/dist/{project-container-ee8064df.cjs.prod.js → project-container-4f14fd7c.cjs.prod.js} +13 -13
- package/dist/{project-container-f9b67fe9.esm.js → project-container-b73d2651.esm.js} +13 -13
- package/dist/{project-container-bfd38f39.cjs.dev.js → project-container-b75269ed.cjs.dev.js} +13 -13
- package/dist/{project-expired-ee6d5ee5.cjs.dev.js → project-expired-1cda3b7e.cjs.dev.js} +9 -7
- package/dist/{project-expired-26882e9c.esm.js → project-expired-cb01ca7d.esm.js} +9 -7
- package/dist/{project-expired-7d4ff82c.cjs.prod.js → project-expired-f19a3356.cjs.prod.js} +9 -7
- package/dist/{project-not-found-5befa123.cjs.prod.js → project-not-found-52441a8a.cjs.prod.js} +9 -7
- package/dist/{project-not-found-2382cec9.cjs.dev.js → project-not-found-548c0653.cjs.dev.js} +9 -7
- package/dist/{project-not-found-c23d348e.esm.js → project-not-found-69a22191.esm.js} +9 -7
- package/dist/{project-not-initialized-3ccc0fbc.cjs.prod.js → project-not-initialized-6c2babc1.cjs.prod.js} +9 -7
- package/dist/{project-not-initialized-6e2e7574.cjs.dev.js → project-not-initialized-bc2258f1.cjs.dev.js} +9 -7
- package/dist/{project-not-initialized-0952c86f.esm.js → project-not-initialized-f0168385.esm.js} +9 -7
- package/dist/{project-suspended-9987b065.cjs.prod.js → project-suspended-31c52b75.cjs.prod.js} +9 -7
- package/dist/{project-suspended-f21443cc.cjs.dev.js → project-suspended-6a83941a.cjs.dev.js} +9 -7
- package/dist/{project-suspended-1eeb1f2d.esm.js → project-suspended-ef485212.esm.js} +9 -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-4af3e4a1.esm.js → redirect-to-logout-404ac2d3.esm.js} +10 -8
- package/dist/{redirect-to-logout-b4c08612.cjs.dev.js → redirect-to-logout-4ccdb9c6.cjs.dev.js} +9 -7
- package/dist/{redirect-to-logout-eb67ac6b.cjs.prod.js → redirect-to-logout-a42e3df6.cjs.prod.js} +9 -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-5de6c859.cjs.dev.js → requests-in-flight-loader-324287e5.cjs.dev.js} +9 -7
- package/dist/{requests-in-flight-loader-7a105650.cjs.prod.js → requests-in-flight-loader-7cc3150d.cjs.prod.js} +9 -7
- package/dist/{requests-in-flight-loader-cb2c7a2f.esm.js → requests-in-flight-loader-f969e2f0.esm.js} +9 -7
- package/dist/{service-page-project-switcher-fc328776.cjs.prod.js → service-page-project-switcher-87f8935d.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-810e383e.esm.js → service-page-project-switcher-a55a912e.esm.js} +1 -1
- package/dist/{service-page-project-switcher-0f1c3a13.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/user-settings-menu-a1d0ba8e.esm.js +0 -320
- package/dist/user-settings-menu-b8359b8b.cjs.dev.js +0 -345
|
@@ -2,29 +2,32 @@
|
|
|
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');
|
|
30
|
+
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
28
31
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
29
32
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
30
33
|
var reactIntl = require('react-intl');
|
|
@@ -33,7 +36,6 @@ var icons = require('@commercetools-uikit/icons');
|
|
|
33
36
|
var location = require('./location-537e0660.cjs.prod.js');
|
|
34
37
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
35
38
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
36
|
-
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
37
39
|
var memoize = require('memoize-one');
|
|
38
40
|
var reactSelect = require('react-select');
|
|
39
41
|
var AccessibleHidden = require('@commercetools-uikit/accessible-hidden');
|
|
@@ -54,7 +56,6 @@ var launchdarklyAdapter = require('@flopflip/launchdarkly-adapter');
|
|
|
54
56
|
var reactBroadcast = require('@flopflip/react-broadcast');
|
|
55
57
|
var types = require('@flopflip/types');
|
|
56
58
|
var reactRedux = require('react-redux');
|
|
57
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
58
59
|
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
59
60
|
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
60
61
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
@@ -73,21 +74,22 @@ var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
|
73
74
|
|
|
74
75
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
75
76
|
|
|
76
|
-
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
77
|
-
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
78
|
-
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
79
|
-
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
80
77
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
81
78
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
82
|
-
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
83
79
|
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
|
|
84
80
|
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
85
81
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
86
82
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
87
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);
|
|
90
|
+
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
88
91
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
89
92
|
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
90
|
-
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
91
93
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
92
94
|
var AccessibleHidden__default = /*#__PURE__*/_interopDefault(AccessibleHidden);
|
|
93
95
|
var SelectInput__default = /*#__PURE__*/_interopDefault(SelectInput);
|
|
@@ -105,9 +107,9 @@ var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
|
105
107
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
106
108
|
|
|
107
109
|
// NOTE: This string will be replaced on build time with the package version.
|
|
108
|
-
var version = "27.
|
|
110
|
+
var version = "27.11.0";
|
|
109
111
|
|
|
110
|
-
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" */); }));
|
|
111
113
|
|
|
112
114
|
// Attempt to load the `projectKey` from localStorage
|
|
113
115
|
function selectProjectKeyFromLocalStorage() {
|
|
@@ -121,6 +123,49 @@ const getPreviousProjectKey = defaultProjectKeyOfUser => {
|
|
|
121
123
|
return;
|
|
122
124
|
};
|
|
123
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
|
+
|
|
145
|
+
const PERFORMANCE_MARKS = {
|
|
146
|
+
SKELETON_VISIBLE: 'mc:skeleton-visible',
|
|
147
|
+
SHELL_CHROME_MOUNTED: 'mc:shell-chrome-mounted',
|
|
148
|
+
INTL_READY: 'mc:intl-ready',
|
|
149
|
+
CONTENT_RENDERED: 'mc:content-rendered',
|
|
150
|
+
HYDRATION_USER: 'mc:hydration-user',
|
|
151
|
+
HYDRATION_PROJECT: 'mc:hydration-project'
|
|
152
|
+
};
|
|
153
|
+
const alreadyMarked = new _Set__default["default"]();
|
|
154
|
+
const markOnce = performanceMark => {
|
|
155
|
+
if (alreadyMarked.has(performanceMark)) return;
|
|
156
|
+
if (!performance?.mark || !performance.measure) return;
|
|
157
|
+
try {
|
|
158
|
+
performance.mark(performanceMark);
|
|
159
|
+
alreadyMarked.add(performanceMark);
|
|
160
|
+
performance.measure(`${performanceMark}:from-nav`, {
|
|
161
|
+
start: 0,
|
|
162
|
+
end: performanceMark
|
|
163
|
+
});
|
|
164
|
+
} catch {
|
|
165
|
+
// Observational only; never break rendering.
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
124
169
|
var messages$1 = reactIntl.defineMessages({
|
|
125
170
|
backToProjectLink: {
|
|
126
171
|
id: 'AppBar.backToProjectLink',
|
|
@@ -386,8 +431,9 @@ ProjectSwitcher.displayName = 'ProjectSwitcher';
|
|
|
386
431
|
// eslint-disable-next-line import/prefer-default-export
|
|
387
432
|
const REQUESTS_IN_FLIGHT_LOADER_DOM_ID = 'loader-for-requests-in-flight';
|
|
388
433
|
|
|
389
|
-
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" */); }));
|
|
390
435
|
|
|
436
|
+
const isStaticRouteWithoutProjectContext = topLevelPath => Boolean(topLevelPath) && constants.isStaticUrlPathInPositionOfProjectKey(topLevelPath) && !constants.isProjectKeylessApplicationEntryPointInProjectContext(topLevelPath);
|
|
391
437
|
var _ref$2 = {
|
|
392
438
|
name: "zjik7",
|
|
393
439
|
styles: "display:flex"
|
|
@@ -401,6 +447,11 @@ var _ref3$1 = {
|
|
|
401
447
|
styles: "height:22px"
|
|
402
448
|
} ;
|
|
403
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];
|
|
404
455
|
const previousProjectKey = getPreviousProjectKey(props.user?.defaultProjectKey ?? undefined);
|
|
405
456
|
return jsxRuntime.jsxs("div", {
|
|
406
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;" + ("" ), "" ),
|
|
@@ -420,10 +471,12 @@ const AppBar = props => {
|
|
|
420
471
|
});
|
|
421
472
|
}
|
|
422
473
|
// The `<ProjectSwitcher>` should be rendered only if the
|
|
423
|
-
// user is fetched and the user has projects while the app runs in
|
|
424
|
-
|
|
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)) {
|
|
425
478
|
var _context;
|
|
426
|
-
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);
|
|
427
480
|
return jsxRuntime.jsxs("div", {
|
|
428
481
|
css: /*#__PURE__*/react$1.css("display:flex;gap:", designSystem.designTokens.spacing20, ";align-items:center;" + ("" ), "" ),
|
|
429
482
|
children: [selectedProject?.isProductionProject && jsxRuntime.jsx("div", {
|
|
@@ -436,11 +489,13 @@ const AppBar = props => {
|
|
|
436
489
|
// This is fine becase the user has still the possibility to "switch"
|
|
437
490
|
// to a project.
|
|
438
491
|
, {
|
|
439
|
-
projectKey: props.
|
|
492
|
+
projectKey: props.projectKey
|
|
440
493
|
})]
|
|
441
494
|
});
|
|
442
495
|
}
|
|
443
|
-
if (!props.user.defaultProjectKey)
|
|
496
|
+
if (!props.user.defaultProjectKey) {
|
|
497
|
+
return null;
|
|
498
|
+
}
|
|
444
499
|
return jsxRuntime.jsx(BackToProject, {
|
|
445
500
|
projectKey: previousProjectKey
|
|
446
501
|
});
|
|
@@ -579,6 +634,11 @@ const FetchProject = props => {
|
|
|
579
634
|
loading = _useMcQuery.loading,
|
|
580
635
|
data = _useMcQuery.data,
|
|
581
636
|
error = _useMcQuery.error;
|
|
637
|
+
react.useEffect(() => {
|
|
638
|
+
if (!loading && data?.project) {
|
|
639
|
+
markOnce(PERFORMANCE_MARKS.HYDRATION_PROJECT);
|
|
640
|
+
}
|
|
641
|
+
}, [loading, data?.project]);
|
|
582
642
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
583
643
|
children: props.children({
|
|
584
644
|
isLoading: loading,
|
|
@@ -589,7 +649,7 @@ const FetchProject = props => {
|
|
|
589
649
|
};
|
|
590
650
|
FetchProject.displayName = 'FetchProject';
|
|
591
651
|
|
|
592
|
-
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 } } } };
|
|
593
653
|
const FetchUser = props => {
|
|
594
654
|
const _useMcQuery = applicationShellConnectors.useMcQuery(LoggedInUserQuery, {
|
|
595
655
|
context: {
|
|
@@ -600,6 +660,11 @@ const FetchUser = props => {
|
|
|
600
660
|
loading = _useMcQuery.loading,
|
|
601
661
|
data = _useMcQuery.data,
|
|
602
662
|
error = _useMcQuery.error;
|
|
663
|
+
react.useEffect(() => {
|
|
664
|
+
if (!loading && data?.user) {
|
|
665
|
+
markOnce(PERFORMANCE_MARKS.HYDRATION_USER);
|
|
666
|
+
}
|
|
667
|
+
}, [loading, data?.user]);
|
|
603
668
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
604
669
|
children: props.children({
|
|
605
670
|
isLoading: loading,
|
|
@@ -610,13 +675,21 @@ const FetchUser = props => {
|
|
|
610
675
|
};
|
|
611
676
|
FetchUser.displayName = 'FetchUser';
|
|
612
677
|
|
|
613
|
-
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" */); }));
|
|
614
679
|
|
|
615
|
-
const
|
|
680
|
+
const PerformanceMark = _ref => {
|
|
681
|
+
let mark = _ref.mark;
|
|
682
|
+
react.useEffect(() => {
|
|
683
|
+
markOnce(mark);
|
|
684
|
+
}, [mark]);
|
|
685
|
+
return null;
|
|
686
|
+
};
|
|
616
687
|
|
|
617
|
-
const
|
|
688
|
+
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-4f14fd7c.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
618
689
|
|
|
619
|
-
const
|
|
690
|
+
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-a42e3df6.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
691
|
+
|
|
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" */); }));
|
|
620
693
|
|
|
621
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; }
|
|
622
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; }
|
|
@@ -736,7 +809,7 @@ const ThemeSwitcher = () => {
|
|
|
736
809
|
};
|
|
737
810
|
|
|
738
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; }
|
|
739
|
-
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; }
|
|
740
813
|
const getHasUnauthorizedError = graphQLErrors => _findInstanceProperty__default["default"](graphQLErrors).call(graphQLErrors, gqlError => gqlError.extensions && gqlError.extensions.code && gqlError.extensions.code === 'UNAUTHENTICATED');
|
|
741
814
|
const getHasUserBeenDeletedError = graphQLErrors => _findInstanceProperty__default["default"](graphQLErrors).call(graphQLErrors, gqlError => {
|
|
742
815
|
var _context;
|
|
@@ -822,7 +895,6 @@ const ApplicationShellAuthenticated = props => {
|
|
|
822
895
|
}
|
|
823
896
|
});
|
|
824
897
|
}
|
|
825
|
-
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
826
898
|
|
|
827
899
|
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
828
900
|
const staffBarLanguage = user?.launchdarklyTrackingGroup === 'commercetools' || user?.launchdarklyTrackingGroup === 'mailosaur' ? applicationShellConnectors.selectUserLanguageFromStorage() : undefined;
|
|
@@ -830,6 +902,10 @@ const ApplicationShellAuthenticated = props => {
|
|
|
830
902
|
// set the staff bar language if applicable
|
|
831
903
|
language: staffBarLanguage ?? user.language
|
|
832
904
|
}) : undefined;
|
|
905
|
+
const projectKeyInContext = selectProjectKeyInContext({
|
|
906
|
+
pathname: location.pathname,
|
|
907
|
+
defaultProjectKeyOfUser: normalizedUser?.defaultProjectKey ?? undefined
|
|
908
|
+
});
|
|
833
909
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
834
910
|
user: normalizedUser,
|
|
835
911
|
environment: applicationEnvironment,
|
|
@@ -837,25 +913,30 @@ const ApplicationShellAuthenticated = props => {
|
|
|
837
913
|
locale: normalizedUser?.language,
|
|
838
914
|
applicationMessages: props.applicationMessages,
|
|
839
915
|
children: _ref7 => {
|
|
916
|
+
var _context2;
|
|
840
917
|
let isLoadingLocaleData = _ref7.isLoading,
|
|
841
918
|
locale = _ref7.locale,
|
|
842
919
|
messages = _ref7.messages;
|
|
843
|
-
return jsxRuntime.
|
|
920
|
+
return jsxRuntime.jsxs(ConfigureIntlProvider
|
|
844
921
|
// We do not want to pass the language as long as the locale data
|
|
845
922
|
// is not loaded.
|
|
846
923
|
, _objectSpread$8(_objectSpread$8({}, isLoadingLocaleData ? {} : {
|
|
847
924
|
locale,
|
|
848
925
|
messages
|
|
849
926
|
}), {}, {
|
|
850
|
-
children: jsxRuntime.jsx(
|
|
927
|
+
children: [jsxRuntime.jsx(PerformanceMark, {
|
|
928
|
+
mark: PERFORMANCE_MARKS.INTL_READY
|
|
929
|
+
}), jsxRuntime.jsx(SetupFlopFlipProvider, {
|
|
851
930
|
user: normalizedUser,
|
|
852
|
-
projectKey:
|
|
931
|
+
projectKey: projectKeyInContext,
|
|
853
932
|
ldClientSideId: applicationEnvironment.ldClientSideId,
|
|
854
933
|
flags: props.featureFlags,
|
|
855
934
|
defaultFlags: props.defaultFeatureFlags,
|
|
856
935
|
children: jsxRuntime.jsxs(ApplicationShellSplitterWrapper, {
|
|
857
936
|
locale: locale ?? 'en',
|
|
858
|
-
children: [jsxRuntime.jsx(
|
|
937
|
+
children: [jsxRuntime.jsx(PerformanceMark, {
|
|
938
|
+
mark: PERFORMANCE_MARKS.SHELL_CHROME_MOUNTED
|
|
939
|
+
}), jsxRuntime.jsx(ThemeSwitcher, {}), jsxRuntime.jsx(RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
|
|
859
940
|
user: normalizedUser
|
|
860
941
|
}), jsxRuntime.jsxs("div", {
|
|
861
942
|
css: /*#__PURE__*/react$1.css("height:100vh;display:grid;grid-template-rows:auto ", oidc.DIMENSIONS.header, " 1fr;grid-template-columns:min-content 1fr;" + ("" ), "" ),
|
|
@@ -873,24 +954,20 @@ const ApplicationShellAuthenticated = props => {
|
|
|
873
954
|
css: _ref3,
|
|
874
955
|
children: jsxRuntime.jsx(AppBar, {
|
|
875
956
|
user: normalizedUser,
|
|
876
|
-
|
|
957
|
+
projectKey: projectKeyInContext
|
|
877
958
|
})
|
|
878
959
|
}), jsxRuntime.jsx("aside", {
|
|
879
960
|
css: _ref2,
|
|
880
961
|
children: (() => {
|
|
881
962
|
// The <NavBar> should only be rendered within a project
|
|
882
963
|
// context, therefore when there is a `projectKey`.
|
|
883
|
-
//
|
|
884
|
-
//
|
|
885
|
-
//
|
|
886
|
-
//
|
|
887
|
-
|
|
888
|
-
// redirect to `/:projectKey`). Therefore, we should not
|
|
889
|
-
// rely on the value in localStorage to determine which
|
|
890
|
-
// `projectKey` is currently used.
|
|
891
|
-
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;
|
|
892
969
|
return jsxRuntime.jsx(FetchProject, {
|
|
893
|
-
projectKey:
|
|
970
|
+
projectKey: projectKeyInContext,
|
|
894
971
|
children: _ref8 => {
|
|
895
972
|
let isLoadingProject = _ref8.isLoading,
|
|
896
973
|
project = _ref8.project;
|
|
@@ -904,7 +981,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
904
981
|
,
|
|
905
982
|
children: jsxRuntime.jsx(Navbar, {
|
|
906
983
|
applicationLocale: locale,
|
|
907
|
-
projectKey:
|
|
984
|
+
projectKey: projectKeyInContext,
|
|
908
985
|
project: project,
|
|
909
986
|
environment: applicationEnvironment,
|
|
910
987
|
onMenuItemClick: props.onMenuItemClick,
|
|
@@ -919,7 +996,9 @@ const ApplicationShellAuthenticated = props => {
|
|
|
919
996
|
children: jsxRuntime.jsx(ApplicationLoader, {})
|
|
920
997
|
}) : jsxRuntime.jsxs(MainContainer, {
|
|
921
998
|
role: "main",
|
|
922
|
-
children: [jsxRuntime.jsx(
|
|
999
|
+
children: [jsxRuntime.jsx(PerformanceMark, {
|
|
1000
|
+
mark: PERFORMANCE_MARKS.CONTENT_RENDERED
|
|
1001
|
+
}), jsxRuntime.jsx("div", {
|
|
923
1002
|
ref: notificationsPageRef,
|
|
924
1003
|
children: jsxRuntime.jsx(reactNotifications.NotificationsList, {
|
|
925
1004
|
domain: constants.DOMAINS.PAGE
|
|
@@ -933,16 +1012,16 @@ const ApplicationShellAuthenticated = props => {
|
|
|
933
1012
|
, {
|
|
934
1013
|
ref: layoutRefs,
|
|
935
1014
|
offsetTop: oidc.DIMENSIONS.header,
|
|
936
|
-
offsetLeft:
|
|
937
|
-
offsetLeftOnExpandedMenu:
|
|
1015
|
+
offsetLeft: projectKeyInContext ? oidc.NAVBAR.widthLeftNavigation : '0px',
|
|
1016
|
+
offsetLeftOnExpandedMenu: projectKeyInContext ? oidc.NAVBAR.widthLeftNavigationWhenExpanded : '0px'
|
|
938
1017
|
}), jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
939
1018
|
children: [jsxRuntime.jsx(reactRouterDom.Route, {
|
|
940
1019
|
path: "/profile",
|
|
941
1020
|
render: () => jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
942
|
-
to:
|
|
1021
|
+
to: `/${constants.STATIC_URL_PATHS.ACCOUNT}/profile`
|
|
943
1022
|
})
|
|
944
1023
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
945
|
-
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}`),
|
|
946
1025
|
children:
|
|
947
1026
|
/**
|
|
948
1027
|
* In case the AppShell uses the `render` function, we assume it's one of two cases:
|
|
@@ -955,21 +1034,50 @@ const ApplicationShellAuthenticated = props => {
|
|
|
955
1034
|
*/
|
|
956
1035
|
props.render ? jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
957
1036
|
children: props.render()
|
|
958
|
-
}) : 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, {})
|
|
959
1058
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
960
1059
|
exact: true,
|
|
961
1060
|
path: "/",
|
|
962
1061
|
children: (() => {
|
|
1062
|
+
const entryPointUriPath = applicationEnvironment.entryPointUriPath;
|
|
963
1063
|
const previousProjectKey = getPreviousProjectKey(normalizedUser?.defaultProjectKey ?? undefined);
|
|
964
1064
|
|
|
965
1065
|
/**
|
|
966
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.
|
|
967
1070
|
* Given the user has not been loaded a loading spinner is shown.
|
|
968
1071
|
* Given the user was not working on a project previously nor has a default
|
|
969
1072
|
* project, the user will be prompted to create one.
|
|
970
1073
|
* Given the user was working on a project previously or has a default
|
|
971
1074
|
* project, the application will redirect to that project.
|
|
972
1075
|
*/
|
|
1076
|
+
if (constants.isProjectKeylessApplicationEntryPoint(entryPointUriPath)) {
|
|
1077
|
+
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
1078
|
+
to: `/${entryPointUriPath}`
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
973
1081
|
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
974
1082
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
975
1083
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
@@ -996,7 +1104,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
996
1104
|
})]
|
|
997
1105
|
})]
|
|
998
1106
|
})
|
|
999
|
-
})
|
|
1107
|
+
})]
|
|
1000
1108
|
}));
|
|
1001
1109
|
}
|
|
1002
1110
|
})
|
|
@@ -1007,7 +1115,6 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1007
1115
|
ApplicationShellAuthenticated.displayName = 'ApplicationShellAuthenticated';
|
|
1008
1116
|
|
|
1009
1117
|
const maxTitleCharLength = 24;
|
|
1010
|
-
const staticPaths = ['account', 'login'];
|
|
1011
1118
|
const getPageTitle = (pathname, additionalParts) => {
|
|
1012
1119
|
const _pathname$split = pathname.split('/'),
|
|
1013
1120
|
_pathname$split2 = _slicedToArray(_pathname$split, 3),
|
|
@@ -1019,7 +1126,7 @@ const getPageTitle = (pathname, additionalParts) => {
|
|
|
1019
1126
|
}
|
|
1020
1127
|
return [_sliceInstanceProperty__default["default"](titlePart).call(titlePart, 0, maxTitleCharLength / 2), _sliceInstanceProperty__default["default"](titlePart).call(titlePart, titlePart.length - maxTitleCharLength / 2)].join('...');
|
|
1021
1128
|
});
|
|
1022
|
-
if (
|
|
1129
|
+
if (constants.isStaticUrlPathInPositionOfProjectKey(projectKeyOrStaticPath)) {
|
|
1023
1130
|
return [...(customTitleParts || []), projectKeyOrStaticPath, 'Merchant Center'].join(' - ');
|
|
1024
1131
|
}
|
|
1025
1132
|
return [...(customTitleParts || []), entryPointUriPath, projectKeyOrStaticPath, 'Merchant Center'].join(' - ');
|
|
@@ -1157,7 +1264,7 @@ const hasCachedAuthenticationState = () => {
|
|
|
1157
1264
|
// THEN we assume that the application does not need a project context.
|
|
1158
1265
|
// GIVEN The application is not requesting a project key,
|
|
1159
1266
|
// THEN we remove the cached project key.
|
|
1160
|
-
// This is the case of
|
|
1267
|
+
// This is the case of a project-keyless application like `account` or `agent-sphere`.
|
|
1161
1268
|
if (!window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
|
|
1162
1269
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1163
1270
|
}
|
|
@@ -1210,7 +1317,7 @@ const hasCachedAuthenticationState = () => {
|
|
|
1210
1317
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1211
1318
|
};
|
|
1212
1319
|
|
|
1213
|
-
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" */); }));
|
|
1214
1321
|
|
|
1215
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; }
|
|
1216
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; }
|
|
@@ -1240,23 +1347,27 @@ const Authenticated = props => {
|
|
|
1240
1347
|
return jsxRuntime.jsx(AmILoggedIn, _objectSpread$4({}, props));
|
|
1241
1348
|
};
|
|
1242
1349
|
Authenticated.displayName = 'Authenticated';
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
})
|
|
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
|
+
};
|
|
1260
1371
|
AuthenticationRoutes.displayName = 'AuthenticationRoutes';
|
|
1261
1372
|
|
|
1262
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)); }
|
|
@@ -1373,7 +1484,7 @@ const ApplicationShellProvider = props => {
|
|
|
1373
1484
|
children: jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
1374
1485
|
environment: coercedEnvironmentValues,
|
|
1375
1486
|
children: jsxRuntime.jsx(reactRedux.Provider, {
|
|
1376
|
-
store:
|
|
1487
|
+
store: applicationEntryPoint.internalReduxStore,
|
|
1377
1488
|
children: jsxRuntime.jsx(react$2.ApolloProvider, {
|
|
1378
1489
|
client: apolloClient,
|
|
1379
1490
|
children: jsxRuntime.jsxs(reactRouterDom.Router, {
|
|
@@ -1412,7 +1523,7 @@ const ApplicationShellProvider = props => {
|
|
|
1412
1523
|
};
|
|
1413
1524
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1414
1525
|
|
|
1415
|
-
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" */); }));
|
|
1416
1527
|
|
|
1417
1528
|
const styles = {
|
|
1418
1529
|
name: "gx7yk8",
|
|
@@ -1436,7 +1547,7 @@ const StrictModeEnablement$1 = props => {
|
|
|
1436
1547
|
const ApplicationShell = props => {
|
|
1437
1548
|
react.useEffect(() => {
|
|
1438
1549
|
props.onRegisterErrorListeners?.({
|
|
1439
|
-
dispatch:
|
|
1550
|
+
dispatch: applicationEntryPoint.internalReduxStore.dispatch
|
|
1440
1551
|
});
|
|
1441
1552
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1442
1553
|
}, []); // <-- run only once, when component mounts
|
|
@@ -1452,7 +1563,7 @@ const ApplicationShell = props => {
|
|
|
1452
1563
|
if (isAuthenticated) {
|
|
1453
1564
|
return jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1454
1565
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1455
|
-
path:
|
|
1566
|
+
path: `/${constants.STATIC_URL_PATHS.LOGOUT}`,
|
|
1456
1567
|
children: jsxRuntime.jsx(RedirectToLogout, {})
|
|
1457
1568
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1458
1569
|
children: jsxRuntime.jsx(ApplicationShellAuthenticated, {
|
|
@@ -1475,7 +1586,7 @@ const ApplicationShell = props => {
|
|
|
1475
1586
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1476
1587
|
ApplicationShell.version = version;
|
|
1477
1588
|
|
|
1478
|
-
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" */); }));
|
|
1479
1590
|
|
|
1480
1591
|
function CustomViewFlopFlipProvider(props) {
|
|
1481
1592
|
const adapterArgs = react.useMemo(() => ({
|
|
@@ -1862,7 +1973,7 @@ function setupGlobalErrorListener() {
|
|
|
1862
1973
|
window.addEventListener('unhandledrejection', event => {
|
|
1863
1974
|
if (shouldErrorBeTracked(event)) {
|
|
1864
1975
|
const errorId = sentry.reportErrorToSentry(event);
|
|
1865
|
-
|
|
1976
|
+
applicationEntryPoint.internalReduxStore.dispatch(actionsGlobal.showUnexpectedErrorNotification({
|
|
1866
1977
|
errorId
|
|
1867
1978
|
}));
|
|
1868
1979
|
}
|
|
@@ -1872,7 +1983,7 @@ function setupGlobalErrorListener() {
|
|
|
1872
1983
|
window.addEventListener('error', errorEvent => {
|
|
1873
1984
|
if (shouldErrorBeTracked(errorEvent)) {
|
|
1874
1985
|
const errorId = sentry.reportErrorToSentry(errorEvent);
|
|
1875
|
-
|
|
1986
|
+
applicationEntryPoint.internalReduxStore.dispatch(actionsGlobal.showUnexpectedErrorNotification({
|
|
1876
1987
|
errorId
|
|
1877
1988
|
}));
|
|
1878
1989
|
}
|
|
@@ -1930,6 +2041,7 @@ exports.ErrorBoundary = ErrorBoundary;
|
|
|
1930
2041
|
exports.FetchProject = FetchProject;
|
|
1931
2042
|
exports.FetchUser = FetchUser;
|
|
1932
2043
|
exports.InjectReducers = InjectReducers;
|
|
2044
|
+
exports.PERFORMANCE_MARKS = PERFORMANCE_MARKS;
|
|
1933
2045
|
exports.ProjectSwitcher = ProjectSwitcher;
|
|
1934
2046
|
exports.ProtectedRoute = ProtectedRoute;
|
|
1935
2047
|
exports.REQUESTS_IN_FLIGHT_LOADER_DOM_ID = REQUESTS_IN_FLIGHT_LOADER_DOM_ID;
|