@boomerang-io/carbon-addons-boomerang-react 4.6.5-beta.34 → 4.6.5-beta.36
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.
|
@@ -58,7 +58,6 @@ const instanceCheckMarkStyle = "instance-checkmark-style";
|
|
|
58
58
|
function Header(props) {
|
|
59
59
|
const { productName, baseEnvUrl, baseServicesUrl, carbonTheme = "g10", className, navLinks, platform, prefixName = "", rightPanel, skipToContentProps, templateMeteringEvent, triggerEvent, userTeams, } = props;
|
|
60
60
|
console.log("platform", platform);
|
|
61
|
-
console.log("enabled", platform?.instanceSwitcherEnabled);
|
|
62
61
|
return (React__default.default.createElement(React__default.default.Fragment, null,
|
|
63
62
|
React__default.default.createElement(react.Theme, { theme: carbonTheme },
|
|
64
63
|
React__default.default.createElement(react.Header, { "aria-label": "App navigation header", className: className },
|
|
@@ -69,7 +68,7 @@ function Header(props) {
|
|
|
69
68
|
? navLinks.map((link) => (React__default.default.createElement(react.HeaderMenuItem, { "aria-label": `Link for ${link.name}`, "data-testid": "header-menu-link", href: link.url, isCurrentPage: window?.location?.href && link.url ? window.location.href.startsWith(link.url) : false, key: link.name, target: link.isExternal ? "_blank" : undefined, rel: link.isExternal ? "noopener noreferrer" : undefined }, link.name)))
|
|
70
69
|
: null),
|
|
71
70
|
React__default.default.createElement(react.HeaderGlobalBar, null,
|
|
72
|
-
|
|
71
|
+
props?.instanceSwitcherEnabled &&
|
|
73
72
|
React__default.default.createElement(InstanceSwitcherMenu, { enabled: Boolean(props.instanceSwitcherEnabled), menuItems: platform?.instances }),
|
|
74
73
|
React__default.default.createElement(RequestsMenu, { baseEnvUrl: baseEnvUrl, enabled: Boolean(props.requestSummary), summary: props.requestSummary }),
|
|
75
74
|
React__default.default.createElement(NotificationsMenu, { baseEnvUrl: baseEnvUrl, baseServicesUrl: baseServicesUrl, enabled: Boolean(props.enableNotifications), countEnabled: Boolean(props.enableNotificationsCount) }),
|
|
@@ -80,8 +79,7 @@ function Header(props) {
|
|
|
80
79
|
React__default.default.createElement(NotificationsContainer.default, { enableMultiContainer: true, containerId: `${settings.prefix}--bmrg-header-notifications` })));
|
|
81
80
|
}
|
|
82
81
|
function InstanceSwitcherMenu(props) {
|
|
83
|
-
|
|
84
|
-
const currentURL = "https://uki.ica.ibm.com";
|
|
82
|
+
const currentURL = window.location.href;
|
|
85
83
|
const { isOpen, toggleActive, ref } = useHeaderMenu.default(MenuButtonId.InstanceSwitcher);
|
|
86
84
|
if (!props.enabled) {
|
|
87
85
|
return null;
|
|
@@ -40,7 +40,7 @@ function UIShell({ baseEnvUrl, carbonTheme = "g10", config, leftPanel, platformN
|
|
|
40
40
|
* Check feature enablement via explicit feature flags
|
|
41
41
|
*/
|
|
42
42
|
const isAppSwitcherEnabled = Boolean(features?.["appSwitcher.enabled"]);
|
|
43
|
-
const instanceSwitcherEnabled = Boolean(
|
|
43
|
+
const instanceSwitcherEnabled = Boolean(platform?.["instanceSwitcherEnabled"]);
|
|
44
44
|
const isFeedbackEnabled = Boolean(features?.["feedback.enabled"]);
|
|
45
45
|
const isNotificationsEnabled = Boolean(features?.["notifications.enabled"]);
|
|
46
46
|
const isNotificationsCountEnabled = Boolean(features?.["notificationsCount.enabled"]);
|
|
@@ -50,7 +50,6 @@ const instanceCheckMarkStyle = "instance-checkmark-style";
|
|
|
50
50
|
function Header(props) {
|
|
51
51
|
const { productName, baseEnvUrl, baseServicesUrl, carbonTheme = "g10", className, navLinks, platform, prefixName = "", rightPanel, skipToContentProps, templateMeteringEvent, triggerEvent, userTeams, } = props;
|
|
52
52
|
console.log("platform", platform);
|
|
53
|
-
console.log("enabled", platform?.instanceSwitcherEnabled);
|
|
54
53
|
return (React.createElement(React.Fragment, null,
|
|
55
54
|
React.createElement(Theme, { theme: carbonTheme },
|
|
56
55
|
React.createElement(Header$1, { "aria-label": "App navigation header", className: className },
|
|
@@ -61,7 +60,7 @@ function Header(props) {
|
|
|
61
60
|
? navLinks.map((link) => (React.createElement(HeaderMenuItem, { "aria-label": `Link for ${link.name}`, "data-testid": "header-menu-link", href: link.url, isCurrentPage: window?.location?.href && link.url ? window.location.href.startsWith(link.url) : false, key: link.name, target: link.isExternal ? "_blank" : undefined, rel: link.isExternal ? "noopener noreferrer" : undefined }, link.name)))
|
|
62
61
|
: null),
|
|
63
62
|
React.createElement(HeaderGlobalBar, null,
|
|
64
|
-
|
|
63
|
+
props?.instanceSwitcherEnabled &&
|
|
65
64
|
React.createElement(InstanceSwitcherMenu, { enabled: Boolean(props.instanceSwitcherEnabled), menuItems: platform?.instances }),
|
|
66
65
|
React.createElement(RequestsMenu, { baseEnvUrl: baseEnvUrl, enabled: Boolean(props.requestSummary), summary: props.requestSummary }),
|
|
67
66
|
React.createElement(NotificationsMenu, { baseEnvUrl: baseEnvUrl, baseServicesUrl: baseServicesUrl, enabled: Boolean(props.enableNotifications), countEnabled: Boolean(props.enableNotificationsCount) }),
|
|
@@ -72,8 +71,7 @@ function Header(props) {
|
|
|
72
71
|
React.createElement(NotificationsContainer, { enableMultiContainer: true, containerId: `${prefix}--bmrg-header-notifications` })));
|
|
73
72
|
}
|
|
74
73
|
function InstanceSwitcherMenu(props) {
|
|
75
|
-
|
|
76
|
-
const currentURL = "https://uki.ica.ibm.com";
|
|
74
|
+
const currentURL = window.location.href;
|
|
77
75
|
const { isOpen, toggleActive, ref } = useHeaderMenu(MenuButtonId.InstanceSwitcher);
|
|
78
76
|
if (!props.enabled) {
|
|
79
77
|
return null;
|
|
@@ -32,7 +32,7 @@ function UIShell({ baseEnvUrl, carbonTheme = "g10", config, leftPanel, platformN
|
|
|
32
32
|
* Check feature enablement via explicit feature flags
|
|
33
33
|
*/
|
|
34
34
|
const isAppSwitcherEnabled = Boolean(features?.["appSwitcher.enabled"]);
|
|
35
|
-
const instanceSwitcherEnabled = Boolean(
|
|
35
|
+
const instanceSwitcherEnabled = Boolean(platform?.["instanceSwitcherEnabled"]);
|
|
36
36
|
const isFeedbackEnabled = Boolean(features?.["feedback.enabled"]);
|
|
37
37
|
const isNotificationsEnabled = Boolean(features?.["notifications.enabled"]);
|
|
38
38
|
const isNotificationsCountEnabled = Boolean(features?.["notificationsCount.enabled"]);
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED