mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-22 11:43:34 +03:00
Fixes "No Result" flash and add a separator (#8140)
Fix for #8137 --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
parent
c0484aa9a2
commit
95b475c855
2
.github/workflows/ci-tinybird.yaml
vendored
2
.github/workflows/ci-tinybird.yaml
vendored
@ -17,5 +17,5 @@ jobs:
|
||||
with:
|
||||
data_project_dir: packages/twenty-tinybird
|
||||
secrets:
|
||||
tb_admin_token: ${{ secrets.TINYBIRD_ADMIN_TOKEN }}
|
||||
tb_admin_token: ${{ secrets.TB_ADMIN_TOKEN }}
|
||||
tb_host: https://api.eu-central-1.aws.tinybird.co
|
@ -13,7 +13,6 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
|
||||
import { SelectableItem } from '@/ui/layout/selectable-list/components/SelectableItem';
|
||||
import { SelectableList } from '@/ui/layout/selectable-list/components/SelectableList';
|
||||
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
|
||||
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||
import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousHotkeyScope';
|
||||
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
|
||||
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
|
||||
@ -119,22 +118,15 @@ export const MultiRecordSelect = ({
|
||||
);
|
||||
})}
|
||||
</SelectableList>
|
||||
{objectRecordsIdsMultiSelect?.length === 0 &&
|
||||
!recordMultiSelectIsLoading && <MenuItem text="No result" />}
|
||||
</DropdownMenuItemsContainer>
|
||||
);
|
||||
|
||||
const createNewButton = isDefined(onCreate) && (
|
||||
<>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItemsContainer>
|
||||
<CreateNewButton
|
||||
onClick={() => onCreate?.(relationPickerSearchFilter)}
|
||||
LeftIcon={IconPlus}
|
||||
text="Add New"
|
||||
/>
|
||||
</DropdownMenuItemsContainer>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
@ -148,14 +140,22 @@ export const MultiRecordSelect = ({
|
||||
<DropdownMenu ref={containerRef} data-select-disable>
|
||||
{dropdownPlacement?.includes('end') && (
|
||||
<>
|
||||
<DropdownMenuItemsContainer>
|
||||
{createNewButton}
|
||||
</DropdownMenuItemsContainer>
|
||||
<DropdownMenuSeparator />
|
||||
{results}
|
||||
{recordMultiSelectIsLoading && !relationPickerSearchFilter && (
|
||||
<>
|
||||
<DropdownMenuSkeletonItem />
|
||||
)}
|
||||
<DropdownMenuSeparator />
|
||||
</>
|
||||
)}
|
||||
{objectRecordsIdsMultiSelect?.length > 0 && (
|
||||
<DropdownMenuSeparator />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<DropdownMenuSearchInput
|
||||
value={relationPickerSearchFilter}
|
||||
onChange={handleFilterChange}
|
||||
@ -166,10 +166,18 @@ export const MultiRecordSelect = ({
|
||||
<>
|
||||
<DropdownMenuSeparator />
|
||||
{recordMultiSelectIsLoading && !relationPickerSearchFilter && (
|
||||
<>
|
||||
<DropdownMenuSkeletonItem />
|
||||
<DropdownMenuSeparator />
|
||||
</>
|
||||
)}
|
||||
{results}
|
||||
{objectRecordsIdsMultiSelect?.length > 0 && (
|
||||
<DropdownMenuSeparator />
|
||||
)}
|
||||
<DropdownMenuItemsContainer>
|
||||
{createNewButton}
|
||||
</DropdownMenuItemsContainer>
|
||||
</>
|
||||
)}
|
||||
</DropdownMenu>
|
||||
|
Loading…
Reference in New Issue
Block a user