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:
@ -23,7 +23,6 @@ export class MainPage {
|
||||
private readonly hiddenFieldsButton: Locator;
|
||||
private readonly editFieldsButton: Locator;
|
||||
private readonly importButton: Locator;
|
||||
private readonly exportButton: Locator;
|
||||
private readonly deletedRecordsButton: Locator;
|
||||
private readonly createNewRecordButton: Locator;
|
||||
private readonly addToFavoritesButton: Locator;
|
||||
@ -67,16 +66,12 @@ export class MainPage {
|
||||
this.importButton = page
|
||||
.getByTestId('tooltip')
|
||||
.filter({ hasText: /^Import$/ });
|
||||
this.exportButton = page
|
||||
.getByTestId('tooltip')
|
||||
.filter({ hasText: /^Export$/ });
|
||||
this.deletedRecordsButton = page
|
||||
.getByTestId('tooltip')
|
||||
.filter({ hasText: /^Deleted */ });
|
||||
this.createNewRecordButton = page.getByTestId('add-button');
|
||||
this.addToFavoritesButton = page.getByText('Add to favorites');
|
||||
this.deleteFromFavoritesButton = page.getByText('Delete from favorites');
|
||||
this.exportBottomBarButton = page.getByText('Export');
|
||||
this.deleteRecordsButton = page.getByText('Delete');
|
||||
}
|
||||
|
||||
@ -166,10 +161,6 @@ export class MainPage {
|
||||
await this.importButton.click();
|
||||
}
|
||||
|
||||
async clickExportButton() {
|
||||
await this.exportButton.click();
|
||||
}
|
||||
|
||||
async clickDeletedRecordsButton() {
|
||||
await this.deletedRecordsButton.click();
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Key } from 'ts-key-enum';
|
||||
import {
|
||||
AppTooltip,
|
||||
IconFileExport,
|
||||
IconFileImport,
|
||||
IconLayout,
|
||||
IconLayoutList,
|
||||
@ -19,10 +18,6 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi
|
||||
import { useObjectOptionsForBoard } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsForBoard';
|
||||
import { useOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useOptionsDropdown';
|
||||
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 { useOpenObjectRecordsSpreadsheetImportDialog } from '@/object-record/spreadsheet-import/hooks/useOpenObjectRecordsSpreadsheetImportDialog';
|
||||
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 { ViewType } from '@/views/types/ViewType';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
import { FeatureFlagKey } from '~/generated-metadata/graphql';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
|
||||
export const ObjectOptionsDropdownMenuContent = () => {
|
||||
const { t } = useLingui();
|
||||
@ -90,14 +85,6 @@ export const ObjectOptionsDropdownMenuContent = () => {
|
||||
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
|
||||
const canImportOrExport =
|
||||
objectMetadataItem.nameSingular !== CoreObjectNameSingular.Note &&
|
||||
@ -167,21 +154,14 @@ export const ObjectOptionsDropdownMenuContent = () => {
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItemsContainer>
|
||||
{canImportOrExport && (
|
||||
<>
|
||||
<MenuItem
|
||||
onClick={download}
|
||||
LeftIcon={IconFileExport}
|
||||
text={displayedExportProgress(progress)}
|
||||
/>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
closeDropdown();
|
||||
openObjectRecordsSpreasheetImportDialog();
|
||||
}}
|
||||
LeftIcon={IconFileImport}
|
||||
text={t`Import`}
|
||||
/>
|
||||
</>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
closeDropdown();
|
||||
openObjectRecordsSpreasheetImportDialog();
|
||||
}}
|
||||
LeftIcon={IconFileImport}
|
||||
text={t`Import`}
|
||||
/>
|
||||
)}
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
|
||||
Reference in New Issue
Block a user