@boomerang-io/carbon-addons-boomerang-react 4.6.5-beta.28 → 4.6.5-beta.29
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.
|
@@ -54,6 +54,7 @@ const MenuAriaLabelRecord = {
|
|
|
54
54
|
Switcher: "Switcher menu",
|
|
55
55
|
};
|
|
56
56
|
const headerButtonClassNames = "cds--btn--icon-only cds--header__action cds--btn cds--btn--primary cds--btn--icon-only cds--btn cds--btn--primary";
|
|
57
|
+
const instanceCheckMarkStyle = "instance-checkmark-style";
|
|
57
58
|
function Header(props) {
|
|
58
59
|
const { productName, baseEnvUrl, baseServicesUrl, carbonTheme = "g10", className, navLinks, platform, prefixName = "", rightPanel, skipToContentProps, templateMeteringEvent, triggerEvent, userTeams, } = props;
|
|
59
60
|
console.log("platform", platform);
|
|
@@ -82,8 +83,6 @@ function Header(props) {
|
|
|
82
83
|
function InstanceSwitcherMenu(props) {
|
|
83
84
|
// const currentURL= window.location.href;
|
|
84
85
|
const currentURL = "https://canada.ica.ibm.com/ica/launchpad";
|
|
85
|
-
console.log("currentURL", currentURL);
|
|
86
|
-
console.log("menuItems", props.menuItems);
|
|
87
86
|
const { isOpen, toggleActive, ref } = useHeaderMenu.default(MenuButtonId.InstanceSwitcher);
|
|
88
87
|
if (!props.enabled) {
|
|
89
88
|
return null;
|
|
@@ -92,7 +91,12 @@ function InstanceSwitcherMenu(props) {
|
|
|
92
91
|
React__default.default.createElement("button", { "aria-controls": MenuListId.instanceSwitcher, "aria-expanded": isOpen, "aria-haspopup": "menu", "aria-label": MenuAriaLabelRecord.instanceSwitcher, className: headerButtonClassNames, "data-testid": "header-instanceSwitcher-link", id: MenuButtonId.InstanceSwitcher, onClick: toggleActive },
|
|
93
92
|
React__default.default.createElement(icons.Wikis, { size: 20 })),
|
|
94
93
|
isOpen ? (React__default.default.createElement(HeaderMenu.default, { "aria-labelledby": MenuButtonId.InstanceSwitcher, id: MenuListId.instanceSwitcher }, Array.isArray(props.menuItems)
|
|
95
|
-
? props.menuItems.map((item) => (React__default.default.createElement(react.HeaderMenuItem, { "aria-label": `Instance Switcher for ${item.instanceName}`, "data-testid": "header-menu-instance-switcher", href: item.url, isCurrentPage: window?.location?.href && item.url ? window.location.href.startsWith(item.url) : false, key: item.instanceName, target: "_self", rel: "noopener noreferrer" },
|
|
94
|
+
? props.menuItems.map((item) => (React__default.default.createElement(react.HeaderMenuItem, { "aria-label": `Instance Switcher for ${item.instanceName}`, "data-testid": "header-menu-instance-switcher", href: item.url, isCurrentPage: window?.location?.href && item.url ? window.location.href.startsWith(item.url) : false, key: item.instanceName, target: "_self", rel: "noopener noreferrer" },
|
|
95
|
+
React__default.default.createElement("div", null,
|
|
96
|
+
React__default.default.createElement("span", null, item.instanceName),
|
|
97
|
+
currentURL.includes(item.instanceName) ? React__default.default.createElement("span", { className: instanceCheckMarkStyle },
|
|
98
|
+
React__default.default.createElement(icons.Checkmark, null),
|
|
99
|
+
" ") : ""))))
|
|
96
100
|
: null)) : null));
|
|
97
101
|
}
|
|
98
102
|
function RequestsMenu(props) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, Header as Header$1, SkipToContent, HeaderName, HeaderNavigation, HeaderMenuItem, HeaderGlobalBar, HeaderPanel, HeaderMenuButton, SideNav, SideNavItems, SideNavLink } from '@carbon/react';
|
|
3
|
-
import { Wikis, Collaborate, NotificationNew, Notification, Help, UserAvatar, Close, Switcher, OpenPanelFilledRight } from '@carbon/react/icons';
|
|
3
|
+
import { Wikis, Checkmark, Collaborate, NotificationNew, Notification, Help, UserAvatar, Close, Switcher, OpenPanelFilledRight } from '@carbon/react/icons';
|
|
4
4
|
import HeaderAppSwitcher from './HeaderAppSwitcher.js';
|
|
5
5
|
import HeaderMenu from './HeaderMenu.js';
|
|
6
6
|
import NotificationsContainer from '../Notifications/NotificationsContainer.js';
|
|
@@ -46,6 +46,7 @@ const MenuAriaLabelRecord = {
|
|
|
46
46
|
Switcher: "Switcher menu",
|
|
47
47
|
};
|
|
48
48
|
const headerButtonClassNames = "cds--btn--icon-only cds--header__action cds--btn cds--btn--primary cds--btn--icon-only cds--btn cds--btn--primary";
|
|
49
|
+
const instanceCheckMarkStyle = "instance-checkmark-style";
|
|
49
50
|
function Header(props) {
|
|
50
51
|
const { productName, baseEnvUrl, baseServicesUrl, carbonTheme = "g10", className, navLinks, platform, prefixName = "", rightPanel, skipToContentProps, templateMeteringEvent, triggerEvent, userTeams, } = props;
|
|
51
52
|
console.log("platform", platform);
|
|
@@ -74,8 +75,6 @@ function Header(props) {
|
|
|
74
75
|
function InstanceSwitcherMenu(props) {
|
|
75
76
|
// const currentURL= window.location.href;
|
|
76
77
|
const currentURL = "https://canada.ica.ibm.com/ica/launchpad";
|
|
77
|
-
console.log("currentURL", currentURL);
|
|
78
|
-
console.log("menuItems", props.menuItems);
|
|
79
78
|
const { isOpen, toggleActive, ref } = useHeaderMenu(MenuButtonId.InstanceSwitcher);
|
|
80
79
|
if (!props.enabled) {
|
|
81
80
|
return null;
|
|
@@ -84,7 +83,12 @@ function InstanceSwitcherMenu(props) {
|
|
|
84
83
|
React.createElement("button", { "aria-controls": MenuListId.instanceSwitcher, "aria-expanded": isOpen, "aria-haspopup": "menu", "aria-label": MenuAriaLabelRecord.instanceSwitcher, className: headerButtonClassNames, "data-testid": "header-instanceSwitcher-link", id: MenuButtonId.InstanceSwitcher, onClick: toggleActive },
|
|
85
84
|
React.createElement(Wikis, { size: 20 })),
|
|
86
85
|
isOpen ? (React.createElement(HeaderMenu, { "aria-labelledby": MenuButtonId.InstanceSwitcher, id: MenuListId.instanceSwitcher }, Array.isArray(props.menuItems)
|
|
87
|
-
? props.menuItems.map((item) => (React.createElement(HeaderMenuItem, { "aria-label": `Instance Switcher for ${item.instanceName}`, "data-testid": "header-menu-instance-switcher", href: item.url, isCurrentPage: window?.location?.href && item.url ? window.location.href.startsWith(item.url) : false, key: item.instanceName, target: "_self", rel: "noopener noreferrer" },
|
|
86
|
+
? props.menuItems.map((item) => (React.createElement(HeaderMenuItem, { "aria-label": `Instance Switcher for ${item.instanceName}`, "data-testid": "header-menu-instance-switcher", href: item.url, isCurrentPage: window?.location?.href && item.url ? window.location.href.startsWith(item.url) : false, key: item.instanceName, target: "_self", rel: "noopener noreferrer" },
|
|
87
|
+
React.createElement("div", null,
|
|
88
|
+
React.createElement("span", null, item.instanceName),
|
|
89
|
+
currentURL.includes(item.instanceName) ? React.createElement("span", { className: instanceCheckMarkStyle },
|
|
90
|
+
React.createElement(Checkmark, null),
|
|
91
|
+
" ") : ""))))
|
|
88
92
|
: null)) : null));
|
|
89
93
|
}
|
|
90
94
|
function RequestsMenu(props) {
|
package/package.json
CHANGED