Add back export all action button (#4750)
 
This commit is contained in:
@ -3,11 +3,13 @@ import { Key } from 'ts-key-enum';
|
|||||||
import {
|
import {
|
||||||
IconBaselineDensitySmall,
|
IconBaselineDensitySmall,
|
||||||
IconChevronLeft,
|
IconChevronLeft,
|
||||||
|
IconFileExport,
|
||||||
IconFileImport,
|
IconFileImport,
|
||||||
IconTag,
|
IconTag,
|
||||||
} from 'twenty-ui';
|
} from 'twenty-ui';
|
||||||
|
|
||||||
import { RECORD_INDEX_OPTIONS_DROPDOWN_ID } from '@/object-record/record-index/options/constants/RecordIndexOptionsDropdownId';
|
import { RECORD_INDEX_OPTIONS_DROPDOWN_ID } from '@/object-record/record-index/options/constants/RecordIndexOptionsDropdownId';
|
||||||
|
import { useExportTableData } from '@/object-record/record-index/options/hooks/useExportTableData.ts';
|
||||||
import { useRecordIndexOptionsForBoard } from '@/object-record/record-index/options/hooks/useRecordIndexOptionsForBoard';
|
import { useRecordIndexOptionsForBoard } from '@/object-record/record-index/options/hooks/useRecordIndexOptionsForBoard';
|
||||||
import { useRecordIndexOptionsForTable } from '@/object-record/record-index/options/hooks/useRecordIndexOptionsForTable';
|
import { useRecordIndexOptionsForTable } from '@/object-record/record-index/options/hooks/useRecordIndexOptionsForTable';
|
||||||
import { TableOptionsHotkeyScope } from '@/object-record/record-table/types/TableOptionsHotkeyScope';
|
import { TableOptionsHotkeyScope } from '@/object-record/record-table/types/TableOptionsHotkeyScope';
|
||||||
@ -97,6 +99,13 @@ export const RecordIndexOptionsDropdownContent = ({
|
|||||||
const { openRecordSpreadsheetImport } =
|
const { openRecordSpreadsheetImport } =
|
||||||
useSpreadsheetRecordImport(objectNameSingular);
|
useSpreadsheetRecordImport(objectNameSingular);
|
||||||
|
|
||||||
|
const { progress, download } = useExportTableData({
|
||||||
|
delayMs: 100,
|
||||||
|
filename: `${objectNameSingular}.csv`,
|
||||||
|
objectNameSingular,
|
||||||
|
recordIndexId,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!currentMenu && (
|
{!currentMenu && (
|
||||||
@ -111,6 +120,11 @@ export const RecordIndexOptionsDropdownContent = ({
|
|||||||
LeftIcon={IconFileImport}
|
LeftIcon={IconFileImport}
|
||||||
text="Import"
|
text="Import"
|
||||||
/>
|
/>
|
||||||
|
<MenuItem
|
||||||
|
onClick={download}
|
||||||
|
LeftIcon={IconFileExport}
|
||||||
|
text={progress === undefined ? `Export` : `Export (${progress}%)`}
|
||||||
|
/>
|
||||||
</DropdownMenuItemsContainer>
|
</DropdownMenuItemsContainer>
|
||||||
)}
|
)}
|
||||||
{currentMenu === 'fields' && (
|
{currentMenu === 'fields' && (
|
||||||
|
|||||||
Reference in New Issue
Block a user