@commercetools-frontend/application-shell 27.9.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-a506643d.cjs.dev.js → custom-view-dev-host-61a6875f.cjs.dev.js} +15 -10
- package/dist/{custom-view-dev-host-48d2bc48.cjs.prod.js → custom-view-dev-host-6802db5c.cjs.prod.js} +15 -10
- package/dist/{custom-view-dev-host-856878ae.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-c4358b17.cjs.dev.js → index-419ebe37.cjs.dev.js} +145 -113
- 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-2e1b3109.cjs.prod.js → index-ae34310f.cjs.prod.js} +145 -113
- package/dist/{index-8202b8ac.esm.js → index-f440fbdc.esm.js} +144 -113
- 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-51b6c2c0.esm.js → oidc-callback-a6d80251.esm.js} +11 -9
- package/dist/{oidc-callback-d8a01652.cjs.dev.js → oidc-callback-b47c8b7e.cjs.dev.js} +11 -10
- package/dist/{oidc-callback-cd36b191.cjs.prod.js → oidc-callback-e6029355.cjs.prod.js} +11 -10
- package/dist/oidc-ddd328fa.esm.js +103 -0
- package/dist/{project-container-289c1867.cjs.dev.js → project-container-2a79f361.cjs.dev.js} +14 -11
- package/dist/{project-container-cba9e7cb.esm.js → project-container-ad07cd24.esm.js} +14 -11
- package/dist/{project-container-ebc714c6.cjs.prod.js → project-container-f3e06769.cjs.prod.js} +14 -11
- package/dist/{project-expired-8a005b06.cjs.prod.js → project-expired-a9741dd7.cjs.prod.js} +6 -5
- package/dist/{project-expired-149df88a.cjs.dev.js → project-expired-ce1a7855.cjs.dev.js} +6 -5
- package/dist/{project-expired-bcaaefdd.esm.js → project-expired-dba360dc.esm.js} +6 -5
- package/dist/{project-not-found-5289edf3.cjs.prod.js → project-not-found-0dd37054.cjs.prod.js} +5 -4
- package/dist/{project-not-found-3d54a0a9.cjs.dev.js → project-not-found-43912d11.cjs.dev.js} +5 -4
- package/dist/{project-not-found-a816829d.esm.js → project-not-found-65aed038.esm.js} +5 -4
- package/dist/{project-not-initialized-6f782586.esm.js → project-not-initialized-3eb732fc.esm.js} +6 -5
- package/dist/{project-not-initialized-e3aa75cc.cjs.prod.js → project-not-initialized-4fecb9ed.cjs.prod.js} +6 -5
- package/dist/{project-not-initialized-f0debef3.cjs.dev.js → project-not-initialized-52f39003.cjs.dev.js} +6 -5
- package/dist/{project-suspended-d7af8cd7.cjs.prod.js → project-suspended-5b1f484a.cjs.prod.js} +5 -4
- package/dist/{project-suspended-596a4e02.esm.js → project-suspended-663d9875.esm.js} +5 -4
- package/dist/{project-suspended-dbb8a967.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-29e049ae.cjs.prod.js → redirect-to-logout-7d335145.cjs.prod.js} +8 -6
- package/dist/{redirect-to-logout-6b536a7a.cjs.dev.js → redirect-to-logout-8b0b2e2c.cjs.dev.js} +8 -6
- package/dist/{redirect-to-logout-e3a515f4.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-ae82cf37.cjs.dev.js → requests-in-flight-loader-497fc4b0.cjs.dev.js} +5 -4
- package/dist/{requests-in-flight-loader-529103d5.cjs.prod.js → requests-in-flight-loader-52e3eb92.cjs.prod.js} +5 -4
- package/dist/{requests-in-flight-loader-22c2de59.esm.js → requests-in-flight-loader-c56604f2.esm.js} +5 -4
- package/dist/{service-page-project-switcher-c0306e45.esm.js → service-page-project-switcher-8942f997.esm.js} +1 -1
- package/dist/{service-page-project-switcher-e339dd8e.cjs.dev.js → service-page-project-switcher-d98264a0.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-baa2016f.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/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.9.
|
|
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,
|
|
@@ -812,16 +824,16 @@ const ApplicationShellAuthenticated = props => {
|
|
|
812
824
|
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
813
825
|
|
|
814
826
|
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
815
|
-
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;
|
|
816
828
|
const normalizedUser = user ? _objectSpread$8(_objectSpread$8({}, user), {}, {
|
|
817
829
|
// set the staff bar language if applicable
|
|
818
|
-
language: staffBarLanguage
|
|
830
|
+
language: staffBarLanguage !== null && staffBarLanguage !== void 0 ? staffBarLanguage : user.language
|
|
819
831
|
}) : undefined;
|
|
820
832
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
821
833
|
user: normalizedUser,
|
|
822
834
|
environment: applicationEnvironment,
|
|
823
835
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
824
|
-
locale: normalizedUser
|
|
836
|
+
locale: normalizedUser === null || normalizedUser === void 0 ? void 0 : normalizedUser.language,
|
|
825
837
|
applicationMessages: props.applicationMessages,
|
|
826
838
|
children: _ref8 => {
|
|
827
839
|
let isLoadingLocaleData = _ref8.isLoading,
|
|
@@ -841,7 +853,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
841
853
|
flags: props.featureFlags,
|
|
842
854
|
defaultFlags: props.defaultFeatureFlags,
|
|
843
855
|
children: jsxRuntime.jsxs(ApplicationShellSplitterWrapper, {
|
|
844
|
-
locale: locale
|
|
856
|
+
locale: locale !== null && locale !== void 0 ? locale : 'en',
|
|
845
857
|
children: [jsxRuntime.jsx(ThemeSwitcher, {}), jsxRuntime.jsx(RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
|
|
846
858
|
user: normalizedUser
|
|
847
859
|
}), jsxRuntime.jsxs("div", {
|
|
@@ -946,8 +958,8 @@ const ApplicationShellAuthenticated = props => {
|
|
|
946
958
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
947
959
|
exact: true,
|
|
948
960
|
path: "/",
|
|
949
|
-
children: (
|
|
950
|
-
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);
|
|
951
963
|
|
|
952
964
|
/**
|
|
953
965
|
* NOTE:
|
|
@@ -960,7 +972,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
960
972
|
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
961
973
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
962
974
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
963
|
-
to:
|
|
975
|
+
to: "/".concat(previousProjectKey)
|
|
964
976
|
});
|
|
965
977
|
})()
|
|
966
978
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
@@ -1139,31 +1151,37 @@ const withoutProjectKeyClaim = scope => {
|
|
|
1139
1151
|
return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, claim => !_startsWithInstanceProperty__default["default"](claim).call(claim, oidc.OIDC_CLAIMS.PROJECT_KEY)).join(' ');
|
|
1140
1152
|
};
|
|
1141
1153
|
const hasCachedAuthenticationState = () => {
|
|
1142
|
-
|
|
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) {
|
|
1143
1156
|
try {
|
|
1157
|
+
var _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP0, _window$app$__DEVELOP1;
|
|
1144
1158
|
let activeProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
|
|
1145
1159
|
if (activeProjectKey) {
|
|
1160
|
+
var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4;
|
|
1146
1161
|
// GIVEN The application is not requesting a project key,
|
|
1147
1162
|
// THEN we assume that the application does not need a project context.
|
|
1148
1163
|
// GIVEN The application is not requesting a project key,
|
|
1149
1164
|
// THEN we remove the cached project key.
|
|
1150
1165
|
// This is the case of an application like `account`.
|
|
1151
|
-
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)) {
|
|
1152
1167
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1153
1168
|
}
|
|
1154
1169
|
|
|
1155
1170
|
// If the project key we had in the storage does not match the one
|
|
1156
1171
|
// we have in the development config, then we need to discard it and
|
|
1157
1172
|
// use the one from the development config.
|
|
1158
|
-
if (window.app.__DEVELOPMENT__
|
|
1159
|
-
|
|
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;
|
|
1160
1176
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(activeProjectKey);
|
|
1161
1177
|
}
|
|
1162
1178
|
} else {
|
|
1163
|
-
|
|
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;
|
|
1164
1182
|
// Here we store the initial project key in local storage,
|
|
1165
1183
|
// so that it gets picked up when we initiate the login flow.
|
|
1166
|
-
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);
|
|
1167
1185
|
}
|
|
1168
1186
|
}
|
|
1169
1187
|
|
|
@@ -1178,11 +1196,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1178
1196
|
}
|
|
1179
1197
|
// Rebuild the requested OIDC scope to verify that it didn't change.
|
|
1180
1198
|
const requestedScope = oidc.buildOidcScope({
|
|
1181
|
-
projectKey: activeProjectKey
|
|
1182
|
-
oAuthScopes: window.app.__DEVELOPMENT__
|
|
1183
|
-
additionalOAuthScopes: window.app.__DEVELOPMENT__
|
|
1184
|
-
teamId: window.app.__DEVELOPMENT__
|
|
1185
|
-
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
|
|
1186
1204
|
});
|
|
1187
1205
|
// Omit the project key from the check. This allows to switch projects
|
|
1188
1206
|
// without having to log in again.
|
|
@@ -1200,11 +1218,12 @@ const hasCachedAuthenticationState = () => {
|
|
|
1200
1218
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1201
1219
|
};
|
|
1202
1220
|
|
|
1203
|
-
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" */); }));
|
|
1204
1222
|
|
|
1205
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; }
|
|
1206
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; }
|
|
1207
1225
|
const Authenticated = props => {
|
|
1226
|
+
var _window$app$__DEVELOP;
|
|
1208
1227
|
// We attempt to see if the user was already authenticated by looking
|
|
1209
1228
|
// at the "cached" flag in local storage.
|
|
1210
1229
|
const cachedAuthenticationState = hasCachedAuthenticationState();
|
|
@@ -1218,7 +1237,7 @@ const Authenticated = props => {
|
|
|
1218
1237
|
|
|
1219
1238
|
// When using the OIDC workflow, we always return false, to trigger
|
|
1220
1239
|
// the redirect to the login page.
|
|
1221
|
-
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) {
|
|
1222
1241
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1223
1242
|
children: props.render({
|
|
1224
1243
|
isAuthenticated: false
|
|
@@ -1232,13 +1251,13 @@ const Authenticated = props => {
|
|
|
1232
1251
|
Authenticated.displayName = 'Authenticated';
|
|
1233
1252
|
const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1234
1253
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1235
|
-
path:
|
|
1254
|
+
path: "/account/oidc/callback",
|
|
1236
1255
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1237
1256
|
locale: props.locale,
|
|
1238
1257
|
applicationMessages: props.applicationMessages
|
|
1239
1258
|
})
|
|
1240
1259
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1241
|
-
path:
|
|
1260
|
+
path: "/:projectKey/:identifier/oidc/callback",
|
|
1242
1261
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1243
1262
|
locale: props.locale,
|
|
1244
1263
|
applicationMessages: props.applicationMessages
|
|
@@ -1351,7 +1370,10 @@ const useCoercedEnvironmentValues = environment => {
|
|
|
1351
1370
|
};
|
|
1352
1371
|
|
|
1353
1372
|
const ApplicationShellProvider = props => {
|
|
1354
|
-
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]);
|
|
1355
1377
|
react.useEffect(() => {
|
|
1356
1378
|
applicationShellConnectors.setCachedApolloClient(apolloClient);
|
|
1357
1379
|
}, [apolloClient]);
|
|
@@ -1402,7 +1424,7 @@ const ApplicationShellProvider = props => {
|
|
|
1402
1424
|
};
|
|
1403
1425
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1404
1426
|
|
|
1405
|
-
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" */); }));
|
|
1406
1428
|
|
|
1407
1429
|
const styles = {
|
|
1408
1430
|
name: "gx7yk8",
|
|
@@ -1425,7 +1447,8 @@ const StrictModeEnablement$1 = props => {
|
|
|
1425
1447
|
};
|
|
1426
1448
|
const ApplicationShell = props => {
|
|
1427
1449
|
react.useEffect(() => {
|
|
1428
|
-
|
|
1450
|
+
var _props$onRegisterErro;
|
|
1451
|
+
(_props$onRegisterErro = props.onRegisterErrorListeners) === null || _props$onRegisterErro === void 0 || _props$onRegisterErro.call(props, {
|
|
1429
1452
|
dispatch: index.internalReduxStore.dispatch
|
|
1430
1453
|
});
|
|
1431
1454
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1465,14 +1488,18 @@ const ApplicationShell = props => {
|
|
|
1465
1488
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1466
1489
|
ApplicationShell.version = version;
|
|
1467
1490
|
|
|
1468
|
-
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" */); }));
|
|
1469
1492
|
|
|
1470
1493
|
function CustomViewFlopFlipProvider(props) {
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
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]);
|
|
1476
1503
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
1477
1504
|
adapter: memoryAdapter.adapter,
|
|
1478
1505
|
defaultFlags: _flagsInstanceProperty__default["default"](props),
|
|
@@ -1508,7 +1535,7 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1508
1535
|
return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1509
1536
|
}
|
|
1510
1537
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
1511
|
-
locale: user
|
|
1538
|
+
locale: (user === null || user === void 0 ? void 0 : user.language) || browserLocale,
|
|
1512
1539
|
applicationMessages: props.messages,
|
|
1513
1540
|
children: _ref2 => {
|
|
1514
1541
|
let isLoadingLocaleData = _ref2.isLoading,
|
|
@@ -1571,15 +1598,15 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1571
1598
|
const customViewsThemesOverrides = {
|
|
1572
1599
|
default: {
|
|
1573
1600
|
marginForCustomViewsSelectorAsTabular: '0',
|
|
1574
|
-
marginForPageContent:
|
|
1575
|
-
paddingForDetailPageHeader:
|
|
1601
|
+
marginForPageContent: "".concat(designSystem.designTokens.spacing50, " 0"),
|
|
1602
|
+
paddingForDetailPageHeader: "0 0 ".concat(designSystem.designTokens.spacing40, " 0"),
|
|
1576
1603
|
paddingForMainPageHeader: '0',
|
|
1577
1604
|
paddingForTabularPageHeader: '0'
|
|
1578
1605
|
}
|
|
1579
1606
|
};
|
|
1580
1607
|
|
|
1581
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; }
|
|
1582
|
-
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; }
|
|
1583
1610
|
const browserLocale = getBrowserLocale(window);
|
|
1584
1611
|
function NotificationsContainer(props) {
|
|
1585
1612
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1638,6 +1665,7 @@ function CustomViewThemeProvider() {
|
|
|
1638
1665
|
*/
|
|
1639
1666
|
const isLocalProdMode = window.app.env === 'development';
|
|
1640
1667
|
function CustomViewShell(props) {
|
|
1668
|
+
var _window$app$__DEVELOP;
|
|
1641
1669
|
const _useState = react.useState(),
|
|
1642
1670
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1643
1671
|
hostContext = _useState2[0],
|
|
@@ -1653,20 +1681,21 @@ function CustomViewShell(props) {
|
|
|
1653
1681
|
if (event.data.eventName === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION) {
|
|
1654
1682
|
setHostContext(event.data.eventData.context);
|
|
1655
1683
|
} else {
|
|
1656
|
-
console.warn(
|
|
1684
|
+
console.warn("CustomViewShell: Unknown received event with name: ".concat(event.data.eventName), {
|
|
1657
1685
|
event
|
|
1658
1686
|
});
|
|
1659
1687
|
}
|
|
1660
1688
|
}, []);
|
|
1661
1689
|
const handleClose = react.useCallback(() => {
|
|
1662
|
-
|
|
1690
|
+
var _iFrameCommunicationP, _context;
|
|
1691
|
+
(_iFrameCommunicationP = iFrameCommunicationPort.current) === null || _iFrameCommunicationP === void 0 || _iFrameCommunicationP.postMessage({
|
|
1663
1692
|
origin: window.location.origin,
|
|
1664
|
-
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),
|
|
1665
1694
|
destination: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
|
|
1666
1695
|
eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE,
|
|
1667
1696
|
eventData: {}
|
|
1668
1697
|
});
|
|
1669
|
-
}, [hostContext
|
|
1698
|
+
}, [hostContext === null || hostContext === void 0 ? void 0 : hostContext.customViewConfig.id]);
|
|
1670
1699
|
react.useEffect(() => {
|
|
1671
1700
|
const bootstrapMessageHandler = event => {
|
|
1672
1701
|
if ((event.origin === window.location.origin ||
|
|
@@ -1698,7 +1727,8 @@ function CustomViewShell(props) {
|
|
|
1698
1727
|
react.useEffect(() => {
|
|
1699
1728
|
// Close the channel when the component unmounts
|
|
1700
1729
|
return () => {
|
|
1701
|
-
|
|
1730
|
+
var _iFrameCommunicationP2;
|
|
1731
|
+
(_iFrameCommunicationP2 = iFrameCommunicationPort.current) === null || _iFrameCommunicationP2 === void 0 || _iFrameCommunicationP2.close();
|
|
1702
1732
|
iFrameCommunicationPort.current = undefined;
|
|
1703
1733
|
};
|
|
1704
1734
|
}, []);
|
|
@@ -1707,7 +1737,7 @@ function CustomViewShell(props) {
|
|
|
1707
1737
|
showLogo: true
|
|
1708
1738
|
});
|
|
1709
1739
|
}
|
|
1710
|
-
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;
|
|
1711
1741
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1712
1742
|
children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
|
|
1713
1743
|
environment: window.app,
|
|
@@ -1716,6 +1746,7 @@ function CustomViewShell(props) {
|
|
|
1716
1746
|
children: _ref => {
|
|
1717
1747
|
let isAuthenticated = _ref.isAuthenticated;
|
|
1718
1748
|
if (isAuthenticated) {
|
|
1749
|
+
var _context2;
|
|
1719
1750
|
return jsxRuntime.jsx(applicationShellConnectors.CustomViewContextProvider, {
|
|
1720
1751
|
hostUrl: hostUrl,
|
|
1721
1752
|
customViewConfig: hostContext.customViewConfig,
|
|
@@ -1734,7 +1765,7 @@ function CustomViewShell(props) {
|
|
|
1734
1765
|
notificationsGlobalRef: notificationsGlobalRef,
|
|
1735
1766
|
notificationsPageRef: notificationsPageRef
|
|
1736
1767
|
}), jsxRuntime.jsxs(reactRouterDom.Route, {
|
|
1737
|
-
path:
|
|
1768
|
+
path: _concatInstanceProperty__default["default"](_context2 = "/custom-views/".concat(hostContext.customViewConfig.id, "/projects/")).call(_context2, hostContext.projectKey),
|
|
1738
1769
|
children: [jsxRuntime.jsx(applicationComponents.ModalPageTopBar, {
|
|
1739
1770
|
onClose: handleClose,
|
|
1740
1771
|
hidePathLabel: true
|
|
@@ -1870,7 +1901,7 @@ function setupGlobalErrorListener() {
|
|
|
1870
1901
|
}
|
|
1871
1902
|
|
|
1872
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; }
|
|
1873
|
-
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; }
|
|
1874
1905
|
|
|
1875
1906
|
/**
|
|
1876
1907
|
* The route path to match. Usually it starts with `/:projectKey/my-entry-point`.
|
|
@@ -1880,7 +1911,8 @@ const makeRoute = (routePath, routeOptions) => {
|
|
|
1880
1911
|
const getUrl = (nextParams, nextQueryParams) => {
|
|
1881
1912
|
const baseUrl = reactRouterDom.generatePath(routePath, _objectSpread(_objectSpread({}, routeOptions.params), nextParams));
|
|
1882
1913
|
if (nextQueryParams) {
|
|
1883
|
-
|
|
1914
|
+
var _context;
|
|
1915
|
+
return _concatInstanceProperty__default["default"](_context = "".concat(baseUrl, "?")).call(_context, nextQueryParams.toString());
|
|
1884
1916
|
}
|
|
1885
1917
|
return baseUrl;
|
|
1886
1918
|
};
|