@commercetools-frontend/application-shell 25.0.0 → 25.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{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/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-dc7f2835.cjs.dev.js → custom-view-dev-host-5350eda4.cjs.dev.js} +10 -15
- package/dist/{custom-view-dev-host-d72f9ae0.cjs.prod.js → custom-view-dev-host-9d70ed5a.cjs.prod.js} +10 -15
- package/dist/{custom-view-dev-host-98432fc5.esm.js → custom-view-dev-host-d5c02c31.esm.js} +10 -14
- package/dist/{index-52c724ed.cjs.prod.js → index-245e2980.cjs.prod.js} +2 -2
- package/dist/{index-208c3cdd.cjs.dev.js → index-2b8a5370.cjs.dev.js} +108 -132
- package/dist/{index-af2cc053.cjs.prod.js → index-3ce8bcb0.cjs.prod.js} +108 -132
- package/dist/{index-25183095.cjs.dev.js → index-614accc4.cjs.dev.js} +2 -2
- package/dist/{index-5aaa33bb.esm.js → index-86039df7.esm.js} +2 -2
- package/dist/{index-75206fba.esm.js → index-c8c7dc44.esm.js} +108 -131
- package/dist/{navbar-0bad8bc8.esm.js → navbar-9a40ead9.esm.js} +89 -104
- package/dist/{navbar-d4189469.cjs.dev.js → navbar-c51e0607.cjs.dev.js} +89 -105
- package/dist/{navbar-7653417f.cjs.prod.js → navbar-e287ce25.cjs.prod.js} +89 -105
- package/dist/oidc-8827f9fe.cjs.dev.js +98 -0
- package/dist/oidc-b2520905.esm.js +84 -0
- package/dist/{oidc-callback-f2f37906.cjs.dev.js → oidc-callback-10369351.cjs.dev.js} +8 -10
- package/dist/{oidc-callback-b6584fe8.esm.js → oidc-callback-43725da4.esm.js} +8 -10
- package/dist/{oidc-callback-3f9e25bc.cjs.prod.js → oidc-callback-d0f0ab00.cjs.prod.js} +8 -10
- package/dist/oidc-d74e6aa2.cjs.prod.js +98 -0
- package/dist/{project-container-27db6a7e.cjs.dev.js → project-container-1ee088eb.cjs.dev.js} +11 -14
- package/dist/{project-container-0c9ee557.cjs.prod.js → project-container-64823e34.cjs.prod.js} +11 -14
- package/dist/{project-container-8f8e017f.esm.js → project-container-da53bf6d.esm.js} +11 -14
- package/dist/{project-expired-da5d431c.cjs.prod.js → project-expired-b3656692.cjs.prod.js} +5 -6
- package/dist/{project-expired-bfa29d75.esm.js → project-expired-c5239755.esm.js} +5 -6
- package/dist/{project-expired-b35819a4.cjs.dev.js → project-expired-cd366d1f.cjs.dev.js} +5 -6
- package/dist/{project-not-found-695fadf6.cjs.prod.js → project-not-found-278f33b4.cjs.prod.js} +4 -5
- package/dist/{project-not-found-5fc657c1.esm.js → project-not-found-329638a6.esm.js} +4 -5
- package/dist/{project-not-found-fdb50d15.cjs.dev.js → project-not-found-e7381918.cjs.dev.js} +4 -5
- package/dist/{project-not-initialized-a3b358cc.esm.js → project-not-initialized-80b21ac8.esm.js} +5 -6
- package/dist/{project-not-initialized-06d78b62.cjs.dev.js → project-not-initialized-9e5f45ed.cjs.dev.js} +5 -6
- package/dist/{project-not-initialized-1603b228.cjs.prod.js → project-not-initialized-df5f697e.cjs.prod.js} +5 -6
- package/dist/{project-suspended-d85025fe.esm.js → project-suspended-41550cb8.esm.js} +4 -5
- package/dist/{project-suspended-7e2257ac.cjs.dev.js → project-suspended-9eb2139a.cjs.dev.js} +4 -5
- package/dist/{project-suspended-324978bc.cjs.prod.js → project-suspended-defdb3bb.cjs.prod.js} +4 -5
- package/dist/{redirect-to-login-3e4a6434.cjs.prod.js → redirect-to-login-12f467b8.cjs.prod.js} +10 -13
- package/dist/{redirect-to-login-edbfacbc.esm.js → redirect-to-login-2944c890.esm.js} +10 -13
- package/dist/{redirect-to-login-66ea895a.cjs.dev.js → redirect-to-login-3bee13ba.cjs.dev.js} +10 -13
- package/dist/{redirect-to-logout-f96c0c4b.cjs.prod.js → redirect-to-logout-4c6e4cb5.cjs.prod.js} +6 -8
- package/dist/{redirect-to-logout-aea7e913.esm.js → redirect-to-logout-a6daf354.esm.js} +6 -8
- package/dist/{redirect-to-logout-ab5d2b07.cjs.dev.js → redirect-to-logout-bb92fd28.cjs.dev.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-5f216050.esm.js → requests-in-flight-loader-32ab77e4.esm.js} +4 -5
- package/dist/{requests-in-flight-loader-3ffee0c0.cjs.prod.js → requests-in-flight-loader-59388ad8.cjs.prod.js} +4 -5
- package/dist/{requests-in-flight-loader-08ef339c.cjs.dev.js → requests-in-flight-loader-98a1e540.cjs.dev.js} +4 -5
- package/dist/{service-page-project-switcher-b21619c0.cjs.prod.js → service-page-project-switcher-9405f62f.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-9c5c86df.cjs.dev.js → service-page-project-switcher-b9a7c9d6.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-99b35fc0.esm.js → service-page-project-switcher-bb959b99.esm.js} +1 -1
- package/dist/{use-applications-menu-21c7420b.cjs.prod.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-7a85c3ee.cjs.dev.js → use-applications-menu-bd718ac8.cjs.dev.js} +39 -47
- package/dist/{user-settings-menu-2d3bfa75.cjs.prod.js → user-settings-menu-013f0041.cjs.prod.js} +22 -29
- package/dist/{user-settings-menu-31e6bb38.esm.js → user-settings-menu-16e8d020.esm.js} +22 -29
- package/dist/{user-settings-menu-c37b343f.cjs.dev.js → user-settings-menu-dc598434.cjs.dev.js} +22 -29
- package/package.json +16 -16
- 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 +22 -26
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +22 -26
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +17 -20
- package/dist/oidc-258fc018.cjs.prod.js +0 -115
- package/dist/oidc-35e8e62a.esm.js +0 -100
- package/dist/oidc-87d116c1.cjs.dev.js +0 -115
|
@@ -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-d74e6aa2.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 = "25.
|
|
108
|
+
var version = "25.1.0";
|
|
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-59388ad8.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-013f0041.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
|
|
@@ -568,11 +569,11 @@ const FetchUser = props => {
|
|
|
568
569
|
};
|
|
569
570
|
FetchUser.displayName = 'FetchUser';
|
|
570
571
|
|
|
571
|
-
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-
|
|
572
|
+
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-e287ce25.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
|
|
572
573
|
|
|
573
|
-
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-
|
|
574
|
+
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-64823e34.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
574
575
|
|
|
575
|
-
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-
|
|
576
|
+
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-4c6e4cb5.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
576
577
|
|
|
577
578
|
const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-e4ff7797.cjs.prod.js' /* webpackChunkName: "redirect-to-project-create" */); }));
|
|
578
579
|
|
|
@@ -584,16 +585,15 @@ var AllFeaturesQuery = { kind: "Document", definitions: [{ kind: "OperationDefin
|
|
|
584
585
|
// is no need to be concerned about security.
|
|
585
586
|
const ldClientSideIdProduction = '5979d95f6040390cd07b5e01';
|
|
586
587
|
function getUserContextForLaunchDarklyAdapter(user, projectKey) {
|
|
587
|
-
var _user$launchdarklyTra, _user$launchdarklyTra2, _user$launchdarklyTra3, _user$launchdarklyTra4, _user$launchdarklyTra5;
|
|
588
588
|
return {
|
|
589
589
|
kind: 'user',
|
|
590
|
-
key: user
|
|
591
|
-
project: projectKey
|
|
592
|
-
id:
|
|
593
|
-
team:
|
|
594
|
-
group:
|
|
595
|
-
subgroup:
|
|
596
|
-
cloudEnvironment:
|
|
590
|
+
key: user?.id,
|
|
591
|
+
project: projectKey ?? '',
|
|
592
|
+
id: user?.launchdarklyTrackingId ?? '',
|
|
593
|
+
team: user?.launchdarklyTrackingTeam ?? [],
|
|
594
|
+
group: user?.launchdarklyTrackingGroup ?? '',
|
|
595
|
+
subgroup: user?.launchdarklyTrackingSubgroup ?? '',
|
|
596
|
+
cloudEnvironment: user?.launchdarklyTrackingCloudEnvironment ?? ''
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
599
|
const parseFlags = fetchedFlags => {
|
|
@@ -625,51 +625,47 @@ const SetupFlopFlipProvider = props => {
|
|
|
625
625
|
}
|
|
626
626
|
}, [enableLongLivedFeatureFlags]);
|
|
627
627
|
const defaultFlags = react.useMemo(() => _objectSpread$9(_objectSpread$9({}, constants.featureFlags.DEFAULT_FLAGS), props.defaultFlags), [props.defaultFlags]);
|
|
628
|
-
const adapterArgs = react.useMemo(() => {
|
|
629
|
-
|
|
630
|
-
|
|
628
|
+
const adapterArgs = react.useMemo(() => ({
|
|
629
|
+
user: {
|
|
630
|
+
key: props.user?.id
|
|
631
|
+
},
|
|
632
|
+
launchdarkly: {
|
|
633
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
634
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.launchdarkly),
|
|
635
|
+
sdk: {
|
|
636
|
+
// Allow to overwrite the client ID, passed via the `additionalEnv` properties
|
|
637
|
+
// of the application config.
|
|
638
|
+
// This is mostly useful for internal usage on our staging environments.
|
|
639
|
+
clientSideId: props.ldClientSideId ?? ldClientSideIdProduction,
|
|
640
|
+
clientOptions: {
|
|
641
|
+
sendEventsOnlyForVariation: true
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
flags,
|
|
645
|
+
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
646
|
+
},
|
|
647
|
+
http: {
|
|
648
|
+
// polling interval set to 15 minutes
|
|
649
|
+
pollingIntervalMs: 1000 * 60 * 15,
|
|
650
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
651
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
631
652
|
user: {
|
|
632
|
-
key:
|
|
653
|
+
key: props.user?.id
|
|
633
654
|
},
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
clientOptions: {
|
|
643
|
-
sendEventsOnlyForVariation: true
|
|
655
|
+
execute: async adapterArgs => {
|
|
656
|
+
const response = await apolloClient.query({
|
|
657
|
+
query: AllFeaturesQuery,
|
|
658
|
+
errorPolicy: 'ignore',
|
|
659
|
+
fetchPolicy: 'network-only',
|
|
660
|
+
context: {
|
|
661
|
+
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
662
|
+
projectKey: adapterArgs.user?.project
|
|
644
663
|
}
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
648
|
-
},
|
|
649
|
-
http: {
|
|
650
|
-
// polling interval set to 15 minutes
|
|
651
|
-
pollingIntervalMs: 1000 * 60 * 15,
|
|
652
|
-
cacheIdentifier: types.cacheIdentifiers.local,
|
|
653
|
-
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
654
|
-
user: {
|
|
655
|
-
key: (_props$user2 = props.user) === null || _props$user2 === void 0 ? void 0 : _props$user2.id
|
|
656
|
-
},
|
|
657
|
-
execute: async adapterArgs => {
|
|
658
|
-
var _adapterArgs$user;
|
|
659
|
-
const response = await apolloClient.query({
|
|
660
|
-
query: AllFeaturesQuery,
|
|
661
|
-
errorPolicy: 'ignore',
|
|
662
|
-
fetchPolicy: 'network-only',
|
|
663
|
-
context: {
|
|
664
|
-
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
665
|
-
projectKey: (_adapterArgs$user = adapterArgs.user) === null || _adapterArgs$user === void 0 ? void 0 : _adapterArgs$user.project
|
|
666
|
-
}
|
|
667
|
-
});
|
|
668
|
-
return parseFlags(response.data);
|
|
669
|
-
}
|
|
664
|
+
});
|
|
665
|
+
return parseFlags(response.data);
|
|
670
666
|
}
|
|
671
|
-
}
|
|
672
|
-
}, [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
|
|
667
|
+
}
|
|
668
|
+
}), [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
|
|
673
669
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
674
670
|
adapter: combineAdapters.adapter,
|
|
675
671
|
adapterArgs: adapterArgs,
|
|
@@ -780,16 +776,16 @@ const ApplicationShellAuthenticated = props => {
|
|
|
780
776
|
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
781
777
|
|
|
782
778
|
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
783
|
-
const staffBarLanguage =
|
|
779
|
+
const staffBarLanguage = user?.launchdarklyTrackingGroup === 'commercetools' || user?.launchdarklyTrackingGroup === 'mailosaur' ? applicationShellConnectors.selectUserLanguageFromStorage() : undefined;
|
|
784
780
|
const normalizedUser = user ? _objectSpread$8(_objectSpread$8({}, user), {}, {
|
|
785
781
|
// set the staff bar language if applicable
|
|
786
|
-
language: staffBarLanguage
|
|
782
|
+
language: staffBarLanguage ?? user.language
|
|
787
783
|
}) : undefined;
|
|
788
784
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
789
785
|
user: normalizedUser,
|
|
790
786
|
environment: applicationEnvironment,
|
|
791
787
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
792
|
-
locale: normalizedUser
|
|
788
|
+
locale: normalizedUser?.language,
|
|
793
789
|
applicationMessages: props.applicationMessages,
|
|
794
790
|
children: _ref7 => {
|
|
795
791
|
let isLoadingLocaleData = _ref7.isLoading,
|
|
@@ -913,8 +909,8 @@ const ApplicationShellAuthenticated = props => {
|
|
|
913
909
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
914
910
|
exact: true,
|
|
915
911
|
path: "/",
|
|
916
|
-
children: (
|
|
917
|
-
const previousProjectKey = getPreviousProjectKey(
|
|
912
|
+
children: (() => {
|
|
913
|
+
const previousProjectKey = getPreviousProjectKey(normalizedUser?.defaultProjectKey ?? undefined);
|
|
918
914
|
|
|
919
915
|
/**
|
|
920
916
|
* NOTE:
|
|
@@ -927,7 +923,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
927
923
|
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
928
924
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
929
925
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
930
|
-
to:
|
|
926
|
+
to: `/${previousProjectKey}`
|
|
931
927
|
});
|
|
932
928
|
})()
|
|
933
929
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
@@ -1103,37 +1099,31 @@ const withoutProjectKeyClaim = scope => {
|
|
|
1103
1099
|
return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, claim => !_startsWithInstanceProperty__default["default"](claim).call(claim, oidc.OIDC_CLAIMS.PROJECT_KEY)).join(' ');
|
|
1104
1100
|
};
|
|
1105
1101
|
const hasCachedAuthenticationState = () => {
|
|
1106
|
-
|
|
1107
|
-
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) {
|
|
1102
|
+
if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
|
|
1108
1103
|
try {
|
|
1109
|
-
var _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP0, _window$app$__DEVELOP1;
|
|
1110
1104
|
let activeProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
|
|
1111
1105
|
if (activeProjectKey) {
|
|
1112
|
-
var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4;
|
|
1113
1106
|
// GIVEN The application is not requesting a project key,
|
|
1114
1107
|
// THEN we assume that the application does not need a project context.
|
|
1115
1108
|
// GIVEN The application is not requesting a project key,
|
|
1116
1109
|
// THEN we remove the cached project key.
|
|
1117
1110
|
// This is the case of an application like `account`.
|
|
1118
|
-
if (!
|
|
1111
|
+
if (!window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
|
|
1119
1112
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1120
1113
|
}
|
|
1121
1114
|
|
|
1122
1115
|
// If the project key we had in the storage does not match the one
|
|
1123
1116
|
// we have in the development config, then we need to discard it and
|
|
1124
1117
|
// use the one from the development config.
|
|
1125
|
-
if (
|
|
1126
|
-
|
|
1127
|
-
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;
|
|
1118
|
+
if (window.app.__DEVELOPMENT__?.oidc?.initialProjectKey && window.app.__DEVELOPMENT__?.oidc?.initialProjectKey !== activeProjectKey) {
|
|
1119
|
+
activeProjectKey = window.app.__DEVELOPMENT__?.oidc?.initialProjectKey;
|
|
1128
1120
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(activeProjectKey);
|
|
1129
1121
|
}
|
|
1130
1122
|
} else {
|
|
1131
|
-
|
|
1132
|
-
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) {
|
|
1133
|
-
var _window$app$__DEVELOP7;
|
|
1123
|
+
if (window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
|
|
1134
1124
|
// Here we store the initial project key in local storage,
|
|
1135
1125
|
// so that it gets picked up when we initiate the login flow.
|
|
1136
|
-
applicationShellConnectors.oidcStorage.setActiveProjectKey(
|
|
1126
|
+
applicationShellConnectors.oidcStorage.setActiveProjectKey(window.app.__DEVELOPMENT__?.oidc?.initialProjectKey);
|
|
1137
1127
|
}
|
|
1138
1128
|
}
|
|
1139
1129
|
|
|
@@ -1148,11 +1138,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1148
1138
|
}
|
|
1149
1139
|
// Rebuild the requested OIDC scope to verify that it didn't change.
|
|
1150
1140
|
const requestedScope = oidc.buildOidcScope({
|
|
1151
|
-
projectKey: activeProjectKey
|
|
1152
|
-
oAuthScopes:
|
|
1153
|
-
additionalOAuthScopes:
|
|
1154
|
-
teamId:
|
|
1155
|
-
applicationId:
|
|
1141
|
+
projectKey: activeProjectKey ?? undefined,
|
|
1142
|
+
oAuthScopes: window.app.__DEVELOPMENT__?.oidc?.oAuthScopes,
|
|
1143
|
+
additionalOAuthScopes: window.app.__DEVELOPMENT__?.oidc?.additionalOAuthScopes,
|
|
1144
|
+
teamId: window.app.__DEVELOPMENT__?.oidc?.teamId,
|
|
1145
|
+
applicationId: window.app.__DEVELOPMENT__?.oidc?.applicationId
|
|
1156
1146
|
});
|
|
1157
1147
|
// Omit the project key from the check. This allows to switch projects
|
|
1158
1148
|
// without having to log in again.
|
|
@@ -1170,12 +1160,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1170
1160
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1171
1161
|
};
|
|
1172
1162
|
|
|
1173
|
-
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-
|
|
1163
|
+
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-d0f0ab00.cjs.prod.js' /* webpackChunkName: "oidc-callback" */); }));
|
|
1174
1164
|
|
|
1175
1165
|
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; }
|
|
1176
1166
|
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; }
|
|
1177
1167
|
const Authenticated = props => {
|
|
1178
|
-
var _window$app$__DEVELOP;
|
|
1179
1168
|
// We attempt to see if the user was already authenticated by looking
|
|
1180
1169
|
// at the "cached" flag in local storage.
|
|
1181
1170
|
const cachedAuthenticationState = hasCachedAuthenticationState();
|
|
@@ -1189,7 +1178,7 @@ const Authenticated = props => {
|
|
|
1189
1178
|
|
|
1190
1179
|
// When using the OIDC workflow, we always return false, to trigger
|
|
1191
1180
|
// the redirect to the login page.
|
|
1192
|
-
if (
|
|
1181
|
+
if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
|
|
1193
1182
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1194
1183
|
children: props.render({
|
|
1195
1184
|
isAuthenticated: false
|
|
@@ -1203,13 +1192,13 @@ const Authenticated = props => {
|
|
|
1203
1192
|
Authenticated.displayName = 'Authenticated';
|
|
1204
1193
|
const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1205
1194
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1206
|
-
path:
|
|
1195
|
+
path: `/account/oidc/callback`,
|
|
1207
1196
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1208
1197
|
locale: props.locale,
|
|
1209
1198
|
applicationMessages: props.applicationMessages
|
|
1210
1199
|
})
|
|
1211
1200
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1212
|
-
path:
|
|
1201
|
+
path: `/:projectKey/:identifier/oidc/callback`,
|
|
1213
1202
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1214
1203
|
locale: props.locale,
|
|
1215
1204
|
applicationMessages: props.applicationMessages
|
|
@@ -1322,10 +1311,7 @@ const useCoercedEnvironmentValues = environment => {
|
|
|
1322
1311
|
};
|
|
1323
1312
|
|
|
1324
1313
|
const ApplicationShellProvider = props => {
|
|
1325
|
-
const apolloClient = react.useMemo(() =>
|
|
1326
|
-
var _props$apolloClient;
|
|
1327
|
-
return (_props$apolloClient = props.apolloClient) !== null && _props$apolloClient !== void 0 ? _props$apolloClient : applicationShellConnectors.createApolloClient();
|
|
1328
|
-
}, [props.apolloClient]);
|
|
1314
|
+
const apolloClient = react.useMemo(() => props.apolloClient ?? applicationShellConnectors.createApolloClient(), [props.apolloClient]);
|
|
1329
1315
|
react.useEffect(() => {
|
|
1330
1316
|
applicationShellConnectors.setCachedApolloClient(apolloClient);
|
|
1331
1317
|
}, [apolloClient]);
|
|
@@ -1376,7 +1362,7 @@ const ApplicationShellProvider = props => {
|
|
|
1376
1362
|
};
|
|
1377
1363
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1378
1364
|
|
|
1379
|
-
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-
|
|
1365
|
+
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-12f467b8.cjs.prod.js' /* webpackChunkName: "redirect-to-login" */); }));
|
|
1380
1366
|
|
|
1381
1367
|
const styles = {
|
|
1382
1368
|
name: "gx7yk8",
|
|
@@ -1399,8 +1385,7 @@ const StrictModeEnablement$1 = props => {
|
|
|
1399
1385
|
};
|
|
1400
1386
|
const ApplicationShell = props => {
|
|
1401
1387
|
react.useEffect(() => {
|
|
1402
|
-
|
|
1403
|
-
(_props$onRegisterErro = props.onRegisterErrorListeners) === null || _props$onRegisterErro === void 0 || _props$onRegisterErro.call(props, {
|
|
1388
|
+
props.onRegisterErrorListeners?.({
|
|
1404
1389
|
dispatch: index.internalReduxStore.dispatch
|
|
1405
1390
|
});
|
|
1406
1391
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1440,18 +1425,14 @@ const ApplicationShell = props => {
|
|
|
1440
1425
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1441
1426
|
ApplicationShell.version = version;
|
|
1442
1427
|
|
|
1443
|
-
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-
|
|
1428
|
+
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-9d70ed5a.cjs.prod.js' /* webpackChunkName: "custom-view-dev-host" */); }));
|
|
1444
1429
|
|
|
1445
1430
|
function CustomViewFlopFlipProvider(props) {
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
key: (_props$user = props.user) === null || _props$user === void 0 ? void 0 : _props$user.id
|
|
1452
|
-
}
|
|
1453
|
-
};
|
|
1454
|
-
}, [(_props$user2 = props.user) === null || _props$user2 === void 0 ? void 0 : _props$user2.id]);
|
|
1431
|
+
const adapterArgs = react.useMemo(() => ({
|
|
1432
|
+
user: {
|
|
1433
|
+
key: props.user?.id
|
|
1434
|
+
}
|
|
1435
|
+
}), [props.user?.id]);
|
|
1455
1436
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
1456
1437
|
adapter: memoryAdapter.adapter,
|
|
1457
1438
|
defaultFlags: _flagsInstanceProperty__default["default"](props),
|
|
@@ -1487,7 +1468,7 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1487
1468
|
return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1488
1469
|
}
|
|
1489
1470
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
1490
|
-
locale:
|
|
1471
|
+
locale: user?.language || browserLocale,
|
|
1491
1472
|
applicationMessages: props.messages,
|
|
1492
1473
|
children: _ref2 => {
|
|
1493
1474
|
let isLoadingLocaleData = _ref2.isLoading,
|
|
@@ -1550,15 +1531,15 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1550
1531
|
const customViewsThemesOverrides = {
|
|
1551
1532
|
default: {
|
|
1552
1533
|
marginForCustomViewsSelectorAsTabular: '0',
|
|
1553
|
-
marginForPageContent:
|
|
1554
|
-
paddingForDetailPageHeader:
|
|
1534
|
+
marginForPageContent: `${designSystem.designTokens.spacing50} 0`,
|
|
1535
|
+
paddingForDetailPageHeader: `0 0 ${designSystem.designTokens.spacing40} 0`,
|
|
1555
1536
|
paddingForMainPageHeader: '0',
|
|
1556
1537
|
paddingForTabularPageHeader: '0'
|
|
1557
1538
|
}
|
|
1558
1539
|
};
|
|
1559
1540
|
|
|
1560
1541
|
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; }
|
|
1561
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1542
|
+
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; }
|
|
1562
1543
|
const browserLocale = getBrowserLocale(window);
|
|
1563
1544
|
function NotificationsContainer(props) {
|
|
1564
1545
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1615,7 +1596,6 @@ function CustomViewThemeProvider() {
|
|
|
1615
1596
|
*/
|
|
1616
1597
|
const isLocalProdMode = window.app.env === 'development';
|
|
1617
1598
|
function CustomViewShell(props) {
|
|
1618
|
-
var _window$app$__DEVELOP;
|
|
1619
1599
|
const _useState = react.useState(),
|
|
1620
1600
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1621
1601
|
hostContext = _useState2[0],
|
|
@@ -1631,21 +1611,20 @@ function CustomViewShell(props) {
|
|
|
1631
1611
|
if (event.data.eventName === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION) {
|
|
1632
1612
|
setHostContext(event.data.eventData.context);
|
|
1633
1613
|
} else {
|
|
1634
|
-
console.warn(
|
|
1614
|
+
console.warn(`CustomViewShell: Unknown received event with name: ${event.data.eventName}`, {
|
|
1635
1615
|
event
|
|
1636
1616
|
});
|
|
1637
1617
|
}
|
|
1638
1618
|
}, []);
|
|
1639
1619
|
const handleClose = react.useCallback(() => {
|
|
1640
|
-
|
|
1641
|
-
(_iFrameCommunicationP = iFrameCommunicationPort.current) === null || _iFrameCommunicationP === void 0 || _iFrameCommunicationP.postMessage({
|
|
1620
|
+
iFrameCommunicationPort.current?.postMessage({
|
|
1642
1621
|
origin: window.location.origin,
|
|
1643
|
-
source:
|
|
1622
|
+
source: `${constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX}${hostContext?.customViewConfig.id}`,
|
|
1644
1623
|
destination: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
|
|
1645
1624
|
eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE,
|
|
1646
1625
|
eventData: {}
|
|
1647
1626
|
});
|
|
1648
|
-
}, [hostContext
|
|
1627
|
+
}, [hostContext?.customViewConfig.id]);
|
|
1649
1628
|
react.useEffect(() => {
|
|
1650
1629
|
const bootstrapMessageHandler = event => {
|
|
1651
1630
|
if ((event.origin === window.location.origin ||
|
|
@@ -1677,8 +1656,7 @@ function CustomViewShell(props) {
|
|
|
1677
1656
|
react.useEffect(() => {
|
|
1678
1657
|
// Close the channel when the component unmounts
|
|
1679
1658
|
return () => {
|
|
1680
|
-
|
|
1681
|
-
(_iFrameCommunicationP2 = iFrameCommunicationPort.current) === null || _iFrameCommunicationP2 === void 0 || _iFrameCommunicationP2.close();
|
|
1659
|
+
iFrameCommunicationPort.current?.close();
|
|
1682
1660
|
iFrameCommunicationPort.current = undefined;
|
|
1683
1661
|
};
|
|
1684
1662
|
}, []);
|
|
@@ -1687,7 +1665,7 @@ function CustomViewShell(props) {
|
|
|
1687
1665
|
showLogo: true
|
|
1688
1666
|
});
|
|
1689
1667
|
}
|
|
1690
|
-
const hostUrl = isLocalProdMode ?
|
|
1668
|
+
const hostUrl = isLocalProdMode ? window.app.__DEVELOPMENT__?.customViewHostUrl : hostContext.hostUrl;
|
|
1691
1669
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1692
1670
|
children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
|
|
1693
1671
|
environment: window.app,
|
|
@@ -1696,7 +1674,6 @@ function CustomViewShell(props) {
|
|
|
1696
1674
|
children: _ref => {
|
|
1697
1675
|
let isAuthenticated = _ref.isAuthenticated;
|
|
1698
1676
|
if (isAuthenticated) {
|
|
1699
|
-
var _context2;
|
|
1700
1677
|
return jsxRuntime.jsx(applicationShellConnectors.CustomViewContextProvider, {
|
|
1701
1678
|
hostUrl: hostUrl,
|
|
1702
1679
|
customViewConfig: hostContext.customViewConfig,
|
|
@@ -1715,7 +1692,7 @@ function CustomViewShell(props) {
|
|
|
1715
1692
|
notificationsGlobalRef: notificationsGlobalRef,
|
|
1716
1693
|
notificationsPageRef: notificationsPageRef
|
|
1717
1694
|
}), jsxRuntime.jsxs(reactRouterDom.Route, {
|
|
1718
|
-
path:
|
|
1695
|
+
path: `/custom-views/${hostContext.customViewConfig.id}/projects/${hostContext.projectKey}`,
|
|
1719
1696
|
children: [jsxRuntime.jsx(applicationComponents.ModalPageTopBar, {
|
|
1720
1697
|
onClose: handleClose,
|
|
1721
1698
|
hidePathLabel: true
|
|
@@ -1851,7 +1828,7 @@ function setupGlobalErrorListener() {
|
|
|
1851
1828
|
}
|
|
1852
1829
|
|
|
1853
1830
|
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; }
|
|
1854
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1831
|
+
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; }
|
|
1855
1832
|
|
|
1856
1833
|
/**
|
|
1857
1834
|
* The route path to match. Usually it starts with `/:projectKey/my-entry-point`.
|
|
@@ -1861,8 +1838,7 @@ const makeRoute = (routePath, routeOptions) => {
|
|
|
1861
1838
|
const getUrl = (nextParams, nextQueryParams) => {
|
|
1862
1839
|
const baseUrl = reactRouterDom.generatePath(routePath, _objectSpread(_objectSpread({}, routeOptions.params), nextParams));
|
|
1863
1840
|
if (nextQueryParams) {
|
|
1864
|
-
|
|
1865
|
-
return _concatInstanceProperty__default["default"](_context = "".concat(baseUrl, "?")).call(_context, nextQueryParams.toString());
|
|
1841
|
+
return `${baseUrl}?${nextQueryParams.toString()}`;
|
|
1866
1842
|
}
|
|
1867
1843
|
return baseUrl;
|
|
1868
1844
|
};
|
|
@@ -65,7 +65,7 @@ var requestsInFlightReducer = (requestsInFlight, action) => {
|
|
|
65
65
|
if (isHideRequestInFlightAction(action)) {
|
|
66
66
|
// may only remove first occurence
|
|
67
67
|
if (!_includesInstanceProperty__default["default"](requestsInFlight).call(requestsInFlight, action.payload)) {
|
|
68
|
-
sentry.reportErrorToSentry(new Error(
|
|
68
|
+
sentry.reportErrorToSentry(new Error(`Tried to hide "${action.payload}", but it was not progressing!`));
|
|
69
69
|
return requestsInFlight;
|
|
70
70
|
}
|
|
71
71
|
return excludeFirstOccurrence(requestsInFlight, action.payload);
|
|
@@ -141,7 +141,7 @@ const patchedGetCorrelationId = () => applicationShellConnectors.getCorrelationI
|
|
|
141
141
|
const getAdditionalHeaders = () => {
|
|
142
142
|
const sessionToken = applicationShellConnectors.oidcStorage.getSessionToken();
|
|
143
143
|
return omitEmpty__default["default"]({
|
|
144
|
-
[constants.SUPPORTED_HEADERS.AUTHORIZATION]: sessionToken ?
|
|
144
|
+
[constants.SUPPORTED_HEADERS.AUTHORIZATION]: sessionToken ? `Bearer ${sessionToken}` : undefined,
|
|
145
145
|
[constants.SUPPORTED_HEADERS.X_APPLICATION_ID]: window.app.applicationIdentifier,
|
|
146
146
|
[constants.SUPPORTED_HEADERS.X_CUSTOM_VIEW_ID]: window.app.customViewId,
|
|
147
147
|
[constants.SUPPORTED_HEADERS.X_TEAM_ID]: applicationShellConnectors.selectTeamIdFromStorage()
|
|
@@ -42,7 +42,7 @@ var requestsInFlightReducer = (requestsInFlight, action) => {
|
|
|
42
42
|
if (isHideRequestInFlightAction(action)) {
|
|
43
43
|
// may only remove first occurence
|
|
44
44
|
if (!_includesInstanceProperty(requestsInFlight).call(requestsInFlight, action.payload)) {
|
|
45
|
-
reportErrorToSentry(new Error(
|
|
45
|
+
reportErrorToSentry(new Error(`Tried to hide "${action.payload}", but it was not progressing!`));
|
|
46
46
|
return requestsInFlight;
|
|
47
47
|
}
|
|
48
48
|
return excludeFirstOccurrence(requestsInFlight, action.payload);
|
|
@@ -118,7 +118,7 @@ const patchedGetCorrelationId = () => getCorrelationId({
|
|
|
118
118
|
const getAdditionalHeaders = () => {
|
|
119
119
|
const sessionToken = oidcStorage.getSessionToken();
|
|
120
120
|
return omitEmpty({
|
|
121
|
-
[SUPPORTED_HEADERS.AUTHORIZATION]: sessionToken ?
|
|
121
|
+
[SUPPORTED_HEADERS.AUTHORIZATION]: sessionToken ? `Bearer ${sessionToken}` : undefined,
|
|
122
122
|
[SUPPORTED_HEADERS.X_APPLICATION_ID]: window.app.applicationIdentifier,
|
|
123
123
|
[SUPPORTED_HEADERS.X_CUSTOM_VIEW_ID]: window.app.customViewId,
|
|
124
124
|
[SUPPORTED_HEADERS.X_TEAM_ID]: selectTeamIdFromStorage()
|