filter out parent group if it doesn't match (#28344)

fixes: #28079

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-04-03 10:56:08 +02:00 committed by GitHub
parent df55dafe8d
commit 952d484907
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -226,18 +226,20 @@ export const GroupPickerDialog = ({
.slice(groupId ? first : 0, max + (groupId ? first : 0))
.map((group: SelectableGroup) => (
<Fragment key={group.id}>
<GroupRow
key={group.id}
group={group}
isRowDisabled={isRowDisabled}
onSelect={setGroupId}
type={type}
isSearching={isSearching}
setIsSearching={setIsSearching}
selectedRows={selectedRows}
setSelectedRows={setSelectedRows}
canBrowse={canBrowse}
/>
{(!isSearching || group.name?.includes(filter)) && (
<GroupRow
key={group.id}
group={group}
isRowDisabled={isRowDisabled}
onSelect={setGroupId}
type={type}
isSearching={isSearching}
setIsSearching={setIsSearching}
selectedRows={selectedRows}
setSelectedRows={setSelectedRows}
canBrowse={canBrowse}
/>
)}
{isSearching &&
group.subGroups?.map((g) => (
<GroupRow