RBAC: hide the empty basic role from the org role picker (#72276)

hide the empty basic role from the org role picker
This commit is contained in:
Ieva
2023-07-25 13:54:53 +01:00
committed by GitHub
parent 8e090f9951
commit 783a8527c5

View File

@ -13,7 +13,8 @@ interface Props {
width?: number | 'auto';
}
const options = Object.keys(OrgRole).map((key) => ({ label: key, value: key }));
const basicRoles = Object.values(OrgRole).filter((r) => r !== OrgRole.None);
const options = basicRoles.map((r) => ({ label: r, value: r }));
export function OrgRolePicker({ value, onChange, 'aria-label': ariaLabel, inputId, autoFocus, ...restProps }: Props) {
return (