diff --git a/src/components/list-empty-state/ListEmptyState.tsx b/src/components/list-empty-state/ListEmptyState.tsx index 6381fab0b3..cf0561fabd 100644 --- a/src/components/list-empty-state/ListEmptyState.tsx +++ b/src/components/list-empty-state/ListEmptyState.tsx @@ -9,6 +9,7 @@ import { EmptyStateSecondaryActions, } from "@patternfly/react-core"; import { PlusCircleIcon } from "@patternfly/react-icons"; +import { SearchIcon } from "@patternfly/react-icons"; export type Action = { text: string; @@ -19,8 +20,10 @@ export type Action = { export type ListEmptyStateProps = { message: string; instructions: string; - primaryActionText: string; - onPrimaryAction: MouseEventHandler; + primaryActionText?: string; + onPrimaryAction?: MouseEventHandler; + hasIcon?: boolean; + isSearchVariant?: boolean; secondaryActions?: Action[]; }; @@ -28,20 +31,28 @@ export const ListEmptyState = ({ message, instructions, onPrimaryAction, + hasIcon, + isSearchVariant, primaryActionText, secondaryActions, }: ListEmptyStateProps) => { return ( <> - + {hasIcon && isSearchVariant ? ( + + ) : ( + + )} {message} {instructions} - + {primaryActionText && ( + + )} {secondaryActions && ( {secondaryActions.map((action) => ( diff --git a/src/groups/GroupsSection.tsx b/src/groups/GroupsSection.tsx index b57af67193..f7e231a10b 100644 --- a/src/groups/GroupsSection.tsx +++ b/src/groups/GroupsSection.tsx @@ -8,6 +8,7 @@ import { ServerGroupMembersRepresentation, } from "./models/server-info"; import { TableToolbar } from "../components/table-toolbar/TableToolbar"; +import { ListEmptyState } from "../components/list-empty-state/ListEmptyState"; import { Button, Divider, @@ -90,16 +91,17 @@ export const GroupsSection = () => { + {!rawData && (
)} - {rawData && ( + {rawData && rawData.length > 0 ? ( @@ -122,8 +124,25 @@ export const GroupsSection = () => { } > - + {rawData && ( + + )} + {filteredData && filteredData.length === 0 && ( + + )} + ) : ( + )}
diff --git a/src/groups/messages.json b/src/groups/messages.json index 278e38d2e2..047b98793c 100644 --- a/src/groups/messages.json +++ b/src/groups/messages.json @@ -9,6 +9,10 @@ "members": "Members", "moveTo": "Move to", "delete": "Delete", - "tableOfGroups": "Table of groups" + "tableOfGroups": "Table of groups", + "noSearchResults": "No search results", + "noSearchResultsInstructions" : "Click on the search bar above to search for groups", + "noGroupsInThisRealm" : "No groups in this Realm", + "noGroupsInThisRealmInstructions" : "You haven't created any groups in this realm. Create a group to get started." } } diff --git a/yarn.lock b/yarn.lock index ac3faac5ec..32a4142a96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15237,7 +15237,7 @@ prepend-http@^1.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= -prettier@^2.0.5: +prettier@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==