Remove export action from the view options menu (#10517)

Closes https://github.com/twentyhq/core-team-issues/issues/64
Remove export action from the view options menu
This commit is contained in:
Raphaël Bosi
2025-02-26 18:20:07 +01:00
committed by GitHub
parent fa2930b0f9
commit 24aca790f7
2 changed files with 9 additions and 38 deletions

View File

@ -23,7 +23,6 @@ export class MainPage {
private readonly hiddenFieldsButton: Locator; private readonly hiddenFieldsButton: Locator;
private readonly editFieldsButton: Locator; private readonly editFieldsButton: Locator;
private readonly importButton: Locator; private readonly importButton: Locator;
private readonly exportButton: Locator;
private readonly deletedRecordsButton: Locator; private readonly deletedRecordsButton: Locator;
private readonly createNewRecordButton: Locator; private readonly createNewRecordButton: Locator;
private readonly addToFavoritesButton: Locator; private readonly addToFavoritesButton: Locator;
@ -67,16 +66,12 @@ export class MainPage {
this.importButton = page this.importButton = page
.getByTestId('tooltip') .getByTestId('tooltip')
.filter({ hasText: /^Import$/ }); .filter({ hasText: /^Import$/ });
this.exportButton = page
.getByTestId('tooltip')
.filter({ hasText: /^Export$/ });
this.deletedRecordsButton = page this.deletedRecordsButton = page
.getByTestId('tooltip') .getByTestId('tooltip')
.filter({ hasText: /^Deleted */ }); .filter({ hasText: /^Deleted */ });
this.createNewRecordButton = page.getByTestId('add-button'); this.createNewRecordButton = page.getByTestId('add-button');
this.addToFavoritesButton = page.getByText('Add to favorites'); this.addToFavoritesButton = page.getByText('Add to favorites');
this.deleteFromFavoritesButton = page.getByText('Delete from favorites'); this.deleteFromFavoritesButton = page.getByText('Delete from favorites');
this.exportBottomBarButton = page.getByText('Export');
this.deleteRecordsButton = page.getByText('Delete'); this.deleteRecordsButton = page.getByText('Delete');
} }
@ -166,10 +161,6 @@ export class MainPage {
await this.importButton.click(); await this.importButton.click();
} }
async clickExportButton() {
await this.exportButton.click();
}
async clickDeletedRecordsButton() { async clickDeletedRecordsButton() {
await this.deletedRecordsButton.click(); await this.deletedRecordsButton.click();
} }

View File

@ -1,7 +1,6 @@
import { Key } from 'ts-key-enum'; import { Key } from 'ts-key-enum';
import { import {
AppTooltip, AppTooltip,
IconFileExport,
IconFileImport, IconFileImport,
IconLayout, IconLayout,
IconLayoutList, IconLayoutList,
@ -19,10 +18,6 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi
import { useObjectOptionsForBoard } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsForBoard'; import { useObjectOptionsForBoard } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsForBoard';
import { useOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useOptionsDropdown'; import { useOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useOptionsDropdown';
import { recordGroupFieldMetadataComponentState } from '@/object-record/record-group/states/recordGroupFieldMetadataComponentState'; import { recordGroupFieldMetadataComponentState } from '@/object-record/record-group/states/recordGroupFieldMetadataComponentState';
import {
displayedExportProgress,
useExportRecords,
} from '@/object-record/record-index/export/hooks/useExportRecords';
import { TableOptionsHotkeyScope } from '@/object-record/record-table/types/TableOptionsHotkeyScope'; import { TableOptionsHotkeyScope } from '@/object-record/record-table/types/TableOptionsHotkeyScope';
import { useOpenObjectRecordsSpreadsheetImportDialog } from '@/object-record/spreadsheet-import/hooks/useOpenObjectRecordsSpreadsheetImportDialog'; import { useOpenObjectRecordsSpreadsheetImportDialog } from '@/object-record/spreadsheet-import/hooks/useOpenObjectRecordsSpreadsheetImportDialog';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader'; import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader';
@ -33,9 +28,9 @@ import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/
import { useGetCurrentView } from '@/views/hooks/useGetCurrentView'; import { useGetCurrentView } from '@/views/hooks/useGetCurrentView';
import { ViewType } from '@/views/types/ViewType'; import { ViewType } from '@/views/types/ViewType';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared'; import { isDefined } from 'twenty-shared';
import { FeatureFlagKey } from '~/generated-metadata/graphql'; import { FeatureFlagKey } from '~/generated-metadata/graphql';
import { useLingui } from '@lingui/react/macro';
export const ObjectOptionsDropdownMenuContent = () => { export const ObjectOptionsDropdownMenuContent = () => {
const { t } = useLingui(); const { t } = useLingui();
@ -90,14 +85,6 @@ export const ObjectOptionsDropdownMenuContent = () => {
objectMetadataItem.nameSingular, objectMetadataItem.nameSingular,
); );
const { progress, download } = useExportRecords({
delayMs: 100,
filename: `${objectMetadataItem.nameSingular}.csv`,
objectMetadataItem,
recordIndexId,
viewType,
});
// TODO: Remove this once we have implemented Rich Text v2 and removed the old rich text // TODO: Remove this once we have implemented Rich Text v2 and removed the old rich text
const canImportOrExport = const canImportOrExport =
objectMetadataItem.nameSingular !== CoreObjectNameSingular.Note && objectMetadataItem.nameSingular !== CoreObjectNameSingular.Note &&
@ -167,21 +154,14 @@ export const ObjectOptionsDropdownMenuContent = () => {
<DropdownMenuSeparator /> <DropdownMenuSeparator />
<DropdownMenuItemsContainer> <DropdownMenuItemsContainer>
{canImportOrExport && ( {canImportOrExport && (
<> <MenuItem
<MenuItem onClick={() => {
onClick={download} closeDropdown();
LeftIcon={IconFileExport} openObjectRecordsSpreasheetImportDialog();
text={displayedExportProgress(progress)} }}
/> LeftIcon={IconFileImport}
<MenuItem text={t`Import`}
onClick={() => { />
closeDropdown();
openObjectRecordsSpreasheetImportDialog();
}}
LeftIcon={IconFileImport}
text={t`Import`}
/>
</>
)} )}
<MenuItem <MenuItem
onClick={() => { onClick={() => {