add functionality to select and add multiple groups

This commit is contained in:
jenny-s51 2021-04-15 15:46:47 -04:00
parent 559bf1ccee
commit 62b21dbfe1

View file

@ -32,7 +32,7 @@ export type UserFormProps = {
max?: number, max?: number,
search?: string search?: string
) => Promise<UserRepresentation[]>; ) => Promise<UserRepresentation[]>;
addGroups?: (newReps: GroupRepresentation[]) => void; addGroup?: (newGroup: GroupRepresentation) => void;
}; };
export const UserGroups = () => { export const UserGroups = () => {
@ -48,17 +48,12 @@ export const UserGroups = () => {
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const [username, setUsername] = useState(""); const [username, setUsername] = useState("");
const [join, setJoin] = useState<GroupTableData>();
const lastId = getLastId(location.pathname);
const [isDirectMembership, setDirectMembership] = useState(true); const [isDirectMembership, setDirectMembership] = useState(true);
const [directMembershipList, setDirectMembershipList] = useState< const [directMembershipList, setDirectMembershipList] = useState<
GroupRepresentation[] GroupRepresentation[]
>([]); >([]);
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [move, setMove] = useState<GroupTableData>();
const adminClient = useAdminClient(); const adminClient = useAdminClient();
const { id } = useParams<{ id: string }>(); const { id } = useParams<{ id: string }>();
@ -210,15 +205,6 @@ export const UserGroups = () => {
const toggleModal = () => { const toggleModal = () => {
setOpen(!open); setOpen(!open);
}; };
const JoinGroupButtonRenderer = (group: GroupRepresentation) => {
return (
<>
<Button onClick={() => joinGroup(group)} variant="link">
{t("users:joinGroup")}
</Button>
</>
);
};
const joinGroup = (group: GroupRepresentation) => { const joinGroup = (group: GroupRepresentation) => {
setSelectedGroup(group); setSelectedGroup(group);