@commercetools-frontend/application-shell 27.8.0 → 27.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{application-entry-point-c87294b0.cjs.dev.js → application-entry-point-18d8fba0.cjs.dev.js} +7 -4
- package/dist/{application-entry-point-10a5e1a5.esm.js → application-entry-point-1b23fb6b.esm.js} +6 -4
- package/dist/{application-entry-point-8c4b8e53.cjs.prod.js → application-entry-point-74a06151.cjs.prod.js} +4 -3
- package/dist/{application-shell-splitter-dbae9dfc.esm.js → application-shell-splitter-2c38991b.esm.js} +2 -1
- package/dist/{application-shell-splitter-e87a060f.cjs.dev.js → application-shell-splitter-a527378f.cjs.dev.js} +2 -1
- package/dist/{application-shell-splitter-62fabf2c.cjs.prod.js → application-shell-splitter-b560f8be.cjs.prod.js} +2 -1
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +5 -4
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +5 -4
- package/dist/commercetools-frontend-application-shell.esm.js +5 -4
- package/dist/{custom-view-dev-host-fccf2c99.cjs.dev.js → custom-view-dev-host-61a6875f.cjs.dev.js} +15 -10
- package/dist/{custom-view-dev-host-09ad216c.cjs.prod.js → custom-view-dev-host-6802db5c.cjs.prod.js} +15 -10
- package/dist/{custom-view-dev-host-3652a0d6.esm.js → custom-view-dev-host-b47bb9bc.esm.js} +14 -10
- package/dist/declarations/src/components/setup-flop-flip-provider/setup-flop-flip-provider.d.ts +15 -0
- package/dist/{index-614accc4.cjs.dev.js → index-25183095.cjs.dev.js} +2 -2
- package/dist/{index-70e88ad7.cjs.dev.js → index-419ebe37.cjs.dev.js} +183 -140
- package/dist/{index-245e2980.cjs.prod.js → index-52c724ed.cjs.prod.js} +2 -2
- package/dist/{index-86039df7.esm.js → index-5aaa33bb.esm.js} +2 -2
- package/dist/{index-d0c30fac.cjs.prod.js → index-ae34310f.cjs.prod.js} +173 -134
- package/dist/index-f440fbdc.esm.js +1985 -0
- package/dist/{navbar-9eb6c972.esm.js → navbar-5290186f.esm.js} +104 -89
- package/dist/{navbar-f4b2552d.cjs.prod.js → navbar-9a1054eb.cjs.prod.js} +105 -89
- package/dist/{navbar-59504b51.cjs.dev.js → navbar-f2740795.cjs.dev.js} +105 -89
- package/dist/oidc-349b18df.cjs.dev.js +119 -0
- package/dist/oidc-3ad2f42d.cjs.prod.js +119 -0
- package/dist/{oidc-callback-2d5be737.esm.js → oidc-callback-a6d80251.esm.js} +11 -9
- package/dist/{oidc-callback-d8397df9.cjs.dev.js → oidc-callback-b47c8b7e.cjs.dev.js} +11 -10
- package/dist/{oidc-callback-60c1e8e8.cjs.prod.js → oidc-callback-e6029355.cjs.prod.js} +11 -10
- package/dist/oidc-ddd328fa.esm.js +103 -0
- package/dist/{project-container-31a4f3c6.cjs.dev.js → project-container-2a79f361.cjs.dev.js} +14 -11
- package/dist/{project-container-08fbe4b7.esm.js → project-container-ad07cd24.esm.js} +14 -11
- package/dist/{project-container-e61a39a2.cjs.prod.js → project-container-f3e06769.cjs.prod.js} +14 -11
- package/dist/{project-expired-97aa9779.cjs.prod.js → project-expired-a9741dd7.cjs.prod.js} +6 -5
- package/dist/{project-expired-324758a8.cjs.dev.js → project-expired-ce1a7855.cjs.dev.js} +6 -5
- package/dist/{project-expired-bb3b8866.esm.js → project-expired-dba360dc.esm.js} +6 -5
- package/dist/{project-not-found-4190bacf.cjs.prod.js → project-not-found-0dd37054.cjs.prod.js} +5 -4
- package/dist/{project-not-found-d2857df2.cjs.dev.js → project-not-found-43912d11.cjs.dev.js} +5 -4
- package/dist/{project-not-found-569f8569.esm.js → project-not-found-65aed038.esm.js} +5 -4
- package/dist/{project-not-initialized-fe8d8e96.esm.js → project-not-initialized-3eb732fc.esm.js} +6 -5
- package/dist/{project-not-initialized-c84c85da.cjs.prod.js → project-not-initialized-4fecb9ed.cjs.prod.js} +6 -5
- package/dist/{project-not-initialized-d60bab15.cjs.dev.js → project-not-initialized-52f39003.cjs.dev.js} +6 -5
- package/dist/{project-suspended-18333595.cjs.prod.js → project-suspended-5b1f484a.cjs.prod.js} +5 -4
- package/dist/{project-suspended-4bb66583.esm.js → project-suspended-663d9875.esm.js} +5 -4
- package/dist/{project-suspended-f4900a38.cjs.dev.js → project-suspended-b3b9d9d4.cjs.dev.js} +5 -4
- package/dist/{redirect-to-login-6675c038.cjs.prod.js → redirect-to-login-0596ba25.cjs.prod.js} +13 -10
- package/dist/{redirect-to-login-8a61864c.cjs.dev.js → redirect-to-login-6c3b5cc4.cjs.dev.js} +13 -10
- package/dist/{redirect-to-login-b79d0910.esm.js → redirect-to-login-c5629017.esm.js} +13 -10
- package/dist/{redirect-to-logout-31d43a03.cjs.prod.js → redirect-to-logout-7d335145.cjs.prod.js} +8 -6
- package/dist/{redirect-to-logout-0646ed18.cjs.dev.js → redirect-to-logout-8b0b2e2c.cjs.dev.js} +8 -6
- package/dist/{redirect-to-logout-0e2cfb93.esm.js → redirect-to-logout-9994a431.esm.js} +8 -6
- package/dist/{redirector-72ccfbc2.cjs.dev.js → redirector-0efdd994.cjs.dev.js} +4 -3
- package/dist/{redirector-d856975f.esm.js → redirector-656c6ee7.esm.js} +4 -3
- package/dist/{redirector-0c72d0a4.cjs.prod.js → redirector-c858d578.cjs.prod.js} +4 -3
- package/dist/{requests-in-flight-loader-fb5d3f6f.cjs.dev.js → requests-in-flight-loader-497fc4b0.cjs.dev.js} +5 -4
- package/dist/{requests-in-flight-loader-ab4d59f3.cjs.prod.js → requests-in-flight-loader-52e3eb92.cjs.prod.js} +5 -4
- package/dist/{requests-in-flight-loader-17158914.esm.js → requests-in-flight-loader-c56604f2.esm.js} +5 -4
- package/dist/{service-page-project-switcher-cb63edbf.esm.js → service-page-project-switcher-8942f997.esm.js} +1 -1
- package/dist/{service-page-project-switcher-a4d1d6de.cjs.dev.js → service-page-project-switcher-d98264a0.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-e221eba8.cjs.prod.js → service-page-project-switcher-f332cda6.cjs.prod.js} +1 -1
- package/dist/{use-applications-menu-8984efa1.cjs.prod.js → use-applications-menu-21c7420b.cjs.prod.js} +47 -39
- package/dist/{use-applications-menu-bd718ac8.cjs.dev.js → use-applications-menu-7a85c3ee.cjs.dev.js} +47 -39
- package/dist/{use-applications-menu-bc2b9a66.esm.js → use-applications-menu-8ff2d130.esm.js} +44 -37
- package/dist/{user-settings-menu-b8359b8b.cjs.dev.js → user-settings-menu-0f655cb1.cjs.dev.js} +30 -23
- package/dist/{user-settings-menu-a1d0ba8e.esm.js → user-settings-menu-bcb676d5.esm.js} +30 -23
- package/dist/{user-settings-menu-2235add2.cjs.prod.js → user-settings-menu-c52bf93a.cjs.prod.js} +30 -23
- package/package.json +53 -53
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +2 -1
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +2 -1
- package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +2 -1
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +35 -33
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +35 -33
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +29 -28
- package/dist/index-2856f98e.esm.js +0 -1943
- package/dist/oidc-0cba182b.cjs.prod.js +0 -102
- package/dist/oidc-b9e7297c.cjs.dev.js +0 -102
- package/dist/oidc-cb344fae.esm.js +0 -87
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
var reactRouterDom = require('react-router-dom');
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-52c724ed.cjs.prod.js');
|
|
6
6
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
7
7
|
var _styled = require('@emotion/styled/base');
|
|
8
8
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
@@ -23,8 +23,9 @@ var constants = require('@commercetools-frontend/constants');
|
|
|
23
23
|
var i18n = require('@commercetools-frontend/i18n');
|
|
24
24
|
var reactNotifications = require('@commercetools-frontend/react-notifications');
|
|
25
25
|
var sentry = require('@commercetools-frontend/sentry');
|
|
26
|
-
var oidc = require('./oidc-
|
|
26
|
+
var oidc = require('./oidc-3ad2f42d.cjs.prod.js');
|
|
27
27
|
require('@babel/runtime-corejs3/core-js-stable/url');
|
|
28
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
28
29
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
29
30
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
30
31
|
var reactIntl = require('react-intl');
|
|
@@ -32,6 +33,7 @@ var FlatButton = require('@commercetools-uikit/flat-button');
|
|
|
32
33
|
var icons = require('@commercetools-uikit/icons');
|
|
33
34
|
var location = require('./location-537e0660.cjs.prod.js');
|
|
34
35
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
36
|
+
var _taggedTemplateLiteral = require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
|
|
35
37
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
36
38
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
37
39
|
var memoize = require('memoize-one');
|
|
@@ -85,6 +87,7 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
85
87
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
86
88
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
87
89
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
90
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
88
91
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
89
92
|
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
90
93
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -105,9 +108,9 @@ var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
|
105
108
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
106
109
|
|
|
107
110
|
// NOTE: This string will be replaced on build time with the package version.
|
|
108
|
-
var version = "27.
|
|
111
|
+
var version = "27.9.1";
|
|
109
112
|
|
|
110
|
-
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-
|
|
113
|
+
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-52e3eb92.cjs.prod.js' /* webpackChunkName: "requests-in-flight-loader" */); }));
|
|
111
114
|
|
|
112
115
|
// Attempt to load the `projectKey` from localStorage
|
|
113
116
|
function selectProjectKeyFromLocalStorage() {
|
|
@@ -133,7 +136,7 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
133
136
|
* A full page reload is needed as the user's project may have changed (deletions and/or additions).
|
|
134
137
|
* As a result the project and user queries need refetching.
|
|
135
138
|
*/
|
|
136
|
-
const redirectToProject = key => location.location.replace(
|
|
139
|
+
const redirectToProject = key => location.location.replace("/".concat(key));
|
|
137
140
|
const BackToProject = props => {
|
|
138
141
|
const intl = reactIntl.useIntl();
|
|
139
142
|
return jsxRuntime.jsx(FlatButton__default["default"], {
|
|
@@ -144,14 +147,8 @@ const BackToProject = props => {
|
|
|
144
147
|
};
|
|
145
148
|
BackToProject.displayName = 'BackToProject';
|
|
146
149
|
|
|
147
|
-
|
|
148
|
-
0% {
|
|
149
|
-
background-color: ${designSystem.customProperties.colorNeutral};
|
|
150
|
-
}
|
|
151
|
-
100% {
|
|
152
|
-
background-color: ${designSystem.customProperties.colorNeutral95};
|
|
153
|
-
}
|
|
154
|
-
`;
|
|
150
|
+
var _templateObject;
|
|
151
|
+
const animationPulse = react$1.keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n background-color: ", ";\n }\n 100% {\n background-color: ", ";\n }\n"])), designSystem.customProperties.colorNeutral, designSystem.customProperties.colorNeutral95);
|
|
155
152
|
const getWidthBySize = props => {
|
|
156
153
|
switch (props.shape) {
|
|
157
154
|
case 'dot':
|
|
@@ -348,14 +345,15 @@ const ProjectSwitcher = props => {
|
|
|
348
345
|
onChange: event => {
|
|
349
346
|
const selectedProjectKey = event.target.value;
|
|
350
347
|
if (selectedProjectKey !== props.projectKey) {
|
|
351
|
-
|
|
348
|
+
var _window$app$__DEVELOP;
|
|
349
|
+
if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
|
|
352
350
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(selectedProjectKey);
|
|
353
351
|
}
|
|
354
352
|
|
|
355
353
|
// We simply redirect to a "new" browser page, instead of using the
|
|
356
354
|
// history router. This will simplify a lot of things and avoid possible
|
|
357
355
|
// problems like e.g. resetting the store/state.
|
|
358
|
-
redirectTo(
|
|
356
|
+
redirectTo("/".concat(selectedProjectKey));
|
|
359
357
|
}
|
|
360
358
|
},
|
|
361
359
|
options: data && data.user && mapProjectsToOptions(data.user.projects.results) || [],
|
|
@@ -386,7 +384,7 @@ ProjectSwitcher.displayName = 'ProjectSwitcher';
|
|
|
386
384
|
// eslint-disable-next-line import/prefer-default-export
|
|
387
385
|
const REQUESTS_IN_FLIGHT_LOADER_DOM_ID = 'loader-for-requests-in-flight';
|
|
388
386
|
|
|
389
|
-
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-
|
|
387
|
+
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-c52bf93a.cjs.prod.js' /* webpackChunkName: "user-settings-menu" */); }));
|
|
390
388
|
|
|
391
389
|
var _ref$1 = {
|
|
392
390
|
name: "zjik7",
|
|
@@ -401,7 +399,8 @@ var _ref3$1 = {
|
|
|
401
399
|
styles: "height:22px"
|
|
402
400
|
} ;
|
|
403
401
|
const AppBar = props => {
|
|
404
|
-
|
|
402
|
+
var _props$user$defaultPr, _props$user;
|
|
403
|
+
const previousProjectKey = getPreviousProjectKey((_props$user$defaultPr = (_props$user = props.user) === null || _props$user === void 0 ? void 0 : _props$user.defaultProjectKey) !== null && _props$user$defaultPr !== void 0 ? _props$user$defaultPr : undefined);
|
|
405
404
|
return jsxRuntime.jsxs("div", {
|
|
406
405
|
css: /*#__PURE__*/react$1.css("background-color:", designSystem.designTokens.colorSurface, ";box-shadow:0px 2px 5px 0px rgba(0, 0, 0, 0.15);padding:0 40px;min-height:", oidc.DIMENSIONS.header, ";position:relative;width:100%;z-index:20000;display:flex;align-items:center;justify-content:space-between;" + ("" ), "" ),
|
|
407
406
|
"data-test": "top-navigation",
|
|
@@ -426,7 +425,7 @@ const AppBar = props => {
|
|
|
426
425
|
const selectedProject = _findInstanceProperty__default["default"](_context = props.user.projects.results).call(_context, project => project.key === props.projectKeyFromUrl);
|
|
427
426
|
return jsxRuntime.jsxs("div", {
|
|
428
427
|
css: /*#__PURE__*/react$1.css("display:flex;gap:", designSystem.designTokens.spacing20, ";align-items:center;" + ("" ), "" ),
|
|
429
|
-
children: [selectedProject
|
|
428
|
+
children: [(selectedProject === null || selectedProject === void 0 ? void 0 : selectedProject.isProductionProject) && jsxRuntime.jsx("div", {
|
|
430
429
|
css: _ref3$1,
|
|
431
430
|
children: jsxRuntime.jsx(applicationComponents.ProjectStamp.IsProduction, {})
|
|
432
431
|
}), jsxRuntime.jsx(ProjectSwitcher
|
|
@@ -495,7 +494,7 @@ const Passthrough = _ref => {
|
|
|
495
494
|
children: children
|
|
496
495
|
});
|
|
497
496
|
};
|
|
498
|
-
const LazyApplicationShellSplitter = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./application-shell-splitter-
|
|
497
|
+
const LazyApplicationShellSplitter = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./application-shell-splitter-b560f8be.cjs.prod.js' /* webpackChunkName: "application-shell-splitter" */); })
|
|
499
498
|
// When `@commercetools/nimbus` is not installed, the mc-scripts bundler
|
|
500
499
|
// fallback stubs it to an empty module so the build succeeds — but the
|
|
501
500
|
// splitter's Nimbus bindings are then `undefined`. `hasNimbus` reflects that;
|
|
@@ -601,32 +600,40 @@ const FetchUser = props => {
|
|
|
601
600
|
};
|
|
602
601
|
FetchUser.displayName = 'FetchUser';
|
|
603
602
|
|
|
604
|
-
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-
|
|
603
|
+
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-9a1054eb.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
|
|
605
604
|
|
|
606
|
-
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-
|
|
605
|
+
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-f3e06769.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
607
606
|
|
|
608
|
-
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-
|
|
607
|
+
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-7d335145.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
609
608
|
|
|
610
609
|
const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-e4ff7797.cjs.prod.js' /* webpackChunkName: "redirect-to-project-create" */); }));
|
|
611
610
|
|
|
612
611
|
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; }
|
|
613
612
|
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; }
|
|
614
|
-
var AllFeaturesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "AllFeatures" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allFeatures" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 72, source: { body: "query AllFeatures {\n allFeatures {\n name\n value\n reason\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
613
|
+
var AllFeaturesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "AllFeatures" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allFeatures" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 72, source: { body: "query AllFeatures {\n allFeatures {\n name\n value\n reason\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } }; // The LaunchDarkly client-side SDK requires a context to either provide a
|
|
614
|
+
// `key` (non-anonymous) or be marked as `anonymous: true` (in which case the
|
|
615
|
+
// SDK generates a key for it). A context can never satisfy both branches at
|
|
616
|
+
// once, so we model this as a union rather than making `key` optional.
|
|
615
617
|
// This value is hard-coded here because we want to make sure that the
|
|
616
618
|
// app uses our account of LD. The value is meant to be public, so there
|
|
617
619
|
// is no need to be concerned about security.
|
|
618
620
|
const ldClientSideIdProduction = '5979d95f6040390cd07b5e01';
|
|
619
621
|
function getUserContextForLaunchDarklyAdapter(user, projectKey) {
|
|
620
|
-
|
|
622
|
+
var _user$launchdarklyTra, _user$launchdarklyTra2, _user$launchdarklyTra3, _user$launchdarklyTra4, _user$launchdarklyTra5;
|
|
623
|
+
const base = {
|
|
621
624
|
kind: 'user',
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
cloudEnvironment: user?.launchdarklyTrackingCloudEnvironment ?? ''
|
|
625
|
+
project: projectKey !== null && projectKey !== void 0 ? projectKey : '',
|
|
626
|
+
id: (_user$launchdarklyTra = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingId) !== null && _user$launchdarklyTra !== void 0 ? _user$launchdarklyTra : '',
|
|
627
|
+
team: (_user$launchdarklyTra2 = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingTeam) !== null && _user$launchdarklyTra2 !== void 0 ? _user$launchdarklyTra2 : [],
|
|
628
|
+
group: (_user$launchdarklyTra3 = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingGroup) !== null && _user$launchdarklyTra3 !== void 0 ? _user$launchdarklyTra3 : '',
|
|
629
|
+
subgroup: (_user$launchdarklyTra4 = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingSubgroup) !== null && _user$launchdarklyTra4 !== void 0 ? _user$launchdarklyTra4 : '',
|
|
630
|
+
cloudEnvironment: (_user$launchdarklyTra5 = user === null || user === void 0 ? void 0 : user.launchdarklyTrackingCloudEnvironment) !== null && _user$launchdarklyTra5 !== void 0 ? _user$launchdarklyTra5 : ''
|
|
629
631
|
};
|
|
632
|
+
return user !== null && user !== void 0 && user.id ? _objectSpread$9(_objectSpread$9({}, base), {}, {
|
|
633
|
+
key: user.id
|
|
634
|
+
}) : _objectSpread$9(_objectSpread$9({}, base), {}, {
|
|
635
|
+
anonymous: true
|
|
636
|
+
});
|
|
630
637
|
}
|
|
631
638
|
const parseFlags = fetchedFlags => {
|
|
632
639
|
var _context;
|
|
@@ -657,47 +664,52 @@ const SetupFlopFlipProvider = props => {
|
|
|
657
664
|
}
|
|
658
665
|
}, [enableLongLivedFeatureFlags]);
|
|
659
666
|
const defaultFlags = react.useMemo(() => _objectSpread$9(_objectSpread$9({}, constants.featureFlags.DEFAULT_FLAGS), props.defaultFlags), [props.defaultFlags]);
|
|
660
|
-
const adapterArgs = react.useMemo(() =>
|
|
661
|
-
user
|
|
662
|
-
|
|
663
|
-
},
|
|
664
|
-
launchdarkly: {
|
|
665
|
-
cacheIdentifier: types.cacheIdentifiers.local,
|
|
666
|
-
cacheMode: getCacheMode(types.adapterIdentifiers.launchdarkly),
|
|
667
|
-
sdk: {
|
|
668
|
-
// Allow to overwrite the client ID, passed via the `additionalEnv` properties
|
|
669
|
-
// of the application config.
|
|
670
|
-
// This is mostly useful for internal usage on our staging environments.
|
|
671
|
-
clientSideId: props.ldClientSideId ?? ldClientSideIdProduction,
|
|
672
|
-
clientOptions: {
|
|
673
|
-
sendEventsOnlyForVariation: true
|
|
674
|
-
}
|
|
675
|
-
},
|
|
676
|
-
flags,
|
|
677
|
-
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
678
|
-
},
|
|
679
|
-
http: {
|
|
680
|
-
// polling interval set to 15 minutes
|
|
681
|
-
pollingIntervalMs: 1000 * 60 * 15,
|
|
682
|
-
cacheIdentifier: types.cacheIdentifiers.local,
|
|
683
|
-
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
667
|
+
const adapterArgs = react.useMemo(() => {
|
|
668
|
+
var _props$user, _props$ldClientSideId, _props$user2;
|
|
669
|
+
return {
|
|
684
670
|
user: {
|
|
685
|
-
key: props.user
|
|
671
|
+
key: (_props$user = props.user) === null || _props$user === void 0 ? void 0 : _props$user.id
|
|
686
672
|
},
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
673
|
+
launchdarkly: {
|
|
674
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
675
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.launchdarkly),
|
|
676
|
+
sdk: {
|
|
677
|
+
// Allow to overwrite the client ID, passed via the `additionalEnv` properties
|
|
678
|
+
// of the application config.
|
|
679
|
+
// This is mostly useful for internal usage on our staging environments.
|
|
680
|
+
clientSideId: (_props$ldClientSideId = props.ldClientSideId) !== null && _props$ldClientSideId !== void 0 ? _props$ldClientSideId : ldClientSideIdProduction
|
|
681
|
+
// `sendEventsOnlyForVariation` was removed in @launchdarkly/js-client-sdk v4
|
|
682
|
+
// (formerly launchdarkly-js-client-sdk v3). It is no longer needed: as of v4,
|
|
683
|
+
// `allFlags` no longer sends analytics events by default, which is exactly the
|
|
684
|
+
// behavior this option used to opt into.
|
|
685
|
+
},
|
|
686
|
+
flags,
|
|
687
|
+
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
688
|
+
},
|
|
689
|
+
http: {
|
|
690
|
+
// polling interval set to 15 minutes
|
|
691
|
+
pollingIntervalMs: 1000 * 60 * 15,
|
|
692
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
693
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
694
|
+
user: {
|
|
695
|
+
key: (_props$user2 = props.user) === null || _props$user2 === void 0 ? void 0 : _props$user2.id
|
|
696
|
+
},
|
|
697
|
+
execute: async adapterArgs => {
|
|
698
|
+
var _adapterArgs$user;
|
|
699
|
+
const response = await apolloClient.query({
|
|
700
|
+
query: AllFeaturesQuery,
|
|
701
|
+
errorPolicy: 'ignore',
|
|
702
|
+
fetchPolicy: 'network-only',
|
|
703
|
+
context: {
|
|
704
|
+
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
705
|
+
projectKey: (_adapterArgs$user = adapterArgs.user) === null || _adapterArgs$user === void 0 ? void 0 : _adapterArgs$user.project
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
return parseFlags(response.data);
|
|
709
|
+
}
|
|
698
710
|
}
|
|
699
|
-
}
|
|
700
|
-
}
|
|
711
|
+
};
|
|
712
|
+
}, [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
|
|
701
713
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
702
714
|
adapter: combineAdapters.adapter,
|
|
703
715
|
adapterArgs: adapterArgs,
|
|
@@ -739,18 +751,22 @@ const MainContainer = /*#__PURE__*/_styled__default["default"]("main", {
|
|
|
739
751
|
* and contains the "restricted" application part.
|
|
740
752
|
*/
|
|
741
753
|
var _ref = {
|
|
754
|
+
name: "26rdb6",
|
|
755
|
+
styles: "position:sticky;bottom:0;z-index:9999;pointer-events:none"
|
|
756
|
+
} ;
|
|
757
|
+
var _ref2 = {
|
|
742
758
|
name: "tlwzvn",
|
|
743
759
|
styles: "flex-grow:1;display:flex;flex-direction:column;position:relative;>*:not(:first-of-type){flex-grow:1;display:flex;flex-direction:column;}"
|
|
744
760
|
} ;
|
|
745
|
-
var
|
|
761
|
+
var _ref3 = {
|
|
746
762
|
name: "lzrvov",
|
|
747
763
|
styles: "grid-column:1/2;grid-row:2/4;overflow:hidden"
|
|
748
764
|
} ;
|
|
749
|
-
var
|
|
765
|
+
var _ref4 = {
|
|
750
766
|
name: "tjbz3t",
|
|
751
767
|
styles: "grid-row:'2/3';grid-column:'2/3'"
|
|
752
768
|
} ;
|
|
753
|
-
var
|
|
769
|
+
var _ref5 = {
|
|
754
770
|
name: "8bdwu0",
|
|
755
771
|
styles: "grid-row:1;grid-column:1/3"
|
|
756
772
|
} ;
|
|
@@ -769,10 +785,10 @@ const ApplicationShellAuthenticated = props => {
|
|
|
769
785
|
notificationsPageRef
|
|
770
786
|
});
|
|
771
787
|
return jsxRuntime.jsx(FetchUser, {
|
|
772
|
-
children:
|
|
773
|
-
let isLoadingUser =
|
|
774
|
-
user =
|
|
775
|
-
error =
|
|
788
|
+
children: _ref6 => {
|
|
789
|
+
let isLoadingUser = _ref6.isLoading,
|
|
790
|
+
user = _ref6.user,
|
|
791
|
+
error = _ref6.error;
|
|
776
792
|
if (error) {
|
|
777
793
|
// In case there is an unauthorized error, we redirect to the login page
|
|
778
794
|
if (error.graphQLErrors && _Array$isArray__default["default"](error.graphQLErrors)) {
|
|
@@ -793,9 +809,9 @@ const ApplicationShellAuthenticated = props => {
|
|
|
793
809
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
794
810
|
locale: userLocale,
|
|
795
811
|
applicationMessages: props.applicationMessages,
|
|
796
|
-
children:
|
|
797
|
-
let locale =
|
|
798
|
-
messages =
|
|
812
|
+
children: _ref7 => {
|
|
813
|
+
let locale = _ref7.locale,
|
|
814
|
+
messages = _ref7.messages;
|
|
799
815
|
sentry.reportErrorToSentry(error, {});
|
|
800
816
|
return jsxRuntime.jsx(ConfigureIntlProvider, {
|
|
801
817
|
locale: locale,
|
|
@@ -808,21 +824,21 @@ const ApplicationShellAuthenticated = props => {
|
|
|
808
824
|
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
809
825
|
|
|
810
826
|
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
811
|
-
const staffBarLanguage = user
|
|
827
|
+
const staffBarLanguage = (user === null || user === void 0 ? void 0 : user.launchdarklyTrackingGroup) === 'commercetools' || (user === null || user === void 0 ? void 0 : user.launchdarklyTrackingGroup) === 'mailosaur' ? applicationShellConnectors.selectUserLanguageFromStorage() : undefined;
|
|
812
828
|
const normalizedUser = user ? _objectSpread$8(_objectSpread$8({}, user), {}, {
|
|
813
829
|
// set the staff bar language if applicable
|
|
814
|
-
language: staffBarLanguage
|
|
830
|
+
language: staffBarLanguage !== null && staffBarLanguage !== void 0 ? staffBarLanguage : user.language
|
|
815
831
|
}) : undefined;
|
|
816
832
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
817
833
|
user: normalizedUser,
|
|
818
834
|
environment: applicationEnvironment,
|
|
819
835
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
820
|
-
locale: normalizedUser
|
|
836
|
+
locale: normalizedUser === null || normalizedUser === void 0 ? void 0 : normalizedUser.language,
|
|
821
837
|
applicationMessages: props.applicationMessages,
|
|
822
|
-
children:
|
|
823
|
-
let isLoadingLocaleData =
|
|
824
|
-
locale =
|
|
825
|
-
messages =
|
|
838
|
+
children: _ref8 => {
|
|
839
|
+
let isLoadingLocaleData = _ref8.isLoading,
|
|
840
|
+
locale = _ref8.locale,
|
|
841
|
+
messages = _ref8.messages;
|
|
826
842
|
return jsxRuntime.jsx(ConfigureIntlProvider
|
|
827
843
|
// We do not want to pass the language as long as the locale data
|
|
828
844
|
// is not loaded.
|
|
@@ -837,7 +853,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
837
853
|
flags: props.featureFlags,
|
|
838
854
|
defaultFlags: props.defaultFeatureFlags,
|
|
839
855
|
children: jsxRuntime.jsxs(ApplicationShellSplitterWrapper, {
|
|
840
|
-
locale: locale
|
|
856
|
+
locale: locale !== null && locale !== void 0 ? locale : 'en',
|
|
841
857
|
children: [jsxRuntime.jsx(ThemeSwitcher, {}), jsxRuntime.jsx(RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
|
|
842
858
|
user: normalizedUser
|
|
843
859
|
}), jsxRuntime.jsxs("div", {
|
|
@@ -846,20 +862,20 @@ const ApplicationShellAuthenticated = props => {
|
|
|
846
862
|
ref: notificationsGlobalRef,
|
|
847
863
|
role: "region",
|
|
848
864
|
"aria-live": "polite",
|
|
849
|
-
css:
|
|
865
|
+
css: _ref5,
|
|
850
866
|
children: [jsxRuntime.jsx("div", {
|
|
851
867
|
id: "above-top-navigation"
|
|
852
868
|
}), jsxRuntime.jsx(reactNotifications.NotificationsList, {
|
|
853
869
|
domain: constants.DOMAINS.GLOBAL
|
|
854
870
|
})]
|
|
855
871
|
}), jsxRuntime.jsx("header", {
|
|
856
|
-
css:
|
|
872
|
+
css: _ref4,
|
|
857
873
|
children: jsxRuntime.jsx(AppBar, {
|
|
858
874
|
user: normalizedUser,
|
|
859
875
|
projectKeyFromUrl: projectKeyFromUrl
|
|
860
876
|
})
|
|
861
877
|
}), jsxRuntime.jsx("aside", {
|
|
862
|
-
css:
|
|
878
|
+
css: _ref3,
|
|
863
879
|
children: (() => {
|
|
864
880
|
// The <NavBar> should only be rendered within a project
|
|
865
881
|
// context, therefore when there is a `projectKey`.
|
|
@@ -874,9 +890,9 @@ const ApplicationShellAuthenticated = props => {
|
|
|
874
890
|
if (!projectKeyFromUrl) return null;
|
|
875
891
|
return jsxRuntime.jsx(FetchProject, {
|
|
876
892
|
projectKey: projectKeyFromUrl,
|
|
877
|
-
children:
|
|
878
|
-
let isLoadingProject =
|
|
879
|
-
project =
|
|
893
|
+
children: _ref9 => {
|
|
894
|
+
let isLoadingProject = _ref9.isLoading,
|
|
895
|
+
project = _ref9.project;
|
|
880
896
|
const isLoading = isLoadingUser || isLoadingLocaleData || isLoadingProject || !locale || !project;
|
|
881
897
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
882
898
|
user: normalizedUser,
|
|
@@ -910,7 +926,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
910
926
|
}), jsxRuntime.jsx(reactNotifications.NotificationsList, {
|
|
911
927
|
domain: constants.DOMAINS.SIDE
|
|
912
928
|
}), jsxRuntime.jsxs("div", {
|
|
913
|
-
css:
|
|
929
|
+
css: _ref2,
|
|
914
930
|
children: [jsxRuntime.jsx(applicationComponents.PortalsContainer
|
|
915
931
|
// @ts-ignore
|
|
916
932
|
, {
|
|
@@ -942,8 +958,8 @@ const ApplicationShellAuthenticated = props => {
|
|
|
942
958
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
943
959
|
exact: true,
|
|
944
960
|
path: "/",
|
|
945
|
-
children: (
|
|
946
|
-
const previousProjectKey = getPreviousProjectKey(normalizedUser
|
|
961
|
+
children: (_normalizedUser$defau => {
|
|
962
|
+
const previousProjectKey = getPreviousProjectKey((_normalizedUser$defau = normalizedUser === null || normalizedUser === void 0 ? void 0 : normalizedUser.defaultProjectKey) !== null && _normalizedUser$defau !== void 0 ? _normalizedUser$defau : undefined);
|
|
947
963
|
|
|
948
964
|
/**
|
|
949
965
|
* NOTE:
|
|
@@ -956,7 +972,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
956
972
|
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
957
973
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
958
974
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
959
|
-
to:
|
|
975
|
+
to: "/".concat(previousProjectKey)
|
|
960
976
|
});
|
|
961
977
|
})()
|
|
962
978
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
@@ -975,6 +991,9 @@ const ApplicationShellAuthenticated = props => {
|
|
|
975
991
|
})
|
|
976
992
|
})]
|
|
977
993
|
})]
|
|
994
|
+
}), jsxRuntime.jsx("div", {
|
|
995
|
+
id: constants.MC_MAIN_CONTAINER_PORTAL_ID,
|
|
996
|
+
css: _ref
|
|
978
997
|
})]
|
|
979
998
|
})]
|
|
980
999
|
})]
|
|
@@ -1132,31 +1151,37 @@ const withoutProjectKeyClaim = scope => {
|
|
|
1132
1151
|
return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, claim => !_startsWithInstanceProperty__default["default"](claim).call(claim, oidc.OIDC_CLAIMS.PROJECT_KEY)).join(' ');
|
|
1133
1152
|
};
|
|
1134
1153
|
const hasCachedAuthenticationState = () => {
|
|
1135
|
-
|
|
1154
|
+
var _window$app$__DEVELOP;
|
|
1155
|
+
if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
|
|
1136
1156
|
try {
|
|
1157
|
+
var _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP0, _window$app$__DEVELOP1;
|
|
1137
1158
|
let activeProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
|
|
1138
1159
|
if (activeProjectKey) {
|
|
1160
|
+
var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4;
|
|
1139
1161
|
// GIVEN The application is not requesting a project key,
|
|
1140
1162
|
// THEN we assume that the application does not need a project context.
|
|
1141
1163
|
// GIVEN The application is not requesting a project key,
|
|
1142
1164
|
// THEN we remove the cached project key.
|
|
1143
1165
|
// This is the case of an application like `account`.
|
|
1144
|
-
if (!window.app.__DEVELOPMENT__
|
|
1166
|
+
if (!((_window$app$__DEVELOP2 = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP2 !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP2.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.initialProjectKey)) {
|
|
1145
1167
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1146
1168
|
}
|
|
1147
1169
|
|
|
1148
1170
|
// If the project key we had in the storage does not match the one
|
|
1149
1171
|
// we have in the development config, then we need to discard it and
|
|
1150
1172
|
// use the one from the development config.
|
|
1151
|
-
if (window.app.__DEVELOPMENT__
|
|
1152
|
-
|
|
1173
|
+
if ((_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP3 !== void 0 && (_window$app$__DEVELOP3 = _window$app$__DEVELOP3.oidc) !== null && _window$app$__DEVELOP3 !== void 0 && _window$app$__DEVELOP3.initialProjectKey && ((_window$app$__DEVELOP4 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP4 === void 0 || (_window$app$__DEVELOP4 = _window$app$__DEVELOP4.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.initialProjectKey) !== activeProjectKey) {
|
|
1174
|
+
var _window$app$__DEVELOP5;
|
|
1175
|
+
activeProjectKey = (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 || (_window$app$__DEVELOP5 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : _window$app$__DEVELOP5.initialProjectKey;
|
|
1153
1176
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(activeProjectKey);
|
|
1154
1177
|
}
|
|
1155
1178
|
} else {
|
|
1156
|
-
|
|
1179
|
+
var _window$app$__DEVELOP6;
|
|
1180
|
+
if ((_window$app$__DEVELOP6 = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP6 !== void 0 && (_window$app$__DEVELOP6 = _window$app$__DEVELOP6.oidc) !== null && _window$app$__DEVELOP6 !== void 0 && _window$app$__DEVELOP6.initialProjectKey) {
|
|
1181
|
+
var _window$app$__DEVELOP7;
|
|
1157
1182
|
// Here we store the initial project key in local storage,
|
|
1158
1183
|
// so that it gets picked up when we initiate the login flow.
|
|
1159
|
-
applicationShellConnectors.oidcStorage.setActiveProjectKey(window.app.__DEVELOPMENT__
|
|
1184
|
+
applicationShellConnectors.oidcStorage.setActiveProjectKey((_window$app$__DEVELOP7 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP7 === void 0 || (_window$app$__DEVELOP7 = _window$app$__DEVELOP7.oidc) === null || _window$app$__DEVELOP7 === void 0 ? void 0 : _window$app$__DEVELOP7.initialProjectKey);
|
|
1160
1185
|
}
|
|
1161
1186
|
}
|
|
1162
1187
|
|
|
@@ -1171,11 +1196,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1171
1196
|
}
|
|
1172
1197
|
// Rebuild the requested OIDC scope to verify that it didn't change.
|
|
1173
1198
|
const requestedScope = oidc.buildOidcScope({
|
|
1174
|
-
projectKey: activeProjectKey
|
|
1175
|
-
oAuthScopes: window.app.__DEVELOPMENT__
|
|
1176
|
-
additionalOAuthScopes: window.app.__DEVELOPMENT__
|
|
1177
|
-
teamId: window.app.__DEVELOPMENT__
|
|
1178
|
-
applicationId: window.app.__DEVELOPMENT__
|
|
1199
|
+
projectKey: activeProjectKey !== null && activeProjectKey !== void 0 ? activeProjectKey : undefined,
|
|
1200
|
+
oAuthScopes: (_window$app$__DEVELOP8 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP8 === void 0 || (_window$app$__DEVELOP8 = _window$app$__DEVELOP8.oidc) === null || _window$app$__DEVELOP8 === void 0 ? void 0 : _window$app$__DEVELOP8.oAuthScopes,
|
|
1201
|
+
additionalOAuthScopes: (_window$app$__DEVELOP9 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP9 === void 0 || (_window$app$__DEVELOP9 = _window$app$__DEVELOP9.oidc) === null || _window$app$__DEVELOP9 === void 0 ? void 0 : _window$app$__DEVELOP9.additionalOAuthScopes,
|
|
1202
|
+
teamId: (_window$app$__DEVELOP0 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP0 === void 0 || (_window$app$__DEVELOP0 = _window$app$__DEVELOP0.oidc) === null || _window$app$__DEVELOP0 === void 0 ? void 0 : _window$app$__DEVELOP0.teamId,
|
|
1203
|
+
applicationId: (_window$app$__DEVELOP1 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP1 === void 0 || (_window$app$__DEVELOP1 = _window$app$__DEVELOP1.oidc) === null || _window$app$__DEVELOP1 === void 0 ? void 0 : _window$app$__DEVELOP1.applicationId
|
|
1179
1204
|
});
|
|
1180
1205
|
// Omit the project key from the check. This allows to switch projects
|
|
1181
1206
|
// without having to log in again.
|
|
@@ -1193,11 +1218,12 @@ const hasCachedAuthenticationState = () => {
|
|
|
1193
1218
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1194
1219
|
};
|
|
1195
1220
|
|
|
1196
|
-
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-
|
|
1221
|
+
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-e6029355.cjs.prod.js' /* webpackChunkName: "oidc-callback" */); }));
|
|
1197
1222
|
|
|
1198
1223
|
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; }
|
|
1199
1224
|
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; }
|
|
1200
1225
|
const Authenticated = props => {
|
|
1226
|
+
var _window$app$__DEVELOP;
|
|
1201
1227
|
// We attempt to see if the user was already authenticated by looking
|
|
1202
1228
|
// at the "cached" flag in local storage.
|
|
1203
1229
|
const cachedAuthenticationState = hasCachedAuthenticationState();
|
|
@@ -1211,7 +1237,7 @@ const Authenticated = props => {
|
|
|
1211
1237
|
|
|
1212
1238
|
// When using the OIDC workflow, we always return false, to trigger
|
|
1213
1239
|
// the redirect to the login page.
|
|
1214
|
-
if (window.app.__DEVELOPMENT__
|
|
1240
|
+
if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
|
|
1215
1241
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1216
1242
|
children: props.render({
|
|
1217
1243
|
isAuthenticated: false
|
|
@@ -1225,13 +1251,13 @@ const Authenticated = props => {
|
|
|
1225
1251
|
Authenticated.displayName = 'Authenticated';
|
|
1226
1252
|
const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1227
1253
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1228
|
-
path:
|
|
1254
|
+
path: "/account/oidc/callback",
|
|
1229
1255
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1230
1256
|
locale: props.locale,
|
|
1231
1257
|
applicationMessages: props.applicationMessages
|
|
1232
1258
|
})
|
|
1233
1259
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1234
|
-
path:
|
|
1260
|
+
path: "/:projectKey/:identifier/oidc/callback",
|
|
1235
1261
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1236
1262
|
locale: props.locale,
|
|
1237
1263
|
applicationMessages: props.applicationMessages
|
|
@@ -1344,7 +1370,10 @@ const useCoercedEnvironmentValues = environment => {
|
|
|
1344
1370
|
};
|
|
1345
1371
|
|
|
1346
1372
|
const ApplicationShellProvider = props => {
|
|
1347
|
-
const apolloClient = react.useMemo(() =>
|
|
1373
|
+
const apolloClient = react.useMemo(() => {
|
|
1374
|
+
var _props$apolloClient;
|
|
1375
|
+
return (_props$apolloClient = props.apolloClient) !== null && _props$apolloClient !== void 0 ? _props$apolloClient : applicationShellConnectors.createApolloClient();
|
|
1376
|
+
}, [props.apolloClient]);
|
|
1348
1377
|
react.useEffect(() => {
|
|
1349
1378
|
applicationShellConnectors.setCachedApolloClient(apolloClient);
|
|
1350
1379
|
}, [apolloClient]);
|
|
@@ -1395,7 +1424,7 @@ const ApplicationShellProvider = props => {
|
|
|
1395
1424
|
};
|
|
1396
1425
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1397
1426
|
|
|
1398
|
-
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-
|
|
1427
|
+
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-0596ba25.cjs.prod.js' /* webpackChunkName: "redirect-to-login" */); }));
|
|
1399
1428
|
|
|
1400
1429
|
const styles = {
|
|
1401
1430
|
name: "gx7yk8",
|
|
@@ -1418,7 +1447,8 @@ const StrictModeEnablement$1 = props => {
|
|
|
1418
1447
|
};
|
|
1419
1448
|
const ApplicationShell = props => {
|
|
1420
1449
|
react.useEffect(() => {
|
|
1421
|
-
|
|
1450
|
+
var _props$onRegisterErro;
|
|
1451
|
+
(_props$onRegisterErro = props.onRegisterErrorListeners) === null || _props$onRegisterErro === void 0 || _props$onRegisterErro.call(props, {
|
|
1422
1452
|
dispatch: index.internalReduxStore.dispatch
|
|
1423
1453
|
});
|
|
1424
1454
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1458,14 +1488,18 @@ const ApplicationShell = props => {
|
|
|
1458
1488
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1459
1489
|
ApplicationShell.version = version;
|
|
1460
1490
|
|
|
1461
|
-
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-
|
|
1491
|
+
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-6802db5c.cjs.prod.js' /* webpackChunkName: "custom-view-dev-host" */); }));
|
|
1462
1492
|
|
|
1463
1493
|
function CustomViewFlopFlipProvider(props) {
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1494
|
+
var _props$user2;
|
|
1495
|
+
const adapterArgs = react.useMemo(() => {
|
|
1496
|
+
var _props$user;
|
|
1497
|
+
return {
|
|
1498
|
+
user: {
|
|
1499
|
+
key: (_props$user = props.user) === null || _props$user === void 0 ? void 0 : _props$user.id
|
|
1500
|
+
}
|
|
1501
|
+
};
|
|
1502
|
+
}, [(_props$user2 = props.user) === null || _props$user2 === void 0 ? void 0 : _props$user2.id]);
|
|
1469
1503
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
1470
1504
|
adapter: memoryAdapter.adapter,
|
|
1471
1505
|
defaultFlags: _flagsInstanceProperty__default["default"](props),
|
|
@@ -1501,7 +1535,7 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1501
1535
|
return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1502
1536
|
}
|
|
1503
1537
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
1504
|
-
locale: user
|
|
1538
|
+
locale: (user === null || user === void 0 ? void 0 : user.language) || browserLocale,
|
|
1505
1539
|
applicationMessages: props.messages,
|
|
1506
1540
|
children: _ref2 => {
|
|
1507
1541
|
let isLoadingLocaleData = _ref2.isLoading,
|
|
@@ -1564,15 +1598,15 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1564
1598
|
const customViewsThemesOverrides = {
|
|
1565
1599
|
default: {
|
|
1566
1600
|
marginForCustomViewsSelectorAsTabular: '0',
|
|
1567
|
-
marginForPageContent:
|
|
1568
|
-
paddingForDetailPageHeader:
|
|
1601
|
+
marginForPageContent: "".concat(designSystem.designTokens.spacing50, " 0"),
|
|
1602
|
+
paddingForDetailPageHeader: "0 0 ".concat(designSystem.designTokens.spacing40, " 0"),
|
|
1569
1603
|
paddingForMainPageHeader: '0',
|
|
1570
1604
|
paddingForTabularPageHeader: '0'
|
|
1571
1605
|
}
|
|
1572
1606
|
};
|
|
1573
1607
|
|
|
1574
1608
|
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1575
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1609
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$1(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$1(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1576
1610
|
const browserLocale = getBrowserLocale(window);
|
|
1577
1611
|
function NotificationsContainer(props) {
|
|
1578
1612
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1631,6 +1665,7 @@ function CustomViewThemeProvider() {
|
|
|
1631
1665
|
*/
|
|
1632
1666
|
const isLocalProdMode = window.app.env === 'development';
|
|
1633
1667
|
function CustomViewShell(props) {
|
|
1668
|
+
var _window$app$__DEVELOP;
|
|
1634
1669
|
const _useState = react.useState(),
|
|
1635
1670
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1636
1671
|
hostContext = _useState2[0],
|
|
@@ -1646,20 +1681,21 @@ function CustomViewShell(props) {
|
|
|
1646
1681
|
if (event.data.eventName === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION) {
|
|
1647
1682
|
setHostContext(event.data.eventData.context);
|
|
1648
1683
|
} else {
|
|
1649
|
-
console.warn(
|
|
1684
|
+
console.warn("CustomViewShell: Unknown received event with name: ".concat(event.data.eventName), {
|
|
1650
1685
|
event
|
|
1651
1686
|
});
|
|
1652
1687
|
}
|
|
1653
1688
|
}, []);
|
|
1654
1689
|
const handleClose = react.useCallback(() => {
|
|
1655
|
-
|
|
1690
|
+
var _iFrameCommunicationP, _context;
|
|
1691
|
+
(_iFrameCommunicationP = iFrameCommunicationPort.current) === null || _iFrameCommunicationP === void 0 || _iFrameCommunicationP.postMessage({
|
|
1656
1692
|
origin: window.location.origin,
|
|
1657
|
-
source:
|
|
1693
|
+
source: _concatInstanceProperty__default["default"](_context = "".concat(constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX)).call(_context, hostContext === null || hostContext === void 0 ? void 0 : hostContext.customViewConfig.id),
|
|
1658
1694
|
destination: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
|
|
1659
1695
|
eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE,
|
|
1660
1696
|
eventData: {}
|
|
1661
1697
|
});
|
|
1662
|
-
}, [hostContext
|
|
1698
|
+
}, [hostContext === null || hostContext === void 0 ? void 0 : hostContext.customViewConfig.id]);
|
|
1663
1699
|
react.useEffect(() => {
|
|
1664
1700
|
const bootstrapMessageHandler = event => {
|
|
1665
1701
|
if ((event.origin === window.location.origin ||
|
|
@@ -1691,7 +1727,8 @@ function CustomViewShell(props) {
|
|
|
1691
1727
|
react.useEffect(() => {
|
|
1692
1728
|
// Close the channel when the component unmounts
|
|
1693
1729
|
return () => {
|
|
1694
|
-
|
|
1730
|
+
var _iFrameCommunicationP2;
|
|
1731
|
+
(_iFrameCommunicationP2 = iFrameCommunicationPort.current) === null || _iFrameCommunicationP2 === void 0 || _iFrameCommunicationP2.close();
|
|
1695
1732
|
iFrameCommunicationPort.current = undefined;
|
|
1696
1733
|
};
|
|
1697
1734
|
}, []);
|
|
@@ -1700,7 +1737,7 @@ function CustomViewShell(props) {
|
|
|
1700
1737
|
showLogo: true
|
|
1701
1738
|
});
|
|
1702
1739
|
}
|
|
1703
|
-
const hostUrl = isLocalProdMode ? window.app.__DEVELOPMENT__
|
|
1740
|
+
const hostUrl = isLocalProdMode ? (_window$app$__DEVELOP = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP === void 0 ? void 0 : _window$app$__DEVELOP.customViewHostUrl : hostContext.hostUrl;
|
|
1704
1741
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1705
1742
|
children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
|
|
1706
1743
|
environment: window.app,
|
|
@@ -1709,6 +1746,7 @@ function CustomViewShell(props) {
|
|
|
1709
1746
|
children: _ref => {
|
|
1710
1747
|
let isAuthenticated = _ref.isAuthenticated;
|
|
1711
1748
|
if (isAuthenticated) {
|
|
1749
|
+
var _context2;
|
|
1712
1750
|
return jsxRuntime.jsx(applicationShellConnectors.CustomViewContextProvider, {
|
|
1713
1751
|
hostUrl: hostUrl,
|
|
1714
1752
|
customViewConfig: hostContext.customViewConfig,
|
|
@@ -1727,7 +1765,7 @@ function CustomViewShell(props) {
|
|
|
1727
1765
|
notificationsGlobalRef: notificationsGlobalRef,
|
|
1728
1766
|
notificationsPageRef: notificationsPageRef
|
|
1729
1767
|
}), jsxRuntime.jsxs(reactRouterDom.Route, {
|
|
1730
|
-
path:
|
|
1768
|
+
path: _concatInstanceProperty__default["default"](_context2 = "/custom-views/".concat(hostContext.customViewConfig.id, "/projects/")).call(_context2, hostContext.projectKey),
|
|
1731
1769
|
children: [jsxRuntime.jsx(applicationComponents.ModalPageTopBar, {
|
|
1732
1770
|
onClose: handleClose,
|
|
1733
1771
|
hidePathLabel: true
|
|
@@ -1863,7 +1901,7 @@ function setupGlobalErrorListener() {
|
|
|
1863
1901
|
}
|
|
1864
1902
|
|
|
1865
1903
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1866
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1904
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1867
1905
|
|
|
1868
1906
|
/**
|
|
1869
1907
|
* The route path to match. Usually it starts with `/:projectKey/my-entry-point`.
|
|
@@ -1873,7 +1911,8 @@ const makeRoute = (routePath, routeOptions) => {
|
|
|
1873
1911
|
const getUrl = (nextParams, nextQueryParams) => {
|
|
1874
1912
|
const baseUrl = reactRouterDom.generatePath(routePath, _objectSpread(_objectSpread({}, routeOptions.params), nextParams));
|
|
1875
1913
|
if (nextQueryParams) {
|
|
1876
|
-
|
|
1914
|
+
var _context;
|
|
1915
|
+
return _concatInstanceProperty__default["default"](_context = "".concat(baseUrl, "?")).call(_context, nextQueryParams.toString());
|
|
1877
1916
|
}
|
|
1878
1917
|
return baseUrl;
|
|
1879
1918
|
};
|