Fix: Wrong assignee on loading team member picker (#1894)

show only skeleton when loading
This commit is contained in:
Ayush Agrawal
2023-10-06 14:36:05 +05:30
committed by GitHub
parent 53021dc64f
commit 7574ad82fe

View File

@ -104,7 +104,15 @@ export const SingleEntitySelectBase = <
return ( return (
<> <>
<StyledDropdownMenuItemsContainer ref={containerRef} hasMaxHeight> <StyledDropdownMenuItemsContainer ref={containerRef} hasMaxHeight>
{isAllEntitySelectShown && selectAllLabel && onAllEntitySelected && ( {loading ? (
<DropdownMenuSkeletonItem />
) : entitiesInDropdown.length === 0 && !isAllEntitySelectShown ? (
<MenuItem text="No result" />
) : (
<>
{isAllEntitySelectShown &&
selectAllLabel &&
onAllEntitySelected && (
<MenuItemSelect <MenuItemSelect
onClick={() => onAllEntitySelected()} onClick={() => onAllEntitySelected()}
LeftIcon={SelectAllIcon} LeftIcon={SelectAllIcon}
@ -122,12 +130,7 @@ export const SingleEntitySelectBase = <
selected={!selectedEntity} selected={!selectedEntity}
/> />
)} )}
{loading ? ( {entitiesInDropdown?.map((entity) => (
<DropdownMenuSkeletonItem />
) : entitiesInDropdown.length === 0 && !isAllEntitySelectShown ? (
<MenuItem text="No result" />
) : (
entitiesInDropdown?.map((entity) => (
<MenuItemSelectAvatar <MenuItemSelectAvatar
key={entity.id} key={entity.id}
testId="menu-item" testId="menu-item"
@ -145,7 +148,8 @@ export const SingleEntitySelectBase = <
/> />
} }
/> />
)) ))}
</>
)} )}
</StyledDropdownMenuItemsContainer> </StyledDropdownMenuItemsContainer>
{showCreateButton && ( {showCreateButton && (