diff --git a/client/src/app/layout/HeaderApp/SSOMenu.tsx b/client/src/app/layout/HeaderApp/SSOMenu.tsx
deleted file mode 100644
index 14e33b0dba..0000000000
--- a/client/src/app/layout/HeaderApp/SSOMenu.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-import React, { useState } from "react";
-import { useTranslation } from "react-i18next";
-import { useKeycloak } from "@react-keycloak/web";
-import {
- Dropdown,
- MenuToggle,
- DropdownGroup,
- DropdownItem,
- DropdownList,
- ToolbarItem,
-} from "@patternfly/react-core";
-import { isAuthRequired, LocalStorageKey } from "@app/Constants";
-import { useHistory } from "react-router-dom";
-
-export const SSOMenu: React.FC = () => {
- const { t } = useTranslation();
-
- const { keycloak } = (isAuthRequired && useKeycloak()) || {};
- const history = useHistory();
- const [isDropdownOpen, setIsDropdownOpen] = useState(false);
-
- const onDropdownSelect = () => {
- setIsDropdownOpen((current) => !current);
- };
-
- const onDropdownToggle = (isOpen: boolean) => {
- setIsDropdownOpen(isOpen);
- };
- return (
- <>
- {keycloak && (
-
- (
- onDropdownToggle(!isDropdownOpen)}
- >
- {(keycloak?.idTokenParsed as any)?.["preferred_username"] ??
- "DefaultUsername"}
-
- )}
- >
-
-
- keycloak.accountManagement()}
- >
- {t("actions.manageAccount")}
-
- {
- window.localStorage.removeItem(
- LocalStorageKey.selectedPersona
- );
- {
- keycloak
- .logout()
- .then((res) => {
- history.push("/");
- })
- .catch((err) => {
- console.error("Logout failed:", err);
- history.push("/");
- });
- }
- }}
- >
- {t("actions.logout")}
-
-
-
-
-
- )}
- >
- );
-};
diff --git a/client/src/app/layout/HeaderApp/SsoToolbarItem.tsx b/client/src/app/layout/HeaderApp/SsoToolbarItem.tsx
new file mode 100644
index 0000000000..6a6b519b19
--- /dev/null
+++ b/client/src/app/layout/HeaderApp/SsoToolbarItem.tsx
@@ -0,0 +1,87 @@
+import React, { useState } from "react";
+import { useTranslation } from "react-i18next";
+import { useKeycloak } from "@react-keycloak/web";
+import {
+ Dropdown,
+ MenuToggle,
+ DropdownGroup,
+ DropdownItem,
+ DropdownList,
+ ToolbarItem,
+} from "@patternfly/react-core";
+import { isAuthRequired, LocalStorageKey } from "@app/Constants";
+import { useHistory } from "react-router-dom";
+
+export const SsoToolbarItem: React.FC = () => {
+ return isAuthRequired ? : <>>;
+};
+
+export const AuthEnabledSsoToolbarItem: React.FC = () => {
+ const { t } = useTranslation();
+
+ const { keycloak } = useKeycloak();
+ const history = useHistory();
+ const [isDropdownOpen, setIsDropdownOpen] = useState(false);
+
+ const onDropdownSelect = () => {
+ setIsDropdownOpen((current) => !current);
+ };
+
+ const onDropdownToggle = (isOpen: boolean) => {
+ setIsDropdownOpen(isOpen);
+ };
+
+ return (
+
+ (
+ onDropdownToggle(!isDropdownOpen)}
+ >
+ {keycloak?.idTokenParsed?.["preferred_username"] ??
+ "DefaultUsername"}
+
+ )}
+ >
+
+
+ keycloak.accountManagement()}
+ >
+ {t("actions.manageAccount")}
+
+ {
+ window.localStorage.removeItem(LocalStorageKey.selectedPersona);
+ {
+ keycloak
+ .logout()
+ .then(() => {
+ history.push("/");
+ })
+ .catch((err) => {
+ console.error("Logout failed:", err);
+ history.push("/");
+ });
+ }
+ }}
+ >
+ {t("actions.logout")}
+
+
+
+
+
+ );
+};
diff --git a/client/src/app/layout/HeaderApp/tests/__snapshots__/HeaderApp.test.tsx.snap b/client/src/app/layout/HeaderApp/tests/__snapshots__/HeaderApp.test.tsx.snap
index 364f5996ac..4113ecfb71 100644
--- a/client/src/app/layout/HeaderApp/tests/__snapshots__/HeaderApp.test.tsx.snap
+++ b/client/src/app/layout/HeaderApp/tests/__snapshots__/HeaderApp.test.tsx.snap
@@ -68,18 +68,57 @@ exports[`Test snapshot 1`] = `
class="pf-v5-c-toolbar__content-section"
>
+
+
+
+
{
console.log("useFetchTaskByID", taskId, format, merged);
@@ -128,3 +134,26 @@ export const useFetchTaskByID = (
refetch,
};
};
+
+/** Fetch the TaskQueue counts. Defaults to `0` for all counts. */
+export const useFetchTaskQueue = (addon?: string) => {
+ const { data, error, refetch, isFetching } = useQuery({
+ queryKey: [TasksQueueKey, addon],
+ queryFn: () => getTaskQueue(addon),
+ refetchInterval: 5000,
+ initialData: {
+ total: 0,
+ ready: 0,
+ postponed: 0,
+ pending: 0,
+ running: 0,
+ } as TaskQueue,
+ });
+
+ return {
+ taskQueue: data,
+ isFetching,
+ error,
+ refetch,
+ };
+};