diff --git a/src/components/bread-crumb/GroupBreadCrumbs.tsx b/src/components/bread-crumb/GroupBreadCrumbs.tsx
index e26bf1b7be..37d191e7d7 100644
--- a/src/components/bread-crumb/GroupBreadCrumbs.tsx
+++ b/src/components/bread-crumb/GroupBreadCrumbs.tsx
@@ -29,22 +29,28 @@ export const GroupBreadCrumbs = () => {
{t("groups")}
- {subGroups.map((group, i) => (
-
- {subGroups.length - 1 !== i && (
- remove(group)}
- >
- {group.name}
-
- )}
- {subGroups.length - 1 === i && <>{t("groups:groupDetails")}>}
-
- ))}
+ {subGroups.map((group, i) => {
+ const isLastGroup = i === subGroups.length - 1;
+ return (
+
+ {!isLastGroup && (
+ remove(group)}
+ >
+ {group.name}
+
+ )}
+ {isLastGroup &&
+ (group.id === "search"
+ ? group.name
+ : t("groups:groupDetails"))}
+
+ );
+ })}
)}
>
diff --git a/src/groups/SearchGroups.tsx b/src/groups/SearchGroups.tsx
index 0778aed2d9..1216ba7ccd 100644
--- a/src/groups/SearchGroups.tsx
+++ b/src/groups/SearchGroups.tsx
@@ -6,13 +6,13 @@ import {
ButtonVariant,
Chip,
ChipGroup,
- Form,
InputGroup,
PageSection,
PageSectionVariants,
- Text,
- TextContent,
+ Stack,
+ StackItem,
TextInput,
+ ToolbarItem,
} from "@patternfly/react-core";
import { SearchIcon } from "@patternfly/react-icons";
@@ -23,6 +23,7 @@ import { useRealm } from "../context/realm-context/RealmContext";
import { ListEmptyState } from "../components/list-empty-state/ListEmptyState";
import { GroupPath } from "../components/group/GroupPath";
import { useSubGroups } from "./SubGroupsContext";
+import { ViewHeader } from "../components/view-header/ViewHeader";
type SearchGroup = GroupRepresentation & {
link?: string;
@@ -40,7 +41,10 @@ export const SearchGroups = () => {
const refresh = () => setKey(new Date().getTime());
const { setSubGroups } = useSubGroups();
- useEffect(() => setSubGroups([{ name: t("searchGroups") }]), []);
+ useEffect(
+ () => setSubGroups([{ name: t("searchGroups"), id: "search" }]),
+ []
+ );
const deleteTerm = (id: string) => {
const index = searchTerms.indexOf(id);
@@ -50,21 +54,26 @@ export const SearchGroups = () => {
};
const addTerm = () => {
- setSearchTerms([...searchTerms, searchTerm]);
- setSearchTerm("");
- refresh();
+ if (searchTerm !== "") {
+ setSearchTerms([...searchTerms, searchTerm]);
+ setSearchTerm("");
+ refresh();
+ }
};
- const GroupNameCell = (group: SearchGroup) => {
- setSubGroups([{ name: t("searchGroups"), id: "search" }, group]);
- return (
- <>
-
- {group.name}
-
- >
- );
- };
+ const GroupNameCell = (group: SearchGroup) => (
+ <>
+
+ setSubGroups([{ name: t("searchGroups"), id: "search" }, group])
+ }
+ >
+ {group.name}
+
+ >
+ );
const flatten = (
groups: GroupRepresentation[],
@@ -106,46 +115,52 @@ export const SearchGroups = () => {
return (
<>
-
-
- {t("searchForGroups")}
-
-
+
+
+
+
+
+ setSearchTerm(value)}
+ onKeyDown={(event) => {
+ if (event.key === "Enter") {
+ addTerm();
+ }
+ }}
+ />
+
+
+
+
+
+ {searchTerms.map((term) => (
+ deleteTerm(term)}>
+ {term}
+
+ ))}
+
+
+
+
+ }
ariaLabelKey="groups:groups"
isPaginated
loader={loader}