@commercetools-frontend/application-shell 22.30.3 → 22.31.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-2365588d.esm.js → application-entry-point-44f059a0.esm.js} +3 -3
- package/dist/{application-entry-point-257a1cbc.cjs.prod.js → application-entry-point-654951a6.cjs.prod.js} +2 -2
- package/dist/{application-entry-point-a403a123.cjs.dev.js → application-entry-point-c2f77f23.cjs.dev.js} +3 -3
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +11 -5
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +11 -5
- package/dist/commercetools-frontend-application-shell.esm.js +5 -5
- package/dist/{custom-view-dev-host-2cc66e5d.cjs.dev.js → custom-view-dev-host-1ef244b8.cjs.dev.js} +12 -16
- package/dist/{custom-view-dev-host-e57a61c2.esm.js → custom-view-dev-host-83d6228b.esm.js} +12 -15
- package/dist/{custom-view-dev-host-4e28e0f9.cjs.prod.js → custom-view-dev-host-9469b02c.cjs.prod.js} +12 -16
- package/dist/declarations/src/components/application-page-title/application-page-title.d.ts +16 -0
- package/dist/declarations/src/components/application-shell/application-shell.d.ts +17 -0
- package/dist/declarations/src/components/application-shell-authenticated/application-shell-authenticated.d.ts +4 -0
- package/dist/declarations/src/components/workspaces-navigation-button/index.d.ts +1 -0
- package/dist/declarations/src/components/workspaces-navigation-button/messages.d.ts +8 -0
- package/dist/declarations/src/components/workspaces-navigation-button/workspaces-navigation-button.d.ts +3 -0
- package/dist/declarations/src/configure-store.d.ts +3 -0
- package/dist/declarations/src/hooks/use-routes-creator/use-routes-creator.d.ts +3 -0
- package/dist/declarations/src/index.d.ts +16 -1
- package/dist/declarations/src/types/generated/ctp.d.ts +562 -0
- package/dist/declarations/src/types/generated/mc.d.ts +5 -0
- package/dist/declarations/src/types/generated/proxy.d.ts +3 -0
- package/dist/declarations/src/types/generated/settings.d.ts +22 -0
- package/dist/declarations/src/utils/get-mc-origin/get-mc-origin.d.ts +16 -0
- package/dist/{index-055ebc13.cjs.prod.js → index-91985d64.cjs.prod.js} +2 -2
- package/dist/{index-01054d41.esm.js → index-9475648a.esm.js} +185 -154
- package/dist/{index-ca730730.cjs.dev.js → index-b1476d46.cjs.dev.js} +2 -2
- package/dist/{index-4e5248df.esm.js → index-b6081c20.esm.js} +2 -2
- package/dist/{index-9ad54c23.cjs.dev.js → index-bd1c5108.cjs.dev.js} +190 -153
- package/dist/{index-986cb2e3.cjs.prod.js → index-ff4b1f1e.cjs.prod.js} +175 -144
- package/dist/{navbar-e3ee2a76.esm.js → navbar-18ab9da8.esm.js} +80 -97
- package/dist/{navbar-ced649a9.cjs.prod.js → navbar-32ad8010.cjs.prod.js} +80 -98
- package/dist/{navbar-f981de75.cjs.dev.js → navbar-4068efee.cjs.dev.js} +80 -98
- package/dist/oidc-6c6599a2.cjs.dev.js +98 -0
- package/dist/oidc-8275c04f.esm.js +84 -0
- package/dist/{oidc-callback-64f9a790.cjs.prod.js → oidc-callback-365669c2.cjs.prod.js} +11 -12
- package/dist/{oidc-callback-651f63e0.cjs.dev.js → oidc-callback-910e1e1c.cjs.dev.js} +11 -12
- package/dist/{oidc-callback-bc478925.esm.js → oidc-callback-a622f3a5.esm.js} +11 -12
- package/dist/oidc-d02d4ab8.cjs.prod.js +98 -0
- package/dist/{project-container-7b970853.cjs.prod.js → project-container-4cc1a369.cjs.prod.js} +14 -16
- package/dist/{project-container-7f10329f.cjs.dev.js → project-container-ba49f3db.cjs.dev.js} +14 -16
- package/dist/{project-container-e9061cf4.esm.js → project-container-edb85c22.esm.js} +14 -16
- package/dist/{project-expired-7b154842.cjs.dev.js → project-expired-378bcfb0.cjs.dev.js} +8 -8
- package/dist/{project-expired-08aee9c1.cjs.prod.js → project-expired-59d50031.cjs.prod.js} +8 -8
- package/dist/{project-expired-1cb50976.esm.js → project-expired-ef791516.esm.js} +8 -8
- package/dist/{project-not-found-1b3a3444.cjs.dev.js → project-not-found-543b8e4f.cjs.dev.js} +7 -7
- package/dist/{project-not-found-d1bc7cf2.cjs.prod.js → project-not-found-a7faf93c.cjs.prod.js} +7 -7
- package/dist/{project-not-found-3dc52680.esm.js → project-not-found-bc7cea0c.esm.js} +7 -7
- package/dist/{project-not-initialized-3ca17563.esm.js → project-not-initialized-88376a4a.esm.js} +8 -8
- package/dist/{project-not-initialized-72ca9efb.cjs.dev.js → project-not-initialized-a9c3afa0.cjs.dev.js} +8 -8
- package/dist/{project-not-initialized-f314f99a.cjs.prod.js → project-not-initialized-e9560ddb.cjs.prod.js} +8 -8
- package/dist/{project-suspended-c5ae709a.cjs.prod.js → project-suspended-0686fc53.cjs.prod.js} +7 -7
- package/dist/{project-suspended-f767d4f0.cjs.dev.js → project-suspended-5cc4bc59.cjs.dev.js} +7 -7
- package/dist/{project-suspended-944c20e8.esm.js → project-suspended-8fa0b06e.esm.js} +7 -7
- package/dist/{quick-access-ee9ef366.cjs.dev.js → quick-access-3479fec8.cjs.dev.js} +204 -133
- package/dist/{quick-access-30cee256.esm.js → quick-access-72e35fc8.esm.js} +204 -132
- package/dist/{quick-access-c4f74cba.cjs.prod.js → quick-access-96ea968d.cjs.prod.js} +204 -133
- package/dist/{redirect-to-login-3ebce35d.cjs.dev.js → redirect-to-login-32ebe009.cjs.dev.js} +10 -13
- package/dist/{redirect-to-login-3c5a3f4a.cjs.prod.js → redirect-to-login-60a00442.cjs.prod.js} +10 -13
- package/dist/{redirect-to-login-af9860c8.esm.js → redirect-to-login-b69fb5ce.esm.js} +10 -13
- package/dist/{redirect-to-logout-f3172701.esm.js → redirect-to-logout-4ee944fa.esm.js} +9 -10
- package/dist/{redirect-to-logout-e365ba72.cjs.prod.js → redirect-to-logout-d017b04b.cjs.prod.js} +9 -10
- package/dist/{redirect-to-logout-fff4cb7c.cjs.dev.js → redirect-to-logout-edf8d35c.cjs.dev.js} +9 -10
- package/dist/{redirector-0a16c1d1.cjs.prod.js → redirector-01f35da8.cjs.prod.js} +3 -4
- package/dist/{redirector-d2fd2b5e.esm.js → redirector-76670a54.esm.js} +3 -4
- package/dist/{redirector-e58b9bc3.cjs.dev.js → redirector-98dfc5f0.cjs.dev.js} +3 -4
- package/dist/{requests-in-flight-loader-dd3f8cbb.cjs.dev.js → requests-in-flight-loader-0a78e347.cjs.dev.js} +7 -7
- package/dist/{requests-in-flight-loader-171a2177.cjs.prod.js → requests-in-flight-loader-61257a90.cjs.prod.js} +7 -7
- package/dist/{requests-in-flight-loader-acb4dbaa.esm.js → requests-in-flight-loader-efda7302.esm.js} +7 -7
- package/dist/{service-page-project-switcher-2b3f4d1d.cjs.prod.js → service-page-project-switcher-9310d282.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-6c523761.cjs.dev.js → service-page-project-switcher-ae1cd6fa.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-65755fa9.esm.js → service-page-project-switcher-fb693a35.esm.js} +1 -1
- package/dist/{use-applications-menu-2fe3d465.cjs.dev.js → use-applications-menu-222b9106.cjs.prod.js} +40 -49
- package/dist/{use-applications-menu-0d3f4ffc.cjs.prod.js → use-applications-menu-302a0ac8.cjs.dev.js} +40 -49
- package/dist/{use-applications-menu-03759eab.esm.js → use-applications-menu-b583e9c3.esm.js} +38 -46
- package/dist/{user-settings-menu-bbc43c88.cjs.dev.js → user-settings-menu-7c17f227.cjs.dev.js} +22 -29
- package/dist/{user-settings-menu-3f86267c.cjs.prod.js → user-settings-menu-8bba9f50.cjs.prod.js} +22 -29
- package/dist/{user-settings-menu-36bea559.esm.js → user-settings-menu-ff4a6c63.esm.js} +22 -29
- package/dist/{version-tracker-ab883166.cjs.dev.js → version-tracker-54afa816.cjs.dev.js} +6 -6
- package/dist/{version-tracker-b049fca7.cjs.prod.js → version-tracker-5aea360a.cjs.prod.js} +6 -6
- package/dist/{version-tracker-2ce61357.esm.js → version-tracker-935e29c6.esm.js} +6 -6
- package/package.json +17 -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 +21 -26
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +21 -26
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +16 -20
- package/dist/oidc-63e926e1.cjs.dev.js +0 -115
- package/dist/oidc-cfa56c46.cjs.prod.js +0 -115
- package/dist/oidc-ff53dfd3.esm.js +0 -100
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _pt = require('prop-types');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var reactRouterDom = require('react-router-dom');
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-91985d64.cjs.prod.js');
|
|
7
7
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
8
8
|
var _styled = require('@emotion/styled/base');
|
|
9
9
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
@@ -24,9 +24,8 @@ var constants = require('@commercetools-frontend/constants');
|
|
|
24
24
|
var i18n = require('@commercetools-frontend/i18n');
|
|
25
25
|
var reactNotifications = require('@commercetools-frontend/react-notifications');
|
|
26
26
|
var sentry = require('@commercetools-frontend/sentry');
|
|
27
|
-
var oidc = require('./oidc-
|
|
27
|
+
var oidc = require('./oidc-d02d4ab8.cjs.prod.js');
|
|
28
28
|
require('@babel/runtime-corejs3/core-js-stable/url');
|
|
29
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
30
29
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
31
30
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
32
31
|
var reactIntl = require('react-intl');
|
|
@@ -34,7 +33,6 @@ var FlatButton = require('@commercetools-uikit/flat-button');
|
|
|
34
33
|
var icons = require('@commercetools-uikit/icons');
|
|
35
34
|
var location = require('./location-537e0660.cjs.prod.js');
|
|
36
35
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
37
|
-
var _taggedTemplateLiteral = require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
|
|
38
36
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
39
37
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
40
38
|
var memoize = require('memoize-one');
|
|
@@ -42,6 +40,9 @@ var reactSelect = require('react-select');
|
|
|
42
40
|
var AccessibleHidden = require('@commercetools-uikit/accessible-hidden');
|
|
43
41
|
var SelectInput = require('@commercetools-uikit/select-input');
|
|
44
42
|
var Text = require('@commercetools-uikit/text');
|
|
43
|
+
var reactBroadcast = require('@flopflip/react-broadcast');
|
|
44
|
+
var SecondaryButton = require('@commercetools-uikit/secondary-button');
|
|
45
|
+
var Tooltip = require('@commercetools-uikit/tooltip');
|
|
45
46
|
var CTLogoSVG = require('@commercetools-frontend/assets/images/ct-logo.svg');
|
|
46
47
|
var LoadingSpinner = require('@commercetools-uikit/loading-spinner');
|
|
47
48
|
var history = require('@commercetools-frontend/browser-history');
|
|
@@ -61,7 +62,6 @@ var react$2 = require('@apollo/client/react');
|
|
|
61
62
|
var combineAdapters = require('@flopflip/combine-adapters');
|
|
62
63
|
var httpAdapter = require('@flopflip/http-adapter');
|
|
63
64
|
var ldAdapter = require('@flopflip/launchdarkly-adapter');
|
|
64
|
-
var reactBroadcast = require('@flopflip/react-broadcast');
|
|
65
65
|
var types = require('@flopflip/types');
|
|
66
66
|
var reactRedux = require('react-redux');
|
|
67
67
|
var upperFirst = require('lodash/upperFirst');
|
|
@@ -90,7 +90,6 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
90
90
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
91
91
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
92
92
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
93
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
94
93
|
var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
95
94
|
var FlatButton__default = /*#__PURE__*/_interopDefault(FlatButton);
|
|
96
95
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -98,6 +97,8 @@ var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
|
98
97
|
var AccessibleHidden__default = /*#__PURE__*/_interopDefault(AccessibleHidden);
|
|
99
98
|
var SelectInput__default = /*#__PURE__*/_interopDefault(SelectInput);
|
|
100
99
|
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
100
|
+
var SecondaryButton__default = /*#__PURE__*/_interopDefault(SecondaryButton);
|
|
101
|
+
var Tooltip__default = /*#__PURE__*/_interopDefault(Tooltip);
|
|
101
102
|
var CTLogoSVG__default = /*#__PURE__*/_interopDefault(CTLogoSVG);
|
|
102
103
|
var LoadingSpinner__default = /*#__PURE__*/_interopDefault(LoadingSpinner);
|
|
103
104
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
@@ -116,9 +117,9 @@ var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
|
116
117
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
117
118
|
|
|
118
119
|
// NOTE: This string will be replaced on build time with the package version.
|
|
119
|
-
var applicationShellVersion = "22.
|
|
120
|
+
var applicationShellVersion = "22.31.0";
|
|
120
121
|
|
|
121
|
-
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-
|
|
122
|
+
const RequestsInFlightLoader = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./requests-in-flight-loader-61257a90.cjs.prod.js' /* webpackChunkName: "requests-in-flight-loader" */); }));
|
|
122
123
|
|
|
123
124
|
// Attempt to load the `projectKey` from localStorage
|
|
124
125
|
function selectProjectKeyFromLocalStorage() {
|
|
@@ -132,7 +133,7 @@ const getPreviousProjectKey = defaultProjectKeyOfUser => {
|
|
|
132
133
|
return;
|
|
133
134
|
};
|
|
134
135
|
|
|
135
|
-
var messages$
|
|
136
|
+
var messages$2 = reactIntl.defineMessages({
|
|
136
137
|
backToProjectLink: {
|
|
137
138
|
id: 'AppBar.backToProjectLink',
|
|
138
139
|
defaultMessage: 'Back to project'
|
|
@@ -144,19 +145,25 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
144
145
|
* A full page reload is needed as the user's project may have changed (deletions and/or additions).
|
|
145
146
|
* As a result the project and user queries need refetching.
|
|
146
147
|
*/
|
|
147
|
-
const redirectToProject = key => location.location.replace(
|
|
148
|
+
const redirectToProject = key => location.location.replace(`/${key}`);
|
|
148
149
|
const BackToProject = props => {
|
|
149
150
|
const intl = reactIntl.useIntl();
|
|
150
151
|
return jsxRuntime.jsx(FlatButton__default["default"], {
|
|
151
152
|
onClick: () => redirectToProject(props.projectKey || ''),
|
|
152
153
|
icon: jsxRuntime.jsx(icons.AngleLeftIcon, {}),
|
|
153
|
-
label: intl.formatMessage(messages$
|
|
154
|
+
label: intl.formatMessage(messages$2.backToProjectLink)
|
|
154
155
|
});
|
|
155
156
|
};
|
|
156
157
|
BackToProject.displayName = 'BackToProject';
|
|
157
158
|
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
const animationPulse = react$1.keyframes`
|
|
160
|
+
0% {
|
|
161
|
+
background-color: ${designSystem.customProperties.colorNeutral};
|
|
162
|
+
}
|
|
163
|
+
100% {
|
|
164
|
+
background-color: ${designSystem.customProperties.colorNeutral95};
|
|
165
|
+
}
|
|
166
|
+
`;
|
|
160
167
|
const getWidthBySize = props => {
|
|
161
168
|
switch (props.shape) {
|
|
162
169
|
case 'dot':
|
|
@@ -225,7 +232,7 @@ const LoadingPlaceholder = /*#__PURE__*/_styled__default["default"]("div", {
|
|
|
225
232
|
} )("background-color:", designSystem.customProperties.colorNeutral, ";animation-name:", animationPulse, ";animation-duration:1s;animation-timing-function:ease-out;animation-delay:0;animation-direction:alternate;animation-iteration-count:infinite;width:", getWidthBySize, ";height:", getHeightBySize, ";border-radius:", getRadiusBySize, ";" + ("" ));
|
|
226
233
|
LoadingPlaceholder.displayName = 'LoadingPlaceholder';
|
|
227
234
|
|
|
228
|
-
var messages = reactIntl.defineMessages({
|
|
235
|
+
var messages$1 = reactIntl.defineMessages({
|
|
229
236
|
projectsLabel: {
|
|
230
237
|
id: 'ProjectSwitcher.projectsLabel',
|
|
231
238
|
description: 'The label for project dropdown switcher',
|
|
@@ -276,7 +283,7 @@ const ProjectStampsList = props => jsxRuntime.jsxs(Spacings__default["default"].
|
|
|
276
283
|
daysLeft: props.expiry.daysLeft
|
|
277
284
|
})]
|
|
278
285
|
});
|
|
279
|
-
var _ref$
|
|
286
|
+
var _ref$3 = {
|
|
280
287
|
name: "uyj17t",
|
|
281
288
|
styles: "flex:1;word-wrap:break-word"
|
|
282
289
|
} ;
|
|
@@ -287,7 +294,7 @@ const ProjectSwitcherOption = props => {
|
|
|
287
294
|
scale: "xs",
|
|
288
295
|
justifyContent: "space-between",
|
|
289
296
|
children: [jsxRuntime.jsxs("div", {
|
|
290
|
-
css: _ref$
|
|
297
|
+
css: _ref$3,
|
|
291
298
|
children: [jsxRuntime.jsx(Text__default["default"].Body, {
|
|
292
299
|
fontWeight: "medium",
|
|
293
300
|
tone: props.isDisabled ? 'tertiary' : 'inherit',
|
|
@@ -306,7 +313,7 @@ const ProjectSwitcherOption = props => {
|
|
|
306
313
|
};
|
|
307
314
|
const mapProjectsToOptions = memoize__default["default"](projects => {
|
|
308
315
|
return [{
|
|
309
|
-
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages.projectsLabel)),
|
|
316
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages$1.projectsLabel)),
|
|
310
317
|
options: _mapInstanceProperty__default["default"](projects).call(projects, project => ({
|
|
311
318
|
key: project.key,
|
|
312
319
|
name: project.name,
|
|
@@ -345,7 +352,7 @@ const ProjectSwitcher = props => {
|
|
|
345
352
|
children: [jsxRuntime.jsx(AccessibleHidden__default["default"], {
|
|
346
353
|
children: jsxRuntime.jsx("span", {
|
|
347
354
|
id: PROJECT_SWITCHER_LABEL_ID,
|
|
348
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages.projectsLabel))
|
|
355
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages$1.projectsLabel))
|
|
349
356
|
})
|
|
350
357
|
}), jsxRuntime.jsx(SelectInput__default["default"], {
|
|
351
358
|
value: props.projectKey || '',
|
|
@@ -354,15 +361,14 @@ const ProjectSwitcher = props => {
|
|
|
354
361
|
onChange: event => {
|
|
355
362
|
const selectedProjectKey = event.target.value;
|
|
356
363
|
if (selectedProjectKey !== props.projectKey) {
|
|
357
|
-
|
|
358
|
-
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) {
|
|
364
|
+
if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
|
|
359
365
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(selectedProjectKey);
|
|
360
366
|
}
|
|
361
367
|
|
|
362
368
|
// We simply redirect to a "new" browser page, instead of using the
|
|
363
369
|
// history router. This will simplify a lot of things and avoid possible
|
|
364
370
|
// problems like e.g. resetting the store/state.
|
|
365
|
-
redirectTo(
|
|
371
|
+
redirectTo(`/${selectedProjectKey}`);
|
|
366
372
|
}
|
|
367
373
|
},
|
|
368
374
|
options: data && data.user && mapProjectsToOptions(data.user.projects.results) || [],
|
|
@@ -378,8 +384,8 @@ const ProjectSwitcher = props => {
|
|
|
378
384
|
},
|
|
379
385
|
isClearable: false,
|
|
380
386
|
backspaceRemovesValue: false,
|
|
381
|
-
placeholder: intl.formatMessage(messages.searchPlaceholder),
|
|
382
|
-
noOptionsMessage: () => intl.formatMessage(messages.noResults),
|
|
387
|
+
placeholder: intl.formatMessage(messages$1.searchPlaceholder),
|
|
388
|
+
noOptionsMessage: () => intl.formatMessage(messages$1.noResults),
|
|
383
389
|
horizontalConstraint: 'auto',
|
|
384
390
|
appearance: "quiet",
|
|
385
391
|
maxMenuHeight: 380,
|
|
@@ -393,7 +399,53 @@ ProjectSwitcher.displayName = 'ProjectSwitcher';
|
|
|
393
399
|
// eslint-disable-next-line import/prefer-default-export
|
|
394
400
|
const REQUESTS_IN_FLIGHT_LOADER_DOM_ID = 'loader-for-requests-in-flight';
|
|
395
401
|
|
|
396
|
-
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-
|
|
402
|
+
const UserSettingsMenu = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./user-settings-menu-8bba9f50.cjs.prod.js' /* webpackChunkName: "user-settings-menu" */); }));
|
|
403
|
+
|
|
404
|
+
var messages = reactIntl.defineMessages({
|
|
405
|
+
tooltip: {
|
|
406
|
+
id: 'WorkspacesNavigationButton.tooltip',
|
|
407
|
+
description: 'The tooltip for the Workspaces navigation button',
|
|
408
|
+
defaultMessage: 'Switch between commercetools products'
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
const FEATURE_NAME = 'Workspaces';
|
|
413
|
+
|
|
414
|
+
// TODO: This logo still TBD, placeholder for now
|
|
415
|
+
var _ref$2 = {
|
|
416
|
+
name: "ixn6q",
|
|
417
|
+
styles: "height:22px;width:22px;background-color:lightgray;border-radius:4px"
|
|
418
|
+
} ;
|
|
419
|
+
const WorkspacesLogo = () => {
|
|
420
|
+
return jsxRuntime.jsx("div", {
|
|
421
|
+
css: _ref$2
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
const WorkspacesNavigationButton = () => {
|
|
425
|
+
const _useIntl = reactIntl.useIntl(),
|
|
426
|
+
formatMessage = _useIntl.formatMessage;
|
|
427
|
+
const workspacesAppBarButtonEnabled = reactBroadcast.useFlagVariation(constants.featureFlags.ENABLE_WORKSPACES_UI);
|
|
428
|
+
|
|
429
|
+
// @ts-ignore It's coming from the MC API, it's an object { value: boolean }.
|
|
430
|
+
const isWorkspacesButtonEnabled = workspacesAppBarButtonEnabled?.value;
|
|
431
|
+
if (!isWorkspacesButtonEnabled) return null;
|
|
432
|
+
return jsxRuntime.jsx("div", {
|
|
433
|
+
css: /*#__PURE__*/react$1.css("margin-right:", designSystem.designTokens.spacing60, ";" + ("" ), "" ),
|
|
434
|
+
children: jsxRuntime.jsx("div", {
|
|
435
|
+
css: /*#__PURE__*/react$1.css("a{border-radius:", designSystem.designTokens.borderRadius20, ";}" + ("" ), "" ),
|
|
436
|
+
children: jsxRuntime.jsx(Tooltip__default["default"], {
|
|
437
|
+
placement: "bottom",
|
|
438
|
+
title: formatMessage(messages.tooltip),
|
|
439
|
+
children: jsxRuntime.jsx(SecondaryButton__default["default"], {
|
|
440
|
+
iconLeft: jsxRuntime.jsx(WorkspacesLogo, {}),
|
|
441
|
+
as: reactRouterDom.Link,
|
|
442
|
+
label: FEATURE_NAME,
|
|
443
|
+
to: '/workspaces'
|
|
444
|
+
})
|
|
445
|
+
})
|
|
446
|
+
})
|
|
447
|
+
});
|
|
448
|
+
};
|
|
397
449
|
|
|
398
450
|
var _ref$1 = {
|
|
399
451
|
name: "zjik7",
|
|
@@ -408,8 +460,7 @@ var _ref3$1 = {
|
|
|
408
460
|
styles: "height:22px"
|
|
409
461
|
} ;
|
|
410
462
|
const AppBar = props => {
|
|
411
|
-
|
|
412
|
-
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);
|
|
463
|
+
const previousProjectKey = getPreviousProjectKey(props.user?.defaultProjectKey ?? undefined);
|
|
413
464
|
return jsxRuntime.jsxs("div", {
|
|
414
465
|
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;" + ("" ), "" ),
|
|
415
466
|
"data-test": "top-navigation",
|
|
@@ -434,7 +485,7 @@ const AppBar = props => {
|
|
|
434
485
|
const selectedProject = _findInstanceProperty__default["default"](_context = props.user.projects.results).call(_context, project => project.key === props.projectKeyFromUrl);
|
|
435
486
|
return jsxRuntime.jsxs("div", {
|
|
436
487
|
css: /*#__PURE__*/react$1.css("display:flex;gap:", designSystem.designTokens.spacing20, ";align-items:center;" + ("" ), "" ),
|
|
437
|
-
children: [
|
|
488
|
+
children: [selectedProject?.isProductionProject && jsxRuntime.jsx("div", {
|
|
438
489
|
css: _ref3$1,
|
|
439
490
|
children: jsxRuntime.jsx(applicationComponents.ProjectStamp.IsProduction, {})
|
|
440
491
|
}), jsxRuntime.jsx(ProjectSwitcher
|
|
@@ -466,7 +517,7 @@ const AppBar = props => {
|
|
|
466
517
|
css: _ref$1,
|
|
467
518
|
children: [jsxRuntime.jsx("div", {
|
|
468
519
|
id: oidc.CONTAINERS.LEFT_OF_PROFILE
|
|
469
|
-
}), props.user ? jsxRuntime.jsx(UserSettingsMenu, {
|
|
520
|
+
}), jsxRuntime.jsx(WorkspacesNavigationButton, {}), props.user ? jsxRuntime.jsx(UserSettingsMenu, {
|
|
470
521
|
language: props.user.language,
|
|
471
522
|
firstName: props.user.firstName,
|
|
472
523
|
lastName: props.user.lastName,
|
|
@@ -586,9 +637,9 @@ FetchUser.propTypes = {
|
|
|
586
637
|
};
|
|
587
638
|
FetchUser.displayName = 'FetchUser';
|
|
588
639
|
|
|
589
|
-
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-
|
|
640
|
+
const Navbar = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./navbar-32ad8010.cjs.prod.js' /* webpackChunkName: "navbar" */); }));
|
|
590
641
|
|
|
591
|
-
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-
|
|
642
|
+
const ProjectContainer = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./project-container-4cc1a369.cjs.prod.js' /* webpackChunkName: "project-container" */); }));
|
|
592
643
|
|
|
593
644
|
const getSelectedDataLocaleForProject = projectLocales => {
|
|
594
645
|
const cachedDataLocale = window.localStorage.getItem(constants.STORAGE_KEYS.SELECTED_DATA_LOCALE);
|
|
@@ -700,7 +751,7 @@ var pimIndexerStates = {
|
|
|
700
751
|
NOT_INDEXED: 'NOT_INDEXED'
|
|
701
752
|
};
|
|
702
753
|
|
|
703
|
-
const QuickAccess = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./quick-access-
|
|
754
|
+
const QuickAccess = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./quick-access-96ea968d.cjs.prod.js' /* webpackChunkName: "quick-access" */); }));
|
|
704
755
|
const QuickAccessTrigger = props => {
|
|
705
756
|
const _useState = react.useState(false),
|
|
706
757
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -786,7 +837,7 @@ const QuickAccessTrigger = props => {
|
|
|
786
837
|
QuickAccessTrigger.propTypes = {};
|
|
787
838
|
QuickAccessTrigger.displayName = 'QuickAccessTrigger';
|
|
788
839
|
|
|
789
|
-
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-
|
|
840
|
+
const RedirectToLogout = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-logout-d017b04b.cjs.prod.js' /* webpackChunkName: "redirect-to-logout" */); }));
|
|
790
841
|
|
|
791
842
|
const RedirectToProjectCreate = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-project-create-e4ff7797.cjs.prod.js' /* webpackChunkName: "redirect-to-project-create" */); }));
|
|
792
843
|
|
|
@@ -798,16 +849,15 @@ var AllFeaturesQuery = { kind: "Document", definitions: [{ kind: "OperationDefin
|
|
|
798
849
|
// is no need to be concerned about security.
|
|
799
850
|
const ldClientSideIdProduction = '5979d95f6040390cd07b5e01';
|
|
800
851
|
function getUserContextForLaunchDarklyAdapter(user, projectKey) {
|
|
801
|
-
var _user$launchdarklyTra, _user$launchdarklyTra2, _user$launchdarklyTra3, _user$launchdarklyTra4, _user$launchdarklyTra5;
|
|
802
852
|
return {
|
|
803
853
|
kind: 'user',
|
|
804
|
-
key: user
|
|
805
|
-
project: projectKey
|
|
806
|
-
id:
|
|
807
|
-
team:
|
|
808
|
-
group:
|
|
809
|
-
subgroup:
|
|
810
|
-
cloudEnvironment:
|
|
854
|
+
key: user?.id,
|
|
855
|
+
project: projectKey ?? '',
|
|
856
|
+
id: user?.launchdarklyTrackingId ?? '',
|
|
857
|
+
team: user?.launchdarklyTrackingTeam ?? [],
|
|
858
|
+
group: user?.launchdarklyTrackingGroup ?? '',
|
|
859
|
+
subgroup: user?.launchdarklyTrackingSubgroup ?? '',
|
|
860
|
+
cloudEnvironment: user?.launchdarklyTrackingCloudEnvironment ?? ''
|
|
811
861
|
};
|
|
812
862
|
}
|
|
813
863
|
const parseFlags = fetchedFlags => {
|
|
@@ -839,51 +889,47 @@ const SetupFlopFlipProvider = props => {
|
|
|
839
889
|
}
|
|
840
890
|
}, [enableLongLivedFeatureFlags]);
|
|
841
891
|
const defaultFlags = react.useMemo(() => _objectSpread$7(_objectSpread$7({}, constants.featureFlags.DEFAULT_FLAGS), props.defaultFlags), [props.defaultFlags]);
|
|
842
|
-
const adapterArgs = react.useMemo(() => {
|
|
843
|
-
|
|
844
|
-
|
|
892
|
+
const adapterArgs = react.useMemo(() => ({
|
|
893
|
+
user: {
|
|
894
|
+
key: props.user?.id
|
|
895
|
+
},
|
|
896
|
+
launchdarkly: {
|
|
897
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
898
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.launchdarkly),
|
|
899
|
+
sdk: {
|
|
900
|
+
// Allow to overwrite the client ID, passed via the `additionalEnv` properties
|
|
901
|
+
// of the application config.
|
|
902
|
+
// This is mostly useful for internal usage on our staging environments.
|
|
903
|
+
clientSideId: props.ldClientSideId ?? ldClientSideIdProduction,
|
|
904
|
+
clientOptions: {
|
|
905
|
+
sendEventsOnlyForVariation: true
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
flags,
|
|
909
|
+
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
910
|
+
},
|
|
911
|
+
http: {
|
|
912
|
+
// polling interval set to 15 minutes
|
|
913
|
+
pollingIntervalMs: 1000 * 60 * 15,
|
|
914
|
+
cacheIdentifier: types.cacheIdentifiers.local,
|
|
915
|
+
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
845
916
|
user: {
|
|
846
|
-
key:
|
|
917
|
+
key: props.user?.id
|
|
847
918
|
},
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
clientOptions: {
|
|
857
|
-
sendEventsOnlyForVariation: true
|
|
919
|
+
execute: async adapterArgs => {
|
|
920
|
+
const response = await apolloClient.query({
|
|
921
|
+
query: AllFeaturesQuery,
|
|
922
|
+
errorPolicy: 'ignore',
|
|
923
|
+
fetchPolicy: 'network-only',
|
|
924
|
+
context: {
|
|
925
|
+
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
926
|
+
projectKey: adapterArgs.user?.project
|
|
858
927
|
}
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
context: getUserContextForLaunchDarklyAdapter(props.user, props.projectKey)
|
|
862
|
-
},
|
|
863
|
-
http: {
|
|
864
|
-
// polling interval set to 15 minutes
|
|
865
|
-
pollingIntervalMs: 1000 * 60 * 15,
|
|
866
|
-
cacheIdentifier: types.cacheIdentifiers.local,
|
|
867
|
-
cacheMode: getCacheMode(types.adapterIdentifiers.http),
|
|
868
|
-
user: {
|
|
869
|
-
key: (_props$user2 = props.user) === null || _props$user2 === void 0 ? void 0 : _props$user2.id
|
|
870
|
-
},
|
|
871
|
-
execute: async adapterArgs => {
|
|
872
|
-
var _adapterArgs$user;
|
|
873
|
-
const response = await apolloClient.query({
|
|
874
|
-
query: AllFeaturesQuery,
|
|
875
|
-
errorPolicy: 'ignore',
|
|
876
|
-
fetchPolicy: 'network-only',
|
|
877
|
-
context: {
|
|
878
|
-
target: constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND,
|
|
879
|
-
projectKey: (_adapterArgs$user = adapterArgs.user) === null || _adapterArgs$user === void 0 ? void 0 : _adapterArgs$user.project
|
|
880
|
-
}
|
|
881
|
-
});
|
|
882
|
-
return parseFlags(response.data);
|
|
883
|
-
}
|
|
928
|
+
});
|
|
929
|
+
return parseFlags(response.data);
|
|
884
930
|
}
|
|
885
|
-
}
|
|
886
|
-
}, [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
|
|
931
|
+
}
|
|
932
|
+
}), [apolloClient, flags, props.ldClientSideId, props.projectKey, props.user]);
|
|
887
933
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
888
934
|
adapter: combineAdapters__default["default"],
|
|
889
935
|
adapterArgs: adapterArgs,
|
|
@@ -905,7 +951,7 @@ const ThemeSwitcher = () => {
|
|
|
905
951
|
});
|
|
906
952
|
};
|
|
907
953
|
|
|
908
|
-
const VersionTracker = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./version-tracker-
|
|
954
|
+
const VersionTracker = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./version-tracker-5aea360a.cjs.prod.js' /* webpackChunkName: "version-tracker" */); }));
|
|
909
955
|
|
|
910
956
|
function ownKeys$6(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; }
|
|
911
957
|
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$6(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
@@ -998,7 +1044,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
998
1044
|
user: user,
|
|
999
1045
|
environment: applicationEnvironment,
|
|
1000
1046
|
children: jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
1001
|
-
locale: user
|
|
1047
|
+
locale: user?.language,
|
|
1002
1048
|
applicationMessages: props.applicationMessages,
|
|
1003
1049
|
children: _ref7 => {
|
|
1004
1050
|
let isLoadingLocaleData = _ref7.isLoading,
|
|
@@ -1019,7 +1065,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1019
1065
|
defaultFlags: props.defaultFeatureFlags,
|
|
1020
1066
|
children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1021
1067
|
children: [jsxRuntime.jsx(ThemeSwitcher, {}), jsxRuntime.jsx(VersionTracker, {}), jsxRuntime.jsx(RequestsInFlightLoader, {}), jsxRuntime.jsx(sentry.SentryUserTracker, {
|
|
1022
|
-
user: user
|
|
1068
|
+
user: user ?? undefined
|
|
1023
1069
|
}), jsxRuntime.jsxs("div", {
|
|
1024
1070
|
css: /*#__PURE__*/react$1.css("height:100vh;display:grid;grid-template-rows:auto ", oidc.DIMENSIONS.header, " 1fr;grid-template-columns:min-content 1fr;" + ("" ), "" ),
|
|
1025
1071
|
children: [jsxRuntime.jsxs("div", {
|
|
@@ -1153,8 +1199,8 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1153
1199
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1154
1200
|
exact: true,
|
|
1155
1201
|
path: "/",
|
|
1156
|
-
children: (
|
|
1157
|
-
const previousProjectKey = getPreviousProjectKey(
|
|
1202
|
+
children: (() => {
|
|
1203
|
+
const previousProjectKey = getPreviousProjectKey(user?.defaultProjectKey ?? undefined);
|
|
1158
1204
|
|
|
1159
1205
|
/**
|
|
1160
1206
|
* NOTE:
|
|
@@ -1167,7 +1213,7 @@ const ApplicationShellAuthenticated = props => {
|
|
|
1167
1213
|
if (!user) return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1168
1214
|
if (!previousProjectKey) return jsxRuntime.jsx(RedirectToProjectCreate, {});
|
|
1169
1215
|
return jsxRuntime.jsx(reactRouterDom.Redirect, {
|
|
1170
|
-
to:
|
|
1216
|
+
to: `/${previousProjectKey}`
|
|
1171
1217
|
});
|
|
1172
1218
|
})()
|
|
1173
1219
|
}), jsxRuntime.jsx(reactRouterDom.Route, {
|
|
@@ -1316,37 +1362,31 @@ const withoutProjectKeyClaim = scope => {
|
|
|
1316
1362
|
return _filterInstanceProperty__default["default"](_context = scope.split(' ')).call(_context, claim => !_startsWithInstanceProperty__default["default"](claim).call(claim, oidc.OIDC_CLAIMS.PROJECT_KEY)).join(' ');
|
|
1317
1363
|
};
|
|
1318
1364
|
const hasCachedAuthenticationState = () => {
|
|
1319
|
-
|
|
1320
|
-
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) {
|
|
1365
|
+
if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
|
|
1321
1366
|
try {
|
|
1322
|
-
var _activeProjectKey, _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP10, _window$app$__DEVELOP11;
|
|
1323
1367
|
let activeProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
|
|
1324
1368
|
if (activeProjectKey) {
|
|
1325
|
-
var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4;
|
|
1326
1369
|
// GIVEN The application is not requesting a project key,
|
|
1327
1370
|
// THEN we assume that the application does not need a project context.
|
|
1328
1371
|
// GIVEN The application is not requesting a project key,
|
|
1329
1372
|
// THEN we remove the cached project key.
|
|
1330
1373
|
// This is the case of an application like `account`.
|
|
1331
|
-
if (!
|
|
1374
|
+
if (!window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
|
|
1332
1375
|
applicationShellConnectors.oidcStorage.removeActiveProjectKey();
|
|
1333
1376
|
}
|
|
1334
1377
|
|
|
1335
1378
|
// If the project key we had in the storage does not match the one
|
|
1336
1379
|
// we have in the development config, then we need to discard it and
|
|
1337
1380
|
// use the one from the development config.
|
|
1338
|
-
if (
|
|
1339
|
-
|
|
1340
|
-
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;
|
|
1381
|
+
if (window.app.__DEVELOPMENT__?.oidc?.initialProjectKey && window.app.__DEVELOPMENT__?.oidc?.initialProjectKey !== activeProjectKey) {
|
|
1382
|
+
activeProjectKey = window.app.__DEVELOPMENT__?.oidc?.initialProjectKey;
|
|
1341
1383
|
applicationShellConnectors.oidcStorage.setActiveProjectKey(activeProjectKey);
|
|
1342
1384
|
}
|
|
1343
1385
|
} else {
|
|
1344
|
-
|
|
1345
|
-
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) {
|
|
1346
|
-
var _window$app$__DEVELOP7;
|
|
1386
|
+
if (window.app.__DEVELOPMENT__?.oidc?.initialProjectKey) {
|
|
1347
1387
|
// Here we store the initial project key in local storage,
|
|
1348
1388
|
// so that it gets picked up when we initiate the login flow.
|
|
1349
|
-
applicationShellConnectors.oidcStorage.setActiveProjectKey(
|
|
1389
|
+
applicationShellConnectors.oidcStorage.setActiveProjectKey(window.app.__DEVELOPMENT__?.oidc?.initialProjectKey);
|
|
1350
1390
|
}
|
|
1351
1391
|
}
|
|
1352
1392
|
|
|
@@ -1361,11 +1401,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1361
1401
|
}
|
|
1362
1402
|
// Rebuild the requested OIDC scope to verify that it didn't change.
|
|
1363
1403
|
const requestedScope = oidc.buildOidcScope({
|
|
1364
|
-
projectKey:
|
|
1365
|
-
oAuthScopes:
|
|
1366
|
-
additionalOAuthScopes:
|
|
1367
|
-
teamId:
|
|
1368
|
-
applicationId:
|
|
1404
|
+
projectKey: activeProjectKey ?? undefined,
|
|
1405
|
+
oAuthScopes: window.app.__DEVELOPMENT__?.oidc?.oAuthScopes,
|
|
1406
|
+
additionalOAuthScopes: window.app.__DEVELOPMENT__?.oidc?.additionalOAuthScopes,
|
|
1407
|
+
teamId: window.app.__DEVELOPMENT__?.oidc?.teamId,
|
|
1408
|
+
applicationId: window.app.__DEVELOPMENT__?.oidc?.applicationId
|
|
1369
1409
|
});
|
|
1370
1410
|
// Omit the project key from the check. This allows to switch projects
|
|
1371
1411
|
// without having to log in again.
|
|
@@ -1383,12 +1423,11 @@ const hasCachedAuthenticationState = () => {
|
|
|
1383
1423
|
return window.localStorage.getItem(constants.STORAGE_KEYS.IS_AUTHENTICATED) === 'true';
|
|
1384
1424
|
};
|
|
1385
1425
|
|
|
1386
|
-
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-
|
|
1426
|
+
const OidcCallback = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./oidc-callback-365669c2.cjs.prod.js' /* webpackChunkName: "oidc-callback" */); }));
|
|
1387
1427
|
|
|
1388
1428
|
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; }
|
|
1389
1429
|
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; }
|
|
1390
1430
|
const Authenticated = props => {
|
|
1391
|
-
var _window$app$__DEVELOP;
|
|
1392
1431
|
// We attempt to see if the user was already authenticated by looking
|
|
1393
1432
|
// at the "cached" flag in local storage.
|
|
1394
1433
|
const cachedAuthenticationState = hasCachedAuthenticationState();
|
|
@@ -1402,7 +1441,7 @@ const Authenticated = props => {
|
|
|
1402
1441
|
|
|
1403
1442
|
// When using the OIDC workflow, we always return false, to trigger
|
|
1404
1443
|
// the redirect to the login page.
|
|
1405
|
-
if (
|
|
1444
|
+
if (window.app.__DEVELOPMENT__?.oidc?.authorizeUrl) {
|
|
1406
1445
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1407
1446
|
children: props.render({
|
|
1408
1447
|
isAuthenticated: false
|
|
@@ -1416,13 +1455,13 @@ const Authenticated = props => {
|
|
|
1416
1455
|
Authenticated.displayName = 'Authenticated';
|
|
1417
1456
|
const AuthenticationRoutes = props => jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1418
1457
|
children: [jsxRuntime.jsx(SuspendedRoute, {
|
|
1419
|
-
path:
|
|
1458
|
+
path: `/account/oidc/callback`,
|
|
1420
1459
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1421
1460
|
locale: props.locale,
|
|
1422
1461
|
applicationMessages: props.applicationMessages
|
|
1423
1462
|
})
|
|
1424
1463
|
}), jsxRuntime.jsx(SuspendedRoute, {
|
|
1425
|
-
path:
|
|
1464
|
+
path: `/:projectKey/:identifier/oidc/callback`,
|
|
1426
1465
|
children: jsxRuntime.jsx(OidcCallback, {
|
|
1427
1466
|
locale: props.locale,
|
|
1428
1467
|
applicationMessages: props.applicationMessages
|
|
@@ -1478,10 +1517,7 @@ const useCoercedEnvironmentValues = environment => {
|
|
|
1478
1517
|
};
|
|
1479
1518
|
|
|
1480
1519
|
const ApplicationShellProvider = props => {
|
|
1481
|
-
const apolloClient = react.useMemo(() =>
|
|
1482
|
-
var _props$apolloClient;
|
|
1483
|
-
return (_props$apolloClient = props.apolloClient) !== null && _props$apolloClient !== void 0 ? _props$apolloClient : applicationShellConnectors.createApolloClient();
|
|
1484
|
-
}, [props.apolloClient]);
|
|
1520
|
+
const apolloClient = react.useMemo(() => props.apolloClient ?? applicationShellConnectors.createApolloClient(), [props.apolloClient]);
|
|
1485
1521
|
react.useEffect(() => {
|
|
1486
1522
|
applicationShellConnectors.setCachedApolloClient(apolloClient);
|
|
1487
1523
|
}, [apolloClient]);
|
|
@@ -1533,7 +1569,7 @@ const ApplicationShellProvider = props => {
|
|
|
1533
1569
|
ApplicationShellProvider.propTypes = {};
|
|
1534
1570
|
ApplicationShellProvider.displayName = 'ApplicationShellProvider';
|
|
1535
1571
|
|
|
1536
|
-
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-
|
|
1572
|
+
const RedirectToLogin = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./redirect-to-login-60a00442.cjs.prod.js' /* webpackChunkName: "redirect-to-login" */); }));
|
|
1537
1573
|
|
|
1538
1574
|
const styles = {
|
|
1539
1575
|
name: "gx7yk8",
|
|
@@ -1557,8 +1593,7 @@ const StrictModeEnablement$1 = props => {
|
|
|
1557
1593
|
StrictModeEnablement$1.propTypes = {};
|
|
1558
1594
|
const ApplicationShell = props => {
|
|
1559
1595
|
react.useEffect(() => {
|
|
1560
|
-
|
|
1561
|
-
(_props$onRegisterErro = props.onRegisterErrorListeners) === null || _props$onRegisterErro === void 0 || _props$onRegisterErro.call(props, {
|
|
1596
|
+
props.onRegisterErrorListeners?.({
|
|
1562
1597
|
dispatch: index.internalReduxStore.dispatch
|
|
1563
1598
|
});
|
|
1564
1599
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1599,18 +1634,14 @@ ApplicationShell.propTypes = {};
|
|
|
1599
1634
|
ApplicationShell.displayName = 'ApplicationShell';
|
|
1600
1635
|
ApplicationShell.version = applicationShellVersion;
|
|
1601
1636
|
|
|
1602
|
-
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-
|
|
1637
|
+
const CustomViewDevHost = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./custom-view-dev-host-9469b02c.cjs.prod.js' /* webpackChunkName: "custom-view-dev-host" */); }));
|
|
1603
1638
|
|
|
1604
1639
|
function CustomViewFlopFlipProvider(props) {
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
key: (_props$user = props.user) === null || _props$user === void 0 ? void 0 : _props$user.id
|
|
1611
|
-
}
|
|
1612
|
-
};
|
|
1613
|
-
}, [(_props$user2 = props.user) === null || _props$user2 === void 0 ? void 0 : _props$user2.id]);
|
|
1640
|
+
const adapterArgs = react.useMemo(() => ({
|
|
1641
|
+
user: {
|
|
1642
|
+
key: props.user?.id
|
|
1643
|
+
}
|
|
1644
|
+
}), [props.user?.id]);
|
|
1614
1645
|
return jsxRuntime.jsx(reactBroadcast.ConfigureFlopFlip, {
|
|
1615
1646
|
adapter: memoryAdapter__default["default"],
|
|
1616
1647
|
defaultFlags: _flagsInstanceProperty__default["default"](props),
|
|
@@ -1648,7 +1679,7 @@ function CustomViewShellAuthenticated(props) {
|
|
|
1648
1679
|
return jsxRuntime.jsx(ApplicationLoader, {});
|
|
1649
1680
|
}
|
|
1650
1681
|
return jsxRuntime.jsx(i18n.AsyncLocaleData, {
|
|
1651
|
-
locale:
|
|
1682
|
+
locale: user?.language || browserLocale,
|
|
1652
1683
|
applicationMessages: props.messages,
|
|
1653
1684
|
children: _ref2 => {
|
|
1654
1685
|
let isLoadingLocaleData = _ref2.isLoading,
|
|
@@ -1712,15 +1743,15 @@ CustomViewShellAuthenticated.propTypes = {};
|
|
|
1712
1743
|
const customViewsThemesOverrides = {
|
|
1713
1744
|
default: {
|
|
1714
1745
|
marginForCustomViewsSelectorAsTabular: '0',
|
|
1715
|
-
marginForPageContent:
|
|
1716
|
-
paddingForDetailPageHeader:
|
|
1746
|
+
marginForPageContent: `${designSystem.designTokens.spacing50} 0`,
|
|
1747
|
+
paddingForDetailPageHeader: `0 0 ${designSystem.designTokens.spacing40} 0`,
|
|
1717
1748
|
paddingForMainPageHeader: '0',
|
|
1718
1749
|
paddingForTabularPageHeader: '0'
|
|
1719
1750
|
}
|
|
1720
1751
|
};
|
|
1721
1752
|
|
|
1722
1753
|
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; }
|
|
1723
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1754
|
+
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; }
|
|
1724
1755
|
const browserLocale = getBrowserLocale(window);
|
|
1725
1756
|
function NotificationsContainer(props) {
|
|
1726
1757
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1779,7 +1810,6 @@ function CustomViewThemeProvider() {
|
|
|
1779
1810
|
*/
|
|
1780
1811
|
const isLocalProdMode = window.app.env === 'development';
|
|
1781
1812
|
function CustomViewShell(props) {
|
|
1782
|
-
var _window$app$__DEVELOP;
|
|
1783
1813
|
const _useState = react.useState(),
|
|
1784
1814
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1785
1815
|
hostContext = _useState2[0],
|
|
@@ -1795,21 +1825,20 @@ function CustomViewShell(props) {
|
|
|
1795
1825
|
if (event.data.eventName === constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_INITIALIZATION) {
|
|
1796
1826
|
setHostContext(event.data.eventData.context);
|
|
1797
1827
|
} else {
|
|
1798
|
-
console.warn(
|
|
1828
|
+
console.warn(`CustomViewShell: Unknown received event with name: ${event.data.eventName}`, {
|
|
1799
1829
|
event
|
|
1800
1830
|
});
|
|
1801
1831
|
}
|
|
1802
1832
|
}, []);
|
|
1803
1833
|
const handleClose = react.useCallback(() => {
|
|
1804
|
-
|
|
1805
|
-
(_iFrameCommunicationP = iFrameCommunicationPort.current) === null || _iFrameCommunicationP === void 0 || _iFrameCommunicationP.postMessage({
|
|
1834
|
+
iFrameCommunicationPort.current?.postMessage({
|
|
1806
1835
|
origin: window.location.origin,
|
|
1807
|
-
source:
|
|
1836
|
+
source: `${constants.CUSTOM_VIEWS_EVENTS_META.CUSTOM_VIEW_KEY_PREFIX}${hostContext?.customViewConfig.id}`,
|
|
1808
1837
|
destination: constants.CUSTOM_VIEWS_EVENTS_META.HOST_APPLICATION_CODE,
|
|
1809
1838
|
eventName: constants.CUSTOM_VIEWS_EVENTS_NAMES.CUSTOM_VIEW_CLOSE,
|
|
1810
1839
|
eventData: {}
|
|
1811
1840
|
});
|
|
1812
|
-
}, [hostContext
|
|
1841
|
+
}, [hostContext?.customViewConfig.id]);
|
|
1813
1842
|
react.useEffect(() => {
|
|
1814
1843
|
const bootstrapMessageHandler = event => {
|
|
1815
1844
|
if ((event.origin === window.location.origin ||
|
|
@@ -1834,8 +1863,7 @@ function CustomViewShell(props) {
|
|
|
1834
1863
|
react.useEffect(() => {
|
|
1835
1864
|
// Close the channel when the component unmounts
|
|
1836
1865
|
return () => {
|
|
1837
|
-
|
|
1838
|
-
(_iFrameCommunicationP2 = iFrameCommunicationPort.current) === null || _iFrameCommunicationP2 === void 0 || _iFrameCommunicationP2.close();
|
|
1866
|
+
iFrameCommunicationPort.current?.close();
|
|
1839
1867
|
iFrameCommunicationPort.current = undefined;
|
|
1840
1868
|
};
|
|
1841
1869
|
}, []);
|
|
@@ -1844,7 +1872,7 @@ function CustomViewShell(props) {
|
|
|
1844
1872
|
showLogo: true
|
|
1845
1873
|
});
|
|
1846
1874
|
}
|
|
1847
|
-
const hostUrl = isLocalProdMode ?
|
|
1875
|
+
const hostUrl = isLocalProdMode ? window.app.__DEVELOPMENT__?.customViewHostUrl : hostContext.hostUrl;
|
|
1848
1876
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1849
1877
|
children: [jsxRuntime.jsx(GlobalStyles, {}), jsxRuntime.jsx(ApplicationShellProvider, {
|
|
1850
1878
|
environment: window.app,
|
|
@@ -1853,7 +1881,6 @@ function CustomViewShell(props) {
|
|
|
1853
1881
|
children: _ref => {
|
|
1854
1882
|
let isAuthenticated = _ref.isAuthenticated;
|
|
1855
1883
|
if (isAuthenticated) {
|
|
1856
|
-
var _context2;
|
|
1857
1884
|
return jsxRuntime.jsx(applicationShellConnectors.CustomViewContextProvider, {
|
|
1858
1885
|
hostUrl: hostUrl,
|
|
1859
1886
|
customViewConfig: hostContext.customViewConfig,
|
|
@@ -1872,7 +1899,7 @@ function CustomViewShell(props) {
|
|
|
1872
1899
|
notificationsGlobalRef: notificationsGlobalRef,
|
|
1873
1900
|
notificationsPageRef: notificationsPageRef
|
|
1874
1901
|
}), jsxRuntime.jsxs(reactRouterDom.Route, {
|
|
1875
|
-
path:
|
|
1902
|
+
path: `/custom-views/${hostContext.customViewConfig.id}/projects/${hostContext.projectKey}`,
|
|
1876
1903
|
children: [jsxRuntime.jsx(applicationComponents.ModalPageTopBar, {
|
|
1877
1904
|
onClose: handleClose,
|
|
1878
1905
|
hidePathLabel: true
|
|
@@ -2016,7 +2043,7 @@ function setupGlobalErrorListener() {
|
|
|
2016
2043
|
}
|
|
2017
2044
|
|
|
2018
2045
|
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; }
|
|
2019
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
2046
|
+
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; }
|
|
2020
2047
|
|
|
2021
2048
|
/**
|
|
2022
2049
|
* The route path to match. Usually it starts with `/:projectKey/my-entry-point`.
|
|
@@ -2026,8 +2053,7 @@ const makeRoute = (routePath, routeOptions) => {
|
|
|
2026
2053
|
const getUrl = (nextParams, nextQueryParams) => {
|
|
2027
2054
|
const baseUrl = reactRouterDom.generatePath(routePath, _objectSpread(_objectSpread({}, routeOptions.params), nextParams));
|
|
2028
2055
|
if (nextQueryParams) {
|
|
2029
|
-
|
|
2030
|
-
return _concatInstanceProperty__default["default"](_context = "".concat(baseUrl, "?")).call(_context, nextQueryParams.toString());
|
|
2056
|
+
return `${baseUrl}?${nextQueryParams.toString()}`;
|
|
2031
2057
|
}
|
|
2032
2058
|
return baseUrl;
|
|
2033
2059
|
};
|
|
@@ -2063,17 +2089,22 @@ exports.ApplicationShellProvider = ApplicationShellProvider;
|
|
|
2063
2089
|
exports.ButlerContainer = ButlerContainer;
|
|
2064
2090
|
exports.ConfigureIntlProvider = ConfigureIntlProvider;
|
|
2065
2091
|
exports.CustomViewShellWrapper = CustomViewShellWrapper;
|
|
2092
|
+
exports.ErrorApologizer = ErrorApologizer;
|
|
2066
2093
|
exports.ErrorBoundary = ErrorBoundary;
|
|
2067
2094
|
exports.FetchProject = FetchProject;
|
|
2095
|
+
exports.FetchUser = FetchUser;
|
|
2068
2096
|
exports.InjectReducers = InjectReducers;
|
|
2069
2097
|
exports.ProjectDataLocale = ProjectDataLocale;
|
|
2070
2098
|
exports.ProjectSwitcher = ProjectSwitcher;
|
|
2071
2099
|
exports.REQUESTS_IN_FLIGHT_LOADER_DOM_ID = REQUESTS_IN_FLIGHT_LOADER_DOM_ID;
|
|
2072
2100
|
exports.RedirectToLogin = RedirectToLogin;
|
|
2101
|
+
exports.RedirectToLogout = RedirectToLogout;
|
|
2073
2102
|
exports.RedirectToProjectCreate = RedirectToProjectCreate;
|
|
2074
2103
|
exports.SetupFlopFlipProvider = SetupFlopFlipProvider;
|
|
2075
2104
|
exports.SuspendedRoute = SuspendedRoute;
|
|
2076
2105
|
exports.applicationShellVersion = applicationShellVersion;
|
|
2106
|
+
exports.getBrowserLocale = getBrowserLocale;
|
|
2107
|
+
exports.getPreviousProjectKey = getPreviousProjectKey;
|
|
2077
2108
|
exports.pimIndexerStates = pimIndexerStates;
|
|
2078
2109
|
exports.setupGlobalErrorListener = setupGlobalErrorListener;
|
|
2079
2110
|
exports.useRoutesCreator = useRoutesCreator;
|