@commercetools-frontend/application-shell 24.9.0 → 24.11.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/commercetools-frontend-application-shell.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-application-shell.esm.js +1 -1
- package/dist/{custom-view-dev-host-2064254e.cjs.prod.js → custom-view-dev-host-3a171a01.cjs.prod.js} +1 -1
- package/dist/{custom-view-dev-host-4e061690.cjs.dev.js → custom-view-dev-host-40b33836.cjs.dev.js} +1 -1
- package/dist/{custom-view-dev-host-3ee6e935.esm.js → custom-view-dev-host-6091b78a.esm.js} +1 -1
- package/dist/declarations-connectors/src/index.d.ts +1 -1
- package/dist/declarations-connectors/src/utils/index.d.ts +1 -0
- package/dist/declarations-connectors/src/utils/select-user-language-from-storage/index.d.ts +1 -0
- package/dist/declarations-connectors/src/utils/select-user-language-from-storage/select-user-language-from-storage.d.ts +1 -0
- package/dist/{index-349ad66e.esm.js → index-67a5d8e8.esm.js} +32 -24
- package/dist/{index-d0acb02b.cjs.prod.js → index-7bdde97c.cjs.prod.js} +25 -17
- package/dist/{index-14c2e02e.cjs.dev.js → index-a57c8458.cjs.dev.js} +31 -23
- package/dist/{oidc-callback-b49a29e8.esm.js → oidc-callback-5f3d5280.esm.js} +1 -1
- package/dist/{oidc-callback-8264660f.cjs.prod.js → oidc-callback-ce8cbdfe.cjs.prod.js} +1 -1
- package/dist/{oidc-callback-3316c0a9.cjs.dev.js → oidc-callback-e07f0c20.cjs.dev.js} +1 -1
- package/dist/{project-container-d53901f3.cjs.prod.js → project-container-2d3d027a.cjs.prod.js} +5 -5
- package/dist/{project-container-b0392a96.cjs.dev.js → project-container-a11a31ca.cjs.dev.js} +5 -5
- package/dist/{project-container-30eacb34.esm.js → project-container-fba09841.esm.js} +5 -5
- package/dist/{project-expired-c7bf35b8.cjs.dev.js → project-expired-9620dee4.cjs.dev.js} +2 -2
- package/dist/{project-expired-bba9e9c4.esm.js → project-expired-ede4d485.esm.js} +2 -2
- package/dist/{project-expired-48bc7056.cjs.prod.js → project-expired-f38a712a.cjs.prod.js} +2 -2
- package/dist/{project-not-found-3919079a.cjs.dev.js → project-not-found-05683f8e.cjs.dev.js} +2 -2
- package/dist/{project-not-found-3f07cd64.esm.js → project-not-found-093ab795.esm.js} +2 -2
- package/dist/{project-not-found-145f8f8e.cjs.prod.js → project-not-found-cfa934da.cjs.prod.js} +2 -2
- package/dist/{project-not-initialized-41963bb6.esm.js → project-not-initialized-1d934ae7.esm.js} +2 -2
- package/dist/{project-not-initialized-71ca74cc.cjs.dev.js → project-not-initialized-1ed56a00.cjs.dev.js} +2 -2
- package/dist/{project-not-initialized-a2befb74.cjs.prod.js → project-not-initialized-b5a1400f.cjs.prod.js} +2 -2
- package/dist/{project-suspended-4e4cf6d9.cjs.dev.js → project-suspended-68e80299.cjs.dev.js} +2 -2
- package/dist/{project-suspended-bd6327f7.cjs.prod.js → project-suspended-8e15a452.cjs.prod.js} +2 -2
- package/dist/{project-suspended-36cbc426.esm.js → project-suspended-e0722654.esm.js} +2 -2
- package/dist/{quick-access-8e9d5474.cjs.prod.js → quick-access-9dd197bb.cjs.prod.js} +1 -1
- package/dist/{quick-access-3749a882.cjs.dev.js → quick-access-a665bbb7.cjs.dev.js} +1 -1
- package/dist/{quick-access-eab4e656.esm.js → quick-access-dfc1f8a9.esm.js} +1 -1
- package/dist/{redirect-to-logout-bdefd5b2.cjs.prod.js → redirect-to-logout-2802852c.cjs.prod.js} +1 -1
- package/dist/{redirect-to-logout-f6418762.esm.js → redirect-to-logout-5db48f16.esm.js} +1 -1
- package/dist/{redirect-to-logout-7fa8b198.cjs.dev.js → redirect-to-logout-74b72fe8.cjs.dev.js} +1 -1
- package/dist/{requests-in-flight-loader-243d6048.cjs.prod.js → requests-in-flight-loader-877c1541.cjs.prod.js} +1 -1
- package/dist/{requests-in-flight-loader-94749d43.cjs.dev.js → requests-in-flight-loader-bc904171.cjs.dev.js} +1 -1
- package/dist/{requests-in-flight-loader-1828040f.esm.js → requests-in-flight-loader-e25f4c31.esm.js} +1 -1
- package/dist/{service-page-project-switcher-ca066340.cjs.prod.js → service-page-project-switcher-1dad9871.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-2caf1334.cjs.dev.js → service-page-project-switcher-af044ac6.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-499fa45d.esm.js → service-page-project-switcher-f3eac18a.esm.js} +1 -1
- package/package.json +22 -22
|
@@ -105,9 +105,9 @@ var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
|
105
105
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
106
106
|
|
|
107
107
|
// NOTE: This string will be replaced on build time with the package version.
|
|
108
|
-
var version = "24.
|
|
108
|
+
var version = "24.11.0";
|
|
109
109
|
|
|
110
|
-
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-877c1541.cjs.prod.js' /* webpackChunkName: "requests-in-flight-loader" */); }));
|
|
111
111
|
|
|
112
112
|
// Attempt to load the `projectKey` from localStorage
|
|
113
113
|
function selectProjectKeyFromLocalStorage() {
|
|
@@ -571,7 +571,7 @@ FetchUser.displayName = 'FetchUser';
|
|
|
571
571
|
|
|
572
572
|
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-acc2cd1b.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
|
|
573
573
|
|
|
574
|
-
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-2d3d027a.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
575
575
|
|
|
576
576
|
const getSelectedDataLocaleForProject = projectLocales => {
|
|
577
577
|
const cachedDataLocale = window.localStorage.getItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE);
|
|
@@ -676,7 +676,7 @@ var pimIndexerStates = {
|
|
|
676
676
|
NOT_INDEXED: 'NOT_INDEXED'
|
|
677
677
|
};
|
|
678
678
|
|
|
679
|
-
const QuickAccess = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./quick-access-
|
|
679
|
+
const QuickAccess = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./quick-access-9dd197bb.cjs.prod.js' /* webpackChunkName: "quick-access" */); }));
|
|
680
680
|
const QuickAccessTrigger = props => {
|
|
681
681
|
const _useState = react.useState(false),
|
|
682
682
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -761,7 +761,7 @@ const QuickAccessTrigger = props => {
|
|
|
761
761
|
};
|
|
762
762
|
QuickAccessTrigger.displayName = 'QuickAccessTrigger';
|
|
763
763
|
|
|
764
|
-
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-
|
|
764
|
+
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-2802852c.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
765
765
|
|
|
766
766
|
const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-e4ff7797.cjs.prod.js' /* webpackChunkName: "redirect-to-project-create" */); }));
|
|
767
767
|
|
|
@@ -944,6 +944,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
944
944
|
}
|
|
945
945
|
// Since we do not know the locale of the user, we pick it from the
|
|
946
946
|
// user's browser to attempt to match the language for the correct translations.
|
|
947
|
+
|
|
947
948
|
const userLocale = getBrowserLocale(window);
|
|
948
949
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
949
950
|
locale: userLocale,
|
|
@@ -961,11 +962,18 @@ const ApplicationShellAuthenticated = props => {
|
|
|
961
962
|
});
|
|
962
963
|
}
|
|
963
964
|
const projectKeyFromUrl = applicationShellConnectors.selectProjectKeyFromUrl(location.pathname);
|
|
965
|
+
|
|
966
|
+
// Check if user is ct staff, and if so get language selected via staff bar from local storage
|
|
967
|
+
const staffBarLanguage = user?.launchdarklyTrackingGroup === 'commercetools' || user?.launchdarklyTrackingGroup === 'mailosaur' ? applicationShellConnectors.selectUserLanguageFromStorage() : undefined;
|
|
968
|
+
const normalizedUser = user ? _objectSpread$8(_objectSpread$8({}, user), {}, {
|
|
969
|
+
// set the staff bar language if applicable
|
|
970
|
+
language: staffBarLanguage ?? user.language
|
|
971
|
+
}) : undefined;
|
|
964
972
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
965
|
-
user:
|
|
973
|
+
user: normalizedUser,
|
|
966
974
|
environment: applicationEnvironment,
|
|
967
975
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
968
|
-
locale:
|
|
976
|
+
locale: normalizedUser?.language,
|
|
969
977
|
applicationMessages: props.applicationMessages,
|
|
970
978
|
children: _ref7 => {
|
|
971
979
|
let isLoadingLocaleData = _ref7.isLoading,
|
|
@@ -979,14 +987,14 @@ const ApplicationShellAuthenticated = props => {
|
|
|
979
987
|
messages
|
|
980
988
|
}), {}, {
|
|
981
989
|
children: jsxRuntime.jsx(SetupFlopFlipProvider, {
|
|
982
|
-
user:
|
|
990
|
+
user: normalizedUser,
|
|
983
991
|
projectKey: projectKeyFromUrl,
|
|
984
992
|
ldClientSideId: applicationEnvironment.ldClientSideId,
|
|
985
993
|
flags: props.featureFlags,
|
|
986
994
|
defaultFlags: props.defaultFeatureFlags,
|
|
987
995
|
children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
988
996
|
children: [jsxRuntime.jsx(ThemeSwitcher, {}), jsxRuntime.jsx(RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
|
|
989
|
-
user:
|
|
997
|
+
user: normalizedUser
|
|
990
998
|
}), jsxRuntime.jsxs("div", {
|
|
991
999
|
css: /*#__PURE__*/react$1.css("height:100vh;display:grid;grid-template-rows:auto ", oidc.DIMENSIONS.header, " 1fr;grid-template-columns:min-content 1fr;" + ("" ), "" ),
|
|
992
1000
|
children: [jsxRuntime.jsxs("div", {
|
|
@@ -1019,7 +1027,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1019
1027
|
let dataLocale = _ref9.locale,
|
|
1020
1028
|
setProjectDataLocale = _ref9.setProjectDataLocale;
|
|
1021
1029
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
1022
|
-
user:
|
|
1030
|
+
user: normalizedUser,
|
|
1023
1031
|
project: project,
|
|
1024
1032
|
projectDataLocale: dataLocale,
|
|
1025
1033
|
environment: applicationEnvironment,
|
|
@@ -1035,7 +1043,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1035
1043
|
}), jsxRuntime.jsx("header", {
|
|
1036
1044
|
css: _ref3,
|
|
1037
1045
|
children: jsxRuntime.jsx(AppBar, {
|
|
1038
|
-
user:
|
|
1046
|
+
user: normalizedUser,
|
|
1039
1047
|
projectKeyFromUrl: projectKeyFromUrl
|
|
1040
1048
|
})
|
|
1041
1049
|
}), jsxRuntime.jsx("aside", {
|
|
@@ -1059,7 +1067,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1059
1067
|
project = _ref0.project;
|
|
1060
1068
|
const isLoading = isLoadingUser || isLoadingLocaleData || isLoadingProject || !locale || !project;
|
|
1061
1069
|
return jsxRuntime.jsx(applicationShellConnectors.ApplicationContextProvider, {
|
|
1062
|
-
user:
|
|
1070
|
+
user: normalizedUser,
|
|
1063
1071
|
environment: applicationEnvironment
|
|
1064
1072
|
// NOTE: do not pass the `project` into the application context.
|
|
1065
1073
|
// The permissions for the Navbar are resolved separately, within
|
|
@@ -1123,7 +1131,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1123
1131
|
exact: true,
|
|
1124
1132
|
path: "/",
|
|
1125
1133
|
children: (() => {
|
|
1126
|
-
const previousProjectKey = getPreviousProjectKey(
|
|
1134
|
+
const previousProjectKey = getPreviousProjectKey(normalizedUser?.defaultProjectKey ?? undefined);
|
|
1127
1135
|
|
|
1128
1136
|
/**
|
|
1129
1137
|
* NOTE:
|
|
@@ -1133,7 +1141,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1133
1141
|
* Given the user was working on a project previously or has a default
|
|
1134
1142
|
* project, the application will redirect to that project.
|
|
1135
1143
|
*/
|
|
1136
|
-
if (!
|
|
1144
|
+
if (!normalizedUser) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1137
1145
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
1138
1146
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
1139
1147
|
to: `/${previousProjectKey}`
|
|
@@ -1143,7 +1151,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1143
1151
|
exact: false,
|
|
1144
1152
|
path: "/:projectKey",
|
|
1145
1153
|
children: jsxRuntime.jsx(ProjectContainer, {
|
|
1146
|
-
user:
|
|
1154
|
+
user: normalizedUser,
|
|
1147
1155
|
environment: applicationEnvironment,
|
|
1148
1156
|
disableRoutePermissionCheck: props.disableRoutePermissionCheck
|
|
1149
1157
|
// This effectively renders the
|
|
@@ -1373,7 +1381,7 @@ const hasCachedAuthenticationState = () => {
|
|
|
1373
1381
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1374
1382
|
};
|
|
1375
1383
|
|
|
1376
|
-
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-
|
|
1384
|
+
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-ce8cbdfe.cjs.prod.js' /* webpackChunkName: "oidc-callback" */); }));
|
|
1377
1385
|
|
|
1378
1386
|
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; }
|
|
1379
1387
|
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; }
|
|
@@ -1581,7 +1589,7 @@ const ApplicationShell = props => {
|
|
|
1581
1589
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1582
1590
|
ApplicationShell.version = version;
|
|
1583
1591
|
|
|
1584
|
-
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-
|
|
1592
|
+
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-3a171a01.cjs.prod.js' /* webpackChunkName: "custom-view-dev-host" */); }));
|
|
1585
1593
|
|
|
1586
1594
|
function CustomViewFlopFlipProvider(props) {
|
|
1587
1595
|
const adapterArgs = react.useMemo(() => ({
|