Localization of actions (#9934)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
@ -13,6 +13,7 @@ import {
|
||||
ActionMenuEntryScope,
|
||||
ActionMenuEntryType,
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import {
|
||||
IconDatabaseExport,
|
||||
IconHeart,
|
||||
@ -30,7 +31,7 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.ADD_TO_FAVORITES,
|
||||
label: 'Add to favorites',
|
||||
label: msg`Add to favorites`,
|
||||
position: 0,
|
||||
Icon: IconHeart,
|
||||
availableOn: [
|
||||
@ -43,7 +44,7 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.REMOVE_FROM_FAVORITES,
|
||||
label: 'Remove from favorites',
|
||||
label: msg`Remove from favorites`,
|
||||
position: 1,
|
||||
Icon: IconHeartOff,
|
||||
availableOn: [
|
||||
@ -56,7 +57,7 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.DELETE,
|
||||
label: 'Delete',
|
||||
label: msg`Delete`,
|
||||
position: 2,
|
||||
Icon: IconTrash,
|
||||
accent: 'danger',
|
||||
@ -71,8 +72,8 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.DELETE,
|
||||
label: 'Delete records',
|
||||
shortLabel: 'Delete',
|
||||
label: msg`Delete records`,
|
||||
shortLabel: msg`Delete`,
|
||||
position: 3,
|
||||
Icon: IconTrash,
|
||||
accent: 'danger',
|
||||
@ -84,8 +85,8 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: 'Export records',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export records`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 4,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
@ -97,8 +98,8 @@ export const DEFAULT_ACTIONS_CONFIG_V1: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: 'Export view',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 5,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
|
||||
@ -18,6 +18,7 @@ import {
|
||||
ActionMenuEntryScope,
|
||||
ActionMenuEntryType,
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import {
|
||||
IconChevronDown,
|
||||
IconChevronUp,
|
||||
@ -40,8 +41,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.CREATE_NEW_RECORD,
|
||||
label: 'Create new record',
|
||||
shortLabel: 'New record',
|
||||
label: msg`Create new record`,
|
||||
shortLabel: msg`New record`,
|
||||
position: 0,
|
||||
isPinned: true,
|
||||
Icon: IconPlus,
|
||||
@ -52,8 +53,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.EXPORT_NOTE_TO_PDF,
|
||||
label: 'Export to PDF',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export to PDF`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 0,
|
||||
isPinned: false,
|
||||
Icon: IconFileExport,
|
||||
@ -64,8 +65,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.ADD_TO_FAVORITES,
|
||||
label: 'Add to favorites',
|
||||
shortLabel: 'Add to favorites',
|
||||
label: msg`Add to favorites`,
|
||||
shortLabel: msg`Add to favorites`,
|
||||
position: 1,
|
||||
isPinned: true,
|
||||
Icon: IconHeart,
|
||||
@ -79,8 +80,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.REMOVE_FROM_FAVORITES,
|
||||
label: 'Remove from favorites',
|
||||
shortLabel: 'Remove from favorites',
|
||||
label: msg`Remove from favorites`,
|
||||
shortLabel: msg`Remove from favorites`,
|
||||
isPinned: true,
|
||||
position: 2,
|
||||
Icon: IconHeartOff,
|
||||
@ -94,8 +95,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.DELETE,
|
||||
label: 'Delete record',
|
||||
shortLabel: 'Delete',
|
||||
label: msg`Delete record`,
|
||||
shortLabel: msg`Delete`,
|
||||
position: 3,
|
||||
Icon: IconTrash,
|
||||
accent: 'danger',
|
||||
@ -110,8 +111,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.DELETE,
|
||||
label: 'Delete records',
|
||||
shortLabel: 'Delete',
|
||||
label: msg`Delete records`,
|
||||
shortLabel: msg`Delete`,
|
||||
position: 4,
|
||||
Icon: IconTrash,
|
||||
accent: 'danger',
|
||||
@ -123,8 +124,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: 'Export records',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export records`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 5,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
@ -136,8 +137,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Object,
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: 'Export view',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 6,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
@ -149,8 +150,8 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.DESTROY,
|
||||
label: 'Permanently destroy record',
|
||||
shortLabel: 'Destroy',
|
||||
label: msg`Permanently destroy record`,
|
||||
shortLabel: msg`Destroy`,
|
||||
position: 7,
|
||||
Icon: IconTrashX,
|
||||
accent: 'danger',
|
||||
@ -165,8 +166,7 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_PREVIOUS_RECORD,
|
||||
label: 'Navigate to previous record',
|
||||
shortLabel: '',
|
||||
label: msg`Navigate to previous record`,
|
||||
position: 8,
|
||||
isPinned: true,
|
||||
Icon: IconChevronUp,
|
||||
@ -177,8 +177,7 @@ export const DEFAULT_ACTIONS_CONFIG_V2: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_NEXT_RECORD,
|
||||
label: 'Navigate to next record',
|
||||
shortLabel: '',
|
||||
label: msg`Navigate to next record`,
|
||||
position: 9,
|
||||
isPinned: true,
|
||||
Icon: IconChevronDown,
|
||||
|
||||
@ -25,6 +25,7 @@ import {
|
||||
ActionMenuEntryScope,
|
||||
ActionMenuEntryType,
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import {
|
||||
IconChevronDown,
|
||||
IconChevronUp,
|
||||
@ -51,8 +52,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: NoSelectionRecordActionKeys.CREATE_NEW_RECORD,
|
||||
label: 'Create new record',
|
||||
shortLabel: 'New record',
|
||||
label: msg`Create new record`,
|
||||
shortLabel: msg`New record`,
|
||||
position: 0,
|
||||
isPinned: true,
|
||||
Icon: IconPlus,
|
||||
@ -61,8 +62,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
activateWorkflowSingleRecord: {
|
||||
key: WorkflowSingleRecordActionKeys.ACTIVATE,
|
||||
label: 'Activate Workflow',
|
||||
shortLabel: 'Activate',
|
||||
label: msg`Activate Workflow`,
|
||||
shortLabel: msg`Activate`,
|
||||
isPinned: true,
|
||||
position: 1,
|
||||
Icon: IconPower,
|
||||
@ -76,8 +77,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
deactivateWorkflowSingleRecord: {
|
||||
key: WorkflowSingleRecordActionKeys.DEACTIVATE,
|
||||
label: 'Deactivate Workflow',
|
||||
shortLabel: 'Deactivate',
|
||||
label: msg`Deactivate Workflow`,
|
||||
shortLabel: msg`Deactivate`,
|
||||
isPinned: true,
|
||||
position: 2,
|
||||
Icon: IconPlayerPause,
|
||||
@ -91,8 +92,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
discardWorkflowDraftSingleRecord: {
|
||||
key: WorkflowSingleRecordActionKeys.DISCARD_DRAFT,
|
||||
label: 'Discard Draft',
|
||||
shortLabel: 'Discard Draft',
|
||||
label: msg`Discard Draft`,
|
||||
shortLabel: msg`Discard Draft`,
|
||||
isPinned: true,
|
||||
position: 3,
|
||||
Icon: IconTrash,
|
||||
@ -106,8 +107,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
seeWorkflowActiveVersionSingleRecord: {
|
||||
key: WorkflowSingleRecordActionKeys.SEE_ACTIVE_VERSION,
|
||||
label: 'See active version',
|
||||
shortLabel: 'See active version',
|
||||
label: msg`See active version`,
|
||||
shortLabel: msg`See active version`,
|
||||
isPinned: false,
|
||||
position: 4,
|
||||
Icon: IconHistory,
|
||||
@ -121,8 +122,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
seeWorkflowRunsSingleRecord: {
|
||||
key: WorkflowSingleRecordActionKeys.SEE_RUNS,
|
||||
label: 'See runs',
|
||||
shortLabel: 'See runs',
|
||||
label: msg`See runs`,
|
||||
shortLabel: msg`See runs`,
|
||||
isPinned: false,
|
||||
position: 5,
|
||||
Icon: IconHistoryToggle,
|
||||
@ -136,8 +137,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
seeWorkflowVersionsHistorySingleRecord: {
|
||||
key: WorkflowSingleRecordActionKeys.SEE_VERSIONS,
|
||||
label: 'See versions history',
|
||||
shortLabel: 'See versions',
|
||||
label: msg`See versions history`,
|
||||
shortLabel: msg`See versions`,
|
||||
isPinned: false,
|
||||
position: 6,
|
||||
Icon: IconHistory,
|
||||
@ -151,8 +152,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
testWorkflowSingleRecord: {
|
||||
key: WorkflowSingleRecordActionKeys.TEST,
|
||||
label: 'Test Workflow',
|
||||
shortLabel: 'Test',
|
||||
label: msg`Test Workflow`,
|
||||
shortLabel: msg`Test`,
|
||||
isPinned: true,
|
||||
position: 7,
|
||||
Icon: IconPlayerPlay,
|
||||
@ -168,8 +169,7 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_PREVIOUS_RECORD,
|
||||
label: 'Navigate to previous workflow',
|
||||
shortLabel: '',
|
||||
label: msg`Navigate to previous workflow`,
|
||||
position: 8,
|
||||
Icon: IconChevronUp,
|
||||
availableOn: [ActionViewType.SHOW_PAGE],
|
||||
@ -179,8 +179,7 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_NEXT_RECORD,
|
||||
label: 'Navigate to next workflow',
|
||||
shortLabel: '',
|
||||
label: msg`Navigate to next workflow`,
|
||||
position: 9,
|
||||
Icon: IconChevronDown,
|
||||
availableOn: [ActionViewType.SHOW_PAGE],
|
||||
@ -190,8 +189,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.ADD_TO_FAVORITES,
|
||||
label: 'Add to favorites',
|
||||
shortLabel: 'Add to favorites',
|
||||
label: msg`Add to favorites`,
|
||||
shortLabel: msg`Add to favorites`,
|
||||
position: 10,
|
||||
isPinned: false,
|
||||
Icon: IconHeart,
|
||||
@ -205,8 +204,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.REMOVE_FROM_FAVORITES,
|
||||
label: 'Remove from favorites',
|
||||
shortLabel: 'Remove from favorites',
|
||||
label: msg`Remove from favorites`,
|
||||
shortLabel: msg`Remove from favorites`,
|
||||
isPinned: false,
|
||||
position: 11,
|
||||
Icon: IconHeartOff,
|
||||
@ -220,8 +219,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.DELETE,
|
||||
label: 'Delete record',
|
||||
shortLabel: 'Delete',
|
||||
label: msg`Delete record`,
|
||||
shortLabel: msg`Delete`,
|
||||
position: 12,
|
||||
Icon: IconTrash,
|
||||
accent: 'danger',
|
||||
@ -236,8 +235,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.DELETE,
|
||||
label: 'Delete records',
|
||||
shortLabel: 'Delete',
|
||||
label: msg`Delete records`,
|
||||
shortLabel: msg`Delete`,
|
||||
position: 13,
|
||||
Icon: IconTrash,
|
||||
accent: 'danger',
|
||||
@ -249,8 +248,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.DESTROY,
|
||||
label: 'Permanently destroy record',
|
||||
shortLabel: 'Destroy',
|
||||
label: msg`Permanently destroy record`,
|
||||
shortLabel: msg`Destroy`,
|
||||
position: 14,
|
||||
Icon: IconTrashX,
|
||||
accent: 'danger',
|
||||
@ -265,8 +264,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: 'Export records',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export records`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 15,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
@ -278,8 +277,8 @@ export const WORKFLOW_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: 'Export view',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 16,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
|
||||
@ -13,6 +13,7 @@ import {
|
||||
ActionMenuEntryScope,
|
||||
ActionMenuEntryType,
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import {
|
||||
IconChevronDown,
|
||||
IconChevronUp,
|
||||
@ -31,8 +32,8 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.ADD_TO_FAVORITES,
|
||||
label: 'Add to favorites',
|
||||
shortLabel: 'Add to favorites',
|
||||
label: msg`Add to favorites`,
|
||||
shortLabel: msg`Add to favorites`,
|
||||
position: 0,
|
||||
isPinned: true,
|
||||
Icon: IconHeart,
|
||||
@ -46,8 +47,8 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.REMOVE_FROM_FAVORITES,
|
||||
label: 'Remove from favorites',
|
||||
shortLabel: 'Remove from favorites',
|
||||
label: msg`Remove from favorites`,
|
||||
shortLabel: msg`Remove from favorites`,
|
||||
isPinned: true,
|
||||
position: 1,
|
||||
Icon: IconHeartOff,
|
||||
@ -61,8 +62,7 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_PREVIOUS_RECORD,
|
||||
label: 'Navigate to previous record',
|
||||
shortLabel: '',
|
||||
label: msg`Navigate to previous record`,
|
||||
position: 2,
|
||||
isPinned: true,
|
||||
Icon: IconChevronUp,
|
||||
@ -73,8 +73,7 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_NEXT_RECORD,
|
||||
label: 'Navigate to next record',
|
||||
shortLabel: '',
|
||||
label: msg`Navigate to next record`,
|
||||
position: 3,
|
||||
isPinned: true,
|
||||
Icon: IconChevronDown,
|
||||
@ -85,8 +84,8 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: 'Export records',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export records`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 4,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
@ -98,8 +97,8 @@ export const WORKFLOW_RUNS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: 'Export view',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 5,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
|
||||
@ -17,6 +17,7 @@ import {
|
||||
ActionMenuEntryScope,
|
||||
ActionMenuEntryType,
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import {
|
||||
IconChevronDown,
|
||||
IconChevronUp,
|
||||
@ -36,8 +37,8 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
> = {
|
||||
useAsDraftWorkflowVersionSingleRecord: {
|
||||
key: WorkflowVersionSingleRecordActionKeys.USE_AS_DRAFT,
|
||||
label: 'Use as draft',
|
||||
shortLabel: 'Use as draft',
|
||||
label: msg`Use as draft`,
|
||||
shortLabel: msg`Use as draft`,
|
||||
position: 1,
|
||||
isPinned: true,
|
||||
type: ActionMenuEntryType.Standard,
|
||||
@ -51,8 +52,8 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
seeWorkflowRunsSingleRecord: {
|
||||
key: WorkflowVersionSingleRecordActionKeys.SEE_RUNS,
|
||||
label: 'See runs',
|
||||
shortLabel: 'See runs',
|
||||
label: msg`See runs`,
|
||||
shortLabel: msg`See runs`,
|
||||
position: 2,
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
@ -65,8 +66,8 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
},
|
||||
seeWorkflowVersionsHistorySingleRecord: {
|
||||
key: WorkflowVersionSingleRecordActionKeys.SEE_VERSIONS,
|
||||
label: 'See versions history',
|
||||
shortLabel: 'See versions',
|
||||
label: msg`See versions history`,
|
||||
shortLabel: msg`See versions`,
|
||||
position: 3,
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
@ -81,8 +82,7 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_PREVIOUS_RECORD,
|
||||
label: 'Navigate to previous version',
|
||||
shortLabel: '',
|
||||
label: msg`Navigate to previous version`,
|
||||
position: 4,
|
||||
Icon: IconChevronUp,
|
||||
availableOn: [ActionViewType.SHOW_PAGE],
|
||||
@ -92,8 +92,7 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.NAVIGATE_TO_NEXT_RECORD,
|
||||
label: 'Navigate to next version',
|
||||
shortLabel: '',
|
||||
label: msg`Navigate to next version`,
|
||||
position: 5,
|
||||
Icon: IconChevronDown,
|
||||
availableOn: [ActionViewType.SHOW_PAGE],
|
||||
@ -103,8 +102,8 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.ADD_TO_FAVORITES,
|
||||
label: 'Add to favorites',
|
||||
shortLabel: 'Add to favorites',
|
||||
label: msg`Add to favorites`,
|
||||
shortLabel: msg`Add to favorites`,
|
||||
position: 6,
|
||||
isPinned: false,
|
||||
Icon: IconHeart,
|
||||
@ -118,8 +117,8 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: SingleRecordActionKeys.REMOVE_FROM_FAVORITES,
|
||||
label: 'Remove from favorites',
|
||||
shortLabel: 'Remove from favorites',
|
||||
label: msg`Remove from favorites`,
|
||||
shortLabel: msg`Remove from favorites`,
|
||||
isPinned: false,
|
||||
position: 7,
|
||||
Icon: IconHeartOff,
|
||||
@ -133,8 +132,8 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: MultipleRecordsActionKeys.EXPORT,
|
||||
label: 'Export records',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export records`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 8,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
@ -146,8 +145,8 @@ export const WORKFLOW_VERSIONS_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: NoSelectionRecordActionKeys.EXPORT_VIEW,
|
||||
label: 'Export view',
|
||||
shortLabel: 'Export',
|
||||
label: msg`Export view`,
|
||||
shortLabel: msg`Export`,
|
||||
position: 9,
|
||||
Icon: IconDatabaseExport,
|
||||
accent: 'default',
|
||||
|
||||
@ -9,6 +9,7 @@ import { recordStoreFamilyState } from '@/object-record/record-store/states/reco
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { useAllActiveWorkflowVersions } from '@/workflow/hooks/useAllActiveWorkflowVersions';
|
||||
import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
@ -61,7 +62,7 @@ export const useWorkflowRunRecordActions = ({
|
||||
type: ActionMenuEntryType.WorkflowRun,
|
||||
key: `workflow-run-${activeWorkflowVersion.id}`,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
label: name,
|
||||
label: msg`${name}`, // eslint-disable-line lingui/no-single-variables-to-translate
|
||||
position: index,
|
||||
Icon: IconSettingsAutomation,
|
||||
onClick: async () => {
|
||||
|
||||
@ -7,6 +7,7 @@ import {
|
||||
ActionMenuEntryScope,
|
||||
ActionMenuEntryType,
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { IconSearch } from 'twenty-ui';
|
||||
|
||||
export const RECORD_AGNOSTIC_ACTIONS_CONFIG: Record<
|
||||
@ -19,8 +20,8 @@ export const RECORD_AGNOSTIC_ACTIONS_CONFIG: Record<
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.Global,
|
||||
key: RecordAgnosticActionsKey.SEARCH_RECORDS,
|
||||
label: 'Search records',
|
||||
shortLabel: 'Search',
|
||||
label: msg`Search records`,
|
||||
shortLabel: msg`Search`,
|
||||
position: 0,
|
||||
isPinned: false,
|
||||
Icon: IconSearch,
|
||||
|
||||
@ -5,6 +5,7 @@ import {
|
||||
import { useAllActiveWorkflowVersions } from '@/workflow/hooks/useAllActiveWorkflowVersions';
|
||||
import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { IconSettingsAutomation, isDefined } from 'twenty-ui';
|
||||
@ -37,7 +38,7 @@ export const useRunWorkflowActions = () => {
|
||||
type: ActionMenuEntryType.WorkflowRun,
|
||||
key: `workflow-run-${activeWorkflowVersion.id}`,
|
||||
scope: ActionMenuEntryScope.Global,
|
||||
label: name,
|
||||
label: msg`${name}`, // eslint-disable-line lingui/no-single-variables-to-translate
|
||||
position: index,
|
||||
Icon: IconSettingsAutomation,
|
||||
useAction: () => {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { ActionMenuEntry } from '@/action-menu/types/ActionMenuEntry';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { i18n } from '@lingui/core';
|
||||
|
||||
type RecordIndexActionMenuBarEntryProps = {
|
||||
entry: ActionMenuEntry;
|
||||
@ -33,7 +34,7 @@ export const RecordIndexActionMenuBarEntry = ({
|
||||
return (
|
||||
<StyledButton onClick={() => entry.onClick?.()}>
|
||||
{entry.Icon && <entry.Icon size={theme.icon.size.md} />}
|
||||
<StyledButtonLabel>{entry.label}</StyledButtonLabel>
|
||||
<StyledButtonLabel>{i18n._(entry.label)}</StyledButtonLabel>
|
||||
</StyledButton>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { actionMenuEntriesComponentSelector } from '@/action-menu/states/actionMenuEntriesComponentSelector';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { i18n } from '@lingui/core';
|
||||
import { Button } from 'twenty-ui';
|
||||
|
||||
export const RecordIndexActionMenuButtons = () => {
|
||||
@ -18,9 +19,9 @@ export const RecordIndexActionMenuButtons = () => {
|
||||
size="small"
|
||||
variant="secondary"
|
||||
accent="default"
|
||||
title={entry.shortLabel}
|
||||
title={entry.shortLabel ? i18n._(entry.shortLabel) : ''}
|
||||
onClick={entry.onClick}
|
||||
ariaLabel={entry.label}
|
||||
ariaLabel={i18n._(entry.label)}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
|
||||
@ -10,6 +10,7 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { extractComponentState } from '@/ui/utilities/state/component-state/utils/extractComponentState';
|
||||
import styled from '@emotion/styled';
|
||||
import { i18n } from '@lingui/core';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { MenuItem } from 'twenty-ui';
|
||||
|
||||
@ -44,7 +45,8 @@ export const RecordIndexActionMenuDropdown = () => {
|
||||
|
||||
//TODO: remove this
|
||||
const width = actionMenuEntries.some(
|
||||
(actionMenuEntry) => actionMenuEntry.label === 'Remove from favorites',
|
||||
(actionMenuEntry) =>
|
||||
i18n._(actionMenuEntry.label) === 'Remove from favorites',
|
||||
)
|
||||
? 200
|
||||
: undefined;
|
||||
@ -75,7 +77,7 @@ export const RecordIndexActionMenuDropdown = () => {
|
||||
closeDropdown();
|
||||
}}
|
||||
accent={item.accent}
|
||||
text={item.label}
|
||||
text={i18n._(item.label)}
|
||||
/>
|
||||
))}
|
||||
</DropdownMenuItemsContainer>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { actionMenuEntriesComponentSelector } from '@/action-menu/states/actionMenuEntriesComponentSelector';
|
||||
import { PageHeaderOpenCommandMenuButton } from '@/ui/layout/page-header/components/PageHeaderOpenCommandMenuButton';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { i18n } from '@lingui/core';
|
||||
import { Button, IconButton, useIsMobile } from 'twenty-ui';
|
||||
|
||||
export const RecordShowActionMenuButtons = () => {
|
||||
@ -23,9 +24,9 @@ export const RecordShowActionMenuButtons = () => {
|
||||
size="small"
|
||||
variant="secondary"
|
||||
accent="default"
|
||||
title={entry.shortLabel}
|
||||
title={i18n._(entry.shortLabel)}
|
||||
onClick={() => entry.onClick?.()}
|
||||
ariaLabel={entry.label}
|
||||
ariaLabel={i18n._(entry.label)}
|
||||
/>
|
||||
) : (
|
||||
<IconButton
|
||||
@ -35,7 +36,7 @@ export const RecordShowActionMenuButtons = () => {
|
||||
variant="secondary"
|
||||
accent="default"
|
||||
onClick={() => entry.onClick?.()}
|
||||
ariaLabel={entry.label}
|
||||
ariaLabel={i18n._(entry.label)}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
|
||||
@ -13,6 +13,7 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import { i18n } from '@lingui/core';
|
||||
import { Key } from 'ts-key-enum';
|
||||
import { Button, MenuItem, getOsControlSymbol } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
@ -92,7 +93,7 @@ export const RightDrawerActionMenuDropdown = () => {
|
||||
);
|
||||
actionMenuEntry.onClick?.();
|
||||
}}
|
||||
text={actionMenuEntry.label}
|
||||
text={i18n._(actionMenuEntry.label)}
|
||||
/>
|
||||
))}
|
||||
</DropdownMenuItemsContainer>
|
||||
|
||||
@ -12,11 +12,13 @@ import { contextStoreTargetedRecordsRuleComponentState } from '@/context-store/s
|
||||
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
|
||||
import { RecordFiltersComponentInstanceContext } from '@/object-record/record-filter/states/context/RecordFiltersComponentInstanceContext';
|
||||
import { isBottomBarOpenedComponentState } from '@/ui/layout/bottom-bar/states/isBottomBarOpenedComponentState';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { expect, jest } from '@storybook/jest';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { userEvent, waitFor, within } from '@storybook/test';
|
||||
import { RecoilRoot } from 'recoil';
|
||||
import { IconTrash, RouterDecorator } from 'twenty-ui';
|
||||
import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';
|
||||
|
||||
const deleteMock = jest.fn();
|
||||
|
||||
@ -25,6 +27,7 @@ const meta: Meta<typeof RecordIndexActionMenuBar> = {
|
||||
component: RecordIndexActionMenuBar,
|
||||
decorators: [
|
||||
RouterDecorator,
|
||||
I18nFrontDecorator,
|
||||
(Story) => (
|
||||
<RecordFiltersComponentInstanceContext.Provider
|
||||
value={{ instanceId: 'story-action-menu' }}
|
||||
@ -55,7 +58,7 @@ const meta: Meta<typeof RecordIndexActionMenuBar> = {
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
type: ActionMenuEntryType.Standard,
|
||||
key: 'delete',
|
||||
label: 'Delete',
|
||||
label: msg`Delete`,
|
||||
position: 0,
|
||||
Icon: IconTrash,
|
||||
onClick: deleteMock,
|
||||
|
||||
@ -3,15 +3,17 @@ import {
|
||||
ActionMenuEntryScope,
|
||||
ActionMenuEntryType,
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { expect, jest } from '@storybook/jest';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { userEvent, within } from '@storybook/testing-library';
|
||||
import { ComponentDecorator, IconCheckbox, IconTrash } from 'twenty-ui';
|
||||
import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';
|
||||
|
||||
const meta: Meta<typeof RecordIndexActionMenuBarEntry> = {
|
||||
title: 'Modules/ActionMenu/RecordIndexActionMenuBarEntry',
|
||||
component: RecordIndexActionMenuBarEntry,
|
||||
decorators: [ComponentDecorator],
|
||||
decorators: [ComponentDecorator, I18nFrontDecorator],
|
||||
};
|
||||
export default meta;
|
||||
|
||||
@ -26,7 +28,7 @@ export const Default: Story = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'delete',
|
||||
label: 'Delete',
|
||||
label: msg`Delete`,
|
||||
position: 0,
|
||||
Icon: IconTrash,
|
||||
onClick: deleteMock,
|
||||
@ -40,7 +42,7 @@ export const WithDangerAccent: Story = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'delete',
|
||||
label: 'Delete',
|
||||
label: msg`Delete`,
|
||||
position: 0,
|
||||
Icon: IconTrash,
|
||||
onClick: deleteMock,
|
||||
@ -55,7 +57,7 @@ export const WithInteraction: Story = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'markAsDone',
|
||||
label: 'Mark as done',
|
||||
label: msg`Mark as done`,
|
||||
position: 0,
|
||||
Icon: IconCheckbox,
|
||||
onClick: markAsDoneMock,
|
||||
|
||||
@ -14,12 +14,14 @@ import {
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { isDropdownOpenComponentState } from '@/ui/layout/dropdown/states/isDropdownOpenComponentState';
|
||||
import { extractComponentState } from '@/ui/utilities/state/component-state/utils/extractComponentState';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import {
|
||||
IconCheckbox,
|
||||
IconHeart,
|
||||
IconTrash,
|
||||
getCanvasElementForDropdownTesting,
|
||||
} from 'twenty-ui';
|
||||
import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';
|
||||
|
||||
const deleteMock = jest.fn();
|
||||
const markAsDoneMock = jest.fn();
|
||||
@ -29,6 +31,7 @@ const meta: Meta<typeof RecordIndexActionMenuDropdown> = {
|
||||
title: 'Modules/ActionMenu/RecordIndexActionMenuDropdown',
|
||||
component: RecordIndexActionMenuDropdown,
|
||||
decorators: [
|
||||
I18nFrontDecorator,
|
||||
(Story) => (
|
||||
<RecoilRoot
|
||||
initializeState={({ set }) => {
|
||||
@ -53,7 +56,7 @@ const meta: Meta<typeof RecordIndexActionMenuDropdown> = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'delete',
|
||||
label: 'Delete',
|
||||
label: msg`Delete`,
|
||||
position: 0,
|
||||
Icon: IconTrash,
|
||||
onClick: deleteMock,
|
||||
@ -63,7 +66,7 @@ const meta: Meta<typeof RecordIndexActionMenuDropdown> = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'markAsDone',
|
||||
label: 'Mark as done',
|
||||
label: msg`Mark as done`,
|
||||
position: 1,
|
||||
Icon: IconCheckbox,
|
||||
onClick: markAsDoneMock,
|
||||
@ -73,7 +76,7 @@ const meta: Meta<typeof RecordIndexActionMenuDropdown> = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'addToFavorites',
|
||||
label: 'Add to favorites',
|
||||
label: msg`Add to favorites`,
|
||||
position: 2,
|
||||
Icon: IconHeart,
|
||||
onClick: addToFavoritesMock,
|
||||
|
||||
@ -12,6 +12,7 @@ import {
|
||||
} from '@/action-menu/types/ActionMenuEntry';
|
||||
import { contextStoreNumberOfSelectedRecordsComponentState } from '@/context-store/states/contextStoreNumberOfSelectedRecordsComponentState';
|
||||
import { contextStoreTargetedRecordsRuleComponentState } from '@/context-store/states/contextStoreTargetedRecordsRuleComponentState';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { userEvent, waitFor, within } from '@storybook/test';
|
||||
import {
|
||||
ComponentDecorator,
|
||||
@ -21,6 +22,7 @@ import {
|
||||
IconTrash,
|
||||
MenuItemAccent,
|
||||
} from 'twenty-ui';
|
||||
import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';
|
||||
|
||||
const deleteMock = jest.fn();
|
||||
const addToFavoritesMock = jest.fn();
|
||||
@ -30,6 +32,7 @@ const meta: Meta<typeof RightDrawerActionMenuDropdown> = {
|
||||
title: 'Modules/ActionMenu/RightDrawerActionMenuDropdown',
|
||||
component: RightDrawerActionMenuDropdown,
|
||||
decorators: [
|
||||
I18nFrontDecorator,
|
||||
(Story) => (
|
||||
<RecoilRoot
|
||||
initializeState={({ set }) => {
|
||||
@ -62,7 +65,7 @@ const meta: Meta<typeof RightDrawerActionMenuDropdown> = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'addToFavorites',
|
||||
label: 'Add to favorites',
|
||||
label: msg`Add to favorites`,
|
||||
position: 0,
|
||||
Icon: IconHeart,
|
||||
onClick: addToFavoritesMock,
|
||||
@ -72,7 +75,7 @@ const meta: Meta<typeof RightDrawerActionMenuDropdown> = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'export',
|
||||
label: 'Export',
|
||||
label: msg`Export`,
|
||||
position: 1,
|
||||
Icon: IconFileExport,
|
||||
onClick: exportMock,
|
||||
@ -82,7 +85,7 @@ const meta: Meta<typeof RightDrawerActionMenuDropdown> = {
|
||||
type: ActionMenuEntryType.Standard,
|
||||
scope: ActionMenuEntryScope.RecordSelection,
|
||||
key: 'delete',
|
||||
label: 'Delete',
|
||||
label: msg`Delete`,
|
||||
position: 2,
|
||||
Icon: IconTrash,
|
||||
onClick: deleteMock,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ActionViewType } from '@/action-menu/actions/types/ActionViewType';
|
||||
import { ConfirmationModalProps } from '@/ui/layout/modal/components/ConfirmationModal';
|
||||
import { MessageDescriptor } from '@lingui/core';
|
||||
import { MouseEvent, ReactElement } from 'react';
|
||||
import { IconComponent, MenuItemAccent } from 'twenty-ui';
|
||||
|
||||
@ -18,8 +19,8 @@ export type ActionMenuEntry = {
|
||||
type: ActionMenuEntryType;
|
||||
scope: ActionMenuEntryScope;
|
||||
key: string;
|
||||
label: string;
|
||||
shortLabel?: string;
|
||||
label: MessageDescriptor;
|
||||
shortLabel?: MessageDescriptor;
|
||||
position: number;
|
||||
Icon: IconComponent;
|
||||
isPinned?: boolean;
|
||||
|
||||
@ -52,6 +52,7 @@ const meta: Meta<typeof CommandMenu> = {
|
||||
title: 'Modules/CommandMenu/CommandMenu',
|
||||
component: CommandMenuRouter,
|
||||
decorators: [
|
||||
I18nFrontDecorator,
|
||||
(Story) => {
|
||||
const setCurrentWorkspace = useSetRecoilState(currentWorkspaceState);
|
||||
const setCurrentWorkspaceMember = useSetRecoilState(
|
||||
|
||||
@ -14,6 +14,7 @@ import {
|
||||
} from '@/command-menu/types/Command';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { i18n } from '@lingui/core';
|
||||
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
import { IconSparkles } from 'twenty-ui';
|
||||
import { useDebounce } from 'use-debounce';
|
||||
@ -55,7 +56,7 @@ export const useCommandMenuCommands = () => {
|
||||
)
|
||||
?.map((actionMenuEntry) => ({
|
||||
id: actionMenuEntry.key,
|
||||
label: actionMenuEntry.label,
|
||||
label: i18n._(actionMenuEntry.label),
|
||||
Icon: actionMenuEntry.Icon,
|
||||
onCommandClick: actionMenuEntry.onClick,
|
||||
type: CommandType.StandardAction,
|
||||
@ -71,7 +72,7 @@ export const useCommandMenuCommands = () => {
|
||||
)
|
||||
?.map((actionMenuEntry) => ({
|
||||
id: actionMenuEntry.key,
|
||||
label: actionMenuEntry.label,
|
||||
label: i18n._(actionMenuEntry.label),
|
||||
Icon: actionMenuEntry.Icon,
|
||||
onCommandClick: actionMenuEntry.onClick,
|
||||
type: CommandType.StandardAction,
|
||||
@ -87,7 +88,7 @@ export const useCommandMenuCommands = () => {
|
||||
)
|
||||
?.map((actionMenuEntry) => ({
|
||||
id: actionMenuEntry.key,
|
||||
label: actionMenuEntry.label,
|
||||
label: i18n._(actionMenuEntry.label),
|
||||
Icon: actionMenuEntry.Icon,
|
||||
onCommandClick: actionMenuEntry.onClick,
|
||||
type: CommandType.StandardAction,
|
||||
@ -103,7 +104,7 @@ export const useCommandMenuCommands = () => {
|
||||
)
|
||||
?.map((actionMenuEntry) => ({
|
||||
id: actionMenuEntry.key,
|
||||
label: actionMenuEntry.label,
|
||||
label: i18n._(actionMenuEntry.label),
|
||||
Icon: actionMenuEntry.Icon,
|
||||
onCommandClick: actionMenuEntry.onClick,
|
||||
type: CommandType.WorkflowRun,
|
||||
@ -119,7 +120,7 @@ export const useCommandMenuCommands = () => {
|
||||
)
|
||||
?.map((actionMenuEntry) => ({
|
||||
id: actionMenuEntry.key,
|
||||
label: actionMenuEntry.label,
|
||||
label: i18n._(actionMenuEntry.label),
|
||||
Icon: actionMenuEntry.Icon,
|
||||
onCommandClick: actionMenuEntry.onClick,
|
||||
type: CommandType.WorkflowRun,
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
export const getEmptyStateSubTitle = (
|
||||
objectNameSingular: string,
|
||||
objectLabel: string,
|
||||
) => {
|
||||
if (objectNameSingular === CoreObjectNameSingular.WorkflowVersion) {
|
||||
return 'Create a workflow and return here to view its versions';
|
||||
return t`Create a workflow and return here to view its versions`;
|
||||
}
|
||||
|
||||
if (objectNameSingular === CoreObjectNameSingular.WorkflowRun) {
|
||||
return 'Run a workflow and return here to view its executions';
|
||||
return t`Run a workflow and return here to view its executions`;
|
||||
}
|
||||
|
||||
return `Use our API or add your first ${objectLabel} manually`;
|
||||
return t`Use our API or add your first ${objectLabel} manually`;
|
||||
};
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
export const getEmptyStateTitle = (
|
||||
objectNameSingular: string,
|
||||
objectLabel: string,
|
||||
) => {
|
||||
if (objectNameSingular === CoreObjectNameSingular.WorkflowVersion) {
|
||||
return 'No workflow versions yet';
|
||||
return t`No workflow versions yet`;
|
||||
}
|
||||
|
||||
if (objectNameSingular === CoreObjectNameSingular.WorkflowRun) {
|
||||
return 'No workflow runs yet';
|
||||
return t`No workflow runs yet`;
|
||||
}
|
||||
|
||||
return `Add your first ${objectLabel}`;
|
||||
return t`Add your first ${objectLabel}`;
|
||||
};
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { Button, IconButton, IconPlus, useIsMobile } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
@ -12,6 +13,8 @@ export const PageAddButton = ({ onClick }: PageAddButtonProps) => {
|
||||
);
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const { t } = useLingui();
|
||||
|
||||
return (
|
||||
<>
|
||||
{isCommandMenuV2Enabled ? (
|
||||
@ -21,9 +24,9 @@ export const PageAddButton = ({ onClick }: PageAddButtonProps) => {
|
||||
size={isMobile ? 'medium' : 'small'}
|
||||
variant="secondary"
|
||||
accent="default"
|
||||
title={isMobile ? '' : 'New record'}
|
||||
title={isMobile ? '' : t`New record`}
|
||||
onClick={onClick}
|
||||
ariaLabel="New record"
|
||||
ariaLabel={t`New record`}
|
||||
/>
|
||||
) : (
|
||||
<IconButton
|
||||
@ -32,7 +35,7 @@ export const PageAddButton = ({ onClick }: PageAddButtonProps) => {
|
||||
size="medium"
|
||||
variant="secondary"
|
||||
accent="default"
|
||||
ariaLabel="Add"
|
||||
ariaLabel={t`Add`}
|
||||
onClick={onClick}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -6,6 +6,8 @@ import { useDeleteOneWorkflowVersion } from '@/workflow/hooks/useDeleteOneWorkfl
|
||||
import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
|
||||
import {
|
||||
Button,
|
||||
IconPlayerPlay,
|
||||
@ -22,6 +24,7 @@ export const RecordShowPageWorkflowHeader = ({
|
||||
}: {
|
||||
workflowId: string;
|
||||
}) => {
|
||||
const { t } = useLingui();
|
||||
const workflowWithCurrentVersion = useWorkflowWithCurrentVersion(workflowId);
|
||||
|
||||
const isWaitingForWorkflowWithCurrentVersion =
|
||||
@ -44,7 +47,7 @@ export const RecordShowPageWorkflowHeader = ({
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
title="Test"
|
||||
title={t`Test`}
|
||||
variant="secondary"
|
||||
Icon={IconPlayerPlay}
|
||||
disabled={isWaitingForWorkflowWithCurrentVersion}
|
||||
@ -52,10 +55,9 @@ export const RecordShowPageWorkflowHeader = ({
|
||||
assertWorkflowWithCurrentVersionIsDefined(workflowWithCurrentVersion);
|
||||
|
||||
if (!canWorkflowBeTested) {
|
||||
enqueueSnackBar('Workflow cannot be tested', {
|
||||
enqueueSnackBar(t`Workflow cannot be tested`, {
|
||||
variant: SnackBarVariant.Error,
|
||||
detailedMessage:
|
||||
'Trigger type should be Manual - when no record(s) are selected',
|
||||
detailedMessage: t`Trigger type should be Manual - when no record(s) are selected`,
|
||||
icon: (
|
||||
<IconSettingsAutomation
|
||||
size={16}
|
||||
@ -75,7 +77,7 @@ export const RecordShowPageWorkflowHeader = ({
|
||||
{workflowWithCurrentVersion?.currentVersion?.status === 'DRAFT' &&
|
||||
workflowWithCurrentVersion.versions?.length > 1 ? (
|
||||
<Button
|
||||
title="Discard Draft"
|
||||
title={t`Discard Draft`}
|
||||
variant="secondary"
|
||||
Icon={IconTrash}
|
||||
disabled={isWaitingForWorkflowWithCurrentVersion}
|
||||
@ -94,7 +96,7 @@ export const RecordShowPageWorkflowHeader = ({
|
||||
{workflowWithCurrentVersion?.currentVersion?.status === 'DRAFT' ||
|
||||
workflowWithCurrentVersion?.currentVersion?.status === 'DEACTIVATED' ? (
|
||||
<Button
|
||||
title="Activate"
|
||||
title={t`Activate`}
|
||||
variant="secondary"
|
||||
Icon={IconPower}
|
||||
disabled={isWaitingForWorkflowWithCurrentVersion}
|
||||
@ -111,7 +113,7 @@ export const RecordShowPageWorkflowHeader = ({
|
||||
/>
|
||||
) : workflowWithCurrentVersion?.currentVersion?.status === 'ACTIVE' ? (
|
||||
<Button
|
||||
title="Deactivate"
|
||||
title={t`Deactivate`}
|
||||
variant="secondary"
|
||||
Icon={IconPlayerStop}
|
||||
disabled={isWaitingForWorkflowWithCurrentVersion}
|
||||
|
||||
@ -4,6 +4,7 @@ import { ComponentDecorator } from 'twenty-ui';
|
||||
|
||||
import { RecordShowPageWorkflowHeader } from '@/workflow/components/RecordShowPageWorkflowHeader';
|
||||
import { expect, within } from '@storybook/test';
|
||||
import { I18nFrontDecorator } from '~/testing/decorators/I18nFrontDecorator';
|
||||
import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';
|
||||
import { SnackBarDecorator } from '~/testing/decorators/SnackBarDecorator';
|
||||
import { graphqlMocks } from '~/testing/graphqlMocks';
|
||||
@ -12,6 +13,7 @@ const meta: Meta<typeof RecordShowPageWorkflowHeader> = {
|
||||
title: 'Modules/Workflow/RecordShowPageWorkflowHeader',
|
||||
component: RecordShowPageWorkflowHeader,
|
||||
decorators: [
|
||||
I18nFrontDecorator,
|
||||
ComponentDecorator,
|
||||
ObjectMetadataItemsDecorator,
|
||||
SnackBarDecorator,
|
||||
|
||||
@ -13,12 +13,14 @@ import {
|
||||
WorkflowDiagramStepNodeData,
|
||||
} from '@/workflow/workflow-diagram/types/WorkflowDiagram';
|
||||
import { getWorkflowNodeIconKey } from '@/workflow/workflow-diagram/utils/getWorkflowNodeIconKey';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { OnSelectionChangeParams, useOnSelectionChange } from '@xyflow/react';
|
||||
import { useCallback } from 'react';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { IconBolt, isDefined, useIcons } from 'twenty-ui';
|
||||
|
||||
export const WorkflowDiagramCanvasEditableEffect = () => {
|
||||
const { t } = useLingui();
|
||||
const { getIcon } = useIcons();
|
||||
const { startNodeCreation } = useStartNodeCreation();
|
||||
|
||||
@ -43,7 +45,7 @@ export const WorkflowDiagramCanvasEditableEffect = () => {
|
||||
const isEmptyTriggerNode = selectedNode.type === EMPTY_TRIGGER_STEP_ID;
|
||||
if (isEmptyTriggerNode) {
|
||||
openRightDrawer(RightDrawerPages.WorkflowStepSelectTriggerType, {
|
||||
title: 'Trigger Type',
|
||||
title: t`Trigger Type`,
|
||||
Icon: IconBolt,
|
||||
});
|
||||
|
||||
@ -53,7 +55,7 @@ export const WorkflowDiagramCanvasEditableEffect = () => {
|
||||
const isCreateStepNode = selectedNode.type === CREATE_STEP_STEP_ID;
|
||||
if (isCreateStepNode) {
|
||||
if (selectedNode.data.nodeType !== 'create-step') {
|
||||
throw new Error('Expected selected node to be a create step node.');
|
||||
throw new Error(t`Expected selected node to be a create step node.`);
|
||||
}
|
||||
|
||||
startNodeCreation(selectedNode.data.parentNodeId);
|
||||
@ -78,6 +80,7 @@ export const WorkflowDiagramCanvasEditableEffect = () => {
|
||||
closeCommandMenu,
|
||||
startNodeCreation,
|
||||
getIcon,
|
||||
t,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user