@commercetools-frontend/application-shell 27.9.1 → 27.9.3
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-1b23fb6b.esm.js → application-entry-point-10a5e1a5.esm.js} +4 -6
- package/dist/{application-entry-point-74a06151.cjs.prod.js → application-entry-point-8c4b8e53.cjs.prod.js} +3 -4
- package/dist/{application-entry-point-18d8fba0.cjs.dev.js → application-entry-point-c87294b0.cjs.dev.js} +4 -7
- package/dist/{application-shell-splitter-a527378f.cjs.dev.js → application-shell-splitter-62fabf2c.cjs.prod.js} +1 -2
- package/dist/{application-shell-splitter-2c38991b.esm.js → application-shell-splitter-dbae9dfc.esm.js} +1 -2
- package/dist/{application-shell-splitter-b560f8be.cjs.prod.js → application-shell-splitter-e87a060f.cjs.dev.js} +1 -2
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +4 -5
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +4 -5
- package/dist/commercetools-frontend-application-shell.esm.js +4 -5
- package/dist/{custom-view-dev-host-6802db5c.cjs.prod.js → custom-view-dev-host-8443430e.cjs.prod.js} +10 -15
- package/dist/{custom-view-dev-host-61a6875f.cjs.dev.js → custom-view-dev-host-ef379eeb.cjs.dev.js} +10 -15
- package/dist/{custom-view-dev-host-b47bb9bc.esm.js → custom-view-dev-host-f2aa4867.esm.js} +10 -14
- package/dist/{index-52c724ed.cjs.prod.js → index-245e2980.cjs.prod.js} +2 -2
- package/dist/{index-25183095.cjs.dev.js → index-614accc4.cjs.dev.js} +2 -2
- package/dist/{index-f440fbdc.esm.js → index-6db123c9.esm.js} +112 -135
- package/dist/{index-5aaa33bb.esm.js → index-86039df7.esm.js} +2 -2
- package/dist/{index-ae34310f.cjs.prod.js → index-ba30aea1.cjs.prod.js} +112 -136
- package/dist/{index-419ebe37.cjs.dev.js → index-cbfba3b0.cjs.dev.js} +112 -136
- package/dist/{navbar-f2740795.cjs.dev.js → navbar-59504b51.cjs.dev.js} +89 -105
- package/dist/{navbar-5290186f.esm.js → navbar-9eb6c972.esm.js} +89 -104
- package/dist/{navbar-9a1054eb.cjs.prod.js → navbar-f4b2552d.cjs.prod.js} +89 -105
- package/dist/oidc-0cba182b.cjs.prod.js +102 -0
- package/dist/oidc-b9e7297c.cjs.dev.js +102 -0
- package/dist/{oidc-callback-a6d80251.esm.js → oidc-callback-1de2b5cc.esm.js} +8 -10
- package/dist/{oidc-callback-e6029355.cjs.prod.js → oidc-callback-ad2d4f4a.cjs.prod.js} +8 -10
- package/dist/{oidc-callback-b47c8b7e.cjs.dev.js → oidc-callback-b9611652.cjs.dev.js} +8 -10
- package/dist/oidc-cb344fae.esm.js +87 -0
- package/dist/{project-container-ad07cd24.esm.js → project-container-b10b2ba2.esm.js} +11 -14
- package/dist/{project-container-2a79f361.cjs.dev.js → project-container-ce6687cf.cjs.dev.js} +11 -14
- package/dist/{project-container-f3e06769.cjs.prod.js → project-container-eedd2887.cjs.prod.js} +11 -14
- package/dist/{project-expired-dba360dc.esm.js → project-expired-1d5912a9.esm.js} +5 -6
- package/dist/{project-expired-ce1a7855.cjs.dev.js → project-expired-2624f02b.cjs.dev.js} +5 -6
- package/dist/{project-expired-a9741dd7.cjs.prod.js → project-expired-4879e033.cjs.prod.js} +5 -6
- package/dist/{project-not-found-43912d11.cjs.dev.js → project-not-found-3a2192c1.cjs.dev.js} +4 -5
- package/dist/{project-not-found-0dd37054.cjs.prod.js → project-not-found-45e93bec.cjs.prod.js} +4 -5
- package/dist/{project-not-found-65aed038.esm.js → project-not-found-e73dc05d.esm.js} +4 -5
- package/dist/{project-not-initialized-4fecb9ed.cjs.prod.js → project-not-initialized-992589b5.cjs.prod.js} +5 -6
- package/dist/{project-not-initialized-3eb732fc.esm.js → project-not-initialized-b4a7d81f.esm.js} +5 -6
- package/dist/{project-not-initialized-52f39003.cjs.dev.js → project-not-initialized-ce095ec5.cjs.dev.js} +5 -6
- package/dist/{project-suspended-663d9875.esm.js → project-suspended-7252b34c.esm.js} +4 -5
- package/dist/{project-suspended-5b1f484a.cjs.prod.js → project-suspended-c118c155.cjs.prod.js} +4 -5
- package/dist/{project-suspended-b3b9d9d4.cjs.dev.js → project-suspended-e1e3de31.cjs.dev.js} +4 -5
- package/dist/{redirect-to-login-0596ba25.cjs.prod.js → redirect-to-login-6675c038.cjs.prod.js} +10 -13
- package/dist/{redirect-to-login-6c3b5cc4.cjs.dev.js → redirect-to-login-8a61864c.cjs.dev.js} +10 -13
- package/dist/{redirect-to-login-c5629017.esm.js → redirect-to-login-b79d0910.esm.js} +10 -13
- package/dist/{redirect-to-logout-7d335145.cjs.prod.js → redirect-to-logout-1005b0ed.cjs.prod.js} +6 -8
- package/dist/{redirect-to-logout-8b0b2e2c.cjs.dev.js → redirect-to-logout-eb15e7ac.cjs.dev.js} +6 -8
- package/dist/{redirect-to-logout-9994a431.esm.js → redirect-to-logout-ff38446c.esm.js} +6 -8
- package/dist/{redirector-c858d578.cjs.prod.js → redirector-0c72d0a4.cjs.prod.js} +3 -4
- package/dist/{redirector-0efdd994.cjs.dev.js → redirector-72ccfbc2.cjs.dev.js} +3 -4
- package/dist/{redirector-656c6ee7.esm.js → redirector-d856975f.esm.js} +3 -4
- package/dist/{requests-in-flight-loader-497fc4b0.cjs.dev.js → requests-in-flight-loader-158a709b.cjs.dev.js} +4 -5
- package/dist/{requests-in-flight-loader-c56604f2.esm.js → requests-in-flight-loader-39bee88a.esm.js} +4 -5
- package/dist/{requests-in-flight-loader-52e3eb92.cjs.prod.js → requests-in-flight-loader-d1f05e3c.cjs.prod.js} +4 -5
- package/dist/{service-page-project-switcher-f332cda6.cjs.prod.js → service-page-project-switcher-5ef5e4d5.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-d98264a0.cjs.dev.js → service-page-project-switcher-b21ee594.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-8942f997.esm.js → service-page-project-switcher-c02b0600.esm.js} +1 -1
- package/dist/{use-applications-menu-7a85c3ee.cjs.dev.js → use-applications-menu-8984efa1.cjs.prod.js} +39 -47
- package/dist/{use-applications-menu-8ff2d130.esm.js → use-applications-menu-bc2b9a66.esm.js} +37 -44
- package/dist/{use-applications-menu-21c7420b.cjs.prod.js → use-applications-menu-bd718ac8.cjs.dev.js} +39 -47
- package/dist/{user-settings-menu-c52bf93a.cjs.prod.js → user-settings-menu-2235add2.cjs.prod.js} +23 -30
- package/dist/{user-settings-menu-bcb676d5.esm.js → user-settings-menu-a1d0ba8e.esm.js} +23 -30
- package/dist/{user-settings-menu-0f655cb1.cjs.dev.js → user-settings-menu-b8359b8b.cjs.dev.js} +23 -30
- package/package.json +25 -25
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +1 -2
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +1 -2
- package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +1 -2
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +21 -25
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +21 -25
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +16 -19
- package/dist/oidc-349b18df.cjs.dev.js +0 -119
- package/dist/oidc-3ad2f42d.cjs.prod.js +0 -119
- package/dist/oidc-ddd328fa.esm.js +0 -103
|
@@ -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-245e2980.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,9 +23,8 @@ 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-0cba182b.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');
|
|
29
28
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
30
29
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
31
30
|
var reactIntl = require('react-intl');
|
|
@@ -33,7 +32,6 @@ var FlatButton = require('@commercetools-uikit/flat-button');
|
|
|
33
32
|
var icons = require('@commercetools-uikit/icons');
|
|
34
33
|
var location = require('./location-537e0660.cjs.prod.js');
|
|
35
34
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
36
|
-
var _taggedTemplateLiteral = require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
|
|
37
35
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
38
36
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
39
37
|
var memoize = require('memoize-one');
|
|
@@ -87,7 +85,6 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
87
85
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
88
86
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
89
87
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
90
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
91
88
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
92
89
|
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
93
90
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -108,9 +105,9 @@ var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
|
108
105
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
109
106
|
|
|
110
107
|
// NOTE: This string will be replaced on build time with the package version.
|
|
111
|
-
var version = "27.9.
|
|
108
|
+
var version = "27.9.3";
|
|
112
109
|
|
|
113
|
-
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-
|
|
110
|
+
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-d1f05e3c.cjs.prod.js' /* webpackChunkName: "requests-in-flight-loader" */); }));
|
|
114
111
|
|
|
115
112
|
// Attempt to load the `projectKey` from localStorage
|
|
116
113
|
function selectProjectKeyFromLocalStorage() {
|
|
@@ -136,7 +133,7 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
136
133
|
* A full page reload is needed as the user's project may have changed (deletions and/or additions).
|
|
137
134
|
* As a result the project and user queries need refetching.
|
|
138
135
|
*/
|
|
139
|
-
const redirectToProject = key => location.location.replace(
|
|
136
|
+
const redirectToProject = key => location.location.replace(`/${key}`);
|
|
140
137
|
const BackToProject = props => {
|
|
141
138
|
const intl = reactIntl.useIntl();
|
|
142
139
|
return jsxRuntime.jsx(FlatButton__default["default"], {
|
|
@@ -147,8 +144,14 @@ const BackToProject = props => {
|
|
|
147
144
|
};
|
|
148
145
|
BackToProject.displayName = 'BackToProject';
|
|
149
146
|
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
const animationPulse = react$1.keyframes`
|
|
148
|
+
0% {
|
|
149
|
+
background-color: ${designSystem.customProperties.colorNeutral};
|
|
150
|
+
}
|
|
151
|
+
100% {
|
|
152
|
+
background-color: ${designSystem.customProperties.colorNeutral95};
|
|
153
|
+
}
|
|
154
|
+
`;
|
|
152
155
|
const getWidthBySize = props => {
|
|
153
156
|
switch (props.shape) {
|
|
154
157
|
case 'dot':
|
|
@@ -345,15 +348,14 @@ const ProjectSwitcher = props => {
|
|
|
345
348
|
onChange: event => {
|
|
346
349
|
const selectedProjectKey = event.target.value;
|
|
347
350
|
if (selectedProjectKey !== props.projectKey) {
|
|
348
|
-
|
|
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) {
|
|
351
|
+
if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
|
|
350
352
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(selectedProjectKey);
|
|
351
353
|
}
|
|
352
354
|
|
|
353
355
|
// We simply redirect to a "new" browser page, instead of using the
|
|
354
356
|
// history router. This will simplify a lot of things and avoid possible
|
|
355
357
|
// problems like e.g. resetting the store/state.
|
|
356
|
-
redirectTo(
|
|
358
|
+
redirectTo(`/${selectedProjectKey}`);
|
|
357
359
|
}
|
|
358
360
|
},
|
|
359
361
|
options: data && data.user && mapProjectsToOptions(data.user.projects.results) || [],
|
|
@@ -384,7 +386,7 @@ ProjectSwitcher.displayName = 'ProjectSwitcher';
|
|
|
384
386
|
// eslint-disable-next-line import/prefer-default-export
|
|
385
387
|
const REQUESTS_IN_FLIGHT_LOADER_DOM_ID = 'loader-for-requests-in-flight';
|
|
386
388
|
|
|
387
|
-
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-
|
|
389
|
+
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-2235add2.cjs.prod.js' /* webpackChunkName: "user-settings-menu" */); }));
|
|
388
390
|
|
|
389
391
|
var _ref$1 = {
|
|
390
392
|
name: "zjik7",
|
|
@@ -399,8 +401,7 @@ var _ref3$1 = {
|
|
|
399
401
|
styles: "height:22px"
|
|
400
402
|
} ;
|
|
401
403
|
const AppBar = props => {
|
|
402
|
-
|
|
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);
|
|
404
|
+
const previousProjectKey = getPreviousProjectKey(props.user?.defaultProjectKey ?? undefined);
|
|
404
405
|
return jsxRuntime.jsxs("div", {
|
|
405
406
|
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;" + ("" ), "" ),
|
|
406
407
|
"data-test": "top-navigation",
|
|
@@ -425,7 +426,7 @@ const AppBar = props => {
|
|
|
425
426
|
const selectedProject = _findInstanceProperty__default["default"](_context = props.user.projects.results).call(_context, project => project.key === props.projectKeyFromUrl);
|
|
426
427
|
return jsxRuntime.jsxs("div", {
|
|
427
428
|
css: /*#__PURE__*/react$1.css("display:flex;gap:", designSystem.designTokens.spacing20, ";align-items:center;" + ("" ), "" ),
|
|
428
|
-
children: [
|
|
429
|
+
children: [selectedProject?.isProductionProject && jsxRuntime.jsx("div", {
|
|
429
430
|
css: _ref3$1,
|
|
430
431
|
children: jsxRuntime.jsx(applicationComponents.ProjectStamp.IsProduction, {})
|
|
431
432
|
}), jsxRuntime.jsx(ProjectSwitcher
|
|
@@ -494,7 +495,7 @@ const Passthrough = _ref => {
|
|
|
494
495
|
children: children
|
|
495
496
|
});
|
|
496
497
|
};
|
|
497
|
-
const LazyApplicationShellSplitter = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./application-shell-splitter-
|
|
498
|
+
const LazyApplicationShellSplitter = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./application-shell-splitter-62fabf2c.cjs.prod.js' /* webpackChunkName: "application-shell-splitter" */); })
|
|
498
499
|
// When `@commercetools/nimbus` is not installed, the mc-scripts bundler
|
|
499
500
|
// fallback stubs it to an empty module so the build succeeds — but the
|
|
500
501
|
// splitter's Nimbus bindings are then `undefined`. `hasNimbus` reflects that;
|
|
@@ -600,11 +601,11 @@ const FetchUser = props => {
|
|
|
600
601
|
};
|
|
601
602
|
FetchUser.displayName = 'FetchUser';
|
|
602
603
|
|
|
603
|
-
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-
|
|
604
|
+
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-f4b2552d.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
|
|
604
605
|
|
|
605
|
-
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-
|
|
606
|
+
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-eedd2887.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
606
607
|
|
|
607
|
-
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-
|
|
608
|
+
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-1005b0ed.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
608
609
|
|
|
609
610
|
const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-e4ff7797.cjs.prod.js' /* webpackChunkName: "redirect-to-project-create" */); }));
|
|
610
611
|
|
|
@@ -619,17 +620,16 @@ var AllFeaturesQuery = { kind: "Document", definitions: [{ kind: "OperationDefin
|
|
|
619
620
|
// is no need to be concerned about security.
|
|
620
621
|
const ldClientSideIdProduction = '5979d95f6040390cd07b5e01';
|
|
621
622
|
function getUserContextForLaunchDarklyAdapter(user, projectKey) {
|
|
622
|
-
var _user$launchdarklyTra, _user$launchdarklyTra2, _user$launchdarklyTra3, _user$launchdarklyTra4, _user$launchdarklyTra5;
|
|
623
623
|
const base = {
|
|
624
624
|
kind: 'user',
|
|
625
|
-
project: projectKey
|
|
626
|
-
id:
|
|
627
|
-
team:
|
|
628
|
-
group:
|
|
629
|
-
subgroup:
|
|
630
|
-
cloudEnvironment:
|
|
625
|
+
project: projectKey ?? '',
|
|
626
|
+
id: user?.launchdarklyTrackingId ?? '',
|
|
627
|
+
team: user?.launchdarklyTrackingTeam ?? [],
|
|
628
|
+
group: user?.launchdarklyTrackingGroup ?? '',
|
|
629
|
+
subgroup: user?.launchdarklyTrackingSubgroup ?? '',
|
|
630
|
+
cloudEnvironment: user?.launchdarklyTrackingCloudEnvironment ?? ''
|
|
631
631
|
};
|
|
632
|
-
return user
|
|
632
|
+
return user?.id ? _objectSpread$9(_objectSpread$9({}, base), {}, {
|
|
633
633
|
key: user.id
|
|
634
634
|
}) : _objectSpread$9(_objectSpread$9({}, base), {}, {
|
|
635
635
|
anonymous: true
|
|
@@ -664,52 +664,48 @@ const SetupFlopFlipProvider = props => {
|
|
|
664
664
|
}
|
|
665
665
|
}, [enableLongLivedFeatureFlags]);
|
|
666
666
|
const defaultFlags = react.useMemo(() => _objectSpread$9(_objectSpread$9({}, constants.featureFlags.DEFAULT_FLAGS), props.defaultFlags), [props.defaultFlags]);
|
|
667
|
-
const adapterArgs = react.useMemo(() => {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
667
|
+
const adapterArgs = react.useMemo(() => ({
|
|
668
|
+
user: {
|
|
669
|
+
key: props.user?.id
|
|
670
|
+
},
|
|
671
|
+
launchdarkly: {
|
|
672
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
673
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.launchdarkly),
|
|
674
|
+
sdk: {
|
|
675
|
+
// Allow to overwrite the client ID, passed via the `additionalEnv` properties
|
|
676
|
+
// of the application config.
|
|
677
|
+
// This is mostly useful for internal usage on our staging environments.
|
|
678
|
+
clientSideId: props.ldClientSideId ?? ldClientSideIdProduction
|
|
679
|
+
// `sendEventsOnlyForVariation` was removed in @launchdarkly/js-client-sdk v4
|
|
680
|
+
// (formerly launchdarkly-js-client-sdk v3). It is no longer needed: as of v4,
|
|
681
|
+
// `allFlags` no longer sends analytics events by default, which is exactly the
|
|
682
|
+
// behavior this option used to opt into.
|
|
672
683
|
},
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
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)
|
|
684
|
+
flags,
|
|
685
|
+
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
686
|
+
},
|
|
687
|
+
http: {
|
|
688
|
+
// polling interval set to 15 minutes
|
|
689
|
+
pollingIntervalMs: 1000 * 60 * 15,
|
|
690
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
691
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
692
|
+
user: {
|
|
693
|
+
key: props.user?.id
|
|
688
694
|
},
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
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
|
-
}
|
|
695
|
+
execute: async adapterArgs => {
|
|
696
|
+
const response = await apolloClient.query({
|
|
697
|
+
query: AllFeaturesQuery,
|
|
698
|
+
errorPolicy: 'ignore',
|
|
699
|
+
fetchPolicy: 'network-only',
|
|
700
|
+
context: {
|
|
701
|
+
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
702
|
+
projectKey: adapterArgs.user?.project
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
return parseFlags(response.data);
|
|
710
706
|
}
|
|
711
|
-
}
|
|
712
|
-
}, [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
|
|
707
|
+
}
|
|
708
|
+
}), [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
|
|
713
709
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
714
710
|
adapter: combineAdapters.adapter,
|
|
715
711
|
adapterArgs: adapterArgs,
|
|
@@ -824,16 +820,16 @@ const ApplicationShellAuthenticated = props => {
|
|
|
824
820
|
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
825
821
|
|
|
826
822
|
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
827
|
-
const staffBarLanguage =
|
|
823
|
+
const staffBarLanguage = user?.launchdarklyTrackingGroup === 'commercetools' || user?.launchdarklyTrackingGroup === 'mailosaur' ? applicationShellConnectors.selectUserLanguageFromStorage() : undefined;
|
|
828
824
|
const normalizedUser = user ? _objectSpread$8(_objectSpread$8({}, user), {}, {
|
|
829
825
|
// set the staff bar language if applicable
|
|
830
|
-
language: staffBarLanguage
|
|
826
|
+
language: staffBarLanguage ?? user.language
|
|
831
827
|
}) : undefined;
|
|
832
828
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
833
829
|
user: normalizedUser,
|
|
834
830
|
environment: applicationEnvironment,
|
|
835
831
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
836
|
-
locale: normalizedUser
|
|
832
|
+
locale: normalizedUser?.language,
|
|
837
833
|
applicationMessages: props.applicationMessages,
|
|
838
834
|
children: _ref8 => {
|
|
839
835
|
let isLoadingLocaleData = _ref8.isLoading,
|
|
@@ -853,7 +849,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
853
849
|
flags: props.featureFlags,
|
|
854
850
|
defaultFlags: props.defaultFeatureFlags,
|
|
855
851
|
children: jsxRuntime.jsxs(ApplicationShellSplitterWrapper, {
|
|
856
|
-
locale: locale
|
|
852
|
+
locale: locale ?? 'en',
|
|
857
853
|
children: [jsxRuntime.jsx(ThemeSwitcher, {}), jsxRuntime.jsx(RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
|
|
858
854
|
user: normalizedUser
|
|
859
855
|
}), jsxRuntime.jsxs("div", {
|
|
@@ -958,8 +954,8 @@ const ApplicationShellAuthenticated = props => {
|
|
|
958
954
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
959
955
|
exact: true,
|
|
960
956
|
path: "/",
|
|
961
|
-
children: (
|
|
962
|
-
const previousProjectKey = getPreviousProjectKey(
|
|
957
|
+
children: (() => {
|
|
958
|
+
const previousProjectKey = getPreviousProjectKey(normalizedUser?.defaultProjectKey ?? undefined);
|
|
963
959
|
|
|
964
960
|
/**
|
|
965
961
|
* NOTE:
|
|
@@ -972,7 +968,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
972
968
|
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
973
969
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
974
970
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
975
|
-
to:
|
|
971
|
+
to: `/${previousProjectKey}`
|
|
976
972
|
});
|
|
977
973
|
})()
|
|
978
974
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
@@ -1151,37 +1147,31 @@ const withoutProjectKeyClaim = scope => {
|
|
|
1151
1147
|
return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, claim => !_startsWithInstanceProperty__default["default"](claim).call(claim, oidc.OIDC_CLAIMS.PROJECT_KEY)).join(' ');
|
|
1152
1148
|
};
|
|
1153
1149
|
const hasCachedAuthenticationState = () => {
|
|
1154
|
-
|
|
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) {
|
|
1150
|
+
if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
|
|
1156
1151
|
try {
|
|
1157
|
-
var _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP0, _window$app$__DEVELOP1;
|
|
1158
1152
|
let activeProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
|
|
1159
1153
|
if (activeProjectKey) {
|
|
1160
|
-
var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4;
|
|
1161
1154
|
// GIVEN The application is not requesting a project key,
|
|
1162
1155
|
// THEN we assume that the application does not need a project context.
|
|
1163
1156
|
// GIVEN The application is not requesting a project key,
|
|
1164
1157
|
// THEN we remove the cached project key.
|
|
1165
1158
|
// This is the case of an application like `account`.
|
|
1166
|
-
if (!
|
|
1159
|
+
if (!window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
|
|
1167
1160
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1168
1161
|
}
|
|
1169
1162
|
|
|
1170
1163
|
// If the project key we had in the storage does not match the one
|
|
1171
1164
|
// we have in the development config, then we need to discard it and
|
|
1172
1165
|
// use the one from the development config.
|
|
1173
|
-
if (
|
|
1174
|
-
|
|
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;
|
|
1166
|
+
if (window.app.__DEVELOPMENT__?.oidc?.initialProjectKey && window.app.__DEVELOPMENT__?.oidc?.initialProjectKey !== activeProjectKey) {
|
|
1167
|
+
activeProjectKey = window.app.__DEVELOPMENT__?.oidc?.initialProjectKey;
|
|
1176
1168
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(activeProjectKey);
|
|
1177
1169
|
}
|
|
1178
1170
|
} else {
|
|
1179
|
-
|
|
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;
|
|
1171
|
+
if (window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
|
|
1182
1172
|
// Here we store the initial project key in local storage,
|
|
1183
1173
|
// so that it gets picked up when we initiate the login flow.
|
|
1184
|
-
applicationShellConnectors.oidcStorage.setActiveProjectKey(
|
|
1174
|
+
applicationShellConnectors.oidcStorage.setActiveProjectKey(window.app.__DEVELOPMENT__?.oidc?.initialProjectKey);
|
|
1185
1175
|
}
|
|
1186
1176
|
}
|
|
1187
1177
|
|
|
@@ -1196,11 +1186,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1196
1186
|
}
|
|
1197
1187
|
// Rebuild the requested OIDC scope to verify that it didn't change.
|
|
1198
1188
|
const requestedScope = oidc.buildOidcScope({
|
|
1199
|
-
projectKey: activeProjectKey
|
|
1200
|
-
oAuthScopes:
|
|
1201
|
-
additionalOAuthScopes:
|
|
1202
|
-
teamId:
|
|
1203
|
-
applicationId:
|
|
1189
|
+
projectKey: activeProjectKey ?? undefined,
|
|
1190
|
+
oAuthScopes: window.app.__DEVELOPMENT__?.oidc?.oAuthScopes,
|
|
1191
|
+
additionalOAuthScopes: window.app.__DEVELOPMENT__?.oidc?.additionalOAuthScopes,
|
|
1192
|
+
teamId: window.app.__DEVELOPMENT__?.oidc?.teamId,
|
|
1193
|
+
applicationId: window.app.__DEVELOPMENT__?.oidc?.applicationId
|
|
1204
1194
|
});
|
|
1205
1195
|
// Omit the project key from the check. This allows to switch projects
|
|
1206
1196
|
// without having to log in again.
|
|
@@ -1218,12 +1208,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1218
1208
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1219
1209
|
};
|
|
1220
1210
|
|
|
1221
|
-
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-
|
|
1211
|
+
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-ad2d4f4a.cjs.prod.js' /* webpackChunkName: "oidc-callback" */); }));
|
|
1222
1212
|
|
|
1223
1213
|
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; }
|
|
1224
1214
|
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; }
|
|
1225
1215
|
const Authenticated = props => {
|
|
1226
|
-
var _window$app$__DEVELOP;
|
|
1227
1216
|
// We attempt to see if the user was already authenticated by looking
|
|
1228
1217
|
// at the "cached" flag in local storage.
|
|
1229
1218
|
const cachedAuthenticationState = hasCachedAuthenticationState();
|
|
@@ -1237,7 +1226,7 @@ const Authenticated = props => {
|
|
|
1237
1226
|
|
|
1238
1227
|
// When using the OIDC workflow, we always return false, to trigger
|
|
1239
1228
|
// the redirect to the login page.
|
|
1240
|
-
if (
|
|
1229
|
+
if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
|
|
1241
1230
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1242
1231
|
children: props.render({
|
|
1243
1232
|
isAuthenticated: false
|
|
@@ -1251,13 +1240,13 @@ const Authenticated = props => {
|
|
|
1251
1240
|
Authenticated.displayName = 'Authenticated';
|
|
1252
1241
|
const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1253
1242
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1254
|
-
path:
|
|
1243
|
+
path: `/account/oidc/callback`,
|
|
1255
1244
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1256
1245
|
locale: props.locale,
|
|
1257
1246
|
applicationMessages: props.applicationMessages
|
|
1258
1247
|
})
|
|
1259
1248
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1260
|
-
path:
|
|
1249
|
+
path: `/:projectKey/:identifier/oidc/callback`,
|
|
1261
1250
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1262
1251
|
locale: props.locale,
|
|
1263
1252
|
applicationMessages: props.applicationMessages
|
|
@@ -1370,10 +1359,7 @@ const useCoercedEnvironmentValues = environment => {
|
|
|
1370
1359
|
};
|
|
1371
1360
|
|
|
1372
1361
|
const ApplicationShellProvider = props => {
|
|
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]);
|
|
1362
|
+
const apolloClient = react.useMemo(() => props.apolloClient ?? applicationShellConnectors.createApolloClient(), [props.apolloClient]);
|
|
1377
1363
|
react.useEffect(() => {
|
|
1378
1364
|
applicationShellConnectors.setCachedApolloClient(apolloClient);
|
|
1379
1365
|
}, [apolloClient]);
|
|
@@ -1424,7 +1410,7 @@ const ApplicationShellProvider = props => {
|
|
|
1424
1410
|
};
|
|
1425
1411
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1426
1412
|
|
|
1427
|
-
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-
|
|
1413
|
+
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-6675c038.cjs.prod.js' /* webpackChunkName: "redirect-to-login" */); }));
|
|
1428
1414
|
|
|
1429
1415
|
const styles = {
|
|
1430
1416
|
name: "gx7yk8",
|
|
@@ -1447,8 +1433,7 @@ const StrictModeEnablement$1 = props => {
|
|
|
1447
1433
|
};
|
|
1448
1434
|
const ApplicationShell = props => {
|
|
1449
1435
|
react.useEffect(() => {
|
|
1450
|
-
|
|
1451
|
-
(_props$onRegisterErro = props.onRegisterErrorListeners) === null || _props$onRegisterErro === void 0 || _props$onRegisterErro.call(props, {
|
|
1436
|
+
props.onRegisterErrorListeners?.({
|
|
1452
1437
|
dispatch: index.internalReduxStore.dispatch
|
|
1453
1438
|
});
|
|
1454
1439
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1488,18 +1473,14 @@ const ApplicationShell = props => {
|
|
|
1488
1473
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1489
1474
|
ApplicationShell.version = version;
|
|
1490
1475
|
|
|
1491
|
-
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-
|
|
1476
|
+
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-8443430e.cjs.prod.js' /* webpackChunkName: "custom-view-dev-host" */); }));
|
|
1492
1477
|
|
|
1493
1478
|
function CustomViewFlopFlipProvider(props) {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
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]);
|
|
1479
|
+
const adapterArgs = react.useMemo(() => ({
|
|
1480
|
+
user: {
|
|
1481
|
+
key: props.user?.id
|
|
1482
|
+
}
|
|
1483
|
+
}), [props.user?.id]);
|
|
1503
1484
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
1504
1485
|
adapter: memoryAdapter.adapter,
|
|
1505
1486
|
defaultFlags: _flagsInstanceProperty__default["default"](props),
|
|
@@ -1535,7 +1516,7 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1535
1516
|
return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1536
1517
|
}
|
|
1537
1518
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
1538
|
-
locale:
|
|
1519
|
+
locale: user?.language || browserLocale,
|
|
1539
1520
|
applicationMessages: props.messages,
|
|
1540
1521
|
children: _ref2 => {
|
|
1541
1522
|
let isLoadingLocaleData = _ref2.isLoading,
|
|
@@ -1598,15 +1579,15 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1598
1579
|
const customViewsThemesOverrides = {
|
|
1599
1580
|
default: {
|
|
1600
1581
|
marginForCustomViewsSelectorAsTabular: '0',
|
|
1601
|
-
marginForPageContent:
|
|
1602
|
-
paddingForDetailPageHeader:
|
|
1582
|
+
marginForPageContent: `${designSystem.designTokens.spacing50} 0`,
|
|
1583
|
+
paddingForDetailPageHeader: `0 0 ${designSystem.designTokens.spacing40} 0`,
|
|
1603
1584
|
paddingForMainPageHeader: '0',
|
|
1604
1585
|
paddingForTabularPageHeader: '0'
|
|
1605
1586
|
}
|
|
1606
1587
|
};
|
|
1607
1588
|
|
|
1608
1589
|
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; }
|
|
1609
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1590
|
+
function _objectSpread$1(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$1(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$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1610
1591
|
const browserLocale = getBrowserLocale(window);
|
|
1611
1592
|
function NotificationsContainer(props) {
|
|
1612
1593
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1665,7 +1646,6 @@ function CustomViewThemeProvider() {
|
|
|
1665
1646
|
*/
|
|
1666
1647
|
const isLocalProdMode = window.app.env === 'development';
|
|
1667
1648
|
function CustomViewShell(props) {
|
|
1668
|
-
var _window$app$__DEVELOP;
|
|
1669
1649
|
const _useState = react.useState(),
|
|
1670
1650
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1671
1651
|
hostContext = _useState2[0],
|
|
@@ -1681,21 +1661,20 @@ function CustomViewShell(props) {
|
|
|
1681
1661
|
if (event.data.eventName === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION) {
|
|
1682
1662
|
setHostContext(event.data.eventData.context);
|
|
1683
1663
|
} else {
|
|
1684
|
-
console.warn(
|
|
1664
|
+
console.warn(`CustomViewShell: Unknown received event with name: ${event.data.eventName}`, {
|
|
1685
1665
|
event
|
|
1686
1666
|
});
|
|
1687
1667
|
}
|
|
1688
1668
|
}, []);
|
|
1689
1669
|
const handleClose = react.useCallback(() => {
|
|
1690
|
-
|
|
1691
|
-
(_iFrameCommunicationP = iFrameCommunicationPort.current) === null || _iFrameCommunicationP === void 0 || _iFrameCommunicationP.postMessage({
|
|
1670
|
+
iFrameCommunicationPort.current?.postMessage({
|
|
1692
1671
|
origin: window.location.origin,
|
|
1693
|
-
source:
|
|
1672
|
+
source: `${constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX}${hostContext?.customViewConfig.id}`,
|
|
1694
1673
|
destination: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
|
|
1695
1674
|
eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE,
|
|
1696
1675
|
eventData: {}
|
|
1697
1676
|
});
|
|
1698
|
-
}, [hostContext
|
|
1677
|
+
}, [hostContext?.customViewConfig.id]);
|
|
1699
1678
|
react.useEffect(() => {
|
|
1700
1679
|
const bootstrapMessageHandler = event => {
|
|
1701
1680
|
if ((event.origin === window.location.origin ||
|
|
@@ -1727,8 +1706,7 @@ function CustomViewShell(props) {
|
|
|
1727
1706
|
react.useEffect(() => {
|
|
1728
1707
|
// Close the channel when the component unmounts
|
|
1729
1708
|
return () => {
|
|
1730
|
-
|
|
1731
|
-
(_iFrameCommunicationP2 = iFrameCommunicationPort.current) === null || _iFrameCommunicationP2 === void 0 || _iFrameCommunicationP2.close();
|
|
1709
|
+
iFrameCommunicationPort.current?.close();
|
|
1732
1710
|
iFrameCommunicationPort.current = undefined;
|
|
1733
1711
|
};
|
|
1734
1712
|
}, []);
|
|
@@ -1737,7 +1715,7 @@ function CustomViewShell(props) {
|
|
|
1737
1715
|
showLogo: true
|
|
1738
1716
|
});
|
|
1739
1717
|
}
|
|
1740
|
-
const hostUrl = isLocalProdMode ?
|
|
1718
|
+
const hostUrl = isLocalProdMode ? window.app.__DEVELOPMENT__?.customViewHostUrl : hostContext.hostUrl;
|
|
1741
1719
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1742
1720
|
children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
|
|
1743
1721
|
environment: window.app,
|
|
@@ -1746,7 +1724,6 @@ function CustomViewShell(props) {
|
|
|
1746
1724
|
children: _ref => {
|
|
1747
1725
|
let isAuthenticated = _ref.isAuthenticated;
|
|
1748
1726
|
if (isAuthenticated) {
|
|
1749
|
-
var _context2;
|
|
1750
1727
|
return jsxRuntime.jsx(applicationShellConnectors.CustomViewContextProvider, {
|
|
1751
1728
|
hostUrl: hostUrl,
|
|
1752
1729
|
customViewConfig: hostContext.customViewConfig,
|
|
@@ -1765,7 +1742,7 @@ function CustomViewShell(props) {
|
|
|
1765
1742
|
notificationsGlobalRef: notificationsGlobalRef,
|
|
1766
1743
|
notificationsPageRef: notificationsPageRef
|
|
1767
1744
|
}), jsxRuntime.jsxs(reactRouterDom.Route, {
|
|
1768
|
-
path:
|
|
1745
|
+
path: `/custom-views/${hostContext.customViewConfig.id}/projects/${hostContext.projectKey}`,
|
|
1769
1746
|
children: [jsxRuntime.jsx(applicationComponents.ModalPageTopBar, {
|
|
1770
1747
|
onClose: handleClose,
|
|
1771
1748
|
hidePathLabel: true
|
|
@@ -1901,7 +1878,7 @@ function setupGlobalErrorListener() {
|
|
|
1901
1878
|
}
|
|
1902
1879
|
|
|
1903
1880
|
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; }
|
|
1904
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1881
|
+
function _objectSpread(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(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(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1905
1882
|
|
|
1906
1883
|
/**
|
|
1907
1884
|
* The route path to match. Usually it starts with `/:projectKey/my-entry-point`.
|
|
@@ -1911,8 +1888,7 @@ const makeRoute = (routePath, routeOptions) => {
|
|
|
1911
1888
|
const getUrl = (nextParams, nextQueryParams) => {
|
|
1912
1889
|
const baseUrl = reactRouterDom.generatePath(routePath, _objectSpread(_objectSpread({}, routeOptions.params), nextParams));
|
|
1913
1890
|
if (nextQueryParams) {
|
|
1914
|
-
|
|
1915
|
-
return _concatInstanceProperty__default["default"](_context = "".concat(baseUrl, "?")).call(_context, nextQueryParams.toString());
|
|
1891
|
+
return `${baseUrl}?${nextQueryParams.toString()}`;
|
|
1916
1892
|
}
|
|
1917
1893
|
return baseUrl;
|
|
1918
1894
|
};
|