mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
feat: limit user filter options (#9179)
This commit is contained in:
parent
1b97b1b931
commit
ec014c0fdf
@ -125,12 +125,14 @@ export const GroupFormUsersSelect: VFC<IGroupFormUsersSelectProps> = ({
|
|||||||
renderOption(props, option as UserOption, selected)
|
renderOption(props, option as UserOption, selected)
|
||||||
}
|
}
|
||||||
filterOptions={(options, { inputValue }) =>
|
filterOptions={(options, { inputValue }) =>
|
||||||
options.filter(
|
options
|
||||||
|
.filter(
|
||||||
({ name, username, email }) =>
|
({ name, username, email }) =>
|
||||||
caseInsensitiveSearch(inputValue, email) ||
|
caseInsensitiveSearch(inputValue, email) ||
|
||||||
caseInsensitiveSearch(inputValue, name) ||
|
caseInsensitiveSearch(inputValue, name) ||
|
||||||
caseInsensitiveSearch(inputValue, username),
|
caseInsensitiveSearch(inputValue, username),
|
||||||
)
|
)
|
||||||
|
.slice(0, 100)
|
||||||
}
|
}
|
||||||
isOptionEqualToValue={(option, value) => option.id === value.id}
|
isOptionEqualToValue={(option, value) => option.id === value.id}
|
||||||
getOptionLabel={(option: UserOption) =>
|
getOptionLabel={(option: UserOption) =>
|
||||||
|
@ -414,9 +414,11 @@ export const ProjectAccessAssign = ({
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
filterOptions={(options, { inputValue }) =>
|
filterOptions={(options, { inputValue }) =>
|
||||||
options.filter((option: IAccessOption) => {
|
options
|
||||||
|
.filter((option: IAccessOption) => {
|
||||||
if (
|
if (
|
||||||
option.type === ENTITY_TYPE.USER ||
|
option.type ===
|
||||||
|
ENTITY_TYPE.USER ||
|
||||||
option.type ===
|
option.type ===
|
||||||
ENTITY_TYPE.SERVICE_ACCOUNT
|
ENTITY_TYPE.SERVICE_ACCOUNT
|
||||||
) {
|
) {
|
||||||
@ -442,6 +444,7 @@ export const ProjectAccessAssign = ({
|
|||||||
option.entity.name,
|
option.entity.name,
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
.slice(0, 100)
|
||||||
}
|
}
|
||||||
isOptionEqualToValue={(option, value) =>
|
isOptionEqualToValue={(option, value) =>
|
||||||
option.type === value.type &&
|
option.type === value.type &&
|
||||||
|
Loading…
Reference in New Issue
Block a user