@commercetools-frontend/application-shell 27.10.0 → 27.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/{index-245e2980.cjs.prod.js → application-entry-point-516fd72c.cjs.prod.js} +70 -4
- package/dist/{index-86039df7.esm.js → application-entry-point-e20cafdb.esm.js} +81 -7
- package/dist/{index-614accc4.cjs.dev.js → application-entry-point-e5623556.cjs.dev.js} +80 -4
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +14 -13
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +14 -13
- package/dist/commercetools-frontend-application-shell.esm.js +12 -11
- package/dist/{custom-view-dev-host-c5cae7af.cjs.prod.js → custom-view-dev-host-24cfaf96.cjs.prod.js} +6 -5
- package/dist/{custom-view-dev-host-8925c254.esm.js → custom-view-dev-host-802ebe34.esm.js} +6 -5
- package/dist/{custom-view-dev-host-16c18b8b.cjs.dev.js → custom-view-dev-host-c2b65fe2.cjs.dev.js} +6 -5
- package/dist/declarations/src/types/generated/mc.d.ts +121 -0
- package/dist/declarations-connectors/src/components/application-context/application-context.d.ts +4 -0
- package/dist/declarations-connectors/src/types/generated/mc.d.ts +121 -0
- package/dist/index-177f89cf.esm.js +2075 -0
- package/dist/index-3244236c.cjs.dev.js +2136 -0
- package/dist/{index-ce507805.cjs.prod.js → index-fc58c6bb.cjs.prod.js} +138 -77
- package/dist/{navbar-f4b2552d.cjs.prod.js → navbar-4bc16e7b.cjs.prod.js} +53 -10
- package/dist/{navbar-59504b51.cjs.dev.js → navbar-5c41b7a0.cjs.dev.js} +56 -10
- package/dist/{navbar-9eb6c972.esm.js → navbar-5e436a16.esm.js} +57 -11
- package/dist/{oidc-callback-ec951044.cjs.dev.js → oidc-callback-1c6e8104.cjs.dev.js} +7 -6
- package/dist/{oidc-callback-5b213b4f.cjs.prod.js → oidc-callback-b0d573ac.cjs.prod.js} +7 -6
- package/dist/{oidc-callback-1836d6f9.esm.js → oidc-callback-b409680a.esm.js} +7 -6
- package/dist/{project-container-d44394a1.cjs.prod.js → project-container-4f14fd7c.cjs.prod.js} +12 -13
- package/dist/{project-container-7f13b722.esm.js → project-container-b73d2651.esm.js} +12 -13
- package/dist/{project-container-bd7b1263.cjs.dev.js → project-container-b75269ed.cjs.dev.js} +12 -13
- package/dist/{project-expired-200d21fc.cjs.dev.js → project-expired-1cda3b7e.cjs.dev.js} +8 -7
- package/dist/{project-expired-b0f48929.esm.js → project-expired-cb01ca7d.esm.js} +8 -7
- package/dist/{project-expired-fbd3b921.cjs.prod.js → project-expired-f19a3356.cjs.prod.js} +8 -7
- package/dist/{project-not-found-2c4da477.cjs.prod.js → project-not-found-52441a8a.cjs.prod.js} +8 -7
- package/dist/{project-not-found-6a2f3959.cjs.dev.js → project-not-found-548c0653.cjs.dev.js} +8 -7
- package/dist/{project-not-found-2b48a462.esm.js → project-not-found-69a22191.esm.js} +8 -7
- package/dist/{project-not-initialized-d1532d05.cjs.prod.js → project-not-initialized-6c2babc1.cjs.prod.js} +8 -7
- package/dist/{project-not-initialized-a4cdccae.cjs.dev.js → project-not-initialized-bc2258f1.cjs.dev.js} +8 -7
- package/dist/{project-not-initialized-8324ddc0.esm.js → project-not-initialized-f0168385.esm.js} +8 -7
- package/dist/{project-suspended-0450891d.cjs.prod.js → project-suspended-31c52b75.cjs.prod.js} +8 -7
- package/dist/{project-suspended-42ac696c.cjs.dev.js → project-suspended-6a83941a.cjs.dev.js} +8 -7
- package/dist/{project-suspended-ab7faf16.esm.js → project-suspended-ef485212.esm.js} +8 -7
- package/dist/{redirect-to-login-6675c038.cjs.prod.js → redirect-to-login-18f6e1b8.cjs.prod.js} +1 -1
- package/dist/{redirect-to-login-8a61864c.cjs.dev.js → redirect-to-login-4dbf1c4e.cjs.dev.js} +1 -1
- package/dist/{redirect-to-login-b79d0910.esm.js → redirect-to-login-79be7369.esm.js} +2 -2
- package/dist/{redirect-to-logout-4de14b5d.esm.js → redirect-to-logout-404ac2d3.esm.js} +9 -8
- package/dist/{redirect-to-logout-37258f53.cjs.dev.js → redirect-to-logout-4ccdb9c6.cjs.dev.js} +8 -7
- package/dist/{redirect-to-logout-71e8db26.cjs.prod.js → redirect-to-logout-a42e3df6.cjs.prod.js} +8 -7
- package/dist/{redirect-to-project-create-9249e554.esm.js → redirect-to-project-create-3a88851c.esm.js} +2 -1
- package/dist/{redirect-to-project-create-e4ff7797.cjs.prod.js → redirect-to-project-create-603634dd.cjs.prod.js} +2 -1
- package/dist/{redirect-to-project-create-f4f01842.cjs.dev.js → redirect-to-project-create-611ee583.cjs.dev.js} +2 -1
- package/dist/{requests-in-flight-loader-60a2553f.cjs.dev.js → requests-in-flight-loader-324287e5.cjs.dev.js} +8 -7
- package/dist/{requests-in-flight-loader-b33d695b.cjs.prod.js → requests-in-flight-loader-7cc3150d.cjs.prod.js} +8 -7
- package/dist/{requests-in-flight-loader-dd13291f.esm.js → requests-in-flight-loader-f969e2f0.esm.js} +8 -7
- package/dist/{service-page-project-switcher-70a8155d.cjs.prod.js → service-page-project-switcher-87f8935d.cjs.prod.js} +1 -1
- package/dist/{service-page-project-switcher-db1d0801.esm.js → service-page-project-switcher-a55a912e.esm.js} +1 -1
- package/dist/{service-page-project-switcher-974235d0.cjs.dev.js → service-page-project-switcher-c91f0690.cjs.dev.js} +1 -1
- package/dist/{use-applications-menu-bd718ac8.cjs.dev.js → use-applications-menu-3526c994.cjs.prod.js} +3 -1
- package/dist/{use-applications-menu-8984efa1.cjs.prod.js → use-applications-menu-c36dd4d1.cjs.dev.js} +3 -1
- package/dist/{use-applications-menu-bc2b9a66.esm.js → use-applications-menu-ed43547f.esm.js} +3 -1
- package/dist/{user-settings-menu-2235add2.cjs.prod.js → user-settings-menu-06f023d0.cjs.prod.js} +3 -3
- package/dist/user-settings-menu-5ff9536e.cjs.dev.js +345 -0
- package/dist/user-settings-menu-64158494.esm.js +320 -0
- package/package.json +17 -17
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +6 -6
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +6 -6
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +4 -4
- package/dist/application-entry-point-10a5e1a5.esm.js +0 -82
- package/dist/application-entry-point-8c4b8e53.cjs.prod.js +0 -86
- package/dist/application-entry-point-c87294b0.cjs.dev.js +0 -96
- package/dist/index-ac7ed4f7.esm.js +0 -2014
- package/dist/index-c7140b1c.cjs.dev.js +0 -2075
- package/dist/user-settings-menu-a1d0ba8e.esm.js +0 -320
- package/dist/user-settings-menu-b8359b8b.cjs.dev.js +0 -345
|
@@ -38,11 +38,12 @@ var permissions = require('@commercetools-frontend/permissions');
|
|
|
38
38
|
var InlineSvg = require('@commercetools-uikit/icons/inline-svg');
|
|
39
39
|
var location = require('./location-537e0660.cjs.prod.js');
|
|
40
40
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
41
|
+
var nimbus = require('@commercetools/nimbus');
|
|
41
42
|
var _keysInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/keys');
|
|
42
43
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
43
44
|
var isNil = require('lodash/isNil');
|
|
44
45
|
var throttle = require('lodash/throttle');
|
|
45
|
-
var useApplicationsMenu = require('./use-applications-menu-
|
|
46
|
+
var useApplicationsMenu = require('./use-applications-menu-3526c994.cjs.prod.js');
|
|
46
47
|
require('@apollo/client');
|
|
47
48
|
require('@commercetools-frontend/l10n');
|
|
48
49
|
|
|
@@ -213,6 +214,10 @@ var messages = reactIntl.defineMessages({
|
|
|
213
214
|
'NavBar.MenuExpander.expandMenu': {
|
|
214
215
|
id: 'NavBar.MenuExpander.expandMenu',
|
|
215
216
|
defaultMessage: 'Expand menu'
|
|
217
|
+
},
|
|
218
|
+
'NavBar.Group.badge.new': {
|
|
219
|
+
id: 'NavBar.Group.badge.new',
|
|
220
|
+
defaultMessage: 'New'
|
|
216
221
|
}
|
|
217
222
|
});
|
|
218
223
|
|
|
@@ -453,6 +458,7 @@ const RestrictedMenuItem = _ref4 => {
|
|
|
453
458
|
// Always check that some of the given permissions match.
|
|
454
459
|
,
|
|
455
460
|
shouldMatchSomePermissions: true,
|
|
461
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
456
462
|
projectPermissions: props.projectPermissions,
|
|
457
463
|
children: props.children
|
|
458
464
|
}) : jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
@@ -460,9 +466,13 @@ const RestrictedMenuItem = _ref4 => {
|
|
|
460
466
|
});
|
|
461
467
|
if (props.featureToggle) {
|
|
462
468
|
// A regular short-lived feature toggle
|
|
463
|
-
if (flagVariation === true)
|
|
469
|
+
if (flagVariation === true) {
|
|
470
|
+
return permissionsWrapper;
|
|
471
|
+
}
|
|
464
472
|
// A long-lived feature toggle with `{ value: boolean, string: reason }`
|
|
465
|
-
if (isLongLivedFlag(flagVariation) && flagVariation.value === true)
|
|
473
|
+
if (isLongLivedFlag(flagVariation) && flagVariation.value === true) {
|
|
474
|
+
return permissionsWrapper;
|
|
475
|
+
}
|
|
466
476
|
return null;
|
|
467
477
|
}
|
|
468
478
|
return permissionsWrapper;
|
|
@@ -515,6 +525,24 @@ const ItemContainer = props => {
|
|
|
515
525
|
};
|
|
516
526
|
ItemContainer.displayName = 'ItemContainer';
|
|
517
527
|
|
|
528
|
+
const GroupLabel = /*#__PURE__*/_styled__default["default"]("div", {
|
|
529
|
+
target: "e18pgpg90"
|
|
530
|
+
} )("font-size:", designSystem.designTokens.fontSize10, ";font-weight:", designSystem.designTokens.fontWeight600, ";letter-spacing:1px;text-transform:uppercase;color:", designSystem.designTokens.colorSurface, ";height:", oidc.NAVBAR.itemSize, ";width:calc(\n ", oidc.NAVBAR.sublistIndentationWhenExpanded, " - 2 *\n ", designSystem.designTokens.spacing25, "\n );padding:", designSystem.designTokens.spacing30, ";box-sizing:border-box;display:flex;align-items:center;gap:", designSystem.designTokens.spacing30, ";" + ("" ));
|
|
531
|
+
const NavbarGroupHeader = _ref => {
|
|
532
|
+
let label = _ref.label,
|
|
533
|
+
isNew = _ref.isNew;
|
|
534
|
+
const intl = reactIntl.useIntl();
|
|
535
|
+
return jsxRuntime.jsxs(GroupLabel, {
|
|
536
|
+
children: [jsxRuntime.jsx("span", {
|
|
537
|
+
children: label
|
|
538
|
+
}), isNew && jsxRuntime.jsx(nimbus.Badge, {
|
|
539
|
+
colorPalette: "primary",
|
|
540
|
+
size: "2xs",
|
|
541
|
+
children: intl.formatMessage(messages['NavBar.Group.badge.new'])
|
|
542
|
+
})]
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
|
|
518
546
|
const NavBarLayout = props => {
|
|
519
547
|
return jsxRuntime.jsx("nav", {
|
|
520
548
|
"aria-busy": true,
|
|
@@ -835,8 +863,17 @@ const getMenuAccessibleLabel = (labelAllLocales, defaultLabel, applicationLocale
|
|
|
835
863
|
if (defaultLabel) return defaultLabel;
|
|
836
864
|
return constants.NO_VALUE_FALLBACK;
|
|
837
865
|
};
|
|
866
|
+
const getNavbarItemPath = (projectKey, uriPath) => {
|
|
867
|
+
const _uriPath$split = uriPath.split('/'),
|
|
868
|
+
_uriPath$split2 = _slicedToArray(_uriPath$split, 1),
|
|
869
|
+
topLevelPath = _uriPath$split2[0];
|
|
870
|
+
if (constants.isProjectKeylessApplicationEntryPoint(topLevelPath)) {
|
|
871
|
+
return `/${uriPath}`;
|
|
872
|
+
}
|
|
873
|
+
return `/${projectKey}/${uriPath}`;
|
|
874
|
+
};
|
|
838
875
|
const getIsSubmenuRouteActive = (uriPath, props) => Boolean(reactRouterDom.matchPath(props.location.pathname, {
|
|
839
|
-
path:
|
|
876
|
+
path: getNavbarItemPath(props.projectKey, uriPath),
|
|
840
877
|
exact: true,
|
|
841
878
|
strict: false
|
|
842
879
|
}));
|
|
@@ -966,7 +1003,7 @@ const ApplicationMenu = props => {
|
|
|
966
1003
|
return () => observer?.disconnect();
|
|
967
1004
|
}, [menuItemIdentifier, props.isMenuOpen, props.handleToggleItem, callbackFn]);
|
|
968
1005
|
const isMainMenuRouteActive = Boolean(reactRouterDom.matchPath(props.location.pathname, {
|
|
969
|
-
path:
|
|
1006
|
+
path: getNavbarItemPath(props.projectKey, props.menu.uriPath),
|
|
970
1007
|
exact: false,
|
|
971
1008
|
strict: false
|
|
972
1009
|
}));
|
|
@@ -994,6 +1031,7 @@ const ApplicationMenu = props => {
|
|
|
994
1031
|
permissions: props.menu.permissions,
|
|
995
1032
|
actionRights: props.menu.actionRights ?? undefined,
|
|
996
1033
|
dataFences: props.menu.dataFences ?? undefined,
|
|
1034
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
997
1035
|
projectPermissions: props.projectPermissions,
|
|
998
1036
|
children: jsxRuntime.jsxs(MenuItem$1, {
|
|
999
1037
|
hasSubmenu: hasSubmenu,
|
|
@@ -1008,7 +1046,7 @@ const ApplicationMenu = props => {
|
|
|
1008
1046
|
identifier: menuItemIdentifier,
|
|
1009
1047
|
ariaLabel: getMenuAccessibleLabel(props.menu.labelAllLocales, props.menu.defaultLabel, props.applicationLocale),
|
|
1010
1048
|
children: [jsxRuntime.jsx(MenuItemLink, {
|
|
1011
|
-
linkTo:
|
|
1049
|
+
linkTo: getNavbarItemPath(props.projectKey, props.menu.uriPath),
|
|
1012
1050
|
useFullRedirectsForLinks: props.useFullRedirectsForLinks,
|
|
1013
1051
|
onClick: props.onMenuItemClick,
|
|
1014
1052
|
ariaLabel: getMenuAccessibleLabel(props.menu.labelAllLocales, props.menu.defaultLabel, props.applicationLocale),
|
|
@@ -1045,12 +1083,13 @@ const ApplicationMenu = props => {
|
|
|
1045
1083
|
permissions: submenu.permissions,
|
|
1046
1084
|
actionRights: submenu.actionRights ?? undefined,
|
|
1047
1085
|
dataFences: submenu.dataFences ?? undefined,
|
|
1086
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
1048
1087
|
projectPermissions: props.projectPermissions,
|
|
1049
1088
|
children: jsxRuntime.jsx(SublistItem, {
|
|
1050
1089
|
isActive: getIsSubmenuRouteActive(submenu.uriPath, props),
|
|
1051
1090
|
children: jsxRuntime.jsx(Text, {
|
|
1052
1091
|
children: jsxRuntime.jsx(MenuItemLink, {
|
|
1053
|
-
linkTo:
|
|
1092
|
+
linkTo: getNavbarItemPath(props.projectKey, submenu.uriPath)
|
|
1054
1093
|
// We want to use an exact matching strategy to avoid multiple
|
|
1055
1094
|
// links matching sub-routes.
|
|
1056
1095
|
,
|
|
@@ -1131,8 +1170,11 @@ const NavBar = props => {
|
|
|
1131
1170
|
scale: "l",
|
|
1132
1171
|
children: _mapInstanceProperty__default["default"](allApplicationsNavbarMenuGroups).call(allApplicationsNavbarMenuGroups, navbarMenuGroup => {
|
|
1133
1172
|
var _context2;
|
|
1134
|
-
return jsxRuntime.
|
|
1135
|
-
children:
|
|
1173
|
+
return jsxRuntime.jsxs("div", {
|
|
1174
|
+
children: [navbarMenuGroup.label && isMenuOpen && jsxRuntime.jsx(NavbarGroupHeader, {
|
|
1175
|
+
label: navbarMenuGroup.label,
|
|
1176
|
+
isNew: navbarMenuGroup.isNew ?? undefined
|
|
1177
|
+
}), _mapInstanceProperty__default["default"](_context2 = navbarMenuGroup.items).call(_context2, menu => {
|
|
1136
1178
|
const menuType = 'scrollable';
|
|
1137
1179
|
const itemIndex = `${menuType}-${menu.key}`;
|
|
1138
1180
|
return jsxRuntime.jsx(ApplicationMenu, {
|
|
@@ -1142,6 +1184,7 @@ const NavBar = props => {
|
|
|
1142
1184
|
handleToggleItem: () => handleToggleItem(itemIndex),
|
|
1143
1185
|
isMenuOpen: isMenuOpen,
|
|
1144
1186
|
shouldCloseMenuFly: shouldCloseMenuFly,
|
|
1187
|
+
isUserAdminOfCurrentProject: props.project?.isUserAdminOfCurrentProject,
|
|
1145
1188
|
projectPermissions: projectPermissions,
|
|
1146
1189
|
applicationLocale: applicationLocale,
|
|
1147
1190
|
projectKey: props.projectKey,
|
|
@@ -1150,7 +1193,7 @@ const NavBar = props => {
|
|
|
1150
1193
|
onMouseMove: e => getMousePosition(e, itemIndex),
|
|
1151
1194
|
mousePosition: mousePosition
|
|
1152
1195
|
}, menu.key);
|
|
1153
|
-
})
|
|
1196
|
+
})]
|
|
1154
1197
|
}, navbarMenuGroup.key);
|
|
1155
1198
|
})
|
|
1156
1199
|
})
|
|
@@ -38,11 +38,12 @@ var permissions = require('@commercetools-frontend/permissions');
|
|
|
38
38
|
var InlineSvg = require('@commercetools-uikit/icons/inline-svg');
|
|
39
39
|
var location = require('./location-c835b8df.cjs.dev.js');
|
|
40
40
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
41
|
+
var nimbus = require('@commercetools/nimbus');
|
|
41
42
|
var _keysInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/keys');
|
|
42
43
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
43
44
|
var isNil = require('lodash/isNil');
|
|
44
45
|
var throttle = require('lodash/throttle');
|
|
45
|
-
var useApplicationsMenu = require('./use-applications-menu-
|
|
46
|
+
var useApplicationsMenu = require('./use-applications-menu-c36dd4d1.cjs.dev.js');
|
|
46
47
|
require('@apollo/client');
|
|
47
48
|
require('@commercetools-frontend/l10n');
|
|
48
49
|
|
|
@@ -323,6 +324,10 @@ var messages = reactIntl.defineMessages({
|
|
|
323
324
|
'NavBar.MenuExpander.expandMenu': {
|
|
324
325
|
id: 'NavBar.MenuExpander.expandMenu',
|
|
325
326
|
defaultMessage: 'Expand menu'
|
|
327
|
+
},
|
|
328
|
+
'NavBar.Group.badge.new': {
|
|
329
|
+
id: 'NavBar.Group.badge.new',
|
|
330
|
+
defaultMessage: 'New'
|
|
326
331
|
}
|
|
327
332
|
});
|
|
328
333
|
|
|
@@ -563,6 +568,7 @@ const RestrictedMenuItem = _ref4 => {
|
|
|
563
568
|
// Always check that some of the given permissions match.
|
|
564
569
|
,
|
|
565
570
|
shouldMatchSomePermissions: true,
|
|
571
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
566
572
|
projectPermissions: props.projectPermissions,
|
|
567
573
|
children: props.children
|
|
568
574
|
}) : jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
@@ -570,9 +576,13 @@ const RestrictedMenuItem = _ref4 => {
|
|
|
570
576
|
});
|
|
571
577
|
if (props.featureToggle) {
|
|
572
578
|
// A regular short-lived feature toggle
|
|
573
|
-
if (flagVariation === true)
|
|
579
|
+
if (flagVariation === true) {
|
|
580
|
+
return permissionsWrapper;
|
|
581
|
+
}
|
|
574
582
|
// A long-lived feature toggle with `{ value: boolean, string: reason }`
|
|
575
|
-
if (isLongLivedFlag(flagVariation) && flagVariation.value === true)
|
|
583
|
+
if (isLongLivedFlag(flagVariation) && flagVariation.value === true) {
|
|
584
|
+
return permissionsWrapper;
|
|
585
|
+
}
|
|
576
586
|
return null;
|
|
577
587
|
}
|
|
578
588
|
return permissionsWrapper;
|
|
@@ -625,6 +635,27 @@ const ItemContainer = props => {
|
|
|
625
635
|
};
|
|
626
636
|
ItemContainer.displayName = 'ItemContainer';
|
|
627
637
|
|
|
638
|
+
const GroupLabel = /*#__PURE__*/_styled__default["default"]("div", process.env.NODE_ENV === "production" ? {
|
|
639
|
+
target: "e18pgpg90"
|
|
640
|
+
} : {
|
|
641
|
+
target: "e18pgpg90",
|
|
642
|
+
label: "GroupLabel"
|
|
643
|
+
})("font-size:", designSystem.designTokens.fontSize10, ";font-weight:", designSystem.designTokens.fontWeight600, ";letter-spacing:1px;text-transform:uppercase;color:", designSystem.designTokens.colorSurface, ";height:", oidc.NAVBAR.itemSize, ";width:calc(\n ", oidc.NAVBAR.sublistIndentationWhenExpanded, " - 2 *\n ", designSystem.designTokens.spacing25, "\n );padding:", designSystem.designTokens.spacing30, ";box-sizing:border-box;display:flex;align-items:center;gap:", designSystem.designTokens.spacing30, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5hdmJhci1ncm91cC1oZWFkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVk2QiIsImZpbGUiOiJuYXZiYXItZ3JvdXAtaGVhZGVyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IEJhZGdlIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMvbmltYnVzJztcbmltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJztcbmltcG9ydCB7IGRlc2lnblRva2VucyBhcyB1aUtpdERlc2lnblRva2VucyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nO1xuaW1wb3J0IHsgTkFWQkFSIH0gZnJvbSAnLi4vLi4vY29uc3RhbnRzJztcbmltcG9ydCBtZXNzYWdlcyBmcm9tICcuL21lc3NhZ2VzJztcblxudHlwZSBOYXZiYXJHcm91cEhlYWRlclByb3BzID0ge1xuICBsYWJlbDogc3RyaW5nO1xuICBpc05ldz86IGJvb2xlYW47XG59O1xuXG5jb25zdCBHcm91cExhYmVsID0gc3R5bGVkLmRpdmBcbiAgZm9udC1zaXplOiAke3VpS2l0RGVzaWduVG9rZW5zLmZvbnRTaXplMTB9O1xuICBmb250LXdlaWdodDogJHt1aUtpdERlc2lnblRva2Vucy5mb250V2VpZ2h0NjAwfTtcbiAgbGV0dGVyLXNwYWNpbmc6IDFweDtcbiAgdGV4dC10cmFuc2Zvcm06IHVwcGVyY2FzZTtcbiAgY29sb3I6ICR7dWlLaXREZXNpZ25Ub2tlbnMuY29sb3JTdXJmYWNlfTtcbiAgaGVpZ2h0OiAke05BVkJBUi5pdGVtU2l6ZX07XG4gIHdpZHRoOiBjYWxjKFxuICAgICR7TkFWQkFSLnN1Ymxpc3RJbmRlbnRhdGlvbldoZW5FeHBhbmRlZH0gLSAyICpcbiAgICAgICR7dWlLaXREZXNpZ25Ub2tlbnMuc3BhY2luZzI1fVxuICApO1xuICBwYWRkaW5nOiAke3VpS2l0RGVzaWduVG9rZW5zLnNwYWNpbmczMH07XG4gIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGdhcDogJHt1aUtpdERlc2lnblRva2Vucy5zcGFjaW5nMzB9O1xuYDtcblxuY29uc3QgTmF2YmFyR3JvdXBIZWFkZXIgPSAoeyBsYWJlbCwgaXNOZXcgfTogTmF2YmFyR3JvdXBIZWFkZXJQcm9wcykgPT4ge1xuICBjb25zdCBpbnRsID0gdXNlSW50bCgpO1xuXG4gIHJldHVybiAoXG4gICAgPEdyb3VwTGFiZWw+XG4gICAgICA8c3Bhbj57bGFiZWx9PC9zcGFuPlxuICAgICAge2lzTmV3ICYmIChcbiAgICAgICAgPEJhZGdlIGNvbG9yUGFsZXR0ZT1cInByaW1hcnlcIiBzaXplPVwiMnhzXCI+XG4gICAgICAgICAge2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlc1snTmF2QmFyLkdyb3VwLmJhZGdlLm5ldyddKX1cbiAgICAgICAgPC9CYWRnZT5cbiAgICAgICl9XG4gICAgPC9Hcm91cExhYmVsPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgTmF2YmFyR3JvdXBIZWFkZXI7XG4iXX0= */"));
|
|
644
|
+
const NavbarGroupHeader = _ref => {
|
|
645
|
+
let label = _ref.label,
|
|
646
|
+
isNew = _ref.isNew;
|
|
647
|
+
const intl = reactIntl.useIntl();
|
|
648
|
+
return jsxRuntime.jsxs(GroupLabel, {
|
|
649
|
+
children: [jsxRuntime.jsx("span", {
|
|
650
|
+
children: label
|
|
651
|
+
}), isNew && jsxRuntime.jsx(nimbus.Badge, {
|
|
652
|
+
colorPalette: "primary",
|
|
653
|
+
size: "2xs",
|
|
654
|
+
children: intl.formatMessage(messages['NavBar.Group.badge.new'])
|
|
655
|
+
})]
|
|
656
|
+
});
|
|
657
|
+
};
|
|
658
|
+
|
|
628
659
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
629
660
|
const NavBarLayout = props => {
|
|
630
661
|
return jsxRuntime.jsx("nav", {
|
|
@@ -974,8 +1005,17 @@ const getMenuAccessibleLabel = (labelAllLocales, defaultLabel, applicationLocale
|
|
|
974
1005
|
if (defaultLabel) return defaultLabel;
|
|
975
1006
|
return constants.NO_VALUE_FALLBACK;
|
|
976
1007
|
};
|
|
1008
|
+
const getNavbarItemPath = (projectKey, uriPath) => {
|
|
1009
|
+
const _uriPath$split = uriPath.split('/'),
|
|
1010
|
+
_uriPath$split2 = _slicedToArray(_uriPath$split, 1),
|
|
1011
|
+
topLevelPath = _uriPath$split2[0];
|
|
1012
|
+
if (constants.isProjectKeylessApplicationEntryPoint(topLevelPath)) {
|
|
1013
|
+
return `/${uriPath}`;
|
|
1014
|
+
}
|
|
1015
|
+
return `/${projectKey}/${uriPath}`;
|
|
1016
|
+
};
|
|
977
1017
|
const getIsSubmenuRouteActive = (uriPath, props) => Boolean(reactRouterDom.matchPath(props.location.pathname, {
|
|
978
|
-
path:
|
|
1018
|
+
path: getNavbarItemPath(props.projectKey, uriPath),
|
|
979
1019
|
exact: true,
|
|
980
1020
|
strict: false
|
|
981
1021
|
}));
|
|
@@ -1105,7 +1145,7 @@ const ApplicationMenu = props => {
|
|
|
1105
1145
|
return () => observer?.disconnect();
|
|
1106
1146
|
}, [menuItemIdentifier, props.isMenuOpen, props.handleToggleItem, callbackFn]);
|
|
1107
1147
|
const isMainMenuRouteActive = Boolean(reactRouterDom.matchPath(props.location.pathname, {
|
|
1108
|
-
path:
|
|
1148
|
+
path: getNavbarItemPath(props.projectKey, props.menu.uriPath),
|
|
1109
1149
|
exact: false,
|
|
1110
1150
|
strict: false
|
|
1111
1151
|
}));
|
|
@@ -1133,6 +1173,7 @@ const ApplicationMenu = props => {
|
|
|
1133
1173
|
permissions: props.menu.permissions,
|
|
1134
1174
|
actionRights: props.menu.actionRights ?? undefined,
|
|
1135
1175
|
dataFences: props.menu.dataFences ?? undefined,
|
|
1176
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
1136
1177
|
projectPermissions: props.projectPermissions,
|
|
1137
1178
|
children: jsxRuntime.jsxs(MenuItem$1, {
|
|
1138
1179
|
hasSubmenu: hasSubmenu,
|
|
@@ -1147,7 +1188,7 @@ const ApplicationMenu = props => {
|
|
|
1147
1188
|
identifier: menuItemIdentifier,
|
|
1148
1189
|
ariaLabel: getMenuAccessibleLabel(props.menu.labelAllLocales, props.menu.defaultLabel, props.applicationLocale),
|
|
1149
1190
|
children: [jsxRuntime.jsx(MenuItemLink, {
|
|
1150
|
-
linkTo:
|
|
1191
|
+
linkTo: getNavbarItemPath(props.projectKey, props.menu.uriPath),
|
|
1151
1192
|
useFullRedirectsForLinks: props.useFullRedirectsForLinks,
|
|
1152
1193
|
onClick: props.onMenuItemClick,
|
|
1153
1194
|
ariaLabel: getMenuAccessibleLabel(props.menu.labelAllLocales, props.menu.defaultLabel, props.applicationLocale),
|
|
@@ -1184,12 +1225,13 @@ const ApplicationMenu = props => {
|
|
|
1184
1225
|
permissions: submenu.permissions,
|
|
1185
1226
|
actionRights: submenu.actionRights ?? undefined,
|
|
1186
1227
|
dataFences: submenu.dataFences ?? undefined,
|
|
1228
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
1187
1229
|
projectPermissions: props.projectPermissions,
|
|
1188
1230
|
children: jsxRuntime.jsx(SublistItem, {
|
|
1189
1231
|
isActive: getIsSubmenuRouteActive(submenu.uriPath, props),
|
|
1190
1232
|
children: jsxRuntime.jsx(Text, {
|
|
1191
1233
|
children: jsxRuntime.jsx(MenuItemLink, {
|
|
1192
|
-
linkTo:
|
|
1234
|
+
linkTo: getNavbarItemPath(props.projectKey, submenu.uriPath)
|
|
1193
1235
|
// We want to use an exact matching strategy to avoid multiple
|
|
1194
1236
|
// links matching sub-routes.
|
|
1195
1237
|
,
|
|
@@ -1270,8 +1312,11 @@ const NavBar = props => {
|
|
|
1270
1312
|
scale: "l",
|
|
1271
1313
|
children: _mapInstanceProperty__default["default"](allApplicationsNavbarMenuGroups).call(allApplicationsNavbarMenuGroups, navbarMenuGroup => {
|
|
1272
1314
|
var _context2;
|
|
1273
|
-
return jsxRuntime.
|
|
1274
|
-
children:
|
|
1315
|
+
return jsxRuntime.jsxs("div", {
|
|
1316
|
+
children: [navbarMenuGroup.label && isMenuOpen && jsxRuntime.jsx(NavbarGroupHeader, {
|
|
1317
|
+
label: navbarMenuGroup.label,
|
|
1318
|
+
isNew: navbarMenuGroup.isNew ?? undefined
|
|
1319
|
+
}), _mapInstanceProperty__default["default"](_context2 = navbarMenuGroup.items).call(_context2, menu => {
|
|
1275
1320
|
const menuType = 'scrollable';
|
|
1276
1321
|
const itemIndex = `${menuType}-${menu.key}`;
|
|
1277
1322
|
return jsxRuntime.jsx(ApplicationMenu, {
|
|
@@ -1281,6 +1326,7 @@ const NavBar = props => {
|
|
|
1281
1326
|
handleToggleItem: () => handleToggleItem(itemIndex),
|
|
1282
1327
|
isMenuOpen: isMenuOpen,
|
|
1283
1328
|
shouldCloseMenuFly: shouldCloseMenuFly,
|
|
1329
|
+
isUserAdminOfCurrentProject: props.project?.isUserAdminOfCurrentProject,
|
|
1284
1330
|
projectPermissions: projectPermissions,
|
|
1285
1331
|
applicationLocale: applicationLocale,
|
|
1286
1332
|
projectKey: props.projectKey,
|
|
@@ -1289,7 +1335,7 @@ const NavBar = props => {
|
|
|
1289
1335
|
onMouseMove: e => getMousePosition(e, itemIndex),
|
|
1290
1336
|
mousePosition: mousePosition
|
|
1291
1337
|
}, menu.key);
|
|
1292
|
-
})
|
|
1338
|
+
})]
|
|
1293
1339
|
}, navbarMenuGroup.key);
|
|
1294
1340
|
})
|
|
1295
1341
|
})
|
|
@@ -19,7 +19,7 @@ import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
|
|
|
19
19
|
import { NavLink, matchPath, useLocation } from 'react-router-dom';
|
|
20
20
|
import { useMcQuery, normalizeAllAppliedPermissions, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences } from '@commercetools-frontend/application-shell-connectors';
|
|
21
21
|
import LogoSVG from '@commercetools-frontend/assets/logos/commercetools_small-logo.svg';
|
|
22
|
-
import { NO_VALUE_FALLBACK, GRAPHQL_TARGETS, STORAGE_KEYS, SUPPORT_PORTAL_URL } from '@commercetools-frontend/constants';
|
|
22
|
+
import { NO_VALUE_FALLBACK, GRAPHQL_TARGETS, STORAGE_KEYS, SUPPORT_PORTAL_URL, isProjectKeylessApplicationEntryPoint } from '@commercetools-frontend/constants';
|
|
23
23
|
import { SidebarCollapseIcon, SidebarExpandIcon, SupportIcon } from '@commercetools-uikit/icons';
|
|
24
24
|
import Spacings from '@commercetools-uikit/spacings';
|
|
25
25
|
import _styled from '@emotion/styled/base';
|
|
@@ -36,11 +36,12 @@ import { RestrictedByPermissions } from '@commercetools-frontend/permissions';
|
|
|
36
36
|
import InlineSvg from '@commercetools-uikit/icons/inline-svg';
|
|
37
37
|
import { l as location } from './location-f21dbc25.esm.js';
|
|
38
38
|
import { jsx, Fragment, jsxs } from '@emotion/react/jsx-runtime';
|
|
39
|
+
import { Badge } from '@commercetools/nimbus';
|
|
39
40
|
import _keysInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/keys';
|
|
40
41
|
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
41
42
|
import isNil from 'lodash/isNil';
|
|
42
43
|
import throttle from 'lodash/throttle';
|
|
43
|
-
import { u as useApplicationsMenu } from './use-applications-menu-
|
|
44
|
+
import { u as useApplicationsMenu } from './use-applications-menu-ed43547f.esm.js';
|
|
44
45
|
import '@apollo/client';
|
|
45
46
|
import '@commercetools-frontend/l10n';
|
|
46
47
|
|
|
@@ -293,6 +294,10 @@ var messages = defineMessages({
|
|
|
293
294
|
'NavBar.MenuExpander.expandMenu': {
|
|
294
295
|
id: 'NavBar.MenuExpander.expandMenu',
|
|
295
296
|
defaultMessage: 'Expand menu'
|
|
297
|
+
},
|
|
298
|
+
'NavBar.Group.badge.new': {
|
|
299
|
+
id: 'NavBar.Group.badge.new',
|
|
300
|
+
defaultMessage: 'New'
|
|
296
301
|
}
|
|
297
302
|
});
|
|
298
303
|
|
|
@@ -533,6 +538,7 @@ const RestrictedMenuItem = _ref4 => {
|
|
|
533
538
|
// Always check that some of the given permissions match.
|
|
534
539
|
,
|
|
535
540
|
shouldMatchSomePermissions: true,
|
|
541
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
536
542
|
projectPermissions: props.projectPermissions,
|
|
537
543
|
children: props.children
|
|
538
544
|
}) : jsx(Fragment, {
|
|
@@ -540,9 +546,13 @@ const RestrictedMenuItem = _ref4 => {
|
|
|
540
546
|
});
|
|
541
547
|
if (props.featureToggle) {
|
|
542
548
|
// A regular short-lived feature toggle
|
|
543
|
-
if (flagVariation === true)
|
|
549
|
+
if (flagVariation === true) {
|
|
550
|
+
return permissionsWrapper;
|
|
551
|
+
}
|
|
544
552
|
// A long-lived feature toggle with `{ value: boolean, string: reason }`
|
|
545
|
-
if (isLongLivedFlag(flagVariation) && flagVariation.value === true)
|
|
553
|
+
if (isLongLivedFlag(flagVariation) && flagVariation.value === true) {
|
|
554
|
+
return permissionsWrapper;
|
|
555
|
+
}
|
|
546
556
|
return null;
|
|
547
557
|
}
|
|
548
558
|
return permissionsWrapper;
|
|
@@ -595,6 +605,27 @@ const ItemContainer = props => {
|
|
|
595
605
|
};
|
|
596
606
|
ItemContainer.displayName = 'ItemContainer';
|
|
597
607
|
|
|
608
|
+
const GroupLabel = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
609
|
+
target: "e18pgpg90"
|
|
610
|
+
} : {
|
|
611
|
+
target: "e18pgpg90",
|
|
612
|
+
label: "GroupLabel"
|
|
613
|
+
})("font-size:", designTokens.fontSize10, ";font-weight:", designTokens.fontWeight600, ";letter-spacing:1px;text-transform:uppercase;color:", designTokens.colorSurface, ";height:", NAVBAR.itemSize, ";width:calc(\n ", NAVBAR.sublistIndentationWhenExpanded, " - 2 *\n ", designTokens.spacing25, "\n );padding:", designTokens.spacing30, ";box-sizing:border-box;display:flex;align-items:center;gap:", designTokens.spacing30, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5hdmJhci1ncm91cC1oZWFkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVk2QiIsImZpbGUiOiJuYXZiYXItZ3JvdXAtaGVhZGVyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IEJhZGdlIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMvbmltYnVzJztcbmltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJztcbmltcG9ydCB7IGRlc2lnblRva2VucyBhcyB1aUtpdERlc2lnblRva2VucyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nO1xuaW1wb3J0IHsgTkFWQkFSIH0gZnJvbSAnLi4vLi4vY29uc3RhbnRzJztcbmltcG9ydCBtZXNzYWdlcyBmcm9tICcuL21lc3NhZ2VzJztcblxudHlwZSBOYXZiYXJHcm91cEhlYWRlclByb3BzID0ge1xuICBsYWJlbDogc3RyaW5nO1xuICBpc05ldz86IGJvb2xlYW47XG59O1xuXG5jb25zdCBHcm91cExhYmVsID0gc3R5bGVkLmRpdmBcbiAgZm9udC1zaXplOiAke3VpS2l0RGVzaWduVG9rZW5zLmZvbnRTaXplMTB9O1xuICBmb250LXdlaWdodDogJHt1aUtpdERlc2lnblRva2Vucy5mb250V2VpZ2h0NjAwfTtcbiAgbGV0dGVyLXNwYWNpbmc6IDFweDtcbiAgdGV4dC10cmFuc2Zvcm06IHVwcGVyY2FzZTtcbiAgY29sb3I6ICR7dWlLaXREZXNpZ25Ub2tlbnMuY29sb3JTdXJmYWNlfTtcbiAgaGVpZ2h0OiAke05BVkJBUi5pdGVtU2l6ZX07XG4gIHdpZHRoOiBjYWxjKFxuICAgICR7TkFWQkFSLnN1Ymxpc3RJbmRlbnRhdGlvbldoZW5FeHBhbmRlZH0gLSAyICpcbiAgICAgICR7dWlLaXREZXNpZ25Ub2tlbnMuc3BhY2luZzI1fVxuICApO1xuICBwYWRkaW5nOiAke3VpS2l0RGVzaWduVG9rZW5zLnNwYWNpbmczMH07XG4gIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIGdhcDogJHt1aUtpdERlc2lnblRva2Vucy5zcGFjaW5nMzB9O1xuYDtcblxuY29uc3QgTmF2YmFyR3JvdXBIZWFkZXIgPSAoeyBsYWJlbCwgaXNOZXcgfTogTmF2YmFyR3JvdXBIZWFkZXJQcm9wcykgPT4ge1xuICBjb25zdCBpbnRsID0gdXNlSW50bCgpO1xuXG4gIHJldHVybiAoXG4gICAgPEdyb3VwTGFiZWw+XG4gICAgICA8c3Bhbj57bGFiZWx9PC9zcGFuPlxuICAgICAge2lzTmV3ICYmIChcbiAgICAgICAgPEJhZGdlIGNvbG9yUGFsZXR0ZT1cInByaW1hcnlcIiBzaXplPVwiMnhzXCI+XG4gICAgICAgICAge2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlc1snTmF2QmFyLkdyb3VwLmJhZGdlLm5ldyddKX1cbiAgICAgICAgPC9CYWRnZT5cbiAgICAgICl9XG4gICAgPC9Hcm91cExhYmVsPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgTmF2YmFyR3JvdXBIZWFkZXI7XG4iXX0= */"));
|
|
614
|
+
const NavbarGroupHeader = _ref => {
|
|
615
|
+
let label = _ref.label,
|
|
616
|
+
isNew = _ref.isNew;
|
|
617
|
+
const intl = useIntl();
|
|
618
|
+
return jsxs(GroupLabel, {
|
|
619
|
+
children: [jsx("span", {
|
|
620
|
+
children: label
|
|
621
|
+
}), isNew && jsx(Badge, {
|
|
622
|
+
colorPalette: "primary",
|
|
623
|
+
size: "2xs",
|
|
624
|
+
children: intl.formatMessage(messages['NavBar.Group.badge.new'])
|
|
625
|
+
})]
|
|
626
|
+
});
|
|
627
|
+
};
|
|
628
|
+
|
|
598
629
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
599
630
|
const NavBarLayout = props => {
|
|
600
631
|
return jsx("nav", {
|
|
@@ -944,8 +975,17 @@ const getMenuAccessibleLabel = (labelAllLocales, defaultLabel, applicationLocale
|
|
|
944
975
|
if (defaultLabel) return defaultLabel;
|
|
945
976
|
return NO_VALUE_FALLBACK;
|
|
946
977
|
};
|
|
978
|
+
const getNavbarItemPath = (projectKey, uriPath) => {
|
|
979
|
+
const _uriPath$split = uriPath.split('/'),
|
|
980
|
+
_uriPath$split2 = _slicedToArray(_uriPath$split, 1),
|
|
981
|
+
topLevelPath = _uriPath$split2[0];
|
|
982
|
+
if (isProjectKeylessApplicationEntryPoint(topLevelPath)) {
|
|
983
|
+
return `/${uriPath}`;
|
|
984
|
+
}
|
|
985
|
+
return `/${projectKey}/${uriPath}`;
|
|
986
|
+
};
|
|
947
987
|
const getIsSubmenuRouteActive = (uriPath, props) => Boolean(matchPath(props.location.pathname, {
|
|
948
|
-
path:
|
|
988
|
+
path: getNavbarItemPath(props.projectKey, uriPath),
|
|
949
989
|
exact: true,
|
|
950
990
|
strict: false
|
|
951
991
|
}));
|
|
@@ -1075,7 +1115,7 @@ const ApplicationMenu = props => {
|
|
|
1075
1115
|
return () => observer?.disconnect();
|
|
1076
1116
|
}, [menuItemIdentifier, props.isMenuOpen, props.handleToggleItem, callbackFn]);
|
|
1077
1117
|
const isMainMenuRouteActive = Boolean(matchPath(props.location.pathname, {
|
|
1078
|
-
path:
|
|
1118
|
+
path: getNavbarItemPath(props.projectKey, props.menu.uriPath),
|
|
1079
1119
|
exact: false,
|
|
1080
1120
|
strict: false
|
|
1081
1121
|
}));
|
|
@@ -1103,6 +1143,7 @@ const ApplicationMenu = props => {
|
|
|
1103
1143
|
permissions: props.menu.permissions,
|
|
1104
1144
|
actionRights: props.menu.actionRights ?? undefined,
|
|
1105
1145
|
dataFences: props.menu.dataFences ?? undefined,
|
|
1146
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
1106
1147
|
projectPermissions: props.projectPermissions,
|
|
1107
1148
|
children: jsxs(MenuItem$1, {
|
|
1108
1149
|
hasSubmenu: hasSubmenu,
|
|
@@ -1117,7 +1158,7 @@ const ApplicationMenu = props => {
|
|
|
1117
1158
|
identifier: menuItemIdentifier,
|
|
1118
1159
|
ariaLabel: getMenuAccessibleLabel(props.menu.labelAllLocales, props.menu.defaultLabel, props.applicationLocale),
|
|
1119
1160
|
children: [jsx(MenuItemLink, {
|
|
1120
|
-
linkTo:
|
|
1161
|
+
linkTo: getNavbarItemPath(props.projectKey, props.menu.uriPath),
|
|
1121
1162
|
useFullRedirectsForLinks: props.useFullRedirectsForLinks,
|
|
1122
1163
|
onClick: props.onMenuItemClick,
|
|
1123
1164
|
ariaLabel: getMenuAccessibleLabel(props.menu.labelAllLocales, props.menu.defaultLabel, props.applicationLocale),
|
|
@@ -1154,12 +1195,13 @@ const ApplicationMenu = props => {
|
|
|
1154
1195
|
permissions: submenu.permissions,
|
|
1155
1196
|
actionRights: submenu.actionRights ?? undefined,
|
|
1156
1197
|
dataFences: submenu.dataFences ?? undefined,
|
|
1198
|
+
isUserAdminOfCurrentProject: props.isUserAdminOfCurrentProject,
|
|
1157
1199
|
projectPermissions: props.projectPermissions,
|
|
1158
1200
|
children: jsx(SublistItem, {
|
|
1159
1201
|
isActive: getIsSubmenuRouteActive(submenu.uriPath, props),
|
|
1160
1202
|
children: jsx(Text, {
|
|
1161
1203
|
children: jsx(MenuItemLink, {
|
|
1162
|
-
linkTo:
|
|
1204
|
+
linkTo: getNavbarItemPath(props.projectKey, submenu.uriPath)
|
|
1163
1205
|
// We want to use an exact matching strategy to avoid multiple
|
|
1164
1206
|
// links matching sub-routes.
|
|
1165
1207
|
,
|
|
@@ -1240,8 +1282,11 @@ const NavBar = props => {
|
|
|
1240
1282
|
scale: "l",
|
|
1241
1283
|
children: _mapInstanceProperty(allApplicationsNavbarMenuGroups).call(allApplicationsNavbarMenuGroups, navbarMenuGroup => {
|
|
1242
1284
|
var _context2;
|
|
1243
|
-
return
|
|
1244
|
-
children:
|
|
1285
|
+
return jsxs("div", {
|
|
1286
|
+
children: [navbarMenuGroup.label && isMenuOpen && jsx(NavbarGroupHeader, {
|
|
1287
|
+
label: navbarMenuGroup.label,
|
|
1288
|
+
isNew: navbarMenuGroup.isNew ?? undefined
|
|
1289
|
+
}), _mapInstanceProperty(_context2 = navbarMenuGroup.items).call(_context2, menu => {
|
|
1245
1290
|
const menuType = 'scrollable';
|
|
1246
1291
|
const itemIndex = `${menuType}-${menu.key}`;
|
|
1247
1292
|
return jsx(ApplicationMenu, {
|
|
@@ -1251,6 +1296,7 @@ const NavBar = props => {
|
|
|
1251
1296
|
handleToggleItem: () => handleToggleItem(itemIndex),
|
|
1252
1297
|
isMenuOpen: isMenuOpen,
|
|
1253
1298
|
shouldCloseMenuFly: shouldCloseMenuFly,
|
|
1299
|
+
isUserAdminOfCurrentProject: props.project?.isUserAdminOfCurrentProject,
|
|
1254
1300
|
projectPermissions: projectPermissions,
|
|
1255
1301
|
applicationLocale: applicationLocale,
|
|
1256
1302
|
projectKey: props.projectKey,
|
|
@@ -1259,7 +1305,7 @@ const NavBar = props => {
|
|
|
1259
1305
|
onMouseMove: e => getMousePosition(e, itemIndex),
|
|
1260
1306
|
mousePosition: mousePosition
|
|
1261
1307
|
}, menu.key);
|
|
1262
|
-
})
|
|
1308
|
+
})]
|
|
1263
1309
|
}, navbarMenuGroup.key);
|
|
1264
1310
|
})
|
|
1265
1311
|
})
|
|
@@ -20,7 +20,7 @@ var icons = require('@commercetools-uikit/icons');
|
|
|
20
20
|
var notifications = require('@commercetools-uikit/notifications');
|
|
21
21
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
22
22
|
var Text = require('@commercetools-uikit/text');
|
|
23
|
-
var dist_commercetoolsFrontendApplicationShell = require('./index-
|
|
23
|
+
var dist_commercetoolsFrontendApplicationShell = require('./index-3244236c.cjs.dev.js');
|
|
24
24
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
25
25
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
26
26
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -32,7 +32,8 @@ require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
|
32
32
|
require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
33
33
|
require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
34
34
|
require('./location-c835b8df.cjs.dev.js');
|
|
35
|
-
require('
|
|
35
|
+
require('@commercetools-frontend/constants');
|
|
36
|
+
require('./application-entry-point-e5623556.cjs.dev.js');
|
|
36
37
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
37
38
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
@@ -42,7 +43,6 @@ require('lodash/mapValues');
|
|
|
42
43
|
require('omit-empty-es');
|
|
43
44
|
require('redux');
|
|
44
45
|
require('redux-thunk');
|
|
45
|
-
require('@commercetools-frontend/constants');
|
|
46
46
|
require('@commercetools-frontend/notifications');
|
|
47
47
|
require('@commercetools-frontend/sdk');
|
|
48
48
|
require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
@@ -52,11 +52,14 @@ require('@commercetools-frontend/sentry');
|
|
|
52
52
|
require('@commercetools-frontend/react-notifications');
|
|
53
53
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
54
54
|
require('redux-logger');
|
|
55
|
+
require('tiny-invariant');
|
|
56
|
+
require('@commercetools-frontend/application-config/ssr');
|
|
57
|
+
require('@commercetools-frontend/permissions');
|
|
55
58
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
56
59
|
require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
60
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
57
61
|
require('@emotion/react');
|
|
58
62
|
require('./oidc-b9e7297c.cjs.dev.js');
|
|
59
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
60
63
|
require('@babel/runtime-corejs3/core-js-stable/set');
|
|
61
64
|
require('react-intl');
|
|
62
65
|
require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
@@ -84,8 +87,6 @@ require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
|
84
87
|
require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
85
88
|
require('@babel/runtime-corejs3/helpers/inherits');
|
|
86
89
|
require('@commercetools-uikit/design-system/materials/resets.css');
|
|
87
|
-
require('@commercetools-frontend/application-config/ssr');
|
|
88
|
-
require('@commercetools-frontend/permissions');
|
|
89
90
|
require('@flopflip/memory-adapter');
|
|
90
91
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
91
92
|
require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
@@ -20,7 +20,7 @@ var icons = require('@commercetools-uikit/icons');
|
|
|
20
20
|
var notifications = require('@commercetools-uikit/notifications');
|
|
21
21
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
22
22
|
var Text = require('@commercetools-uikit/text');
|
|
23
|
-
var dist_commercetoolsFrontendApplicationShell = require('./index-
|
|
23
|
+
var dist_commercetoolsFrontendApplicationShell = require('./index-fc58c6bb.cjs.prod.js');
|
|
24
24
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
25
25
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
26
26
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -32,7 +32,8 @@ require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
|
32
32
|
require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
33
33
|
require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
34
34
|
require('./location-537e0660.cjs.prod.js');
|
|
35
|
-
require('
|
|
35
|
+
require('@commercetools-frontend/constants');
|
|
36
|
+
require('./application-entry-point-516fd72c.cjs.prod.js');
|
|
36
37
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
37
38
|
require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
@@ -42,7 +43,6 @@ require('lodash/mapValues');
|
|
|
42
43
|
require('omit-empty-es');
|
|
43
44
|
require('redux');
|
|
44
45
|
require('redux-thunk');
|
|
45
|
-
require('@commercetools-frontend/constants');
|
|
46
46
|
require('@commercetools-frontend/notifications');
|
|
47
47
|
require('@commercetools-frontend/sdk');
|
|
48
48
|
require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
@@ -52,11 +52,14 @@ require('@commercetools-frontend/sentry');
|
|
|
52
52
|
require('@commercetools-frontend/react-notifications');
|
|
53
53
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
54
54
|
require('redux-logger');
|
|
55
|
+
require('tiny-invariant');
|
|
56
|
+
require('@commercetools-frontend/application-config/ssr');
|
|
57
|
+
require('@commercetools-frontend/permissions');
|
|
55
58
|
require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
56
59
|
require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
60
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
57
61
|
require('@emotion/react');
|
|
58
62
|
require('./oidc-0cba182b.cjs.prod.js');
|
|
59
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
60
63
|
require('@babel/runtime-corejs3/core-js-stable/set');
|
|
61
64
|
require('react-intl');
|
|
62
65
|
require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
@@ -84,8 +87,6 @@ require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
|
84
87
|
require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
85
88
|
require('@babel/runtime-corejs3/helpers/inherits');
|
|
86
89
|
require('@commercetools-uikit/design-system/materials/resets.css');
|
|
87
|
-
require('@commercetools-frontend/application-config/ssr');
|
|
88
|
-
require('@commercetools-frontend/permissions');
|
|
89
90
|
require('@flopflip/memory-adapter');
|
|
90
91
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
91
92
|
require('@babel/runtime-corejs3/core-js-stable/instance/some');
|