Skip to content

Commit

Permalink
fix: users can be removed from all groups in Web UI (#9259)
Browse files Browse the repository at this point in the history
Co-authored-by: Amanda Vialva <amanda.vialva@hpe.com>
  • Loading branch information
maxrussell and amandavialva01 committed Apr 29, 2024
1 parent aea83df commit 86328cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions webui/react/src/components/ManageGroupsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Modal } from 'hew/Modal';
import Select, { Option } from 'hew/Select';
import Spinner from 'hew/Spinner';
import { useToast } from 'hew/Toast';
import lodash from 'lodash';
import React, { useEffect, useId } from 'react';

import { updateGroup } from 'services/api';
Expand Down Expand Up @@ -31,7 +32,7 @@ const ManageGroupsModalComponent: React.FC<Props> = ({ user, groupOptions, userG

const { openToast } = useToast();

const groupsValue = Form.useWatch(GROUPS_NAME, form);
const formGroupIds = Form.useWatch(GROUPS_NAME, form);

const { rbacEnabled } = useObservable(determinedStore.info);

Expand Down Expand Up @@ -81,7 +82,10 @@ const ManageGroupsModalComponent: React.FC<Props> = ({ user, groupOptions, userG
cancel
size="small"
submit={{
disabled: !groupsValue?.length,
disabled: lodash.isEqual(
userGroups.map((g) => g.group.groupId),
formGroupIds,
),
form: idPrefix + FORM_ID,
handleError,
handler: handleSubmit,
Expand Down

0 comments on commit 86328cb

Please sign in to comment.