Create import csv action (#10624)
Closes https://github.com/twentyhq/core-team-issues/issues/63 This PR: - Creates an **Import csv** action - Allows the import of notes and tasks - Removes the import action from the index option menu - Adds export action when only one record is selected - Adds see deleted record action to workflow objects
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { useDeleteMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useDeleteMultipleRecordsAction';
|
||||
import { useExportMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useExportMultipleRecordsAction';
|
||||
import { MultipleRecordsActionKeys } from '@/action-menu/actions/record-actions/multiple-records/types/MultipleRecordsActionKeys';
|
||||
import { useImportRecordsNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useImportRecordsNoSelectionRecordAction';
|
||||
import { useSeeDeletedRecordsNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useSeeDeletedRecordsNoSelectionRecordAction';
|
||||
import { NoSelectionRecordActionKeys } from '@/action-menu/actions/record-actions/no-selection/types/NoSelectionRecordActionsKey';
|
||||
import { useAddToFavoritesSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useAddToFavoritesSingleRecordAction';
|
||||
@ -17,6 +18,7 @@ import {
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import {
|
||||
IconDatabaseExport,
|
||||
IconFileImport,
|
||||
IconHeart,
|
||||
IconHeartOff,
|
||||
IconRotate2,
|
||||
@ -83,13 +85,29 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
availableOn: [ActionViewType.INDEX_PAGE_BULK_SELECTION],
|
||||
useAction: useDeleteMultipleRecordsAction,
|
||||
},
|
||||
exportSingleRecord: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.EXPORT,
|
||||
label: msg`Export record`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 4,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [
|
||||
ActionViewType.SHOW_PAGE,
|
||||
ActionViewType.INDEX_PAGE_SINGLE_RECORD_SELECTION,
|
||||
],
|
||||
useAction: useExportMultipleRecordsAction,
|
||||
},
|
||||
exportMultipleRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: msg`Export records`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 4,
|
||||
position: 5,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
@ -102,7 +120,7 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 5,
|
||||
position: 6,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
@ -115,11 +133,24 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
key: NoSelectionRecordActionKeys.SEE_DELETED_RECORDS,
|
||||
label: msg`See deleted records`,
|
||||
shortLabel: msg`Deleted records`,
|
||||
position: 6,
|
||||
position: 7,
|
||||
Icon: IconRotate2,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useSeeDeletedRecordsNoSelectionRecordAction,
|
||||
},
|
||||
importRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.IMPORT_RECORDS,
|
||||
label: msg`Import records`,
|
||||
shortLabel: msg`Import`,
|
||||
position: 8,
|
||||
Icon: IconFileImport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useImportRecordsNoSelectionRecordAction,
|
||||
},
|
||||
};
|
||||
|
||||
@ -3,6 +3,7 @@ import { useDestroyMultipleRecordsAction } from '@/action-menu/actions/record-ac
|
||||
import { useExportMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useExportMultipleRecordsAction';
|
||||
import { MultipleRecordsActionKeys } from '@/action-menu/actions/record-actions/multiple-records/types/MultipleRecordsActionKeys';
|
||||
import { useCreateNewTableRecordNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useCreateNewTableRecordNoSelectionRecordAction';
|
||||
import { useImportRecordsNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useImportRecordsNoSelectionRecordAction';
|
||||
import { useSeeDeletedRecordsNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useSeeDeletedRecordsNoSelectionRecordAction';
|
||||
import { NoSelectionRecordActionKeys } from '@/action-menu/actions/record-actions/no-selection/types/NoSelectionRecordActionsKey';
|
||||
import { useAddToFavoritesSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useAddToFavoritesSingleRecordAction';
|
||||
@ -26,6 +27,7 @@ import {
|
||||
IconChevronUp,
|
||||
IconDatabaseExport,
|
||||
IconFileExport,
|
||||
IconFileImport,
|
||||
IconHeart,
|
||||
IconHeartOff,
|
||||
IconPlus,
|
||||
@ -123,13 +125,29 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
availableOn: [ActionViewType.INDEX_PAGE_BULK_SELECTION],
|
||||
useAction: useDeleteMultipleRecordsAction,
|
||||
},
|
||||
exportSingleRecord: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.EXPORT,
|
||||
label: msg`Export record`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 6,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [
|
||||
ActionViewType.SHOW_PAGE,
|
||||
ActionViewType.INDEX_PAGE_SINGLE_RECORD_SELECTION,
|
||||
],
|
||||
useAction: useExportMultipleRecordsAction,
|
||||
},
|
||||
exportMultipleRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: msg`Export records`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 6,
|
||||
position: 7,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
@ -142,7 +160,7 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 7,
|
||||
position: 8,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
@ -155,20 +173,33 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
key: NoSelectionRecordActionKeys.SEE_DELETED_RECORDS,
|
||||
label: msg`See deleted records`,
|
||||
shortLabel: msg`Deleted records`,
|
||||
position: 8,
|
||||
position: 9,
|
||||
Icon: IconRotate2,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useSeeDeletedRecordsNoSelectionRecordAction,
|
||||
},
|
||||
importRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.IMPORT_RECORDS,
|
||||
label: msg`Import records`,
|
||||
shortLabel: msg`Import`,
|
||||
position: 10,
|
||||
Icon: IconFileImport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useImportRecordsNoSelectionRecordAction,
|
||||
},
|
||||
destroySingleRecord: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.DESTROY,
|
||||
label: msg`Permanently destroy record`,
|
||||
shortLabel: msg`Destroy`,
|
||||
position: 9,
|
||||
position: 11,
|
||||
Icon: IconTrashX,
|
||||
accent: 'danger',
|
||||
isPinned: true,
|
||||
@ -183,7 +214,7 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_PREVIOUS_RECORD,
|
||||
label: msg`Navigate to previous record`,
|
||||
position: 10,
|
||||
position: 12,
|
||||
isPinned: true,
|
||||
Icon: IconChevronUp,
|
||||
availableOn: [ActionViewType.SHOW_PAGE],
|
||||
@ -194,7 +225,7 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_NEXT_RECORD,
|
||||
label: msg`Navigate to next record`,
|
||||
position: 11,
|
||||
position: 13,
|
||||
isPinned: true,
|
||||
Icon: IconChevronDown,
|
||||
availableOn: [ActionViewType.SHOW_PAGE],
|
||||
@ -206,7 +237,7 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
key: MultipleRecordsActionKeys.DESTROY,
|
||||
label: msg`Permanently destroy records`,
|
||||
shortLabel: msg`Destroy`,
|
||||
position: 12,
|
||||
position: 14,
|
||||
Icon: IconTrashX,
|
||||
accent: 'danger',
|
||||
isPinned: true,
|
||||
|
||||
@ -3,6 +3,8 @@ import { useDestroyMultipleRecordsAction } from '@/action-menu/actions/record-ac
|
||||
import { useExportMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useExportMultipleRecordsAction';
|
||||
import { MultipleRecordsActionKeys } from '@/action-menu/actions/record-actions/multiple-records/types/MultipleRecordsActionKeys';
|
||||
import { useCreateNewTableRecordNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useCreateNewTableRecordNoSelectionRecordAction';
|
||||
import { useImportRecordsNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useImportRecordsNoSelectionRecordAction';
|
||||
import { useSeeDeletedRecordsNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useSeeDeletedRecordsNoSelectionRecordAction';
|
||||
import { NoSelectionRecordActionKeys } from '@/action-menu/actions/record-actions/no-selection/types/NoSelectionRecordActionsKey';
|
||||
import { useAddToFavoritesSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useAddToFavoritesSingleRecordAction';
|
||||
import { useDeleteSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useDeleteSingleRecordAction';
|
||||
@ -31,6 +33,7 @@ import {
|
||||
IconChevronDown,
|
||||
IconChevronUp,
|
||||
IconDatabaseExport,
|
||||
IconFileImport,
|
||||
IconHeart,
|
||||
IconHeartOff,
|
||||
IconHistory,
|
||||
@ -40,6 +43,7 @@ import {
|
||||
IconPlayerPlay,
|
||||
IconPlus,
|
||||
IconPower,
|
||||
IconRotate2,
|
||||
IconTrash,
|
||||
IconTrashX,
|
||||
} from 'twenty-ui';
|
||||
@ -52,7 +56,7 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
> = {
|
||||
createNewRecord: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.CREATE_NEW_RECORD,
|
||||
label: msg`Create new record`,
|
||||
shortLabel: msg`New record`,
|
||||
@ -262,13 +266,29 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
],
|
||||
useAction: useDestroySingleRecordAction,
|
||||
},
|
||||
exportSingleRecord: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.EXPORT,
|
||||
label: msg`Export workflow`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 15,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [
|
||||
ActionViewType.SHOW_PAGE,
|
||||
ActionViewType.INDEX_PAGE_SINGLE_RECORD_SELECTION,
|
||||
],
|
||||
useAction: useExportMultipleRecordsAction,
|
||||
},
|
||||
exportMultipleRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: msg`Export Workflows`,
|
||||
label: msg`Export workflows`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 15,
|
||||
position: 16,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
@ -277,11 +297,11 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
exportView: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 16,
|
||||
position: 17,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
@ -294,11 +314,37 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
key: MultipleRecordsActionKeys.DESTROY,
|
||||
label: msg`Permanently destroy workflows`,
|
||||
shortLabel: msg`Destroy`,
|
||||
position: 17,
|
||||
position: 18,
|
||||
Icon: IconTrashX,
|
||||
accent: 'danger',
|
||||
isPinned: true,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_BULK_SELECTION],
|
||||
useAction: useDestroyMultipleRecordsAction,
|
||||
},
|
||||
seeDeletedRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.SEE_DELETED_RECORDS,
|
||||
label: msg`See deleted workflows`,
|
||||
shortLabel: msg`Deleted workflows`,
|
||||
position: 19,
|
||||
Icon: IconRotate2,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useSeeDeletedRecordsNoSelectionRecordAction,
|
||||
},
|
||||
importRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.IMPORT_RECORDS,
|
||||
label: msg`Import workflows`,
|
||||
shortLabel: msg`Import`,
|
||||
position: 20,
|
||||
Icon: IconFileImport,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useImportRecordsNoSelectionRecordAction,
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { useExportMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useExportMultipleRecordsAction';
|
||||
import { MultipleRecordsActionKeys } from '@/action-menu/actions/record-actions/multiple-records/types/MultipleRecordsActionKeys';
|
||||
import { useSeeDeletedRecordsNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useSeeDeletedRecordsNoSelectionRecordAction';
|
||||
import { NoSelectionRecordActionKeys } from '@/action-menu/actions/record-actions/no-selection/types/NoSelectionRecordActionsKey';
|
||||
import { useAddToFavoritesSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useAddToFavoritesSingleRecordAction';
|
||||
import { useNavigateToNextRecordSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useNavigateToNextRecordSingleRecordAction';
|
||||
@ -20,6 +21,7 @@ import {
|
||||
IconDatabaseExport,
|
||||
IconHeart,
|
||||
IconHeartOff,
|
||||
IconRotate2,
|
||||
} from 'twenty-ui';
|
||||
|
||||
export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
@ -30,7 +32,7 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
> = {
|
||||
addToFavoritesSingleRecord: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: SingleRecordActionKeys.ADD_TO_FAVORITES,
|
||||
label: msg`Add to favorites`,
|
||||
shortLabel: msg`Add to favorites`,
|
||||
@ -62,7 +64,7 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_PREVIOUS_RECORD,
|
||||
label: msg`Navigate to previous record`,
|
||||
label: msg`Navigate to previous run`,
|
||||
position: 2,
|
||||
isPinned: true,
|
||||
Icon: IconChevronUp,
|
||||
@ -73,7 +75,7 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_NEXT_RECORD,
|
||||
label: msg`Navigate to next record`,
|
||||
label: msg`Navigate to next run`,
|
||||
position: 3,
|
||||
isPinned: true,
|
||||
Icon: IconChevronDown,
|
||||
@ -84,7 +86,7 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: msg`Export records`,
|
||||
label: msg`Export runs`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 4,
|
||||
Icon: IconDatabaseExport,
|
||||
@ -95,7 +97,7 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
exportView: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
@ -106,4 +108,17 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useExportMultipleRecordsAction,
|
||||
},
|
||||
seeDeletedRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.SEE_DELETED_RECORDS,
|
||||
label: msg`See deleted runs`,
|
||||
shortLabel: msg`Deleted runs`,
|
||||
position: 6,
|
||||
Icon: IconRotate2,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useSeeDeletedRecordsNoSelectionRecordAction,
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { useExportMultipleRecordsAction } from '@/action-menu/actions/record-actions/multiple-records/hooks/useExportMultipleRecordsAction';
|
||||
import { MultipleRecordsActionKeys } from '@/action-menu/actions/record-actions/multiple-records/types/MultipleRecordsActionKeys';
|
||||
import { useSeeDeletedRecordsNoSelectionRecordAction } from '@/action-menu/actions/record-actions/no-selection/hooks/useSeeDeletedRecordsNoSelectionRecordAction';
|
||||
import { NoSelectionRecordActionKeys } from '@/action-menu/actions/record-actions/no-selection/types/NoSelectionRecordActionsKey';
|
||||
import { useAddToFavoritesSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useAddToFavoritesSingleRecordAction';
|
||||
import { useNavigateToNextRecordSingleRecordAction } from '@/action-menu/actions/record-actions/single-record/hooks/useNavigateToNextRecordSingleRecordAction';
|
||||
@ -27,6 +28,7 @@ import {
|
||||
IconHistory,
|
||||
IconHistoryToggle,
|
||||
IconPencil,
|
||||
IconRotate2,
|
||||
} from 'twenty-ui';
|
||||
|
||||
export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
@ -132,7 +134,7 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: msg`Export records`,
|
||||
label: msg`Export versions`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 8,
|
||||
Icon: IconDatabaseExport,
|
||||
@ -143,7 +145,7 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
exportView: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
@ -154,4 +156,17 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useExportMultipleRecordsAction,
|
||||
},
|
||||
seeDeletedRecords: {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.SEE_DELETED_RECORDS,
|
||||
label: msg`See deleted versions`,
|
||||
shortLabel: msg`Deleted versions`,
|
||||
position: 10,
|
||||
Icon: IconRotate2,
|
||||
accent: 'default',
|
||||
isPinned: false,
|
||||
availableOn: [ActionViewType.INDEX_PAGE_NO_SELECTION],
|
||||
useAction: useSeeDeletedRecordsNoSelectionRecordAction,
|
||||
},
|
||||
};
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
import { ActionHookWithObjectMetadataItem } from '@/action-menu/actions/types/ActionHook';
|
||||
import { useOpenObjectRecordsSpreadsheetImportDialog } from '@/object-record/spreadsheet-import/hooks/useOpenObjectRecordsSpreadsheetImportDialog';
|
||||
|
||||
export const useImportRecordsNoSelectionRecordAction: ActionHookWithObjectMetadataItem =
|
||||
({ objectMetadataItem }) => {
|
||||
const { openObjectRecordsSpreadsheetImportDialog } =
|
||||
useOpenObjectRecordsSpreadsheetImportDialog(
|
||||
objectMetadataItem.nameSingular,
|
||||
);
|
||||
|
||||
return {
|
||||
shouldBeRegistered: true,
|
||||
onClick: () => {
|
||||
openObjectRecordsSpreadsheetImportDialog();
|
||||
},
|
||||
};
|
||||
};
|
||||
@ -1,5 +1,6 @@
|
||||
export enum NoSelectionRecordActionKeys {
|
||||
EXPORT_VIEW = 'export-view-no-selection',
|
||||
CREATE_NEW_RECORD = 'create-new-record-no-selection',
|
||||
SEE_DELETED_RECORDS = 'see-deleted-records-no-selection',
|
||||
EXPORT_VIEW = 'export-view',
|
||||
CREATE_NEW_RECORD = 'create-new-record',
|
||||
SEE_DELETED_RECORDS = 'see-deleted-records',
|
||||
IMPORT_RECORDS = 'import-records',
|
||||
}
|
||||
|
||||
@ -6,4 +6,5 @@ export enum SingleRecordActionKeys {
|
||||
NAVIGATE_TO_NEXT_RECORD = 'navigate-to-next-record-single-record',
|
||||
NAVIGATE_TO_PREVIOUS_RECORD = 'navigate-to-previous-record-single-record',
|
||||
EXPORT_NOTE_TO_PDF = 'export-note-to-pdf-single-record',
|
||||
EXPORT = 'export-single-record',
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Key } from 'ts-key-enum';
|
||||
import {
|
||||
AppTooltip,
|
||||
IconFileImport,
|
||||
IconLayout,
|
||||
IconLayoutList,
|
||||
IconList,
|
||||
@ -10,12 +9,10 @@ import {
|
||||
useIcons,
|
||||
} from 'twenty-ui';
|
||||
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
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 { 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';
|
||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
|
||||
@ -66,16 +63,6 @@ export const ObjectOptionsDropdownMenuContent = () => {
|
||||
viewBarId: recordIndexId,
|
||||
});
|
||||
|
||||
const { openObjectRecordsSpreasheetImportDialog } =
|
||||
useOpenObjectRecordsSpreadsheetImportDialog(
|
||||
objectMetadataItem.nameSingular,
|
||||
);
|
||||
|
||||
// TODO: Remove this once we have implemented Rich Text v2 and removed the old rich text
|
||||
const canImportOrExport =
|
||||
objectMetadataItem.nameSingular !== CoreObjectNameSingular.Note &&
|
||||
objectMetadataItem.nameSingular !== CoreObjectNameSingular.Task;
|
||||
|
||||
const isCommandMenuV2Enabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IsCommandMenuV2Enabled,
|
||||
);
|
||||
@ -137,19 +124,6 @@ export const ObjectOptionsDropdownMenuContent = () => {
|
||||
/>
|
||||
)}
|
||||
</DropdownMenuItemsContainer>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItemsContainer>
|
||||
{canImportOrExport && (
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
closeDropdown();
|
||||
openObjectRecordsSpreasheetImportDialog();
|
||||
}}
|
||||
LeftIcon={IconFileImport}
|
||||
text={t`Import`}
|
||||
/>
|
||||
)}
|
||||
</DropdownMenuItemsContainer>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@ -345,7 +345,7 @@ describe('useSpreadsheetCompanyImport', () => {
|
||||
spreadsheetImportDialogState,
|
||||
);
|
||||
const {
|
||||
openObjectRecordsSpreasheetImportDialog: openRecordSpreadsheetImport,
|
||||
openObjectRecordsSpreadsheetImportDialog: openRecordSpreadsheetImport,
|
||||
} = useOpenObjectRecordsSpreadsheetImportDialog(
|
||||
CoreObjectNameSingular.Company,
|
||||
);
|
||||
|
||||
@ -27,7 +27,7 @@ export const useOpenObjectRecordsSpreadsheetImportDialog = (
|
||||
|
||||
const { buildAvailableFieldsForImport } = useBuildAvailableFieldsForImport();
|
||||
|
||||
const openObjectRecordsSpreasheetImportDialog = (
|
||||
const openObjectRecordsSpreadsheetImportDialog = (
|
||||
options?: Omit<
|
||||
SpreadsheetImportDialogOptions<any>,
|
||||
'fields' | 'isOpen' | 'onClose'
|
||||
@ -78,6 +78,6 @@ export const useOpenObjectRecordsSpreadsheetImportDialog = (
|
||||
};
|
||||
|
||||
return {
|
||||
openObjectRecordsSpreasheetImportDialog,
|
||||
openObjectRecordsSpreadsheetImportDialog,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user