diff --git a/js/apps/account-ui/src/resources/ResourcesTab.tsx b/js/apps/account-ui/src/resources/ResourcesTab.tsx index 7b34fc1267e4..ade3331998a4 100644 --- a/js/apps/account-ui/src/resources/ResourcesTab.tsx +++ b/js/apps/account-ui/src/resources/ResourcesTab.tsx @@ -2,6 +2,10 @@ import { Button, Chip, ChipGroup, + Dropdown, + DropdownItem, + DropdownList, + MenuToggle, OverflowMenu, OverflowMenuContent, OverflowMenuControl, @@ -10,13 +14,9 @@ import { OverflowMenuItem, Spinner, } from "@patternfly/react-core"; -import { - Dropdown, - DropdownItem, - KebabToggle, -} from "@patternfly/react-core/deprecated"; import { EditAltIcon, + EllipsisVIcon, ExternalLinkAltIcon, Remove2Icon, ShareAltIcon, @@ -255,19 +255,32 @@ export const ResourcesTab = ({ isShared = false }: ResourcesTabProps) => { - toggleOpen(resource._id, "contextOpen", open) - } - /> + popperProps={{ + position: "right", + }} + onOpenChange={(isOpen) => + toggleOpen(resource._id, "contextOpen", isOpen) } - isOpen={details[resource._id]?.contextOpen} - isPlain - dropdownItems={[ + toggle={(ref) => ( + + toggleOpen( + resource._id, + "contextOpen", + !details[resource._id]?.contextOpen, + ) + } + isExpanded={details[resource._id]?.contextOpen} + > + + + )} + isOpen={!!details[resource._id]?.contextOpen} + > + { } > {t("edit")} - , + {t("unShare")} @@ -300,25 +312,39 @@ export const ResourcesTab = ({ isShared = false }: ResourcesTabProps) => { } > {t("unShareAllConfirm")} - , - ]} - /> + + + - toggleOpen(resource._id, "contextOpen", open) - } - /> + popperProps={{ + position: "right", + }} + onOpenChange={(isOpen) => + toggleOpen(resource._id, "contextOpen", isOpen) } - isOpen={details[resource._id]?.contextOpen} - isPlain - dropdownItems={[ + toggle={(ref) => ( + + toggleOpen( + resource._id, + "contextOpen", + !details[resource._id]?.contextOpen, + ) + } + > + + + )} + isOpen={!!details[resource._id]?.contextOpen} + > + { } > {t("share")} - , + toggleOpen(resource._id, "editDialogOpen", true) } + isDisabled={ + details[resource._id]?.permissions?.length === 0 + } > {t("edit")} - , + { } > {t("unShareAllConfirm")} - , - ]} - /> + + +