@commercetools-frontend/application-shell 20.10.6 → 20.12.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-015f1dfd.cjs.dev.js → application-entry-point-140f92f2.cjs.dev.js} +11 -5
- package/dist/{application-entry-point-7f99da26.esm.js → application-entry-point-21cef8e6.esm.js} +11 -6
- package/dist/{application-entry-point-9247fc63.cjs.prod.js → application-entry-point-aa870890.cjs.prod.js} +11 -5
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +3 -3
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +3 -3
- package/dist/commercetools-frontend-application-shell.esm.js +3 -3
- package/dist/declarations/src/apollo-links/utils.d.ts +1 -1
- package/dist/declarations/src/components/application-shell/helpers.d.ts +1 -0
- package/dist/declarations/src/components/navbar/use-navbar-state-manager.d.ts +13 -13
- package/dist/declarations/src/hooks/use-is-served-by-proxy/index.d.ts +1 -0
- package/dist/declarations/src/hooks/use-is-served-by-proxy/use-is-served-by-proxy.d.ts +2 -0
- package/dist/declarations/src/types/generated/ctp.d.ts +3619 -3336
- package/dist/declarations/src/types/generated/mc.d.ts +189 -195
- package/dist/declarations/src/types/generated/proxy.d.ts +28 -28
- package/dist/declarations/src/types/generated/settings.d.ts +1425 -2504
- package/dist/{index-f012b7bd.cjs.prod.js → index-473958c5.cjs.prod.js} +85 -30
- package/dist/{index-c6cce324.cjs.dev.js → index-91dc2ebb.cjs.dev.js} +104 -49
- package/dist/{index-e34cdcda.esm.js → index-eebc40b6.esm.js} +104 -49
- package/dist/{project-expired-3b4cf60d.esm.js → project-expired-9d8377ce.esm.js} +3 -3
- package/dist/{project-expired-0c4726a5.cjs.prod.js → project-expired-a0163148.cjs.prod.js} +3 -3
- package/dist/{project-expired-a8eb69b9.cjs.dev.js → project-expired-d0c9a419.cjs.dev.js} +3 -3
- package/dist/{project-not-found-52138a75.cjs.dev.js → project-not-found-4f1e5015.cjs.dev.js} +3 -3
- package/dist/{project-not-found-0baa83dc.cjs.prod.js → project-not-found-6bdfc28d.cjs.prod.js} +3 -3
- package/dist/{project-not-found-1a2b80e0.esm.js → project-not-found-a48ca67b.esm.js} +3 -3
- package/dist/{project-not-initialized-40da3944.esm.js → project-not-initialized-746e3f1c.esm.js} +3 -3
- package/dist/{project-not-initialized-8589ae81.cjs.dev.js → project-not-initialized-84372c36.cjs.dev.js} +3 -3
- package/dist/{project-not-initialized-429473b1.cjs.prod.js → project-not-initialized-e07d2b6b.cjs.prod.js} +3 -3
- package/dist/{project-suspended-9bc132ab.cjs.prod.js → project-suspended-08625b77.cjs.prod.js} +3 -3
- package/dist/{project-suspended-a23e7271.esm.js → project-suspended-1a678884.esm.js} +3 -3
- package/dist/{project-suspended-9697db58.cjs.dev.js → project-suspended-bee672c3.cjs.dev.js} +3 -3
- package/dist/{quick-access-821643e7.cjs.prod.js → quick-access-0a31b56f.cjs.prod.js} +2 -2
- package/dist/{quick-access-9fbae3f2.cjs.dev.js → quick-access-a50256b3.cjs.dev.js} +2 -2
- package/dist/{quick-access-74ab8004.esm.js → quick-access-de902fa0.esm.js} +2 -2
- package/dist/{service-page-project-switcher-03ca40af.esm.js → service-page-project-switcher-454e6146.esm.js} +1 -1
- package/dist/{service-page-project-switcher-690fde70.cjs.dev.js → service-page-project-switcher-ab78eb6d.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-3adcc61d.cjs.prod.js → service-page-project-switcher-bf6bb20a.cjs.prod.js} +1 -1
- package/package.json +33 -33
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +1 -1
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +1 -1
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var applicationEntryPoint = require('./application-entry-point-
|
|
3
|
+
var applicationEntryPoint = require('./application-entry-point-aa870890.cjs.prod.js');
|
|
4
4
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
5
5
|
var _styled = require('@emotion/styled/base');
|
|
6
6
|
var _pt = require('prop-types');
|
|
@@ -1856,8 +1856,10 @@ var UserSettingsMenuBody = function UserSettingsMenuBody(props) {
|
|
|
1856
1856
|
})]
|
|
1857
1857
|
})
|
|
1858
1858
|
}), applicationsAppBarMenu === null || applicationsAppBarMenu === void 0 ? void 0 : _mapInstanceProperty__default["default"](applicationsAppBarMenu).call(applicationsAppBarMenu, function (menu) {
|
|
1859
|
+
var _menu$featureToggle;
|
|
1860
|
+
|
|
1859
1861
|
return jsxRuntime.jsx(OptionalFeatureToggle, {
|
|
1860
|
-
featureToggle: menu.featureToggle,
|
|
1862
|
+
featureToggle: (_menu$featureToggle = menu.featureToggle) !== null && _menu$featureToggle !== void 0 ? _menu$featureToggle : undefined,
|
|
1861
1863
|
children: jsxRuntime.jsx(reactRouterDom.Link, {
|
|
1862
1864
|
css: getUserSettingsMenuItemLinkStyles(),
|
|
1863
1865
|
to: "/account/".concat(menu.uriPath),
|
|
@@ -2291,7 +2293,9 @@ var _ref2$1 = {
|
|
|
2291
2293
|
} ;
|
|
2292
2294
|
|
|
2293
2295
|
var AppBar = function AppBar(props) {
|
|
2294
|
-
var
|
|
2296
|
+
var _props$user$defaultPr, _props$user;
|
|
2297
|
+
|
|
2298
|
+
var 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);
|
|
2295
2299
|
return jsxRuntime.jsxs("div", {
|
|
2296
2300
|
css: /*#__PURE__*/react$2.css("box-shadow:", designSystem.customProperties.shadow1, ";min-height:43px;position:relative;width:100%;z-index:20000;display:flex;align-items:center;justify-content:space-between;" + ("" ), "" ),
|
|
2297
2301
|
"data-test": "top-navigation",
|
|
@@ -2431,27 +2435,25 @@ var LocaleSwitcher = function LocaleSwitcher(props) {
|
|
|
2431
2435
|
LocaleSwitcher.propTypes = {};
|
|
2432
2436
|
|
|
2433
2437
|
var ProjectNotFound = /*#__PURE__*/react.lazy(function () {
|
|
2434
|
-
return Promise.resolve().then(function () { return require('./project-not-found-
|
|
2438
|
+
return Promise.resolve().then(function () { return require('./project-not-found-6bdfc28d.cjs.prod.js'
|
|
2435
2439
|
/* webpackChunkName: "project-not-found" */
|
|
2436
2440
|
); });
|
|
2437
2441
|
});
|
|
2438
2442
|
|
|
2439
2443
|
var ProjectExpired = /*#__PURE__*/react.lazy(function () {
|
|
2440
|
-
return Promise.resolve().then(function () { return require('./project-expired-
|
|
2444
|
+
return Promise.resolve().then(function () { return require('./project-expired-a0163148.cjs.prod.js'
|
|
2441
2445
|
/* webpackChunkName: "project-expired" */
|
|
2442
2446
|
); });
|
|
2443
2447
|
});
|
|
2444
2448
|
|
|
2445
2449
|
var ProjectNotInitialized = /*#__PURE__*/react.lazy(function () {
|
|
2446
|
-
return Promise.resolve().then(function () { return require('./project-not-initialized-
|
|
2450
|
+
return Promise.resolve().then(function () { return require('./project-not-initialized-e07d2b6b.cjs.prod.js'
|
|
2447
2451
|
/* webpackChunkName: "project-not-initialized" */
|
|
2448
2452
|
); });
|
|
2449
2453
|
});
|
|
2450
2454
|
|
|
2451
2455
|
var RedirectToProjectCreate = function RedirectToProjectCreate() {
|
|
2452
|
-
var servedByProxy =
|
|
2453
|
-
return context.environment.servedByProxy;
|
|
2454
|
-
});
|
|
2456
|
+
var servedByProxy = applicationEntryPoint.useIsServedByProxy();
|
|
2455
2457
|
/**
|
|
2456
2458
|
* NOTE:
|
|
2457
2459
|
* This looks a bit unusual: redirecting in render.
|
|
@@ -2492,7 +2494,7 @@ var RedirectToProjectCreate = function RedirectToProjectCreate() {
|
|
|
2492
2494
|
RedirectToProjectCreate.displayName = 'RedirectToProjectCreate';
|
|
2493
2495
|
|
|
2494
2496
|
var ProjectSuspended = /*#__PURE__*/react.lazy(function () {
|
|
2495
|
-
return Promise.resolve().then(function () { return require('./project-suspended-
|
|
2497
|
+
return Promise.resolve().then(function () { return require('./project-suspended-08625b77.cjs.prod.js'
|
|
2496
2498
|
/* webpackChunkName: "project-suspended" */
|
|
2497
2499
|
); });
|
|
2498
2500
|
});
|
|
@@ -2594,6 +2596,8 @@ var ProjectContainer = function ProjectContainer(props) {
|
|
|
2594
2596
|
return jsxRuntime.jsx(ProjectDataLocale, {
|
|
2595
2597
|
locales: project.languages,
|
|
2596
2598
|
children: function children(_ref2) {
|
|
2599
|
+
var _project$expiry$daysL;
|
|
2600
|
+
|
|
2597
2601
|
var locale = _ref2.locale,
|
|
2598
2602
|
setProjectDataLocale = _ref2.setProjectDataLocale;
|
|
2599
2603
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
@@ -2602,7 +2606,7 @@ var ProjectContainer = function ProjectContainer(props) {
|
|
|
2602
2606
|
projectDataLocale: locale,
|
|
2603
2607
|
environment: props.environment,
|
|
2604
2608
|
children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2605
|
-
children: [shouldShowNotificationForTrialExpired(project.expiry.daysLeft) && jsxRuntime.jsx(reactNotifications.Notifier, {
|
|
2609
|
+
children: [shouldShowNotificationForTrialExpired((_project$expiry$daysL = project.expiry.daysLeft) !== null && _project$expiry$daysL !== void 0 ? _project$expiry$daysL : undefined) && jsxRuntime.jsx(reactNotifications.Notifier, {
|
|
2606
2610
|
kind: "warning",
|
|
2607
2611
|
domain: constants.DOMAINS.GLOBAL,
|
|
2608
2612
|
text: intl.formatMessage(messages$1.trialDaysLeft, {
|
|
@@ -2646,9 +2650,7 @@ var getDefaultedFeatureToggles = function getDefaultedFeatureToggles(allFeatureT
|
|
|
2646
2650
|
};
|
|
2647
2651
|
|
|
2648
2652
|
var useAllMenuFeatureToggles = function useAllMenuFeatureToggles() {
|
|
2649
|
-
var servedByProxy =
|
|
2650
|
-
return applicationContext.environment.servedByProxy;
|
|
2651
|
-
});
|
|
2653
|
+
var servedByProxy = applicationEntryPoint.useIsServedByProxy();
|
|
2652
2654
|
var mcProxyApiUrl = applicationShellConnectors.useApplicationContext(function (applicationContext) {
|
|
2653
2655
|
return applicationContext.environment.mcProxyApiUrl;
|
|
2654
2656
|
});
|
|
@@ -3426,7 +3428,7 @@ MenuLabel.propTypes = {
|
|
|
3426
3428
|
};
|
|
3427
3429
|
|
|
3428
3430
|
var ApplicationMenu = function ApplicationMenu(props) {
|
|
3429
|
-
var _context5, _context6, _context7;
|
|
3431
|
+
var _context5, _props$menu$featureTo, _props$menu$actionRig, _props$menu$dataFence, _context6, _context7;
|
|
3430
3432
|
|
|
3431
3433
|
var isMainMenuRouteActive = Boolean(reactRouterDom.matchPath(props.location.pathname, {
|
|
3432
3434
|
path: _concatInstanceProperty__default["default"](_context5 = "/".concat(props.projectKey, "/")).call(_context5, props.menu.uriPath),
|
|
@@ -3451,10 +3453,10 @@ var ApplicationMenu = function ApplicationMenu(props) {
|
|
|
3451
3453
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
3452
3454
|
children: [props.menu.shouldRenderDivider && jsxRuntime.jsx(MenuItemDivider, {}), jsxRuntime.jsx(RestrictedMenuItem, {
|
|
3453
3455
|
keyOfMenuItem: props.menu.key,
|
|
3454
|
-
featureToggle: props.menu.featureToggle,
|
|
3456
|
+
featureToggle: (_props$menu$featureTo = props.menu.featureToggle) !== null && _props$menu$featureTo !== void 0 ? _props$menu$featureTo : undefined,
|
|
3455
3457
|
permissions: props.menu.permissions,
|
|
3456
|
-
actionRights: props.menu.actionRights,
|
|
3457
|
-
dataFences: props.menu.dataFences,
|
|
3458
|
+
actionRights: (_props$menu$actionRig = props.menu.actionRights) !== null && _props$menu$actionRig !== void 0 ? _props$menu$actionRig : undefined,
|
|
3459
|
+
dataFences: (_props$menu$dataFence = props.menu.dataFences) !== null && _props$menu$dataFence !== void 0 ? _props$menu$dataFence : undefined,
|
|
3458
3460
|
projectPermissions: props.projectPermissions,
|
|
3459
3461
|
menuVisibilities: props.menuVisibilities,
|
|
3460
3462
|
namesOfMenuVisibilities: namesOfMenuVisibilitiesOfAllSubmenus,
|
|
@@ -3494,14 +3496,14 @@ var ApplicationMenu = function ApplicationMenu(props) {
|
|
|
3494
3496
|
isActive: props.isActive,
|
|
3495
3497
|
isExpanded: props.isMenuOpen,
|
|
3496
3498
|
children: hasSubmenu ? _mapInstanceProperty__default["default"](_context7 = props.menu.submenu).call(_context7, function (submenu) {
|
|
3497
|
-
var _context8, _context9;
|
|
3499
|
+
var _context8, _submenu$featureToggl, _submenu$actionRights, _submenu$dataFences, _context9;
|
|
3498
3500
|
|
|
3499
3501
|
return jsxRuntime.jsx(RestrictedMenuItem, {
|
|
3500
3502
|
keyOfMenuItem: submenu.key,
|
|
3501
|
-
featureToggle: submenu.featureToggle,
|
|
3503
|
+
featureToggle: (_submenu$featureToggl = submenu.featureToggle) !== null && _submenu$featureToggl !== void 0 ? _submenu$featureToggl : undefined,
|
|
3502
3504
|
permissions: submenu.permissions,
|
|
3503
|
-
actionRights: submenu.actionRights,
|
|
3504
|
-
dataFences: submenu.dataFences,
|
|
3505
|
+
actionRights: (_submenu$actionRights = submenu.actionRights) !== null && _submenu$actionRights !== void 0 ? _submenu$actionRights : undefined,
|
|
3506
|
+
dataFences: (_submenu$dataFences = submenu.dataFences) !== null && _submenu$dataFences !== void 0 ? _submenu$dataFences : undefined,
|
|
3505
3507
|
projectPermissions: props.projectPermissions,
|
|
3506
3508
|
menuVisibilities: props.menuVisibilities,
|
|
3507
3509
|
namesOfMenuVisibilities: submenu.menuVisibility ? [submenu.menuVisibility] : undefined,
|
|
@@ -3516,6 +3518,7 @@ var ApplicationMenu = function ApplicationMenu(props) {
|
|
|
3516
3518
|
onClick: props.onMenuItemClick,
|
|
3517
3519
|
children: jsxRuntime.jsx(MenuLabel, {
|
|
3518
3520
|
labelAllLocales: submenu.labelAllLocales,
|
|
3521
|
+
defaultLabel: submenu.defaultLabel,
|
|
3519
3522
|
applicationLocale: props.applicationLocale
|
|
3520
3523
|
})
|
|
3521
3524
|
})
|
|
@@ -3705,7 +3708,7 @@ var pimIndexerStates = {
|
|
|
3705
3708
|
};
|
|
3706
3709
|
|
|
3707
3710
|
var QuickAccess = /*#__PURE__*/react.lazy(function () {
|
|
3708
|
-
return Promise.resolve().then(function () { return require('./quick-access-
|
|
3711
|
+
return Promise.resolve().then(function () { return require('./quick-access-0a31b56f.cjs.prod.js'
|
|
3709
3712
|
/* webpackChunkName: "quick-access" */
|
|
3710
3713
|
); });
|
|
3711
3714
|
});
|
|
@@ -3802,6 +3805,51 @@ var QuickAccessTrigger = function QuickAccessTrigger(props) {
|
|
|
3802
3805
|
QuickAccessTrigger.propTypes = {};
|
|
3803
3806
|
QuickAccessTrigger.displayName = 'QuickAccessTrigger';
|
|
3804
3807
|
|
|
3808
|
+
/**
|
|
3809
|
+
* Get the "real" Merchant Center frontend URL to redirect the user
|
|
3810
|
+
* to the login page.
|
|
3811
|
+
* We use an explicit full URL so that if a user tries to access the
|
|
3812
|
+
* Custom Applications directly to its domain, it will always redirect
|
|
3813
|
+
* the user to the login page.
|
|
3814
|
+
*
|
|
3815
|
+
* To determine the "real" URL, we need to check if the current location
|
|
3816
|
+
* is a Merchant Center domain, or if it's a custom user domain.
|
|
3817
|
+
* For the latter, we can derive the URL from the Merchant Center API URL.
|
|
3818
|
+
*
|
|
3819
|
+
* A Merchant Center hostname is composed by the following parts:
|
|
3820
|
+
* https://<mc-prefix>.<region>.<provider>.<ct-domain>.<tld>
|
|
3821
|
+
* We neeed to check if at least the first 4 parts (right-to-left) are
|
|
3822
|
+
* the same.
|
|
3823
|
+
*/
|
|
3824
|
+
function getMcOrigin(mcApiUrl) {
|
|
3825
|
+
var _context, _context2;
|
|
3826
|
+
|
|
3827
|
+
var actualWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
|
|
3828
|
+
var mcApiUrlObject = new _URL__default["default"](mcApiUrl);
|
|
3829
|
+
|
|
3830
|
+
var _mcApiUrlObject$hostn = _reverseInstanceProperty__default["default"](_context = mcApiUrlObject.hostname.split('.')).call(_context),
|
|
3831
|
+
_mcApiUrlObject$hostn2 = _slicedToArray(_mcApiUrlObject$hostn, 4),
|
|
3832
|
+
tldMcApi = _mcApiUrlObject$hostn2[0],
|
|
3833
|
+
ctDomainMcApi = _mcApiUrlObject$hostn2[1],
|
|
3834
|
+
providerMcApi = _mcApiUrlObject$hostn2[2],
|
|
3835
|
+
regionMcApi = _mcApiUrlObject$hostn2[3];
|
|
3836
|
+
|
|
3837
|
+
var _actualWindow$locatio = _reverseInstanceProperty__default["default"](_context2 = actualWindow.location.hostname.split('.')).call(_context2),
|
|
3838
|
+
_actualWindow$locatio2 = _slicedToArray(_actualWindow$locatio, 4),
|
|
3839
|
+
tldMc = _actualWindow$locatio2[0],
|
|
3840
|
+
ctDomainMc = _actualWindow$locatio2[1],
|
|
3841
|
+
providerMc = _actualWindow$locatio2[2],
|
|
3842
|
+
regionMc = _actualWindow$locatio2[3];
|
|
3843
|
+
|
|
3844
|
+
var isMatching = tldMcApi === tldMc && ctDomainMcApi === ctDomainMc && providerMcApi === providerMc && regionMcApi === regionMc;
|
|
3845
|
+
|
|
3846
|
+
if (isMatching) {
|
|
3847
|
+
return actualWindow.location.origin;
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3850
|
+
return mcApiUrlObject.origin.replace('mc-api', 'mc');
|
|
3851
|
+
}
|
|
3852
|
+
|
|
3805
3853
|
var generateAndCacheNonceWithState = function generateAndCacheNonceWithState(state) {
|
|
3806
3854
|
var nonce = uuid.v4(); // We store additional information within the given `nonce`
|
|
3807
3855
|
// to then retrieve it later when the IdP redirects back
|
|
@@ -3818,6 +3866,7 @@ var RedirectToLogin = function RedirectToLogin() {
|
|
|
3818
3866
|
var _window$app$__DEVELOP, _window$app$__DEVELOP2;
|
|
3819
3867
|
|
|
3820
3868
|
var location = reactRouterDom.useLocation();
|
|
3869
|
+
var servedByProxy = applicationEntryPoint.useIsServedByProxy();
|
|
3821
3870
|
|
|
3822
3871
|
if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
|
|
3823
3872
|
var _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6, _window$app$__DEVELOP7, _window$app$__DEVELOP8;
|
|
@@ -3868,8 +3917,10 @@ var RedirectToLogin = function RedirectToLogin() {
|
|
|
3868
3917
|
});
|
|
3869
3918
|
}
|
|
3870
3919
|
|
|
3920
|
+
var mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
|
|
3871
3921
|
return jsxRuntime.jsx(Redirector, {
|
|
3872
3922
|
to: "login",
|
|
3923
|
+
origin: mcOrigin,
|
|
3873
3924
|
location: location,
|
|
3874
3925
|
queryParams: {
|
|
3875
3926
|
reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
|
|
@@ -3890,9 +3941,7 @@ var RedirectToLogout = function RedirectToLogout(props) {
|
|
|
3890
3941
|
var _window$app$__DEVELOP, _window$app$__DEVELOP2, _props$reason;
|
|
3891
3942
|
|
|
3892
3943
|
var location = reactRouterDom.useLocation();
|
|
3893
|
-
var servedByProxy =
|
|
3894
|
-
return context.environment.servedByProxy;
|
|
3895
|
-
});
|
|
3944
|
+
var servedByProxy = applicationEntryPoint.useIsServedByProxy();
|
|
3896
3945
|
|
|
3897
3946
|
if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
|
|
3898
3947
|
// Remove the `sessionToken` from storage, so that the AppShell can initiate
|
|
@@ -3901,8 +3950,10 @@ var RedirectToLogout = function RedirectToLogout(props) {
|
|
|
3901
3950
|
return jsxRuntime.jsx(RedirectToLogin, {});
|
|
3902
3951
|
}
|
|
3903
3952
|
|
|
3953
|
+
var mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
|
|
3904
3954
|
return jsxRuntime.jsx(Redirector, {
|
|
3905
3955
|
to: "logout",
|
|
3956
|
+
origin: mcOrigin,
|
|
3906
3957
|
location: location,
|
|
3907
3958
|
queryParams: _objectSpread$1({
|
|
3908
3959
|
reason: (_props$reason = props.reason) !== null && _props$reason !== void 0 ? _props$reason : constants.LOGOUT_REASONS.USER
|
|
@@ -4023,9 +4074,11 @@ var RestrictedApplication = function RestrictedApplication(props) {
|
|
|
4023
4074
|
user: user,
|
|
4024
4075
|
environment: applicationEnvironment,
|
|
4025
4076
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
4026
|
-
locale: user
|
|
4077
|
+
locale: user === null || user === void 0 ? void 0 : user.language,
|
|
4027
4078
|
applicationMessages: props.applicationMessages,
|
|
4028
4079
|
children: function children(_ref9) {
|
|
4080
|
+
var _user$businessRole;
|
|
4081
|
+
|
|
4029
4082
|
var isLoadingLocaleData = _ref9.isLoading,
|
|
4030
4083
|
locale = _ref9.locale,
|
|
4031
4084
|
messages = _ref9.messages;
|
|
@@ -4043,13 +4096,13 @@ var RestrictedApplication = function RestrictedApplication(props) {
|
|
|
4043
4096
|
defaultFlags: props.defaultFeatureFlags,
|
|
4044
4097
|
children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4045
4098
|
children: [jsxRuntime.jsx(VersionTracker, {}), jsxRuntime.jsx(applicationEntryPoint.RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
|
|
4046
|
-
user: user
|
|
4099
|
+
user: user !== null && user !== void 0 ? user : undefined
|
|
4047
4100
|
}), jsxRuntime.jsx(GtmUserTracker, {
|
|
4048
4101
|
user: user
|
|
4049
4102
|
}), jsxRuntime.jsx(GtmApplicationTracker, {
|
|
4050
4103
|
applicationName: applicationEnvironment.applicationName,
|
|
4051
4104
|
projectKey: projectKeyFromUrl,
|
|
4052
|
-
userBusinessRole: user === null || user === void 0 ? void 0 : user.businessRole
|
|
4105
|
+
userBusinessRole: (_user$businessRole = user === null || user === void 0 ? void 0 : user.businessRole) !== null && _user$businessRole !== void 0 ? _user$businessRole : undefined
|
|
4053
4106
|
}), jsxRuntime.jsxs("div", {
|
|
4054
4107
|
role: "application-layout",
|
|
4055
4108
|
css: _ref6,
|
|
@@ -4174,7 +4227,9 @@ var RestrictedApplication = function RestrictedApplication(props) {
|
|
|
4174
4227
|
exact: true,
|
|
4175
4228
|
path: "/",
|
|
4176
4229
|
render: function render() {
|
|
4177
|
-
var
|
|
4230
|
+
var _user$defaultProjectK;
|
|
4231
|
+
|
|
4232
|
+
var previousProjectKey = getPreviousProjectKey((_user$defaultProjectK = user === null || user === void 0 ? void 0 : user.defaultProjectKey) !== null && _user$defaultProjectK !== void 0 ? _user$defaultProjectK : undefined);
|
|
4178
4233
|
/**
|
|
4179
4234
|
* NOTE:
|
|
4180
4235
|
* Given the user has not been loaded a loading spinner is shown.
|