@commercetools-frontend/application-shell 20.11.0 → 20.12.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-ffe525a6.cjs.prod.js → application-entry-point-32ba21e8.cjs.prod.js} +36 -78
- package/dist/{application-entry-point-18770bfb.cjs.dev.js → application-entry-point-ca79642e.cjs.dev.js} +36 -78
- package/dist/{application-entry-point-3f374457.esm.js → application-entry-point-caba3fcf.esm.js} +14 -52
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +9 -4
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +9 -4
- package/dist/commercetools-frontend-application-shell.esm.js +7 -4
- package/dist/constants-33a16227.esm.js +46 -0
- package/dist/constants-745aeeca.cjs.prod.js +54 -0
- package/dist/constants-fdbe0e9d.cjs.dev.js +54 -0
- 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/locale-switcher/locale-switcher.d.ts +3 -4
- 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/index.d.ts +1 -1
- package/dist/declarations/src/ssr/index.d.ts +2 -0
- package/dist/declarations/src/utils/formatters.d.ts +8 -0
- package/dist/declarations/src/utils/index.d.ts +1 -0
- package/dist/declarations/src/{components/authenticated/helpers.d.ts → utils/oidc.d.ts} +0 -0
- package/dist/{index-76c4413b.cjs.prod.js → index-0428cf83.cjs.prod.js} +117 -101
- package/dist/{index-e6679632.cjs.dev.js → index-1a8b5b91.cjs.dev.js} +123 -107
- package/dist/{index-f9fabc3f.esm.js → index-dd13496f.esm.js} +82 -66
- package/dist/oidc-7e7761de.cjs.dev.js +94 -0
- package/dist/oidc-8e05c00e.esm.js +84 -0
- package/dist/oidc-be09bd90.cjs.prod.js +94 -0
- package/dist/{project-expired-76545cc5.cjs.dev.js → project-expired-1c83f3b0.cjs.dev.js} +7 -4
- package/dist/{project-expired-ca9b4abf.esm.js → project-expired-633f1944.esm.js} +7 -4
- package/dist/{project-expired-add920ff.cjs.prod.js → project-expired-da4386e2.cjs.prod.js} +7 -4
- package/dist/{project-not-found-705141ee.esm.js → project-not-found-ba7eb62f.esm.js} +7 -4
- package/dist/{project-not-found-ecbab238.cjs.prod.js → project-not-found-d28a8381.cjs.prod.js} +7 -4
- package/dist/{project-not-found-9b444972.cjs.dev.js → project-not-found-fa0d0fed.cjs.dev.js} +7 -4
- package/dist/{project-not-initialized-aa2e0406.cjs.prod.js → project-not-initialized-3bb6a35a.cjs.prod.js} +7 -4
- package/dist/{project-not-initialized-43c3480b.cjs.dev.js → project-not-initialized-75d542c8.cjs.dev.js} +7 -4
- package/dist/{project-not-initialized-c75f1950.esm.js → project-not-initialized-b5aa1292.esm.js} +7 -4
- package/dist/{project-suspended-c851af31.esm.js → project-suspended-a7b9d722.esm.js} +7 -4
- package/dist/{project-suspended-d70929a8.cjs.prod.js → project-suspended-d498f169.cjs.prod.js} +7 -4
- package/dist/{project-suspended-d476386a.cjs.dev.js → project-suspended-ed1a8044.cjs.dev.js} +7 -4
- package/dist/{quick-access-0a46f8a1.cjs.prod.js → quick-access-5133c280.cjs.prod.js} +5 -2
- package/dist/{quick-access-3c16727c.cjs.dev.js → quick-access-53014796.cjs.dev.js} +5 -2
- package/dist/{quick-access-11f02492.esm.js → quick-access-612dc2d7.esm.js} +5 -2
- package/dist/{service-page-project-switcher-6ec976d5.cjs.prod.js → service-page-project-switcher-08c6c7d5.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-087d711d.esm.js → service-page-project-switcher-4893264d.esm.js} +1 -1
- package/dist/{service-page-project-switcher-e22f7891.cjs.dev.js → service-page-project-switcher-dfbbe4c1.cjs.dev.js} +1 -1
- package/package.json +63 -57
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.d.ts +1 -0
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +16 -0
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.js +7 -0
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +16 -0
- package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +6 -0
- package/ssr/package.json +4 -0
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +3 -1
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +3 -1
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +3 -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-32ba21e8.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');
|
|
@@ -18,15 +18,18 @@ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/obje
|
|
|
18
18
|
var react = require('react');
|
|
19
19
|
var reactRouterDom = require('react-router-dom');
|
|
20
20
|
var react$2 = require('@emotion/react');
|
|
21
|
-
var constants = require('@commercetools-frontend/constants');
|
|
21
|
+
var constants$1 = require('@commercetools-frontend/constants');
|
|
22
22
|
var sentry = require('@commercetools-frontend/sentry');
|
|
23
23
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
24
24
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
25
25
|
var reactNotifications = require('@commercetools-frontend/react-notifications');
|
|
26
26
|
var i18n = require('@commercetools-frontend/i18n');
|
|
27
27
|
var uuid = require('uuid');
|
|
28
|
+
var constants = require('./constants-745aeeca.cjs.prod.js');
|
|
28
29
|
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
29
30
|
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
31
|
+
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
32
|
+
require('lodash/upperFirst');
|
|
30
33
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
31
34
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
32
35
|
var Perfume = require('perfume.js');
|
|
@@ -38,8 +41,7 @@ var reactRedux = require('react-redux');
|
|
|
38
41
|
var history = require('@commercetools-frontend/browser-history');
|
|
39
42
|
var reactIntl = require('react-intl');
|
|
40
43
|
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
41
|
-
var
|
|
42
|
-
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
44
|
+
var oidc = require('./oidc-be09bd90.cjs.prod.js');
|
|
43
45
|
var qss = require('qss');
|
|
44
46
|
var jwtDecode = require('jwt-decode');
|
|
45
47
|
var FailedAuthenticationSVG = require('@commercetools-frontend/assets/images/locked-diamond.svg');
|
|
@@ -82,6 +84,7 @@ var _flagsInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/inst
|
|
|
82
84
|
var ldAdapter = require('@flopflip/launchdarkly-adapter');
|
|
83
85
|
var httpAdapter = require('@flopflip/http-adapter');
|
|
84
86
|
var combineAdapters = require('@flopflip/combine-adapters');
|
|
87
|
+
require('@babel/runtime-corejs3/helpers/toConsumableArray');
|
|
85
88
|
require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
86
89
|
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
87
90
|
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
@@ -112,12 +115,12 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
|
|
|
112
115
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
113
116
|
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
114
117
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
118
|
+
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
115
119
|
var Perfume__default = /*#__PURE__*/_interopDefault(Perfume);
|
|
116
120
|
var _reverseInstanceProperty__default = /*#__PURE__*/_interopDefault(_reverseInstanceProperty);
|
|
117
121
|
var camelcase__default = /*#__PURE__*/_interopDefault(camelcase);
|
|
118
122
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
119
123
|
var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
|
|
120
|
-
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
121
124
|
var jwtDecode__default = /*#__PURE__*/_interopDefault(jwtDecode);
|
|
122
125
|
var FailedAuthenticationSVG__default = /*#__PURE__*/_interopDefault(FailedAuthenticationSVG);
|
|
123
126
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
@@ -153,7 +156,7 @@ var throttle__default = /*#__PURE__*/_interopDefault(throttle);
|
|
|
153
156
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
154
157
|
|
|
155
158
|
function selectProjectKeyFromLocalStorage() {
|
|
156
|
-
return window.localStorage.getItem(
|
|
159
|
+
return window.localStorage.getItem(constants.STORAGE_KEYS.ACTIVE_PROJECT_KEY);
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
var getPreviousProjectKey = function getPreviousProjectKey(defaultProjectKeyOfUser) {
|
|
@@ -178,7 +181,7 @@ var createApolloContextForProxyForwardTo = function createApolloContextForProxyF
|
|
|
178
181
|
};
|
|
179
182
|
|
|
180
183
|
var getSelectedDataLocaleForProject = function getSelectedDataLocaleForProject(projectLocales) {
|
|
181
|
-
var cachedDataLocale = window.localStorage.getItem(
|
|
184
|
+
var cachedDataLocale = window.localStorage.getItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE); // Make sure the cached locale is listed in the selected project
|
|
182
185
|
|
|
183
186
|
var isCachedDataLocaleIncludedInProjectLanguages = _includesInstanceProperty__default["default"](projectLocales).call(projectLocales, cachedDataLocale || '');
|
|
184
187
|
|
|
@@ -186,7 +189,7 @@ var getSelectedDataLocaleForProject = function getSelectedDataLocaleForProject(p
|
|
|
186
189
|
|
|
187
190
|
var defaultDataLocaleForProject = projectLocales[0]; // Cache it
|
|
188
191
|
|
|
189
|
-
window.localStorage.setItem(
|
|
192
|
+
window.localStorage.setItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE, defaultDataLocaleForProject);
|
|
190
193
|
return defaultDataLocaleForProject;
|
|
191
194
|
};
|
|
192
195
|
|
|
@@ -199,7 +202,7 @@ var ProjectDataLocale = function ProjectDataLocale(props) {
|
|
|
199
202
|
var handleSetProjectDataLocale = react.useCallback(function (locale) {
|
|
200
203
|
setLocale(locale); // Cache it
|
|
201
204
|
|
|
202
|
-
window.localStorage.setItem(
|
|
205
|
+
window.localStorage.setItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE, locale);
|
|
203
206
|
}, []);
|
|
204
207
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
205
208
|
children: props.children({
|
|
@@ -617,44 +620,11 @@ var ConfigureIntlProvider = function ConfigureIntlProvider(props) {
|
|
|
617
620
|
ConfigureIntlProvider.propTypes = {};
|
|
618
621
|
ConfigureIntlProvider.displayName = 'ConfigureIntlProvider';
|
|
619
622
|
|
|
620
|
-
var buildOidcScope = function buildOidcScope(options) {
|
|
621
|
-
var _context7;
|
|
622
|
-
|
|
623
|
-
var claims = [];
|
|
624
|
-
|
|
625
|
-
if (options.projectKey) {
|
|
626
|
-
var _context, _context2, _options$oAuthScopes$, _options$oAuthScopes, _context4, _options$oAuthScopes$2, _options$oAuthScopes2;
|
|
627
|
-
|
|
628
|
-
claims.push(_concatInstanceProperty__default["default"](_context = "".concat(applicationEntryPoint.OIDC_CLAIMS.PROJECT_KEY, ":")).call(_context, options.projectKey));
|
|
629
|
-
claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty__default["default"](_context2 = (_options$oAuthScopes$ = (_options$oAuthScopes = options.oAuthScopes) === null || _options$oAuthScopes === void 0 ? void 0 : _options$oAuthScopes.view) !== null && _options$oAuthScopes$ !== void 0 ? _options$oAuthScopes$ : []).call(_context2, function (scope) {
|
|
630
|
-
var _context3;
|
|
631
|
-
|
|
632
|
-
return _concatInstanceProperty__default["default"](_context3 = "".concat(applicationEntryPoint.OIDC_CLAIMS.VIEW, ":")).call(_context3, scope);
|
|
633
|
-
})));
|
|
634
|
-
claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty__default["default"](_context4 = (_options$oAuthScopes$2 = (_options$oAuthScopes2 = options.oAuthScopes) === null || _options$oAuthScopes2 === void 0 ? void 0 : _options$oAuthScopes2.manage) !== null && _options$oAuthScopes$2 !== void 0 ? _options$oAuthScopes$2 : []).call(_context4, function (scope) {
|
|
635
|
-
var _context5;
|
|
636
|
-
|
|
637
|
-
return _concatInstanceProperty__default["default"](_context5 = "".concat(applicationEntryPoint.OIDC_CLAIMS.MANAGE, ":")).call(_context5, scope);
|
|
638
|
-
})));
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
var teamId = options.teamId;
|
|
642
|
-
|
|
643
|
-
if (teamId) {
|
|
644
|
-
var _context6;
|
|
645
|
-
|
|
646
|
-
claims.push(_concatInstanceProperty__default["default"](_context6 = "".concat(applicationEntryPoint.OIDC_CLAIMS.TEAM_ID, ":")).call(_context6, teamId));
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
return _concatInstanceProperty__default["default"](_context7 = [// This is required as per OIDC spec.
|
|
650
|
-
applicationEntryPoint.OIDC_CLAIMS.OPEN_ID]).call(_context7, claims).join(' ');
|
|
651
|
-
};
|
|
652
|
-
|
|
653
623
|
var withoutProjectKeyClaim = function withoutProjectKeyClaim(scope) {
|
|
654
624
|
var _context;
|
|
655
625
|
|
|
656
626
|
return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, function (claim) {
|
|
657
|
-
return !_startsWithInstanceProperty__default["default"](claim).call(claim,
|
|
627
|
+
return !_startsWithInstanceProperty__default["default"](claim).call(claim, constants.OIDC_CLAIMS.PROJECT_KEY);
|
|
658
628
|
}).join(' ');
|
|
659
629
|
};
|
|
660
630
|
|
|
@@ -701,7 +671,7 @@ var hasCachedAuthenticationState = function hasCachedAuthenticationState() {
|
|
|
701
671
|
} // Rebuild the requested OIDC scope to verify that it didn't change.
|
|
702
672
|
|
|
703
673
|
|
|
704
|
-
var requestedScope = buildOidcScope({
|
|
674
|
+
var requestedScope = oidc.buildOidcScope({
|
|
705
675
|
projectKey: activeProjectKey !== null && activeProjectKey !== void 0 ? activeProjectKey : undefined,
|
|
706
676
|
oAuthScopes: (_window$app$__DEVELOP9 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP9 === void 0 ? void 0 : (_window$app$__DEVELOP10 = _window$app$__DEVELOP9.oidc) === null || _window$app$__DEVELOP10 === void 0 ? void 0 : _window$app$__DEVELOP10.oAuthScopes,
|
|
707
677
|
teamId: (_window$app$__DEVELOP11 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP11 === void 0 ? void 0 : (_window$app$__DEVELOP12 = _window$app$__DEVELOP11.oidc) === null || _window$app$__DEVELOP12 === void 0 ? void 0 : _window$app$__DEVELOP12.teamId
|
|
@@ -721,7 +691,7 @@ var hasCachedAuthenticationState = function hasCachedAuthenticationState() {
|
|
|
721
691
|
}
|
|
722
692
|
}
|
|
723
693
|
|
|
724
|
-
return window.localStorage.getItem(
|
|
694
|
+
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
725
695
|
};
|
|
726
696
|
|
|
727
697
|
function useMcQuery(query, options) {
|
|
@@ -745,7 +715,7 @@ var AmILoggedIn = function AmILoggedIn(props) {
|
|
|
745
715
|
// is valid. We return null while the query is loading.
|
|
746
716
|
var _useMcQuery = useMcQuery(AmILoggedInQuery, {
|
|
747
717
|
context: {
|
|
748
|
-
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
718
|
+
target: constants$1.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
749
719
|
skipTokenRetry: true
|
|
750
720
|
},
|
|
751
721
|
// NOTE: With `no-cache` the `useQuery` will not trigger a
|
|
@@ -764,20 +734,20 @@ var AmILoggedIn = function AmILoggedIn(props) {
|
|
|
764
734
|
if (!data) {
|
|
765
735
|
// In case the request is 200 but there is no data, we assume
|
|
766
736
|
// there are some errors.
|
|
767
|
-
window.localStorage.removeItem(
|
|
737
|
+
window.localStorage.removeItem(constants.STORAGE_KEYS.IS_AUTHENTICATED);
|
|
768
738
|
} else {
|
|
769
739
|
// Even though the login page might set this flag, we just make sure that
|
|
770
740
|
// we do it here as well. This will help in the future when we eventually
|
|
771
741
|
// move the auth service to itw own domain, in which case the local storage
|
|
772
742
|
// is not shared anymore.
|
|
773
|
-
window.localStorage.setItem(
|
|
743
|
+
window.localStorage.setItem(constants.STORAGE_KEYS.IS_AUTHENTICATED, String(true));
|
|
774
744
|
}
|
|
775
745
|
},
|
|
776
746
|
onError: function onError() {
|
|
777
747
|
// The query fails without the `mcAccessToken`. In this case the caching
|
|
778
748
|
// needs to be unset as otherwise the application will end up in a infinte
|
|
779
749
|
// redirect loop.
|
|
780
|
-
window.localStorage.removeItem(
|
|
750
|
+
window.localStorage.removeItem(constants.STORAGE_KEYS.IS_AUTHENTICATED);
|
|
781
751
|
}
|
|
782
752
|
}),
|
|
783
753
|
data = _useMcQuery.data,
|
|
@@ -1334,7 +1304,7 @@ var FetchUser = function FetchUser(props) {
|
|
|
1334
1304
|
var _useMcQuery = useMcQuery(LoggedInUserQuery, {
|
|
1335
1305
|
onError: sentry.reportErrorToSentry,
|
|
1336
1306
|
context: {
|
|
1337
|
-
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
|
|
1307
|
+
target: constants$1.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
|
|
1338
1308
|
}
|
|
1339
1309
|
}),
|
|
1340
1310
|
loading = _useMcQuery.loading,
|
|
@@ -1359,7 +1329,7 @@ var pushDependencyVersionCounter = function pushDependencyVersionCounter(_ref) {
|
|
|
1359
1329
|
var payload = _ref.payload;
|
|
1360
1330
|
return sdk.actions.post({
|
|
1361
1331
|
uri: '/metrics/counters',
|
|
1362
|
-
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.MC_METRICS,
|
|
1332
|
+
mcApiProxyTarget: constants$1.MC_API_PROXY_TARGETS.MC_METRICS,
|
|
1363
1333
|
payload: _JSON$stringify__default["default"](payload)
|
|
1364
1334
|
});
|
|
1365
1335
|
};
|
|
@@ -1411,7 +1381,7 @@ var FetchProject = function FetchProject(props) {
|
|
|
1411
1381
|
projectKey: props.projectKey
|
|
1412
1382
|
},
|
|
1413
1383
|
context: {
|
|
1414
|
-
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
|
|
1384
|
+
target: constants$1.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
|
|
1415
1385
|
},
|
|
1416
1386
|
skip: props.skip === true
|
|
1417
1387
|
}),
|
|
@@ -1790,7 +1760,7 @@ var renderLabel = function renderLabel(menu, applicationLanguage) {
|
|
|
1790
1760
|
});
|
|
1791
1761
|
|
|
1792
1762
|
if (localizedLabel) return localizedLabel.value;
|
|
1793
|
-
return constants.NO_VALUE_FALLBACK;
|
|
1763
|
+
return constants$1.NO_VALUE_FALLBACK;
|
|
1794
1764
|
};
|
|
1795
1765
|
|
|
1796
1766
|
var MenuItem$1 = _styled__default["default"]("div", {
|
|
@@ -1896,7 +1866,7 @@ var UserSettingsMenuBody = function UserSettingsMenuBody(props) {
|
|
|
1896
1866
|
})
|
|
1897
1867
|
}), jsxRuntime.jsx("a", {
|
|
1898
1868
|
css: getUserSettingsMenuItemLinkStyles(),
|
|
1899
|
-
href: constants.SUPPORT_PORTAL_URL,
|
|
1869
|
+
href: constants$1.SUPPORT_PORTAL_URL,
|
|
1900
1870
|
rel: "noopener noreferrer",
|
|
1901
1871
|
target: "_blank",
|
|
1902
1872
|
"data-track-component": "Navigation-Support-links",
|
|
@@ -1918,7 +1888,7 @@ var UserSettingsMenuBody = function UserSettingsMenuBody(props) {
|
|
|
1918
1888
|
css: getUserSettingsMenuItemLinkStyles() // NOTE: we want to redirect to a new page so that the
|
|
1919
1889
|
// server can remove things like cookie for access token.
|
|
1920
1890
|
,
|
|
1921
|
-
href: "/logout?reason=".concat(constants.LOGOUT_REASONS.USER),
|
|
1891
|
+
href: "/logout?reason=".concat(constants$1.LOGOUT_REASONS.USER),
|
|
1922
1892
|
"data-test": "logout-button",
|
|
1923
1893
|
"data-user-settings-menu": true,
|
|
1924
1894
|
children: [jsxRuntime.jsx(MenuItem$1, {
|
|
@@ -2102,7 +2072,7 @@ var ProjectSwitcher = function ProjectSwitcher(props) {
|
|
|
2102
2072
|
var _useMcQuery = useMcQuery(ProjectsQuery, {
|
|
2103
2073
|
onError: sentry.reportErrorToSentry,
|
|
2104
2074
|
context: {
|
|
2105
|
-
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
|
|
2075
|
+
target: constants$1.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
|
|
2106
2076
|
}
|
|
2107
2077
|
}),
|
|
2108
2078
|
loading = _useMcQuery.loading,
|
|
@@ -2326,7 +2296,7 @@ var AppBar = function AppBar(props) {
|
|
|
2326
2296
|
children: [jsxRuntime.jsxs(Spacings__default["default"].Inline, {
|
|
2327
2297
|
alignItems: "center",
|
|
2328
2298
|
children: [jsxRuntime.jsx("div", {
|
|
2329
|
-
id:
|
|
2299
|
+
id: constants.CONTAINERS.LOCALE_SWITCHER
|
|
2330
2300
|
}), function () {
|
|
2331
2301
|
if (!props.user) {
|
|
2332
2302
|
return jsxRuntime.jsx(LoadingPlaceholder, {
|
|
@@ -2435,27 +2405,25 @@ var LocaleSwitcher = function LocaleSwitcher(props) {
|
|
|
2435
2405
|
LocaleSwitcher.propTypes = {};
|
|
2436
2406
|
|
|
2437
2407
|
var ProjectNotFound = /*#__PURE__*/react.lazy(function () {
|
|
2438
|
-
return Promise.resolve().then(function () { return require('./project-not-found-
|
|
2408
|
+
return Promise.resolve().then(function () { return require('./project-not-found-d28a8381.cjs.prod.js'
|
|
2439
2409
|
/* webpackChunkName: "project-not-found" */
|
|
2440
2410
|
); });
|
|
2441
2411
|
});
|
|
2442
2412
|
|
|
2443
2413
|
var ProjectExpired = /*#__PURE__*/react.lazy(function () {
|
|
2444
|
-
return Promise.resolve().then(function () { return require('./project-expired-
|
|
2414
|
+
return Promise.resolve().then(function () { return require('./project-expired-da4386e2.cjs.prod.js'
|
|
2445
2415
|
/* webpackChunkName: "project-expired" */
|
|
2446
2416
|
); });
|
|
2447
2417
|
});
|
|
2448
2418
|
|
|
2449
2419
|
var ProjectNotInitialized = /*#__PURE__*/react.lazy(function () {
|
|
2450
|
-
return Promise.resolve().then(function () { return require('./project-not-initialized-
|
|
2420
|
+
return Promise.resolve().then(function () { return require('./project-not-initialized-3bb6a35a.cjs.prod.js'
|
|
2451
2421
|
/* webpackChunkName: "project-not-initialized" */
|
|
2452
2422
|
); });
|
|
2453
2423
|
});
|
|
2454
2424
|
|
|
2455
2425
|
var RedirectToProjectCreate = function RedirectToProjectCreate() {
|
|
2456
|
-
var servedByProxy =
|
|
2457
|
-
return context.environment.servedByProxy;
|
|
2458
|
-
});
|
|
2426
|
+
var servedByProxy = applicationEntryPoint.useIsServedByProxy();
|
|
2459
2427
|
/**
|
|
2460
2428
|
* NOTE:
|
|
2461
2429
|
* This looks a bit unusual: redirecting in render.
|
|
@@ -2496,7 +2464,7 @@ var RedirectToProjectCreate = function RedirectToProjectCreate() {
|
|
|
2496
2464
|
RedirectToProjectCreate.displayName = 'RedirectToProjectCreate';
|
|
2497
2465
|
|
|
2498
2466
|
var ProjectSuspended = /*#__PURE__*/react.lazy(function () {
|
|
2499
|
-
return Promise.resolve().then(function () { return require('./project-suspended-
|
|
2467
|
+
return Promise.resolve().then(function () { return require('./project-suspended-d498f169.cjs.prod.js'
|
|
2500
2468
|
/* webpackChunkName: "project-suspended" */
|
|
2501
2469
|
); });
|
|
2502
2470
|
});
|
|
@@ -2543,13 +2511,13 @@ var ProjectContainer = function ProjectContainer(props) {
|
|
|
2543
2511
|
* is inserted in the DOM tree.
|
|
2544
2512
|
* "
|
|
2545
2513
|
*/
|
|
2546
|
-
setLocaleSwitcherNode(document.getElementById(
|
|
2514
|
+
setLocaleSwitcherNode(document.getElementById(constants.CONTAINERS.LOCALE_SWITCHER));
|
|
2547
2515
|
}, [setLocaleSwitcherNode]);
|
|
2548
2516
|
var projectKey = props.match.params.projectKey;
|
|
2549
2517
|
react.useEffect(function () {
|
|
2550
2518
|
// Ensure to sync the `projectKey` from the URL with localStorage.
|
|
2551
2519
|
if (projectKey) {
|
|
2552
|
-
window.localStorage.setItem(
|
|
2520
|
+
window.localStorage.setItem(constants.STORAGE_KEYS.ACTIVE_PROJECT_KEY, projectKey);
|
|
2553
2521
|
}
|
|
2554
2522
|
}, [projectKey]); // }
|
|
2555
2523
|
|
|
@@ -2567,7 +2535,7 @@ var ProjectContainer = function ProjectContainer(props) {
|
|
|
2567
2535
|
*/
|
|
2568
2536
|
|
|
2569
2537
|
if (hasNoProjects && props.environment.enableSignUp !== true && props.environment.servedByProxy) return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
2570
|
-
to: "/logout?reason=".concat(constants.LOGOUT_REASONS.NO_PROJECTS)
|
|
2538
|
+
to: "/logout?reason=".concat(constants$1.LOGOUT_REASONS.NO_PROJECTS)
|
|
2571
2539
|
});
|
|
2572
2540
|
if (hasNoProjects && props.environment.enableSignUp) return jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
2573
2541
|
children: [jsxRuntime.jsx(reactRouterDom.Route, {
|
|
@@ -2591,7 +2559,7 @@ var ProjectContainer = function ProjectContainer(props) {
|
|
|
2591
2559
|
if (isProjectLoading) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
2592
2560
|
if (!project) return jsxRuntime.jsx(ProjectNotFound, {});
|
|
2593
2561
|
if (project.suspension && project.suspension.isActive) return jsxRuntime.jsx(ProjectSuspended, {
|
|
2594
|
-
isTemporary: project.suspension.reason ===
|
|
2562
|
+
isTemporary: project.suspension.reason === constants.SUSPENSION_REASONS.TEMPORARY_MAINTENANCE
|
|
2595
2563
|
});
|
|
2596
2564
|
if (project.expiry && project.expiry.isActive) return jsxRuntime.jsx(ProjectExpired, {});
|
|
2597
2565
|
if (project.initialized === false) return jsxRuntime.jsx(ProjectNotInitialized, {});
|
|
@@ -2610,7 +2578,7 @@ var ProjectContainer = function ProjectContainer(props) {
|
|
|
2610
2578
|
children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2611
2579
|
children: [shouldShowNotificationForTrialExpired((_project$expiry$daysL = project.expiry.daysLeft) !== null && _project$expiry$daysL !== void 0 ? _project$expiry$daysL : undefined) && jsxRuntime.jsx(reactNotifications.Notifier, {
|
|
2612
2580
|
kind: "warning",
|
|
2613
|
-
domain: constants.DOMAINS.GLOBAL,
|
|
2581
|
+
domain: constants$1.DOMAINS.GLOBAL,
|
|
2614
2582
|
text: intl.formatMessage(messages$1.trialDaysLeft, {
|
|
2615
2583
|
daysLeft: project.expiry.daysLeft || 0
|
|
2616
2584
|
})
|
|
@@ -2652,9 +2620,7 @@ var getDefaultedFeatureToggles = function getDefaultedFeatureToggles(allFeatureT
|
|
|
2652
2620
|
};
|
|
2653
2621
|
|
|
2654
2622
|
var useAllMenuFeatureToggles = function useAllMenuFeatureToggles() {
|
|
2655
|
-
var servedByProxy =
|
|
2656
|
-
return applicationContext.environment.servedByProxy;
|
|
2657
|
-
});
|
|
2623
|
+
var servedByProxy = applicationEntryPoint.useIsServedByProxy();
|
|
2658
2624
|
var mcProxyApiUrl = applicationShellConnectors.useApplicationContext(function (applicationContext) {
|
|
2659
2625
|
return applicationContext.environment.mcProxyApiUrl;
|
|
2660
2626
|
});
|
|
@@ -2787,7 +2753,7 @@ var SetupFlopFlipProvider = function SetupFlopFlipProvider(props) {
|
|
|
2787
2753
|
query: AllFeaturesQuery,
|
|
2788
2754
|
errorPolicy: 'ignore',
|
|
2789
2755
|
context: {
|
|
2790
|
-
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
|
|
2756
|
+
target: constants$1.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND
|
|
2791
2757
|
}
|
|
2792
2758
|
});
|
|
2793
2759
|
|
|
@@ -2863,7 +2829,7 @@ var messages = reactIntl.defineMessages({
|
|
|
2863
2829
|
});
|
|
2864
2830
|
|
|
2865
2831
|
var useLoadingMenuLayoutEffect = function useLoadingMenuLayoutEffect() {
|
|
2866
|
-
var cachedIsForcedMenuOpen = window.localStorage.getItem(
|
|
2832
|
+
var cachedIsForcedMenuOpen = window.localStorage.getItem(constants.STORAGE_KEYS.IS_FORCED_MENU_OPEN);
|
|
2867
2833
|
var isForcedMenuOpen = isNil__default["default"](cachedIsForcedMenuOpen) ? null : JSON.parse(cachedIsForcedMenuOpen);
|
|
2868
2834
|
react.useLayoutEffect(function () {
|
|
2869
2835
|
if (isForcedMenuOpen) document.body.classList.add('body__menu-open');
|
|
@@ -2942,7 +2908,7 @@ var useNavbarStateManager = function useNavbarStateManager(props) {
|
|
|
2942
2908
|
var _useMcQuery = useMcQuery(FetchProjectExtensionsNavbar, {
|
|
2943
2909
|
skip: !props.environment.servedByProxy,
|
|
2944
2910
|
context: {
|
|
2945
|
-
target: constants.GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
2911
|
+
target: constants$1.GRAPHQL_TARGETS.SETTINGS_SERVICE
|
|
2946
2912
|
},
|
|
2947
2913
|
fetchPolicy: 'cache-and-network',
|
|
2948
2914
|
onError: sentry.reportErrorToSentry
|
|
@@ -3018,7 +2984,7 @@ var useNavbarStateManager = function useNavbarStateManager(props) {
|
|
|
3018
2984
|
})
|
|
3019
2985
|
};
|
|
3020
2986
|
})).call(_context4, nonNullable) : [];
|
|
3021
|
-
var cachedIsForcedMenuOpen = window.localStorage.getItem(
|
|
2987
|
+
var cachedIsForcedMenuOpen = window.localStorage.getItem(constants.STORAGE_KEYS.IS_FORCED_MENU_OPEN);
|
|
3022
2988
|
var isForcedMenuOpen = isNil__default["default"](cachedIsForcedMenuOpen) ? null : JSON.parse(cachedIsForcedMenuOpen);
|
|
3023
2989
|
|
|
3024
2990
|
var _useReducer = react.useReducer(reducer, getInitialState(isForcedMenuOpen)),
|
|
@@ -3100,7 +3066,7 @@ var useNavbarStateManager = function useNavbarStateManager(props) {
|
|
|
3100
3066
|
type: 'toggleIsMenuOpen'
|
|
3101
3067
|
}); // Synchronize the menu state with local storage.
|
|
3102
3068
|
|
|
3103
|
-
window.localStorage.setItem(
|
|
3069
|
+
window.localStorage.setItem(constants.STORAGE_KEYS.IS_FORCED_MENU_OPEN, String(!state.isMenuOpen));
|
|
3104
3070
|
}, [state.activeItemIndex, state.isMenuOpen]);
|
|
3105
3071
|
|
|
3106
3072
|
var allApplicationNavbarMenu = _concatInstanceProperty__default["default"](_context7 = _concatInstanceProperty__default["default"](_context8 = applicationsNavBarMenu || []).call(_context8, legacyCustomAppsMenu)).call(_context7, organizationCustomAppsMenu);
|
|
@@ -3334,11 +3300,7 @@ var MenuItemDivider = function MenuItemDivider() {
|
|
|
3334
3300
|
});
|
|
3335
3301
|
};
|
|
3336
3302
|
|
|
3337
|
-
MenuItemDivider.displayName = 'MenuItemDivider';
|
|
3338
|
-
// and the `<ToggleFeature>` components. However, it's necessary to have it as
|
|
3339
|
-
// the `<ToggleFeature>` wrapper should be rendered only if the `featureToggle`
|
|
3340
|
-
// prop is defined. This is because `<ToggleFeature>` will not render any
|
|
3341
|
-
// children if the flag is missing/not found.
|
|
3303
|
+
MenuItemDivider.displayName = 'MenuItemDivider';
|
|
3342
3304
|
|
|
3343
3305
|
var isEveryMenuVisibilitySetToHidden = function isEveryMenuVisibilitySetToHidden(menuVisibilities, namesOfMenuVisibilities) {
|
|
3344
3306
|
return _Array$isArray__default["default"](namesOfMenuVisibilities) && namesOfMenuVisibilities.length > 0 && _everyInstanceProperty__default["default"](namesOfMenuVisibilities).call(namesOfMenuVisibilities, function (nameOfMenuVisibility) {
|
|
@@ -3350,9 +3312,14 @@ var restrictedMenuItemDefaultProps = {
|
|
|
3350
3312
|
permissions: []
|
|
3351
3313
|
};
|
|
3352
3314
|
|
|
3315
|
+
function isLongLivedFlag(flag) {
|
|
3316
|
+
return typeof (flag === null || flag === void 0 ? void 0 : flag.value) === 'boolean';
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3353
3319
|
var RestrictedMenuItem = function RestrictedMenuItem(props) {
|
|
3354
3320
|
// NOTE: Custom application are activated/deactivated while their
|
|
3355
3321
|
// visibility is not controlled via a visibiility overwrite.
|
|
3322
|
+
var flagVariation = reactBroadcast.useFlagVariation(props.featureToggle);
|
|
3356
3323
|
if (isEveryMenuVisibilitySetToHidden(props.menuVisibilities, props.namesOfMenuVisibilities)) return null;
|
|
3357
3324
|
var permissionsWrapper = _Array$isArray__default["default"](props.permissions) && props.permissions.length > 0 || _Array$isArray__default["default"](props.dataFences) && props.dataFences.length > 0 ? jsxRuntime.jsx(permissions.RestrictedByPermissions, {
|
|
3358
3325
|
permissions: props.permissions,
|
|
@@ -3376,10 +3343,11 @@ var RestrictedMenuItem = function RestrictedMenuItem(props) {
|
|
|
3376
3343
|
});
|
|
3377
3344
|
|
|
3378
3345
|
if (props.featureToggle) {
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3346
|
+
// A regular short-lived feature toggle
|
|
3347
|
+
if (flagVariation === true) return permissionsWrapper; // A long-lived feature toggle with `{ value: boolean, string: reason }`
|
|
3348
|
+
|
|
3349
|
+
if (isLongLivedFlag(flagVariation) && flagVariation.value === true) return permissionsWrapper;
|
|
3350
|
+
return null;
|
|
3383
3351
|
}
|
|
3384
3352
|
|
|
3385
3353
|
return permissionsWrapper;
|
|
@@ -3421,7 +3389,7 @@ var MenuLabel = function MenuLabel(props) {
|
|
|
3421
3389
|
children: props.defaultLabel
|
|
3422
3390
|
});
|
|
3423
3391
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3424
|
-
children: constants.NO_VALUE_FALLBACK
|
|
3392
|
+
children: constants$1.NO_VALUE_FALLBACK
|
|
3425
3393
|
});
|
|
3426
3394
|
};
|
|
3427
3395
|
|
|
@@ -3624,7 +3592,7 @@ var NavBar = function NavBar(props) {
|
|
|
3624
3592
|
},
|
|
3625
3593
|
onMouseLeave: isMenuOpen ? undefined : shouldCloseMenuFly,
|
|
3626
3594
|
children: jsxRuntime.jsx("a", {
|
|
3627
|
-
href: constants.SUPPORT_PORTAL_URL,
|
|
3595
|
+
href: constants$1.SUPPORT_PORTAL_URL,
|
|
3628
3596
|
rel: "noopener noreferrer",
|
|
3629
3597
|
target: "_blank",
|
|
3630
3598
|
children: jsxRuntime.jsxs("div", {
|
|
@@ -3712,7 +3680,7 @@ var pimIndexerStates = {
|
|
|
3712
3680
|
};
|
|
3713
3681
|
|
|
3714
3682
|
var QuickAccess = /*#__PURE__*/react.lazy(function () {
|
|
3715
|
-
return Promise.resolve().then(function () { return require('./quick-access-
|
|
3683
|
+
return Promise.resolve().then(function () { return require('./quick-access-5133c280.cjs.prod.js'
|
|
3716
3684
|
/* webpackChunkName: "quick-access" */
|
|
3717
3685
|
); });
|
|
3718
3686
|
});
|
|
@@ -3809,6 +3777,51 @@ var QuickAccessTrigger = function QuickAccessTrigger(props) {
|
|
|
3809
3777
|
QuickAccessTrigger.propTypes = {};
|
|
3810
3778
|
QuickAccessTrigger.displayName = 'QuickAccessTrigger';
|
|
3811
3779
|
|
|
3780
|
+
/**
|
|
3781
|
+
* Get the "real" Merchant Center frontend URL to redirect the user
|
|
3782
|
+
* to the login page.
|
|
3783
|
+
* We use an explicit full URL so that if a user tries to access the
|
|
3784
|
+
* Custom Applications directly to its domain, it will always redirect
|
|
3785
|
+
* the user to the login page.
|
|
3786
|
+
*
|
|
3787
|
+
* To determine the "real" URL, we need to check if the current location
|
|
3788
|
+
* is a Merchant Center domain, or if it's a custom user domain.
|
|
3789
|
+
* For the latter, we can derive the URL from the Merchant Center API URL.
|
|
3790
|
+
*
|
|
3791
|
+
* A Merchant Center hostname is composed by the following parts:
|
|
3792
|
+
* https://<mc-prefix>.<region>.<provider>.<ct-domain>.<tld>
|
|
3793
|
+
* We neeed to check if at least the first 4 parts (right-to-left) are
|
|
3794
|
+
* the same.
|
|
3795
|
+
*/
|
|
3796
|
+
function getMcOrigin(mcApiUrl) {
|
|
3797
|
+
var _context, _context2;
|
|
3798
|
+
|
|
3799
|
+
var actualWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
|
|
3800
|
+
var mcApiUrlObject = new _URL__default["default"](mcApiUrl);
|
|
3801
|
+
|
|
3802
|
+
var _mcApiUrlObject$hostn = _reverseInstanceProperty__default["default"](_context = mcApiUrlObject.hostname.split('.')).call(_context),
|
|
3803
|
+
_mcApiUrlObject$hostn2 = _slicedToArray(_mcApiUrlObject$hostn, 4),
|
|
3804
|
+
tldMcApi = _mcApiUrlObject$hostn2[0],
|
|
3805
|
+
ctDomainMcApi = _mcApiUrlObject$hostn2[1],
|
|
3806
|
+
providerMcApi = _mcApiUrlObject$hostn2[2],
|
|
3807
|
+
regionMcApi = _mcApiUrlObject$hostn2[3];
|
|
3808
|
+
|
|
3809
|
+
var _actualWindow$locatio = _reverseInstanceProperty__default["default"](_context2 = actualWindow.location.hostname.split('.')).call(_context2),
|
|
3810
|
+
_actualWindow$locatio2 = _slicedToArray(_actualWindow$locatio, 4),
|
|
3811
|
+
tldMc = _actualWindow$locatio2[0],
|
|
3812
|
+
ctDomainMc = _actualWindow$locatio2[1],
|
|
3813
|
+
providerMc = _actualWindow$locatio2[2],
|
|
3814
|
+
regionMc = _actualWindow$locatio2[3];
|
|
3815
|
+
|
|
3816
|
+
var isMatching = tldMcApi === tldMc && ctDomainMcApi === ctDomainMc && providerMcApi === providerMc && regionMcApi === regionMc;
|
|
3817
|
+
|
|
3818
|
+
if (isMatching) {
|
|
3819
|
+
return actualWindow.location.origin;
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3822
|
+
return mcApiUrlObject.origin.replace('mc-api', 'mc');
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3812
3825
|
var generateAndCacheNonceWithState = function generateAndCacheNonceWithState(state) {
|
|
3813
3826
|
var nonce = uuid.v4(); // We store additional information within the given `nonce`
|
|
3814
3827
|
// to then retrieve it later when the IdP redirects back
|
|
@@ -3825,6 +3838,7 @@ var RedirectToLogin = function RedirectToLogin() {
|
|
|
3825
3838
|
var _window$app$__DEVELOP, _window$app$__DEVELOP2;
|
|
3826
3839
|
|
|
3827
3840
|
var location = reactRouterDom.useLocation();
|
|
3841
|
+
var servedByProxy = applicationEntryPoint.useIsServedByProxy();
|
|
3828
3842
|
|
|
3829
3843
|
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) {
|
|
3830
3844
|
var _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6, _window$app$__DEVELOP7, _window$app$__DEVELOP8;
|
|
@@ -3850,7 +3864,7 @@ var RedirectToLogin = function RedirectToLogin() {
|
|
|
3850
3864
|
redirectTo: nextProjectKey ? "/".concat(nextProjectKey) : '/'
|
|
3851
3865
|
}
|
|
3852
3866
|
});
|
|
3853
|
-
var requestedScope = buildOidcScope({
|
|
3867
|
+
var requestedScope = oidc.buildOidcScope({
|
|
3854
3868
|
projectKey: nextProjectKey !== null && nextProjectKey !== void 0 ? nextProjectKey : undefined,
|
|
3855
3869
|
oAuthScopes: (_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP3 === void 0 ? void 0 : (_window$app$__DEVELOP4 = _window$app$__DEVELOP3.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.oAuthScopes,
|
|
3856
3870
|
teamId: (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : (_window$app$__DEVELOP6 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP6 === void 0 ? void 0 : _window$app$__DEVELOP6.teamId
|
|
@@ -3864,10 +3878,10 @@ var RedirectToLogin = function RedirectToLogin() {
|
|
|
3864
3878
|
origin: (_window$app$__DEVELOP7 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP7 === void 0 ? void 0 : (_window$app$__DEVELOP8 = _window$app$__DEVELOP7.oidc) === null || _window$app$__DEVELOP8 === void 0 ? void 0 : _window$app$__DEVELOP8.authorizeUrl,
|
|
3865
3879
|
location: location,
|
|
3866
3880
|
queryParams: {
|
|
3867
|
-
reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
|
|
3881
|
+
reason: constants$1.LOGOUT_REASONS.UNAUTHORIZED,
|
|
3868
3882
|
// Query parameters for OIDC-lik workflow.
|
|
3869
3883
|
client_id: window.app.applicationId,
|
|
3870
|
-
response_type:
|
|
3884
|
+
response_type: constants.OIDC_RESPONSE_TYPES.ID_TOKEN,
|
|
3871
3885
|
scope: requestedScope,
|
|
3872
3886
|
state: sessionId,
|
|
3873
3887
|
nonce: sessionId
|
|
@@ -3875,11 +3889,13 @@ var RedirectToLogin = function RedirectToLogin() {
|
|
|
3875
3889
|
});
|
|
3876
3890
|
}
|
|
3877
3891
|
|
|
3892
|
+
var mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
|
|
3878
3893
|
return jsxRuntime.jsx(Redirector, {
|
|
3879
3894
|
to: "login",
|
|
3895
|
+
origin: mcOrigin,
|
|
3880
3896
|
location: location,
|
|
3881
3897
|
queryParams: {
|
|
3882
|
-
reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
|
|
3898
|
+
reason: constants$1.LOGOUT_REASONS.UNAUTHORIZED,
|
|
3883
3899
|
redirectTo: urlUtils.trimLeadingAndTrailingSlashes(urlUtils.joinPaths(window.location.origin, location.pathname))
|
|
3884
3900
|
}
|
|
3885
3901
|
});
|
|
@@ -3897,9 +3913,7 @@ var RedirectToLogout = function RedirectToLogout(props) {
|
|
|
3897
3913
|
var _window$app$__DEVELOP, _window$app$__DEVELOP2, _props$reason;
|
|
3898
3914
|
|
|
3899
3915
|
var location = reactRouterDom.useLocation();
|
|
3900
|
-
var servedByProxy =
|
|
3901
|
-
return context.environment.servedByProxy;
|
|
3902
|
-
});
|
|
3916
|
+
var servedByProxy = applicationEntryPoint.useIsServedByProxy();
|
|
3903
3917
|
|
|
3904
3918
|
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) {
|
|
3905
3919
|
// Remove the `sessionToken` from storage, so that the AppShell can initiate
|
|
@@ -3908,11 +3922,13 @@ var RedirectToLogout = function RedirectToLogout(props) {
|
|
|
3908
3922
|
return jsxRuntime.jsx(RedirectToLogin, {});
|
|
3909
3923
|
}
|
|
3910
3924
|
|
|
3925
|
+
var mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
|
|
3911
3926
|
return jsxRuntime.jsx(Redirector, {
|
|
3912
3927
|
to: "logout",
|
|
3928
|
+
origin: mcOrigin,
|
|
3913
3929
|
location: location,
|
|
3914
3930
|
queryParams: _objectSpread$1({
|
|
3915
|
-
reason: (_props$reason = props.reason) !== null && _props$reason !== void 0 ? _props$reason : constants.LOGOUT_REASONS.USER
|
|
3931
|
+
reason: (_props$reason = props.reason) !== null && _props$reason !== void 0 ? _props$reason : constants$1.LOGOUT_REASONS.USER
|
|
3916
3932
|
}, servedByProxy ? {} : {
|
|
3917
3933
|
// This will be used after being logged in, to redirect to this location.
|
|
3918
3934
|
redirectTo: window.location.origin
|
|
@@ -3999,7 +4015,7 @@ var RestrictedApplication = function RestrictedApplication(props) {
|
|
|
3999
4015
|
|
|
4000
4016
|
if (hasUnauthorizedError || hasUserBeenDeletedError) {
|
|
4001
4017
|
var logoutReason;
|
|
4002
|
-
if (hasUnauthorizedError) logoutReason = constants.LOGOUT_REASONS.UNAUTHORIZED;else if (hasUserBeenDeletedError) logoutReason = constants.LOGOUT_REASONS.DELETED;
|
|
4018
|
+
if (hasUnauthorizedError) logoutReason = constants$1.LOGOUT_REASONS.UNAUTHORIZED;else if (hasUserBeenDeletedError) logoutReason = constants$1.LOGOUT_REASONS.DELETED;
|
|
4003
4019
|
return jsxRuntime.jsx(RedirectToLogout, {
|
|
4004
4020
|
reason: logoutReason
|
|
4005
4021
|
});
|
|
@@ -4066,7 +4082,7 @@ var RestrictedApplication = function RestrictedApplication(props) {
|
|
|
4066
4082
|
role: "global-notifications",
|
|
4067
4083
|
css: _ref5,
|
|
4068
4084
|
children: jsxRuntime.jsx(reactNotifications.NotificationsList, {
|
|
4069
|
-
domain: constants.DOMAINS.GLOBAL
|
|
4085
|
+
domain: constants$1.DOMAINS.GLOBAL
|
|
4070
4086
|
})
|
|
4071
4087
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
4072
4088
|
children: function children() {
|
|
@@ -4155,9 +4171,9 @@ var RestrictedApplication = function RestrictedApplication(props) {
|
|
|
4155
4171
|
}) : jsxRuntime.jsxs(MainContainer, {
|
|
4156
4172
|
role: "main",
|
|
4157
4173
|
children: [jsxRuntime.jsx(reactNotifications.NotificationsList, {
|
|
4158
|
-
domain: constants.DOMAINS.PAGE
|
|
4174
|
+
domain: constants$1.DOMAINS.PAGE
|
|
4159
4175
|
}), jsxRuntime.jsx(reactNotifications.NotificationsList, {
|
|
4160
|
-
domain: constants.DOMAINS.SIDE
|
|
4176
|
+
domain: constants$1.DOMAINS.SIDE
|
|
4161
4177
|
}), jsxRuntime.jsxs("div", {
|
|
4162
4178
|
css: _ref2,
|
|
4163
4179
|
children: [jsxRuntime.jsx(applicationComponents.PortalsContainer, {}), jsxRuntime.jsxs(reactRouterDom.Switch, {
|