diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts index f23a3c1be31..7cb42f737fa 100644 --- a/packages/twenty-front/src/generated-metadata/graphql.ts +++ b/packages/twenty-front/src/generated-metadata/graphql.ts @@ -840,6 +840,7 @@ export type CommandMenuItem = { availabilityType: CommandMenuItemAvailabilityType; conditionalAvailabilityExpression?: Maybe; createdAt: Scalars['DateTime']; + engineComponentKey?: Maybe; frontComponent?: Maybe; frontComponentId?: Maybe; icon?: Maybe; @@ -1124,6 +1125,7 @@ export type CreateCommandMenuItemInput = { availabilityObjectMetadataId?: InputMaybe; availabilityType?: InputMaybe; conditionalAvailabilityExpression?: InputMaybe; + engineComponentKey?: InputMaybe; frontComponentId?: InputMaybe; icon?: InputMaybe; isPinned?: InputMaybe; @@ -1571,6 +1573,30 @@ export type EmailsConfiguration = { configurationType: WidgetConfigurationType; }; +export enum EngineComponentKey { + ACTIVATE_WORKFLOW = 'ACTIVATE_WORKFLOW', + ADD_TO_FAVORITES = 'ADD_TO_FAVORITES', + CREATE_NEW_RECORD = 'CREATE_NEW_RECORD', + DEACTIVATE_WORKFLOW = 'DEACTIVATE_WORKFLOW', + DELETE_MULTIPLE_RECORDS = 'DELETE_MULTIPLE_RECORDS', + DELETE_SINGLE_RECORD = 'DELETE_SINGLE_RECORD', + DESTROY_MULTIPLE_RECORDS = 'DESTROY_MULTIPLE_RECORDS', + DESTROY_SINGLE_RECORD = 'DESTROY_SINGLE_RECORD', + DISCARD_DRAFT_WORKFLOW = 'DISCARD_DRAFT_WORKFLOW', + DUPLICATE_DASHBOARD = 'DUPLICATE_DASHBOARD', + DUPLICATE_WORKFLOW = 'DUPLICATE_WORKFLOW', + MERGE_MULTIPLE_RECORDS = 'MERGE_MULTIPLE_RECORDS', + REMOVE_FROM_FAVORITES = 'REMOVE_FROM_FAVORITES', + RESTORE_MULTIPLE_RECORDS = 'RESTORE_MULTIPLE_RECORDS', + RESTORE_SINGLE_RECORD = 'RESTORE_SINGLE_RECORD', + SAVE_DASHBOARD_LAYOUT = 'SAVE_DASHBOARD_LAYOUT', + SAVE_RECORD_PAGE_LAYOUT = 'SAVE_RECORD_PAGE_LAYOUT', + STOP_WORKFLOW_RUN = 'STOP_WORKFLOW_RUN', + TEST_WORKFLOW = 'TEST_WORKFLOW', + TIDY_UP_WORKFLOW = 'TIDY_UP_WORKFLOW', + USE_AS_DRAFT_WORKFLOW_VERSION = 'USE_AS_DRAFT_WORKFLOW_VERSION' +} + export type EventLogDateRangeInput = { end?: InputMaybe; start?: InputMaybe; @@ -4867,6 +4893,7 @@ export type UpdateApplicationRegistrationVariablePayload = { export type UpdateCommandMenuItemInput = { availabilityObjectMetadataId?: InputMaybe; availabilityType?: InputMaybe; + engineComponentKey?: InputMaybe; icon?: InputMaybe; id: Scalars['UUID']; isPinned?: InputMaybe; @@ -6140,12 +6167,12 @@ export type ListPlansQueryVariables = Exact<{ [key: string]: never; }>; export type ListPlansQuery = { __typename?: 'Query', listPlans: Array<{ __typename?: 'BillingPlan', planKey: BillingPlanKey, licensedProducts: Array<{ __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array | null, prices?: Array<{ __typename?: 'BillingPriceLicensed', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }>, meteredProducts: Array<{ __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array | null, prices?: Array<{ __typename?: 'BillingPriceMetered', priceUsageType: BillingUsageType, recurringInterval: SubscriptionInterval, stripePriceId: string, tiers: Array<{ __typename?: 'BillingPriceTier', flatAmount?: number | null, unitAmount?: number | null, upTo?: number | null }> }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }> }> }; -export type CommandMenuItemFieldsFragment = { __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, conditionalAvailabilityExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null }; +export type CommandMenuItemFieldsFragment = { __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey?: EngineComponentKey | null, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, conditionalAvailabilityExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null }; export type FindManyCommandMenuItemsQueryVariables = Exact<{ [key: string]: never; }>; -export type FindManyCommandMenuItemsQuery = { __typename?: 'Query', commandMenuItems: Array<{ __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, conditionalAvailabilityExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null }> }; +export type FindManyCommandMenuItemsQuery = { __typename?: 'Query', commandMenuItems: Array<{ __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, engineComponentKey?: EngineComponentKey | null, label: string, icon?: string | null, shortLabel?: string | null, position: number, isPinned: boolean, conditionalAvailabilityExpression?: string | null, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null }> }; export type PageLayoutFragmentFragment = { __typename?: 'PageLayout', id: string, name: string, objectMetadataId?: string | null, type: PageLayoutType, defaultTabToFocusOnMobileAndSidePanelId?: string | null, createdAt: string, updatedAt: string, tabs?: Array<{ __typename?: 'PageLayoutTab', id: string, applicationId: string, title: string, icon?: string | null, position: number, layoutMode?: PageLayoutTabLayoutMode | null, isOverridden: boolean, pageLayoutId: string, createdAt: string, updatedAt: string, widgets?: Array<{ __typename?: 'PageLayoutWidget', id: string, title: string, type: WidgetType, objectMetadataId?: string | null, isOverridden: boolean, createdAt: string, updatedAt: string, deletedAt?: string | null, pageLayoutTabId: string, gridPosition: { __typename?: 'GridPosition', column: number, columnSpan: number, row: number, rowSpan: number }, position?: { __typename?: 'PageLayoutWidgetCanvasPosition', layoutMode: PageLayoutTabLayoutMode } | { __typename?: 'PageLayoutWidgetGridPosition', layoutMode: PageLayoutTabLayoutMode, row: number, column: number, rowSpan: number, columnSpan: number } | { __typename?: 'PageLayoutWidgetVerticalListPosition', layoutMode: PageLayoutTabLayoutMode, index: number } | null, configuration: { __typename?: 'AggregateChartConfiguration', configurationType: WidgetConfigurationType, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, label?: string | null, displayDataLabel?: boolean | null, format?: string | null, description?: string | null, filter?: any | null, prefix?: string | null, suffix?: string | null, timezone?: string | null, firstDayOfTheWeek?: number | null, ratioAggregateConfig?: { __typename?: 'RatioAggregateConfig', fieldMetadataId: string, optionValue: string } | null } | { __typename?: 'BarChartConfiguration', configurationType: WidgetConfigurationType, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, primaryAxisGroupByFieldMetadataId: string, primaryAxisGroupBySubFieldName?: string | null, primaryAxisDateGranularity?: ObjectRecordGroupByDateGranularity | null, primaryAxisOrderBy?: GraphOrderBy | null, primaryAxisManualSortOrder?: Array | null, secondaryAxisGroupByFieldMetadataId?: string | null, secondaryAxisGroupBySubFieldName?: string | null, secondaryAxisGroupByDateGranularity?: ObjectRecordGroupByDateGranularity | null, secondaryAxisOrderBy?: GraphOrderBy | null, secondaryAxisManualSortOrder?: Array | null, omitNullValues?: boolean | null, axisNameDisplay?: AxisNameDisplay | null, displayDataLabel?: boolean | null, displayLegend?: boolean | null, rangeMin?: number | null, rangeMax?: number | null, color?: string | null, description?: string | null, filter?: any | null, groupMode?: BarChartGroupMode | null, layout: BarChartLayout, isCumulative?: boolean | null, splitMultiValueFields?: boolean | null, timezone?: string | null, firstDayOfTheWeek?: number | null } | { __typename?: 'CalendarConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'EmailsConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'FieldConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'FieldRichTextConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'FieldsConfiguration', configurationType: WidgetConfigurationType, viewId?: string | null, newFieldDefaultVisibility?: boolean | null, shouldAllowUserToSeeHiddenFields?: boolean | null } | { __typename?: 'FilesConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'FrontComponentConfiguration', configurationType: WidgetConfigurationType, frontComponentId: string } | { __typename?: 'GaugeChartConfiguration', configurationType: WidgetConfigurationType, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, displayDataLabel?: boolean | null, color?: string | null, description?: string | null, filter?: any | null, timezone?: string | null, firstDayOfTheWeek?: number | null } | { __typename?: 'IframeConfiguration', configurationType: WidgetConfigurationType, url?: string | null } | { __typename?: 'LineChartConfiguration', configurationType: WidgetConfigurationType, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, primaryAxisGroupByFieldMetadataId: string, primaryAxisGroupBySubFieldName?: string | null, primaryAxisDateGranularity?: ObjectRecordGroupByDateGranularity | null, primaryAxisOrderBy?: GraphOrderBy | null, primaryAxisManualSortOrder?: Array | null, secondaryAxisGroupByFieldMetadataId?: string | null, secondaryAxisGroupBySubFieldName?: string | null, secondaryAxisGroupByDateGranularity?: ObjectRecordGroupByDateGranularity | null, secondaryAxisOrderBy?: GraphOrderBy | null, secondaryAxisManualSortOrder?: Array | null, omitNullValues?: boolean | null, axisNameDisplay?: AxisNameDisplay | null, displayDataLabel?: boolean | null, displayLegend?: boolean | null, rangeMin?: number | null, rangeMax?: number | null, color?: string | null, description?: string | null, filter?: any | null, isStacked?: boolean | null, isCumulative?: boolean | null, splitMultiValueFields?: boolean | null, timezone?: string | null, firstDayOfTheWeek?: number | null } | { __typename?: 'NotesConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'PieChartConfiguration', configurationType: WidgetConfigurationType, groupByFieldMetadataId: string, aggregateFieldMetadataId: string, aggregateOperation: AggregateOperations, groupBySubFieldName?: string | null, dateGranularity?: ObjectRecordGroupByDateGranularity | null, orderBy?: GraphOrderBy | null, manualSortOrder?: Array | null, displayDataLabel?: boolean | null, showCenterMetric?: boolean | null, displayLegend?: boolean | null, hideEmptyCategory?: boolean | null, splitMultiValueFields?: boolean | null, color?: string | null, description?: string | null, filter?: any | null, timezone?: string | null, firstDayOfTheWeek?: number | null } | { __typename?: 'StandaloneRichTextConfiguration', configurationType: WidgetConfigurationType, body: { __typename?: 'RichTextV2Body', blocknote?: string | null, markdown?: string | null } } | { __typename?: 'TasksConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'TimelineConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'ViewConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'WorkflowConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'WorkflowRunConfiguration', configurationType: WidgetConfigurationType } | { __typename?: 'WorkflowVersionConfiguration', configurationType: WidgetConfigurationType } }> | null }> | null }; @@ -7641,6 +7668,7 @@ export const CommandMenuItemFieldsFragmentDoc = gql` name isHeadless } + engineComponentKey label icon shortLabel diff --git a/packages/twenty-front/src/modules/command-menu-item/constants/EngineComponentKeyComponentMap.tsx b/packages/twenty-front/src/modules/command-menu-item/constants/EngineComponentKeyComponentMap.tsx new file mode 100644 index 00000000000..955e5ed3c28 --- /dev/null +++ b/packages/twenty-front/src/modules/command-menu-item/constants/EngineComponentKeyComponentMap.tsx @@ -0,0 +1,77 @@ +import { DeleteMultipleRecordsCommand } from '@/command-menu-item/record/multiple-records/components/DeleteMultipleRecordsCommand'; +import { DestroyMultipleRecordsCommand } from '@/command-menu-item/record/multiple-records/components/DestroyMultipleRecordsCommand'; +import { MergeMultipleRecordsCommand } from '@/command-menu-item/record/multiple-records/components/MergeMultipleRecordsCommand'; +import { RestoreMultipleRecordsCommand } from '@/command-menu-item/record/multiple-records/components/RestoreMultipleRecordsCommand'; +import { CreateNewIndexRecordNoSelectionRecordCommand } from '@/command-menu-item/record/no-selection/components/CreateNewIndexRecordNoSelectionRecordCommand'; +import { AddToFavoritesSingleRecordCommand } from '@/command-menu-item/record/single-record/components/AddToFavoritesSingleRecordCommand'; +import { DeleteSingleRecordCommand } from '@/command-menu-item/record/single-record/components/DeleteSingleRecordCommand'; +import { DestroySingleRecordCommand } from '@/command-menu-item/record/single-record/components/DestroySingleRecordCommand'; +import { RemoveFromFavoritesSingleRecordCommand } from '@/command-menu-item/record/single-record/components/RemoveFromFavoritesSingleRecordCommand'; +import { RestoreSingleRecordCommand } from '@/command-menu-item/record/single-record/components/RestoreSingleRecordCommand'; +import { DuplicateDashboardSingleRecordCommand } from '@/command-menu-item/record/single-record/dashboard/components/DuplicateDashboardSingleRecordCommand'; +import { SaveDashboardSingleRecordCommand } from '@/command-menu-item/record/single-record/dashboard/components/SaveDashboardSingleRecordCommand'; +import { SaveRecordPageLayoutSingleRecordCommand } from '@/command-menu-item/record/single-record/record-page-layout/components/SaveRecordPageLayoutSingleRecordCommand'; +import { ActivateWorkflowSingleRecordCommand } from '@/command-menu-item/record/single-record/workflow/components/ActivateWorkflowSingleRecordCommand'; +import { DeactivateWorkflowSingleRecordCommand } from '@/command-menu-item/record/single-record/workflow/components/DeactivateWorkflowSingleRecordCommand'; +import { DiscardDraftWorkflowSingleRecordCommand } from '@/command-menu-item/record/single-record/workflow/components/DiscardDraftWorkflowSingleRecordCommand'; +import { DuplicateWorkflowSingleRecordCommand } from '@/command-menu-item/record/single-record/workflow/components/DuplicateWorkflowSingleRecordCommand'; +import { TestWorkflowSingleRecordCommand } from '@/command-menu-item/record/single-record/workflow/components/TestWorkflowSingleRecordCommand'; +import { TidyUpWorkflowSingleRecordCommand } from '@/command-menu-item/record/single-record/workflow/components/TidyUpWorkflowSingleRecordCommand'; +import { StopWorkflowRunSingleRecordCommand } from '@/command-menu-item/record/single-record/workflow-runs/components/StopWorkflowRunSingleRecordCommand'; +import { UseAsDraftWorkflowVersionSingleRecordCommand } from '@/command-menu-item/record/single-record/workflow-versions/components/UseAsDraftWorkflowVersionSingleRecordCommand'; +import { EngineComponentKey } from '~/generated-metadata/graphql'; + +export const ENGINE_COMPONENT_KEY_COMPONENT_MAP: Record< + EngineComponentKey, + React.ReactNode +> = { + [EngineComponentKey.CREATE_NEW_RECORD]: ( + + ), + [EngineComponentKey.DELETE_SINGLE_RECORD]: , + [EngineComponentKey.DELETE_MULTIPLE_RECORDS]: ( + + ), + [EngineComponentKey.RESTORE_SINGLE_RECORD]: , + [EngineComponentKey.RESTORE_MULTIPLE_RECORDS]: ( + + ), + [EngineComponentKey.DESTROY_SINGLE_RECORD]: , + [EngineComponentKey.DESTROY_MULTIPLE_RECORDS]: ( + + ), + [EngineComponentKey.ADD_TO_FAVORITES]: , + [EngineComponentKey.REMOVE_FROM_FAVORITES]: ( + + ), + [EngineComponentKey.MERGE_MULTIPLE_RECORDS]: , + [EngineComponentKey.DUPLICATE_DASHBOARD]: ( + + ), + [EngineComponentKey.DUPLICATE_WORKFLOW]: ( + + ), + [EngineComponentKey.ACTIVATE_WORKFLOW]: ( + + ), + [EngineComponentKey.DEACTIVATE_WORKFLOW]: ( + + ), + [EngineComponentKey.DISCARD_DRAFT_WORKFLOW]: ( + + ), + [EngineComponentKey.TEST_WORKFLOW]: , + [EngineComponentKey.STOP_WORKFLOW_RUN]: ( + + ), + [EngineComponentKey.USE_AS_DRAFT_WORKFLOW_VERSION]: ( + + ), + [EngineComponentKey.SAVE_RECORD_PAGE_LAYOUT]: ( + + ), + [EngineComponentKey.SAVE_DASHBOARD_LAYOUT]: ( + + ), + [EngineComponentKey.TIDY_UP_WORKFLOW]: , +}; diff --git a/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts b/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts index ca80245c323..7216f04cbaf 100644 --- a/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts +++ b/packages/twenty-front/src/modules/command-menu-item/graphql/fragments/commandMenuItemFragment.ts @@ -10,6 +10,7 @@ export const COMMAND_MENU_ITEM_FRAGMENT = gql` name isHeadless } + engineComponentKey label icon shortLabel diff --git a/packages/twenty-front/src/modules/command-menu-item/server-items/hooks/useCommandMenuItemFrontComponentCommands.tsx b/packages/twenty-front/src/modules/command-menu-item/server-items/hooks/useCommandMenuItemFrontComponentCommands.tsx index ba746782aca..18b132d1765 100644 --- a/packages/twenty-front/src/modules/command-menu-item/server-items/hooks/useCommandMenuItemFrontComponentCommands.tsx +++ b/packages/twenty-front/src/modules/command-menu-item/server-items/hooks/useCommandMenuItemFrontComponentCommands.tsx @@ -1,3 +1,4 @@ +import { ENGINE_COMPONENT_KEY_COMPONENT_MAP } from '@/command-menu-item/constants/EngineComponentKeyComponentMap'; import { Command } from '@/command-menu-item/display/components/Command'; import { HeadlessFrontComponentCommandMenuItem } from '@/command-menu-item/display/components/HeadlessFrontComponentCommandMenuItem'; import { CommandMenuItemScope } from '@/command-menu-item/types/CommandMenuItemScope'; @@ -22,6 +23,7 @@ import { COMMAND_MENU_DEFAULT_ICON } from '@/workflow/workflow-trigger/constants import { CommandMenuItemAvailabilityType, type CommandMenuItemFieldsFragment, + type EngineComponentKey, useFindManyCommandMenuItemsQuery, } from '~/generated-metadata/graphql'; @@ -30,6 +32,10 @@ type CommandMenuItemWithFrontComponent = CommandMenuItemFieldsFragment & { conditionalAvailabilityExpression?: string | null; }; +type CommandMenuItemWithSource = CommandMenuItemFieldsFragment & { + conditionalAvailabilityExpression?: string | null; +}; + type BuildCommandMenuItemFromFrontComponentParams = { item: CommandMenuItemWithFrontComponent; type?: CommandMenuItemType; @@ -53,8 +59,6 @@ type BuildCommandMenuItemFromFrontComponentParams = { commandMenuContextApi: CommandMenuContextApi; }; -// TODO: we should remove this backward compatibility logic in the future -// once we have migrated all command menu items const buildCommandMenuItemFromFrontComponent = ({ item, type = CommandMenuItemType.FrontComponent, @@ -115,6 +119,47 @@ const buildCommandMenuItemFromFrontComponent = ({ }; }; +type BuildCommandMenuItemFromStandardKeyParams = { + item: CommandMenuItemWithSource; + engineComponentKey: EngineComponentKey; + type?: CommandMenuItemType; + scope: CommandMenuItemScope; + isPinned: boolean; + getIcon: ReturnType['getIcon']; + commandMenuContextApi: CommandMenuContextApi; +}; + +const buildCommandItemFromEngineKey = ({ + item, + engineComponentKey, + type = CommandMenuItemType.Standard, + scope, + isPinned, + getIcon, + commandMenuContextApi, +}: BuildCommandMenuItemFromStandardKeyParams) => { + const Icon = getIcon(item.icon, COMMAND_MENU_DEFAULT_ICON); + + const component = ENGINE_COMPONENT_KEY_COMPONENT_MAP[engineComponentKey]; + + return { + type, + key: `command-menu-item-engine-${item.id}`, + scope, + label: item.label, + shortLabel: item.shortLabel ?? undefined, + position: item.position, + isPinned, + Icon, + shouldBeRegistered: () => + evaluateConditionalAvailabilityExpression( + item.conditionalAvailabilityExpression, + commandMenuContextApi, + ), + component, + }; +}; + export const useCommandMenuItemFrontComponentCommands = ( commandMenuContextApi: CommandMenuContextApi, ) => { @@ -159,74 +204,102 @@ export const useCommandMenuItemFrontComponentCommands = ( const { data } = useFindManyCommandMenuItemsQuery(); - const frontComponentItems = - data?.commandMenuItems?.filter( - (item): item is CommandMenuItemWithFrontComponent => - isDefined(item.frontComponentId), - ) ?? []; + const allItems = data?.commandMenuItems ?? []; - const objectMatches = (item: CommandMenuItemWithFrontComponent) => + const objectMatches = (item: CommandMenuItemFieldsFragment) => !isDefined(item.availabilityObjectMetadataId) || item.availabilityObjectMetadataId === contextStoreCurrentObjectMetadataItemId; - const frontComponentItemsWithObjectMatches = - frontComponentItems.filter(objectMatches); + const itemsWithObjectMatches = allItems.filter(objectMatches); - const globalItems = frontComponentItemsWithObjectMatches.filter( + const buildCommandMenuItem = ({ + item, + scope, + isPinned, + typeOverride, + }: { + item: CommandMenuItemFieldsFragment; + scope: CommandMenuItemScope; + isPinned: boolean; + typeOverride?: CommandMenuItemType; + }) => { + if (isDefined(item.engineComponentKey)) { + return buildCommandItemFromEngineKey({ + item, + engineComponentKey: item.engineComponentKey, + type: typeOverride, + scope, + isPinned, + getIcon, + commandMenuContextApi, + }); + } + + if (isDefined(item.frontComponentId)) { + return buildCommandMenuItemFromFrontComponent({ + item: item as CommandMenuItemWithFrontComponent, + type: typeOverride, + scope, + isPinned, + getIcon, + openFrontComponentInSidePanel, + mountHeadlessFrontComponent, + commandMenuContextApi, + mountContext, + }); + } + + return null; + }; + + const globalItems = itemsWithObjectMatches.filter( (item) => item.availabilityType === CommandMenuItemAvailabilityType.GLOBAL, ); - const recordScopedItems = frontComponentItemsWithObjectMatches.filter( + const recordScopedItems = itemsWithObjectMatches.filter( (item) => item.availabilityType === CommandMenuItemAvailabilityType.RECORD_SELECTION, ); - const fallbackItems = frontComponentItemsWithObjectMatches.filter( + const fallbackItems = itemsWithObjectMatches.filter( (item) => item.availabilityType === CommandMenuItemAvailabilityType.FALLBACK, ); - const globalCommandMenuItems = globalItems.map((item) => - buildCommandMenuItemFromFrontComponent({ - item, - scope: CommandMenuItemScope.Global, - isPinned: !contextStoreIsPageInEditMode && item.isPinned, - getIcon, - openFrontComponentInSidePanel, - mountHeadlessFrontComponent, - commandMenuContextApi, - }), - ); + const globalCommandMenuItems = globalItems + .map((item) => + buildCommandMenuItem({ + item, + scope: CommandMenuItemScope.Global, + isPinned: !contextStoreIsPageInEditMode && item.isPinned, + }), + ) + .filter(isDefined); const recordScopedCommandMenuItems = hasRecordSelection - ? recordScopedItems.map((item) => - buildCommandMenuItemFromFrontComponent({ - item, - scope: CommandMenuItemScope.RecordSelection, - isPinned: !contextStoreIsPageInEditMode && item.isPinned, - getIcon, - openFrontComponentInSidePanel, - mountHeadlessFrontComponent, - commandMenuContextApi, - mountContext, - }), - ) + ? recordScopedItems + .map((item) => + buildCommandMenuItem({ + item, + scope: CommandMenuItemScope.RecordSelection, + isPinned: !contextStoreIsPageInEditMode && item.isPinned, + }), + ) + .filter(isDefined) : []; - const fallbackCommandMenuItems = fallbackItems.map((item) => - buildCommandMenuItemFromFrontComponent({ - item, - type: CommandMenuItemType.Fallback, - scope: CommandMenuItemScope.Global, - isPinned: false, - getIcon, - openFrontComponentInSidePanel, - mountHeadlessFrontComponent, - commandMenuContextApi, - }), - ); + const fallbackCommandMenuItems = fallbackItems + .map((item) => + buildCommandMenuItem({ + item, + scope: CommandMenuItemScope.Global, + isPinned: false, + typeOverride: CommandMenuItemType.Fallback, + }), + ) + .filter(isDefined); return [ ...globalCommandMenuItems, diff --git a/packages/twenty-sdk/src/clients/generated/metadata/schema.graphql b/packages/twenty-sdk/src/clients/generated/metadata/schema.graphql index 076c2a113cd..2b67d4d18a0 100644 --- a/packages/twenty-sdk/src/clients/generated/metadata/schema.graphql +++ b/packages/twenty-sdk/src/clients/generated/metadata/schema.graphql @@ -2037,6 +2037,7 @@ type CommandMenuItem { workflowVersionId: UUID frontComponentId: UUID frontComponent: FrontComponent + engineComponentKey: EngineComponentKey label: String! icon: String shortLabel: String @@ -2050,6 +2051,30 @@ type CommandMenuItem { updatedAt: DateTime! } +enum EngineComponentKey { + CREATE_NEW_RECORD + DELETE_SINGLE_RECORD + DELETE_MULTIPLE_RECORDS + RESTORE_SINGLE_RECORD + RESTORE_MULTIPLE_RECORDS + DESTROY_SINGLE_RECORD + DESTROY_MULTIPLE_RECORDS + ADD_TO_FAVORITES + REMOVE_FROM_FAVORITES + MERGE_MULTIPLE_RECORDS + DUPLICATE_DASHBOARD + DUPLICATE_WORKFLOW + ACTIVATE_WORKFLOW + DEACTIVATE_WORKFLOW + DISCARD_DRAFT_WORKFLOW + TEST_WORKFLOW + STOP_WORKFLOW_RUN + USE_AS_DRAFT_WORKFLOW_VERSION + SAVE_RECORD_PAGE_LAYOUT + SAVE_DASHBOARD_LAYOUT + TIDY_UP_WORKFLOW +} + enum CommandMenuItemAvailabilityType { GLOBAL RECORD_SELECTION @@ -3650,6 +3675,7 @@ input UpsertFieldsWidgetFieldInput { input CreateCommandMenuItemInput { workflowVersionId: UUID frontComponentId: UUID + engineComponentKey: EngineComponentKey label: String! icon: String shortLabel: String @@ -3669,6 +3695,7 @@ input UpdateCommandMenuItemInput { isPinned: Boolean availabilityType: CommandMenuItemAvailabilityType availabilityObjectMetadataId: UUID + engineComponentKey: EngineComponentKey } input CreateFrontComponentInput { diff --git a/packages/twenty-sdk/src/clients/generated/metadata/schema.ts b/packages/twenty-sdk/src/clients/generated/metadata/schema.ts index 6dc26386fd1..0a047bfe777 100644 --- a/packages/twenty-sdk/src/clients/generated/metadata/schema.ts +++ b/packages/twenty-sdk/src/clients/generated/metadata/schema.ts @@ -1771,6 +1771,7 @@ export interface CommandMenuItem { workflowVersionId?: Scalars['UUID'] frontComponentId?: Scalars['UUID'] frontComponent?: FrontComponent + engineComponentKey?: EngineComponentKey label: Scalars['String'] icon?: Scalars['String'] shortLabel?: Scalars['String'] @@ -1785,6 +1786,8 @@ export interface CommandMenuItem { __typename: 'CommandMenuItem' } +export type EngineComponentKey = 'CREATE_NEW_RECORD' | 'DELETE_SINGLE_RECORD' | 'DELETE_MULTIPLE_RECORDS' | 'RESTORE_SINGLE_RECORD' | 'RESTORE_MULTIPLE_RECORDS' | 'DESTROY_SINGLE_RECORD' | 'DESTROY_MULTIPLE_RECORDS' | 'ADD_TO_FAVORITES' | 'REMOVE_FROM_FAVORITES' | 'MERGE_MULTIPLE_RECORDS' | 'DUPLICATE_DASHBOARD' | 'DUPLICATE_WORKFLOW' | 'ACTIVATE_WORKFLOW' | 'DEACTIVATE_WORKFLOW' | 'DISCARD_DRAFT_WORKFLOW' | 'TEST_WORKFLOW' | 'STOP_WORKFLOW_RUN' | 'USE_AS_DRAFT_WORKFLOW_VERSION' | 'SAVE_RECORD_PAGE_LAYOUT' | 'SAVE_DASHBOARD_LAYOUT' | 'TIDY_UP_WORKFLOW' + export type CommandMenuItemAvailabilityType = 'GLOBAL' | 'RECORD_SELECTION' | 'FALLBACK' export interface AgentChatThread { @@ -4697,6 +4700,7 @@ export interface CommandMenuItemGenqlSelection{ workflowVersionId?: boolean | number frontComponentId?: boolean | number frontComponent?: FrontComponentGenqlSelection + engineComponentKey?: boolean | number label?: boolean | number icon?: boolean | number shortLabel?: boolean | number @@ -5992,9 +5996,9 @@ export interface UpsertFieldsWidgetFieldInput { /** The id of the view field */ viewFieldId: Scalars['UUID'],isVisible: Scalars['Boolean'],position: Scalars['Float']} -export interface CreateCommandMenuItemInput {workflowVersionId?: (Scalars['UUID'] | null),frontComponentId?: (Scalars['UUID'] | null),label: Scalars['String'],icon?: (Scalars['String'] | null),shortLabel?: (Scalars['String'] | null),position?: (Scalars['Float'] | null),isPinned?: (Scalars['Boolean'] | null),availabilityType?: (CommandMenuItemAvailabilityType | null),conditionalAvailabilityExpression?: (Scalars['String'] | null),availabilityObjectMetadataId?: (Scalars['UUID'] | null)} +export interface CreateCommandMenuItemInput {workflowVersionId?: (Scalars['UUID'] | null),frontComponentId?: (Scalars['UUID'] | null),engineComponentKey?: (EngineComponentKey | null),label: Scalars['String'],icon?: (Scalars['String'] | null),shortLabel?: (Scalars['String'] | null),position?: (Scalars['Float'] | null),isPinned?: (Scalars['Boolean'] | null),availabilityType?: (CommandMenuItemAvailabilityType | null),conditionalAvailabilityExpression?: (Scalars['String'] | null),availabilityObjectMetadataId?: (Scalars['UUID'] | null)} -export interface UpdateCommandMenuItemInput {id: Scalars['UUID'],label?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),shortLabel?: (Scalars['String'] | null),position?: (Scalars['Float'] | null),isPinned?: (Scalars['Boolean'] | null),availabilityType?: (CommandMenuItemAvailabilityType | null),availabilityObjectMetadataId?: (Scalars['UUID'] | null)} +export interface UpdateCommandMenuItemInput {id: Scalars['UUID'],label?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),shortLabel?: (Scalars['String'] | null),position?: (Scalars['Float'] | null),isPinned?: (Scalars['Boolean'] | null),availabilityType?: (CommandMenuItemAvailabilityType | null),availabilityObjectMetadataId?: (Scalars['UUID'] | null),engineComponentKey?: (EngineComponentKey | null)} export interface CreateFrontComponentInput {id?: (Scalars['UUID'] | null),name: Scalars['String'],description?: (Scalars['String'] | null),sourceComponentPath: Scalars['String'],builtComponentPath: Scalars['String'],componentName: Scalars['String'],builtComponentChecksum: Scalars['String']} @@ -8513,6 +8517,30 @@ export const enumLogicFunctionExecutionStatus = { ERROR: 'ERROR' as const } +export const enumEngineComponentKey = { + CREATE_NEW_RECORD: 'CREATE_NEW_RECORD' as const, + DELETE_SINGLE_RECORD: 'DELETE_SINGLE_RECORD' as const, + DELETE_MULTIPLE_RECORDS: 'DELETE_MULTIPLE_RECORDS' as const, + RESTORE_SINGLE_RECORD: 'RESTORE_SINGLE_RECORD' as const, + RESTORE_MULTIPLE_RECORDS: 'RESTORE_MULTIPLE_RECORDS' as const, + DESTROY_SINGLE_RECORD: 'DESTROY_SINGLE_RECORD' as const, + DESTROY_MULTIPLE_RECORDS: 'DESTROY_MULTIPLE_RECORDS' as const, + ADD_TO_FAVORITES: 'ADD_TO_FAVORITES' as const, + REMOVE_FROM_FAVORITES: 'REMOVE_FROM_FAVORITES' as const, + MERGE_MULTIPLE_RECORDS: 'MERGE_MULTIPLE_RECORDS' as const, + DUPLICATE_DASHBOARD: 'DUPLICATE_DASHBOARD' as const, + DUPLICATE_WORKFLOW: 'DUPLICATE_WORKFLOW' as const, + ACTIVATE_WORKFLOW: 'ACTIVATE_WORKFLOW' as const, + DEACTIVATE_WORKFLOW: 'DEACTIVATE_WORKFLOW' as const, + DISCARD_DRAFT_WORKFLOW: 'DISCARD_DRAFT_WORKFLOW' as const, + TEST_WORKFLOW: 'TEST_WORKFLOW' as const, + STOP_WORKFLOW_RUN: 'STOP_WORKFLOW_RUN' as const, + USE_AS_DRAFT_WORKFLOW_VERSION: 'USE_AS_DRAFT_WORKFLOW_VERSION' as const, + SAVE_RECORD_PAGE_LAYOUT: 'SAVE_RECORD_PAGE_LAYOUT' as const, + SAVE_DASHBOARD_LAYOUT: 'SAVE_DASHBOARD_LAYOUT' as const, + TIDY_UP_WORKFLOW: 'TIDY_UP_WORKFLOW' as const +} + export const enumCommandMenuItemAvailabilityType = { GLOBAL: 'GLOBAL' as const, RECORD_SELECTION: 'RECORD_SELECTION' as const, diff --git a/packages/twenty-sdk/src/clients/generated/metadata/types.ts b/packages/twenty-sdk/src/clients/generated/metadata/types.ts index 4297d5c37af..95121bfcad6 100644 --- a/packages/twenty-sdk/src/clients/generated/metadata/types.ts +++ b/packages/twenty-sdk/src/clients/generated/metadata/types.ts @@ -52,29 +52,30 @@ export default { 181, 216, 224, - 237, + 225, 238, - 243, - 246, - 252, + 239, + 244, + 247, 253, - 255, - 260, - 265, + 254, + 256, + 261, 266, - 278, - 294, + 267, + 279, 295, - 318, - 325, + 296, + 319, 326, 327, - 329, - 338, - 397, - 448, + 328, + 330, + 339, + 398, 449, - 450 + 450, + 451 ], "types": { "BillingProductDTO": { @@ -4083,6 +4084,9 @@ export default { "frontComponent": [ 222 ], + "engineComponentKey": [ + 224 + ], "label": [ 1 ], @@ -4099,7 +4103,7 @@ export default { 6 ], "availabilityType": [ - 224 + 225 ], "conditionalAvailabilityExpression": [ 1 @@ -4120,6 +4124,7 @@ export default { 1 ] }, + "EngineComponentKey": {}, "CommandMenuItemAvailabilityType": {}, "AgentChatThread": { "id": [ @@ -4198,7 +4203,7 @@ export default { }, "AISystemPromptPreview": { "sections": [ - 227 + 228 ], "estimatedTokenCount": [ 21 @@ -4209,7 +4214,7 @@ export default { }, "AgentChatThreadEdge": { "node": [ - 225 + 226 ], "cursor": [ 40 @@ -4223,7 +4228,7 @@ export default { 168 ], "edges": [ - 229 + 230 ], "__typename": [ 1 @@ -4260,10 +4265,10 @@ export default { 3 ], "evaluations": [ - 231 + 232 ], "messages": [ - 226 + 227 ], "createdAt": [ 4 @@ -4334,10 +4339,10 @@ export default { 1 ], "modelFamily": [ - 237 + 238 ], "inferenceProvider": [ - 238 + 239 ], "inputCostPerMillionTokensInCredits": [ 11 @@ -4346,7 +4351,7 @@ export default { 11 ], "nativeCapabilities": [ - 235 + 236 ], "deprecated": [ 6 @@ -4368,10 +4373,10 @@ export default { 1 ], "modelFamily": [ - 237 + 238 ], "inferenceProvider": [ - 238 + 239 ], "isAvailable": [ 6 @@ -4394,7 +4399,7 @@ export default { 6 ], "models": [ - 239 + 240 ], "__typename": [ 1 @@ -4408,7 +4413,7 @@ export default { 1 ], "trialPeriods": [ - 234 + 235 ], "__typename": [ 1 @@ -4416,7 +4421,7 @@ export default { }, "Support": { "supportDriver": [ - 243 + 244 ], "supportFrontChatId": [ 1 @@ -4442,7 +4447,7 @@ export default { }, "Captcha": { "provider": [ - 246 + 247 ], "siteKey": [ 1 @@ -4479,7 +4484,7 @@ export default { 162 ], "metadata": [ - 248 + 249 ], "__typename": [ 1 @@ -4493,10 +4498,10 @@ export default { 164 ], "billing": [ - 241 + 242 ], "aiModels": [ - 236 + 237 ], "signInPrefilled": [ 6 @@ -4517,28 +4522,28 @@ export default { 6 ], "support": [ - 242 + 243 ], "isAttachmentPreviewEnabled": [ 6 ], "sentry": [ - 244 + 245 ], "captcha": [ - 245 + 246 ], "chromeExtensionId": [ 1 ], "api": [ - 247 + 248 ], "canManageFeatureFlags": [ 6 ], "publicFeatureFlags": [ - 249 + 250 ], "isMicrosoftMessagingEnabled": [ 6 @@ -4588,13 +4593,13 @@ export default { 6 ], "source": [ - 252 + 253 ], "isEnvOnly": [ 6 ], "type": [ - 253 + 254 ], "options": [ 15 @@ -4607,10 +4612,10 @@ export default { "ConfigVariableType": {}, "ConfigVariablesGroupData": { "variables": [ - 251 + 252 ], "name": [ - 255 + 256 ], "description": [ 1 @@ -4625,7 +4630,7 @@ export default { "ConfigVariablesGroup": {}, "ConfigVariables": { "groups": [ - 254 + 255 ], "__typename": [ 1 @@ -4650,7 +4655,7 @@ export default { 21 ], "results": [ - 257 + 258 ], "__typename": [ 1 @@ -4667,7 +4672,7 @@ export default { 15 ], "state": [ - 260 + 261 ], "timestamp": [ 11 @@ -4717,7 +4722,7 @@ export default { }, "QueueJobsResponse": { "jobs": [ - 259 + 260 ], "count": [ 11 @@ -4729,7 +4734,7 @@ export default { 6 ], "retentionConfig": [ - 261 + 262 ], "__typename": [ 1 @@ -4740,7 +4745,7 @@ export default { 21 ], "results": [ - 257 + 258 ], "__typename": [ 1 @@ -4748,13 +4753,13 @@ export default { }, "SystemHealthService": { "id": [ - 265 + 266 ], "label": [ 1 ], "status": [ - 266 + 267 ], "__typename": [ 1 @@ -4764,7 +4769,7 @@ export default { "AdminPanelHealthServiceStatus": {}, "SystemHealth": { "services": [ - 264 + 265 ], "__typename": [ 1 @@ -4807,7 +4812,7 @@ export default { 150 ], "users": [ - 268 + 269 ], "featureFlags": [ 161 @@ -4818,10 +4823,10 @@ export default { }, "UserLookup": { "user": [ - 268 + 269 ], "workspaces": [ - 269 + 270 ], "__typename": [ 1 @@ -4846,7 +4851,7 @@ export default { 1 ], "status": [ - 266 + 267 ], "__typename": [ 1 @@ -4854,7 +4859,7 @@ export default { }, "AdminPanelHealthServiceData": { "id": [ - 265 + 266 ], "label": [ 1 @@ -4863,7 +4868,7 @@ export default { 1 ], "status": [ - 266 + 267 ], "errorMessage": [ 1 @@ -4872,7 +4877,7 @@ export default { 1 ], "queues": [ - 272 + 273 ], "__typename": [ 1 @@ -4894,7 +4899,7 @@ export default { 1 ], "data": [ - 274 + 275 ], "__typename": [ 1 @@ -4937,13 +4942,13 @@ export default { 11 ], "timeRange": [ - 278 + 279 ], "details": [ - 276 + 277 ], "data": [ - 275 + 276 ], "__typename": [ 1 @@ -5049,7 +5054,7 @@ export default { 1 ], "fields": [ - 283 + 284 ], "__typename": [ 1 @@ -5146,10 +5151,10 @@ export default { 6 ], "objectPermissions": [ - 287 + 288 ], "fieldPermissions": [ - 288 + 289 ], "permissionFlags": [ 1 @@ -5199,19 +5204,19 @@ export default { 1 ], "objects": [ - 284 - ], - "fields": [ - 283 - ], - "logicFunctions": [ 285 ], - "frontComponents": [ + "fields": [ + 284 + ], + "logicFunctions": [ 286 ], + "frontComponents": [ + 287 + ], "defaultRole": [ - 289 + 290 ], "sourcePackage": [ 1 @@ -5271,13 +5276,13 @@ export default { 1 ], "driver": [ - 294 - ], - "status": [ 295 ], + "status": [ + 296 + ], "verificationRecords": [ - 292 + 293 ], "verifiedAt": [ 4 @@ -5324,7 +5329,7 @@ export default { 1 ], "location": [ - 297 + 298 ], "__typename": [ 1 @@ -5352,13 +5357,13 @@ export default { }, "ImapSmtpCaldavConnectionParameters": { "IMAP": [ - 299 + 300 ], "SMTP": [ - 299 + 300 ], "CALDAV": [ - 299 + 300 ], "__typename": [ 1 @@ -5378,7 +5383,7 @@ export default { 3 ], "connectionParameters": [ - 300 + 301 ], "__typename": [ 1 @@ -5442,7 +5447,7 @@ export default { 1 ], "series": [ - 305 + 306 ], "xAxisLabel": [ 1 @@ -5491,7 +5496,7 @@ export default { 1 ], "data": [ - 307 + 308 ], "__typename": [ 1 @@ -5499,7 +5504,7 @@ export default { }, "LineChartData": { "series": [ - 308 + 309 ], "xAxisLabel": [ 1 @@ -5536,7 +5541,7 @@ export default { }, "PieChartData": { "data": [ - 310 + 311 ], "showLegend": [ 6 @@ -5619,13 +5624,13 @@ export default { }, "EventLogQueryResult": { "records": [ - 313 + 314 ], "totalCount": [ 21 ], "pageInfo": [ - 314 + 315 ], "__typename": [ 1 @@ -5692,7 +5697,7 @@ export default { 32, { "input": [ - 317, + 318, "LogicFunctionIdInput!" ] } @@ -5704,7 +5709,7 @@ export default { 15, { "input": [ - 317, + 318, "LogicFunctionIdInput!" ] } @@ -5713,7 +5718,7 @@ export default { 1, { "input": [ - 317, + 318, "LogicFunctionIdInput!" ] } @@ -5921,7 +5926,7 @@ export default { 25, { "input": [ - 319, + 320, "AgentIdInput!" ] } @@ -5959,7 +5964,7 @@ export default { 2, { "input": [ - 320, + 321, "GetApiKeyInput!" ] } @@ -6121,10 +6126,10 @@ export default { 191 ], "webhooks": [ - 233 + 234 ], "webhook": [ - 233, + 234, { "id": [ 3, @@ -6133,7 +6138,7 @@ export default { } ], "chatThread": [ - 225, + 226, { "id": [ 3, @@ -6142,7 +6147,7 @@ export default { } ], "chatMessages": [ - 226, + 227, { "threadId": [ 3, @@ -6151,7 +6156,7 @@ export default { } ], "getAISystemPromptPreview": [ - 228 + 229 ], "skills": [ 220 @@ -6166,24 +6171,24 @@ export default { } ], "chatThreads": [ - 230, + 231, { "paging": [ 39, "CursorPaging!" ], "filter": [ - 321, + 322, "AgentChatThreadFilter!" ], "sorting": [ - 324, + 325, "[AgentChatThreadSort!]!" ] } ], "agentTurns": [ - 232, + 233, { "agentId": [ 3, @@ -6192,43 +6197,43 @@ export default { } ], "eventLogs": [ - 315, + 316, { "input": [ - 328, + 329, "EventLogQueryInput!" ] } ], "pieChartData": [ - 311, + 312, { "input": [ - 332, + 333, "PieChartDataInput!" ] } ], "lineChartData": [ - 309, + 310, { "input": [ - 333, + 334, "LineChartDataInput!" ] } ], "barChartData": [ - 306, + 307, { "input": [ - 334, + 335, "BarChartDataInput!" ] } ], "getConnectedImapSmtpCaldavAccount": [ - 301, + 302, { "id": [ 3, @@ -6237,7 +6242,7 @@ export default { } ], "getAutoCompleteAddress": [ - 296, + 297, { "address": [ 1, @@ -6256,7 +6261,7 @@ export default { } ], "getAddressDetails": [ - 298, + 299, { "placeId": [ 1, @@ -6269,40 +6274,40 @@ export default { } ], "getConfigVariablesGrouped": [ - 256 + 257 ], "getSystemHealthStatus": [ - 267 + 268 ], "getIndicatorHealthStatus": [ - 273, + 274, { "indicatorId": [ - 265, + 266, "HealthIndicatorId!" ] } ], "getQueueMetrics": [ - 277, + 278, { "queueName": [ 1, "String!" ], "timeRange": [ - 278 + 279 ] } ], "versionInfo": [ - 271 + 272 ], "getAdminAiModels": [ - 240 + 241 ], "getDatabaseConfigVariable": [ - 251, + 252, { "key": [ 1, @@ -6311,14 +6316,14 @@ export default { } ], "getQueueJobs": [ - 262, + 263, { "queueName": [ 1, "String!" ], "state": [ - 260, + 261, "JobState!" ], "limit": [ @@ -6333,19 +6338,19 @@ export default { 7 ], "getPostgresCredentials": [ - 303 + 304 ], "findManyPublicDomains": [ - 291 + 292 ], "getEmailingDomains": [ - 293 + 294 ], "findManyMarketplaceApps": [ - 290 + 291 ], "findOneMarketplaceApp": [ - 290, + 291, { "universalIdentifier": [ 1, @@ -6373,7 +6378,7 @@ export default { }, "LogicFunctionIdInput": { "id": [ - 318 + 319 ], "__typename": [ 1 @@ -6398,16 +6403,16 @@ export default { }, "AgentChatThreadFilter": { "and": [ - 321 + 322 ], "or": [ - 321 + 322 ], "id": [ 42 ], "updatedAt": [ - 322 + 323 ], "__typename": [ 1 @@ -6445,10 +6450,10 @@ export default { 4 ], "between": [ - 323 + 324 ], "notBetween": [ - 323 + 324 ], "__typename": [ 1 @@ -6467,14 +6472,14 @@ export default { }, "AgentChatThreadSort": { "field": [ - 325 - ], - "direction": [ 326 ], - "nulls": [ + "direction": [ 327 ], + "nulls": [ + 328 + ], "__typename": [ 1 ] @@ -6484,10 +6489,10 @@ export default { "SortNulls": {}, "EventLogQueryInput": { "table": [ - 329 + 330 ], "filters": [ - 330 + 331 ], "first": [ 21 @@ -6508,7 +6513,7 @@ export default { 1 ], "dateRange": [ - 331 + 332 ], "recordId": [ 1 @@ -6569,7 +6574,7 @@ export default { 6, { "input": [ - 336, + 337, "AddQuerySubscriptionInput!" ] } @@ -6578,7 +6583,7 @@ export default { 6, { "input": [ - 337, + 338, "RemoveQueryFromEventStreamInput!" ] } @@ -6607,7 +6612,7 @@ export default { 122, { "type": [ - 338, + 339, "AnalyticsType!" ], "name": [ @@ -6625,7 +6630,7 @@ export default { 75, { "input": [ - 339, + 340, "CreatePageLayoutWidgetInput!" ] } @@ -6638,7 +6643,7 @@ export default { "String!" ], "input": [ - 341, + 342, "UpdatePageLayoutWidgetInput!" ] } @@ -6656,7 +6661,7 @@ export default { 110, { "input": [ - 342, + 343, "CreatePageLayoutTabInput!" ] } @@ -6669,7 +6674,7 @@ export default { "String!" ], "input": [ - 343, + 344, "UpdatePageLayoutTabInput!" ] } @@ -6687,7 +6692,7 @@ export default { 111, { "input": [ - 344, + 345, "CreatePageLayoutInput!" ] } @@ -6700,7 +6705,7 @@ export default { "String!" ], "input": [ - 345, + 346, "UpdatePageLayoutInput!" ] } @@ -6722,7 +6727,7 @@ export default { "String!" ], "input": [ - 346, + 347, "UpdatePageLayoutWithTabsInput!" ] } @@ -6731,7 +6736,7 @@ export default { 32, { "input": [ - 317, + 318, "LogicFunctionIdInput!" ] } @@ -6740,7 +6745,7 @@ export default { 32, { "input": [ - 349, + 350, "CreateLogicFunctionFromSourceInput!" ] } @@ -6749,7 +6754,7 @@ export default { 215, { "input": [ - 350, + 351, "ExecuteOneLogicFunctionInput!" ] } @@ -6758,7 +6763,7 @@ export default { 6, { "input": [ - 351, + 352, "UpdateLogicFunctionFromSourceInput!" ] } @@ -6767,7 +6772,7 @@ export default { 46, { "input": [ - 353, + 354, "CreateOneObjectInput!" ] } @@ -6776,7 +6781,7 @@ export default { 46, { "input": [ - 355, + 356, "DeleteOneObjectInput!" ] } @@ -6785,7 +6790,7 @@ export default { 46, { "input": [ - 356, + 357, "UpdateOneObjectInput!" ] } @@ -6794,7 +6799,7 @@ export default { 50, { "input": [ - 358, + 359, "UpdateViewFieldInput!" ] } @@ -6803,7 +6808,7 @@ export default { 50, { "input": [ - 360, + 361, "CreateViewFieldInput!" ] } @@ -6812,7 +6817,7 @@ export default { 50, { "inputs": [ - 360, + 361, "[CreateViewFieldInput!]!" ] } @@ -6821,7 +6826,7 @@ export default { 50, { "input": [ - 361, + 362, "DeleteViewFieldInput!" ] } @@ -6830,7 +6835,7 @@ export default { 50, { "input": [ - 362, + 363, "DestroyViewFieldInput!" ] } @@ -6839,7 +6844,7 @@ export default { 60, { "input": [ - 363, + 364, "CreateViewInput!" ] } @@ -6852,7 +6857,7 @@ export default { "String!" ], "input": [ - 364, + 365, "UpdateViewInput!" ] } @@ -6879,7 +6884,7 @@ export default { 57, { "input": [ - 365, + 366, "CreateViewSortInput!" ] } @@ -6888,7 +6893,7 @@ export default { 57, { "input": [ - 366, + 367, "UpdateViewSortInput!" ] } @@ -6897,7 +6902,7 @@ export default { 6, { "input": [ - 368, + 369, "DeleteViewSortInput!" ] } @@ -6906,7 +6911,7 @@ export default { 6, { "input": [ - 369, + 370, "DestroyViewSortInput!" ] } @@ -6915,7 +6920,7 @@ export default { 56, { "input": [ - 370, + 371, "CreateViewGroupInput!" ] } @@ -6924,7 +6929,7 @@ export default { 56, { "inputs": [ - 370, + 371, "[CreateViewGroupInput!]!" ] } @@ -6933,7 +6938,7 @@ export default { 56, { "input": [ - 371, + 372, "UpdateViewGroupInput!" ] } @@ -6942,7 +6947,7 @@ export default { 56, { "input": [ - 373, + 374, "DeleteViewGroupInput!" ] } @@ -6951,7 +6956,7 @@ export default { 56, { "input": [ - 374, + 375, "DestroyViewGroupInput!" ] } @@ -6960,7 +6965,7 @@ export default { 52, { "input": [ - 375, + 376, "CreateViewFilterGroupInput!" ] } @@ -6973,7 +6978,7 @@ export default { "String!" ], "input": [ - 376, + 377, "UpdateViewFilterGroupInput!" ] } @@ -7000,7 +7005,7 @@ export default { 54, { "input": [ - 377, + 378, "CreateViewFilterInput!" ] } @@ -7009,7 +7014,7 @@ export default { 54, { "input": [ - 378, + 379, "UpdateViewFilterInput!" ] } @@ -7018,7 +7023,7 @@ export default { 54, { "input": [ - 380, + 381, "DeleteViewFilterInput!" ] } @@ -7027,7 +7032,7 @@ export default { 54, { "input": [ - 381, + 382, "DestroyViewFilterInput!" ] } @@ -7036,7 +7041,7 @@ export default { 59, { "input": [ - 382, + 383, "UpdateViewFieldGroupInput!" ] } @@ -7045,7 +7050,7 @@ export default { 59, { "input": [ - 384, + 385, "CreateViewFieldGroupInput!" ] } @@ -7054,7 +7059,7 @@ export default { 59, { "inputs": [ - 384, + 385, "[CreateViewFieldGroupInput!]!" ] } @@ -7063,7 +7068,7 @@ export default { 59, { "input": [ - 385, + 386, "DeleteViewFieldGroupInput!" ] } @@ -7072,7 +7077,7 @@ export default { 59, { "input": [ - 386, + 387, "DestroyViewFieldGroupInput!" ] } @@ -7081,7 +7086,7 @@ export default { 60, { "input": [ - 387, + 388, "UpsertFieldsWidgetInput!" ] } @@ -7090,7 +7095,7 @@ export default { 223, { "input": [ - 390, + 391, "CreateCommandMenuItemInput!" ] } @@ -7099,7 +7104,7 @@ export default { 223, { "input": [ - 391, + 392, "UpdateCommandMenuItemInput!" ] } @@ -7117,7 +7122,7 @@ export default { 222, { "input": [ - 392, + 393, "CreateFrontComponentInput!" ] } @@ -7126,7 +7131,7 @@ export default { 222, { "input": [ - 393, + 394, "UpdateFrontComponentInput!" ] } @@ -7144,7 +7149,7 @@ export default { 25, { "input": [ - 395, + 396, "CreateAgentInput!" ] } @@ -7153,7 +7158,7 @@ export default { 25, { "input": [ - 396, + 397, "UpdateAgentInput!" ] } @@ -7162,7 +7167,7 @@ export default { 25, { "input": [ - 319, + 320, "AgentIdInput!" ] } @@ -7171,7 +7176,7 @@ export default { 146, { "file": [ - 397, + 398, "Upload!" ] } @@ -7180,7 +7185,7 @@ export default { 146, { "file": [ - 397, + 398, "Upload!" ] } @@ -7189,7 +7194,7 @@ export default { 146, { "file": [ - 397, + 398, "Upload!" ] } @@ -7198,7 +7203,7 @@ export default { 146, { "file": [ - 397, + 398, "Upload!" ] } @@ -7207,7 +7212,7 @@ export default { 146, { "file": [ - 397, + 398, "Upload!" ], "fieldMetadataId": [ @@ -7220,7 +7225,7 @@ export default { 146, { "file": [ - 397, + 398, "Upload!" ], "fieldMetadataUniversalIdentifier": [ @@ -7280,7 +7285,7 @@ export default { 214, { "input": [ - 398, + 399, "CreateNavigationMenuItemInput!" ] } @@ -7289,7 +7294,7 @@ export default { 214, { "input": [ - 399, + 400, "UpdateOneNavigationMenuItemInput!" ] } @@ -7307,7 +7312,7 @@ export default { 2, { "input": [ - 401, + 402, "CreateApiKeyInput!" ] } @@ -7316,7 +7321,7 @@ export default { 2, { "input": [ - 402, + 403, "UpdateApiKeyInput!" ] } @@ -7325,7 +7330,7 @@ export default { 2, { "input": [ - 403, + 404, "RevokeApiKeyInput!" ] } @@ -7360,7 +7365,7 @@ export default { 29, { "createRoleInput": [ - 404, + 405, "CreateRoleInput!" ] } @@ -7369,7 +7374,7 @@ export default { 29, { "updateRoleInput": [ - 405, + 406, "UpdateRoleInput!" ] } @@ -7387,7 +7392,7 @@ export default { 16, { "upsertObjectPermissionsInput": [ - 407, + 408, "UpsertObjectPermissionsInput!" ] } @@ -7396,7 +7401,7 @@ export default { 27, { "upsertPermissionFlagsInput": [ - 409, + 410, "UpsertPermissionFlagsInput!" ] } @@ -7405,7 +7410,7 @@ export default { 26, { "upsertFieldPermissionsInput": [ - 410, + 411, "UpsertFieldPermissionsInput!" ] } @@ -7414,7 +7419,7 @@ export default { 179, { "input": [ - 412, + 413, "UpsertRowLevelPermissionPredicatesInput!" ] } @@ -7481,7 +7486,7 @@ export default { 145, { "input": [ - 415, + 416, "CreateApprovedAccessDomainInput!" ] } @@ -7490,7 +7495,7 @@ export default { 6, { "input": [ - 416, + 417, "DeleteApprovedAccessDomainInput!" ] } @@ -7499,7 +7504,7 @@ export default { 145, { "input": [ - 417, + 418, "ValidateApprovedAccessDomainInput!" ] } @@ -7508,7 +7513,7 @@ export default { 34, { "input": [ - 418, + 419, "CreateOneFieldMetadataInput!" ] } @@ -7517,7 +7522,7 @@ export default { 34, { "input": [ - 420, + 421, "UpdateOneFieldMetadataInput!" ] } @@ -7526,7 +7531,7 @@ export default { 34, { "input": [ - 422, + 423, "DeleteOneFieldInput!" ] } @@ -7572,7 +7577,7 @@ export default { 66, { "data": [ - 423, + 424, "ActivateWorkspaceInput!" ] } @@ -7581,7 +7586,7 @@ export default { 66, { "data": [ - 424, + 425, "UpdateWorkspaceInput!" ] } @@ -7596,7 +7601,7 @@ export default { 201, { "input": [ - 425, + 426, "GetAuthorizationUrlForSSOInput!" ] } @@ -7850,7 +7855,7 @@ export default { 185, { "input": [ - 426, + 427, "CreateApplicationRegistrationInput!" ] } @@ -7859,7 +7864,7 @@ export default { 7, { "input": [ - 427, + 428, "UpdateApplicationRegistrationInput!" ] } @@ -7886,7 +7891,7 @@ export default { 5, { "input": [ - 429, + 430, "CreateApplicationRegistrationVariableInput!" ] } @@ -7895,7 +7900,7 @@ export default { 5, { "input": [ - 430, + 431, "UpdateApplicationRegistrationVariableInput!" ] } @@ -7913,7 +7918,7 @@ export default { 7, { "file": [ - 397, + 398, "Upload!" ], "universalIdentifier": [ @@ -7972,7 +7977,7 @@ export default { 192, { "input": [ - 432, + 433, "SetupOIDCSsoInput!" ] } @@ -7981,7 +7986,7 @@ export default { 192, { "input": [ - 433, + 434, "SetupSAMLSsoInput!" ] } @@ -7990,7 +7995,7 @@ export default { 188, { "input": [ - 434, + 435, "DeleteSsoInput!" ] } @@ -7999,31 +8004,31 @@ export default { 189, { "input": [ - 435, + 436, "EditSsoInput!" ] } ], "createWebhook": [ - 233, + 234, { "input": [ - 436, + 437, "CreateWebhookInput!" ] } ], "updateWebhook": [ - 233, + 234, { "input": [ - 437, + 438, "UpdateWebhookInput!" ] } ], "deleteWebhook": [ - 233, + 234, { "id": [ 3, @@ -8032,13 +8037,13 @@ export default { } ], "createChatThread": [ - 225 + 226 ], "createSkill": [ 220, { "input": [ - 439, + 440, "CreateSkillInput!" ] } @@ -8047,7 +8052,7 @@ export default { 220, { "input": [ - 440, + 441, "UpdateSkillInput!" ] } @@ -8080,7 +8085,7 @@ export default { } ], "evaluateAgentTurn": [ - 231, + 232, { "turnId": [ 3, @@ -8089,7 +8094,7 @@ export default { } ], "runEvaluationInput": [ - 232, + 233, { "agentId": [ 3, @@ -8102,7 +8107,7 @@ export default { } ], "duplicateDashboard": [ - 312, + 313, { "id": [ 3, @@ -8111,7 +8116,7 @@ export default { } ], "impersonate": [ - 279, + 280, { "userId": [ 3, @@ -8124,7 +8129,7 @@ export default { } ], "startChannelSync": [ - 304, + 305, { "connectedAccountId": [ 3, @@ -8133,7 +8138,7 @@ export default { } ], "saveImapSmtpCaldavAccount": [ - 302, + 303, { "accountOwnerId": [ 3, @@ -8144,7 +8149,7 @@ export default { "String!" ], "connectionParameters": [ - 441, + 442, "EmailAccountConnectionParameters!" ], "id": [ @@ -8156,13 +8161,13 @@ export default { 161, { "input": [ - 443, + 444, "UpdateLabPublicFeatureFlagInput!" ] } ], "userLookupAdminPanel": [ - 270, + 271, { "userIdentifier": [ 1, @@ -8236,7 +8241,7 @@ export default { } ], "retryJobs": [ - 263, + 264, { "queueName": [ 1, @@ -8249,7 +8254,7 @@ export default { } ], "deleteJobs": [ - 258, + 259, { "queueName": [ 1, @@ -8262,13 +8267,13 @@ export default { } ], "enablePostgresProxy": [ - 303 + 304 ], "disablePostgresProxy": [ - 303 + 304 ], "createPublicDomain": [ - 291, + 292, { "domain": [ 1, @@ -8295,14 +8300,14 @@ export default { } ], "createEmailingDomain": [ - 293, + 294, { "domain": [ 1, "String!" ], "driver": [ - 294, + 295, "EmailingDomainDriver!" ] } @@ -8317,7 +8322,7 @@ export default { } ], "verifyEmailingDomain": [ - 293, + 294, { "id": [ 1, @@ -8329,7 +8334,7 @@ export default { 68, { "input": [ - 444, + 445, "CreateOneAppTokenInput!" ] } @@ -8362,7 +8367,7 @@ export default { 6, { "workspaceMigration": [ - 446, + 447, "WorkspaceMigrationInput!" ] } @@ -8394,7 +8399,7 @@ export default { } ], "createDevelopmentApplication": [ - 280, + 281, { "universalIdentifier": [ 1, @@ -8416,7 +8421,7 @@ export default { } ], "syncApplication": [ - 281, + 282, { "manifest": [ 15, @@ -8425,10 +8430,10 @@ export default { } ], "uploadApplicationFile": [ - 282, + 283, { "file": [ - 397, + 398, "Upload!" ], "applicationUniversalIdentifier": [ @@ -8436,7 +8441,7 @@ export default { "String!" ], "fileFolder": [ - 450, + 451, "FileFolder!" ], "filePath": [ @@ -8511,7 +8516,7 @@ export default { 3 ], "gridPosition": [ - 340 + 341 ], "position": [ 15 @@ -8551,7 +8556,7 @@ export default { 3 ], "gridPosition": [ - 340 + 341 ], "position": [ 15 @@ -8633,7 +8638,7 @@ export default { 3 ], "tabs": [ - 347 + 348 ], "__typename": [ 1 @@ -8653,7 +8658,7 @@ export default { 1 ], "widgets": [ - 348 + 349 ], "__typename": [ 1 @@ -8676,7 +8681,7 @@ export default { 3 ], "gridPosition": [ - 340 + 341 ], "position": [ 15 @@ -8745,7 +8750,7 @@ export default { 3 ], "update": [ - 352 + 353 ], "__typename": [ 1 @@ -8791,7 +8796,7 @@ export default { }, "CreateOneObjectInput": { "object": [ - 354 + 355 ], "__typename": [ 1 @@ -8848,7 +8853,7 @@ export default { }, "UpdateOneObjectInput": { "update": [ - 357 + 358 ], "id": [ 3 @@ -8900,7 +8905,7 @@ export default { 3 ], "update": [ - 359 + 360 ], "__typename": [ 1 @@ -9099,7 +9104,7 @@ export default { 3 ], "update": [ - 367 + 368 ], "__typename": [ 1 @@ -9154,7 +9159,7 @@ export default { 3 ], "update": [ - 372 + 373 ], "__typename": [ 1 @@ -9267,7 +9272,7 @@ export default { 3 ], "update": [ - 379 + 380 ], "__typename": [ 1 @@ -9317,7 +9322,7 @@ export default { 3 ], "update": [ - 383 + 384 ], "__typename": [ 1 @@ -9381,10 +9386,10 @@ export default { 3 ], "groups": [ - 388 + 389 ], "fields": [ - 389 + 390 ], "__typename": [ 1 @@ -9404,7 +9409,7 @@ export default { 6 ], "fields": [ - 389 + 390 ], "__typename": [ 1 @@ -9431,6 +9436,9 @@ export default { "frontComponentId": [ 3 ], + "engineComponentKey": [ + 224 + ], "label": [ 1 ], @@ -9447,7 +9455,7 @@ export default { 6 ], "availabilityType": [ - 224 + 225 ], "conditionalAvailabilityExpression": [ 1 @@ -9479,11 +9487,14 @@ export default { 6 ], "availabilityType": [ - 224 + 225 ], "availabilityObjectMetadataId": [ 3 ], + "engineComponentKey": [ + 224 + ], "__typename": [ 1 ] @@ -9519,7 +9530,7 @@ export default { 3 ], "update": [ - 394 + 395 ], "__typename": [ 1 @@ -9650,7 +9661,7 @@ export default { 3 ], "update": [ - 400 + 401 ], "__typename": [ 1 @@ -9767,7 +9778,7 @@ export default { }, "UpdateRoleInput": { "update": [ - 406 + 407 ], "id": [ 3 @@ -9822,7 +9833,7 @@ export default { 3 ], "objectPermissions": [ - 408 + 409 ], "__typename": [ 1 @@ -9864,7 +9875,7 @@ export default { 3 ], "fieldPermissions": [ - 411 + 412 ], "__typename": [ 1 @@ -9895,10 +9906,10 @@ export default { 3 ], "predicates": [ - 413 + 414 ], "predicateGroups": [ - 414 + 415 ], "__typename": [ 1 @@ -9988,7 +9999,7 @@ export default { }, "CreateOneFieldMetadataInput": { "field": [ - 419 + 420 ], "__typename": [ 1 @@ -10061,7 +10072,7 @@ export default { 3 ], "update": [ - 421 + 422 ], "__typename": [ 1 @@ -10261,7 +10272,7 @@ export default { 1 ], "update": [ - 428 + 429 ], "__typename": [ 1 @@ -10324,7 +10335,7 @@ export default { 1 ], "update": [ - 431 + 432 ], "__typename": [ 1 @@ -10425,7 +10436,7 @@ export default { 3 ], "update": [ - 438 + 439 ], "__typename": [ 1 @@ -10499,13 +10510,13 @@ export default { }, "EmailAccountConnectionParameters": { "IMAP": [ - 442 + 443 ], "SMTP": [ - 442 + 443 ], "CALDAV": [ - 442 + 443 ], "__typename": [ 1 @@ -10544,7 +10555,7 @@ export default { }, "CreateOneAppTokenInput": { "appToken": [ - 445 + 446 ], "__typename": [ 1 @@ -10560,7 +10571,7 @@ export default { }, "WorkspaceMigrationInput": { "actions": [ - 447 + 448 ], "__typename": [ 1 @@ -10568,10 +10579,10 @@ export default { }, "WorkspaceMigrationDeleteActionInput": { "type": [ - 448 + 449 ], "metadataName": [ - 449 + 450 ], "universalIdentifier": [ 1 @@ -10588,7 +10599,7 @@ export default { 121, { "input": [ - 452, + 453, "OnDbEventInput!" ] } @@ -10606,7 +10617,7 @@ export default { 217, { "input": [ - 453, + 454, "LogicFunctionLogsInput!" ] } diff --git a/packages/twenty-server/src/database/typeorm/core/migrations/common/1773311456455-add-engine-component-key-to-command-menu-item.ts b/packages/twenty-server/src/database/typeorm/core/migrations/common/1773311456455-add-engine-component-key-to-command-menu-item.ts new file mode 100644 index 00000000000..d21e43f9255 --- /dev/null +++ b/packages/twenty-server/src/database/typeorm/core/migrations/common/1773311456455-add-engine-component-key-to-command-menu-item.ts @@ -0,0 +1,37 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class AddEngineComponentKeyToCommandMenuItem1773311456455 + implements MigrationInterface +{ + name = 'AddEngineComponentKeyToCommandMenuItem1773311456455'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "core"."commandMenuItem" DROP CONSTRAINT "CHK_command_menu_item_workflow_or_front_component"`, + ); + await queryRunner.query( + `CREATE TYPE "core"."commandMenuItem_enginecomponentkey_enum" AS ENUM('CREATE_NEW_RECORD', 'DELETE_SINGLE_RECORD', 'DELETE_MULTIPLE_RECORDS', 'RESTORE_SINGLE_RECORD', 'RESTORE_MULTIPLE_RECORDS', 'DESTROY_SINGLE_RECORD', 'DESTROY_MULTIPLE_RECORDS', 'ADD_TO_FAVORITES', 'REMOVE_FROM_FAVORITES', 'MERGE_MULTIPLE_RECORDS', 'DUPLICATE_DASHBOARD', 'DUPLICATE_WORKFLOW', 'ACTIVATE_WORKFLOW', 'DEACTIVATE_WORKFLOW', 'DISCARD_DRAFT_WORKFLOW', 'TEST_WORKFLOW', 'STOP_WORKFLOW_RUN', 'USE_AS_DRAFT_WORKFLOW_VERSION', 'SAVE_RECORD_PAGE_LAYOUT', 'SAVE_DASHBOARD_LAYOUT', 'TIDY_UP_WORKFLOW')`, + ); + await queryRunner.query( + `ALTER TABLE "core"."commandMenuItem" ADD "engineComponentKey" "core"."commandMenuItem_enginecomponentkey_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "core"."commandMenuItem" ADD CONSTRAINT "CHK_CMD_MENU_ITEM_WF_OR_FC_OR_ENGINE_KEY" CHECK (("workflowVersionId" IS NOT NULL AND "frontComponentId" IS NULL AND "engineComponentKey" IS NULL) OR ("workflowVersionId" IS NULL AND "frontComponentId" IS NOT NULL AND "engineComponentKey" IS NULL) OR ("workflowVersionId" IS NULL AND "frontComponentId" IS NULL AND "engineComponentKey" IS NOT NULL))`, + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "core"."commandMenuItem" DROP CONSTRAINT "CHK_CMD_MENU_ITEM_WF_OR_FC_OR_ENGINE_KEY"`, + ); + await queryRunner.query( + `ALTER TABLE "core"."commandMenuItem" DROP COLUMN "engineComponentKey"`, + ); + await queryRunner.query( + `DROP TYPE "core"."commandMenuItem_enginecomponentkey_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "core"."commandMenuItem" ADD CONSTRAINT "CHK_command_menu_item_workflow_or_front_component" CHECK (((("workflowVersionId" IS NOT NULL) AND ("frontComponentId" IS NULL)) OR (("workflowVersionId" IS NULL) AND ("frontComponentId" IS NOT NULL))))`, + ); + } +} diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-command-menu-item-manifest-to-universal-flat-command-menu-item.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-command-menu-item-manifest-to-universal-flat-command-menu-item.util.ts index 3493ee80be1..3ced7a114a4 100644 --- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-command-menu-item-manifest-to-universal-flat-command-menu-item.util.ts +++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-command-menu-item-manifest-to-universal-flat-command-menu-item.util.ts @@ -1,6 +1,6 @@ import { type CommandMenuItemManifest } from 'twenty-shared/application'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; import { type UniversalFlatCommandMenuItem } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-command-menu-item.type'; const AVAILABILITY_TYPE_MAP: Record< @@ -38,6 +38,7 @@ export const fromCommandMenuItemManifestToUniversalFlatCommandMenuItem = ({ commandMenuItemManifest.frontComponentUniversalIdentifier, availabilityObjectMetadataUniversalIdentifier: commandMenuItemManifest.availabilityObjectUniversalIdentifier ?? null, + engineComponentKey: null, workflowVersionId: null, createdAt: now, updatedAt: now, diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto.ts index 50532d552c6..6b2a902a4ea 100644 --- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto.ts +++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto.ts @@ -1,10 +1,4 @@ -import { - Field, - Float, - HideField, - ObjectType, - registerEnumType, -} from '@nestjs/graphql'; +import { Field, Float, HideField, ObjectType } from '@nestjs/graphql'; import { IsBoolean, @@ -18,13 +12,10 @@ import { } from 'class-validator'; import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; +import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum'; import { FrontComponentDTO } from 'src/engine/metadata-modules/front-component/dtos/front-component.dto'; -registerEnumType(CommandMenuItemAvailabilityType, { - name: 'CommandMenuItemAvailabilityType', -}); - @ObjectType('CommandMenuItem') export class CommandMenuItemDTO { @IsUUID() @@ -45,6 +36,11 @@ export class CommandMenuItemDTO { @Field(() => FrontComponentDTO, { nullable: true }) frontComponent?: FrontComponentDTO | null; + @IsEnum(EngineComponentKey) + @IsOptional() + @Field(() => EngineComponentKey, { nullable: true }) + engineComponentKey?: EngineComponentKey; + @IsString() @IsNotEmpty() @Field() diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/create-command-menu-item.input.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/create-command-menu-item.input.ts index e076dce2e98..2948cd0d4b2 100644 --- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/create-command-menu-item.input.ts +++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/create-command-menu-item.input.ts @@ -11,7 +11,8 @@ import { } from 'class-validator'; import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; +import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum'; @InputType() export class CreateCommandMenuItemInput { @@ -25,6 +26,11 @@ export class CreateCommandMenuItemInput { @Field(() => UUIDScalarType, { nullable: true }) frontComponentId?: string; + @IsEnum(EngineComponentKey) + @IsOptional() + @Field(() => EngineComponentKey, { nullable: true }) + engineComponentKey?: EngineComponentKey; + @IsString() @IsNotEmpty() @Field() diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/update-command-menu-item.input.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/update-command-menu-item.input.ts index d4782923955..f3f0036adca 100644 --- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/update-command-menu-item.input.ts +++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/dtos/update-command-menu-item.input.ts @@ -11,7 +11,8 @@ import { } from 'class-validator'; import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; +import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum'; @InputType() export class UpdateCommandMenuItemInput { @@ -54,4 +55,9 @@ export class UpdateCommandMenuItemInput { @IsOptional() @Field(() => UUIDScalarType, { nullable: true }) availabilityObjectMetadataId?: string; + + @IsEnum(EngineComponentKey) + @IsOptional() + @Field(() => EngineComponentKey, { nullable: true }) + engineComponentKey?: EngineComponentKey; } diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity.ts index 32c87cbf8f2..8c481653320 100644 --- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity.ts +++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity.ts @@ -11,16 +11,12 @@ import { UpdateDateColumn, } from 'typeorm'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; +import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum'; import { FrontComponentEntity } from 'src/engine/metadata-modules/front-component/entities/front-component.entity'; import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity'; import { SyncableEntity } from 'src/engine/workspace-manager/types/syncable-entity.interface'; -export enum CommandMenuItemAvailabilityType { - GLOBAL = 'GLOBAL', - RECORD_SELECTION = 'RECORD_SELECTION', - FALLBACK = 'FALLBACK', -} - @Entity({ name: 'commandMenuItem', schema: 'core' }) @Index('IDX_COMMAND_MENU_ITEM_WORKFLOW_VERSION_ID_WORKSPACE_ID', [ 'workflowVersionId', @@ -34,8 +30,8 @@ export enum CommandMenuItemAvailabilityType { 'availabilityObjectMetadataId', ]) @Check( - 'CHK_command_menu_item_workflow_or_front_component', - '("workflowVersionId" IS NOT NULL AND "frontComponentId" IS NULL) OR ("workflowVersionId" IS NULL AND "frontComponentId" IS NOT NULL)', + 'CHK_CMD_MENU_ITEM_WF_OR_FC_OR_ENGINE_KEY', + '("workflowVersionId" IS NOT NULL AND "frontComponentId" IS NULL AND "engineComponentKey" IS NULL) OR ("workflowVersionId" IS NULL AND "frontComponentId" IS NOT NULL AND "engineComponentKey" IS NULL) OR ("workflowVersionId" IS NULL AND "frontComponentId" IS NULL AND "engineComponentKey" IS NOT NULL)', ) export class CommandMenuItemEntity extends SyncableEntity @@ -57,6 +53,13 @@ export class CommandMenuItemEntity @JoinColumn({ name: 'frontComponentId' }) frontComponent: Relation | null; + @Column({ + type: 'enum', + enum: Object.values(EngineComponentKey), + nullable: true, + }) + engineComponentKey: EngineComponentKey | null; + @Column({ nullable: false }) label: string; @@ -74,7 +77,7 @@ export class CommandMenuItemEntity @Column({ type: 'enum', - enum: CommandMenuItemAvailabilityType, + enum: Object.values(CommandMenuItemAvailabilityType), nullable: false, default: CommandMenuItemAvailabilityType.GLOBAL, }) diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum.ts new file mode 100644 index 00000000000..7b63549bd31 --- /dev/null +++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum.ts @@ -0,0 +1,11 @@ +import { registerEnumType } from '@nestjs/graphql'; + +export enum CommandMenuItemAvailabilityType { + GLOBAL = 'GLOBAL', + RECORD_SELECTION = 'RECORD_SELECTION', + FALLBACK = 'FALLBACK', +} + +registerEnumType(CommandMenuItemAvailabilityType, { + name: 'CommandMenuItemAvailabilityType', +}); diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts new file mode 100644 index 00000000000..391b28a91f2 --- /dev/null +++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts @@ -0,0 +1,29 @@ +import { registerEnumType } from '@nestjs/graphql'; + +export enum EngineComponentKey { + CREATE_NEW_RECORD = 'CREATE_NEW_RECORD', + DELETE_SINGLE_RECORD = 'DELETE_SINGLE_RECORD', + DELETE_MULTIPLE_RECORDS = 'DELETE_MULTIPLE_RECORDS', + RESTORE_SINGLE_RECORD = 'RESTORE_SINGLE_RECORD', + RESTORE_MULTIPLE_RECORDS = 'RESTORE_MULTIPLE_RECORDS', + DESTROY_SINGLE_RECORD = 'DESTROY_SINGLE_RECORD', + DESTROY_MULTIPLE_RECORDS = 'DESTROY_MULTIPLE_RECORDS', + ADD_TO_FAVORITES = 'ADD_TO_FAVORITES', + REMOVE_FROM_FAVORITES = 'REMOVE_FROM_FAVORITES', + MERGE_MULTIPLE_RECORDS = 'MERGE_MULTIPLE_RECORDS', + DUPLICATE_DASHBOARD = 'DUPLICATE_DASHBOARD', + DUPLICATE_WORKFLOW = 'DUPLICATE_WORKFLOW', + ACTIVATE_WORKFLOW = 'ACTIVATE_WORKFLOW', + DEACTIVATE_WORKFLOW = 'DEACTIVATE_WORKFLOW', + DISCARD_DRAFT_WORKFLOW = 'DISCARD_DRAFT_WORKFLOW', + TEST_WORKFLOW = 'TEST_WORKFLOW', + STOP_WORKFLOW_RUN = 'STOP_WORKFLOW_RUN', + USE_AS_DRAFT_WORKFLOW_VERSION = 'USE_AS_DRAFT_WORKFLOW_VERSION', + SAVE_RECORD_PAGE_LAYOUT = 'SAVE_RECORD_PAGE_LAYOUT', + SAVE_DASHBOARD_LAYOUT = 'SAVE_DASHBOARD_LAYOUT', + TIDY_UP_WORKFLOW = 'TIDY_UP_WORKFLOW', +} + +registerEnumType(EngineComponentKey, { + name: 'EngineComponentKey', +}); diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/constants/flat-command-menu-item-editable-properties.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/constants/flat-command-menu-item-editable-properties.constant.ts index f8dc66ad959..aad154dcd8d 100644 --- a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/constants/flat-command-menu-item-editable-properties.constant.ts +++ b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/constants/flat-command-menu-item-editable-properties.constant.ts @@ -8,4 +8,5 @@ export const FLAT_COMMAND_MENU_ITEM_EDITABLE_PROPERTIES = [ 'isPinned', 'availabilityType', 'availabilityObjectMetadataId', + 'engineComponentKey', ] as const satisfies MetadataEntityPropertyName<'commandMenuItem'>[]; diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-command-menu-item-entity-to-flat-command-menu-item.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-command-menu-item-entity-to-flat-command-menu-item.util.ts index a5b25f461d1..81a7a51754a 100644 --- a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-command-menu-item-entity-to-flat-command-menu-item.util.ts +++ b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-command-menu-item-entity-to-flat-command-menu-item.util.ts @@ -61,6 +61,7 @@ export const fromCommandMenuItemEntityToFlatCommandMenuItem = ({ id: commandMenuItemEntity.id, workflowVersionId: commandMenuItemEntity.workflowVersionId, frontComponentId: commandMenuItemEntity.frontComponentId, + engineComponentKey: commandMenuItemEntity.engineComponentKey, label: commandMenuItemEntity.label, icon: commandMenuItemEntity.icon, shortLabel: commandMenuItemEntity.shortLabel, diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-create-command-menu-item-input-to-flat-command-menu-item-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-create-command-menu-item-input-to-flat-command-menu-item-to-create.util.ts index 5f92aff261b..aa415cedf50 100644 --- a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-create-command-menu-item-input-to-flat-command-menu-item-to-create.util.ts +++ b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-create-command-menu-item-input-to-flat-command-menu-item-to-create.util.ts @@ -7,7 +7,7 @@ import { CommandMenuItemExceptionCode, } from 'src/engine/metadata-modules/command-menu-item/command-menu-item.exception'; import { type CreateCommandMenuItemInput } from 'src/engine/metadata-modules/command-menu-item/dtos/create-command-menu-item.input'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; import { type FlatCommandMenuItem } from 'src/engine/metadata-modules/flat-command-menu-item/types/flat-command-menu-item.type'; import { type AllFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/all-flat-entity-maps.type'; import { resolveEntityRelationUniversalIdentifiers } from 'src/engine/metadata-modules/flat-entity/utils/resolve-entity-relation-universal-identifiers.util'; @@ -32,10 +32,19 @@ export const fromCreateCommandMenuItemInputToFlatCommandMenuItemToCreate = ({ const hasFrontComponentId = isDefined( createCommandMenuItemInput.frontComponentId, ); + const hasEngineComponentKey = isDefined( + createCommandMenuItemInput.engineComponentKey, + ); - if (hasWorkflowVersionId === hasFrontComponentId) { + const sourceCount = [ + hasWorkflowVersionId, + hasFrontComponentId, + hasEngineComponentKey, + ].filter(Boolean).length; + + if (sourceCount !== 1) { throw new CommandMenuItemException( - 'Exactly one of workflowVersionId or frontComponentId is required', + 'Exactly one of workflowVersionId, frontComponentId or engineComponentKey is required', CommandMenuItemExceptionCode.WORKFLOW_OR_FRONT_COMPONENT_REQUIRED, ); } @@ -62,6 +71,7 @@ export const fromCreateCommandMenuItemInputToFlatCommandMenuItemToCreate = ({ workflowVersionId: createCommandMenuItemInput.workflowVersionId ?? null, frontComponentId: createCommandMenuItemInput.frontComponentId ?? null, frontComponentUniversalIdentifier, + engineComponentKey: createCommandMenuItemInput.engineComponentKey ?? null, label: createCommandMenuItemInput.label, icon: createCommandMenuItemInput.icon ?? null, shortLabel: createCommandMenuItemInput.shortLabel ?? null, diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-flat-command-menu-item-to-command-menu-item-dto.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-flat-command-menu-item-to-command-menu-item-dto.util.ts index f4e1aa09959..b64f7d54d1f 100644 --- a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-flat-command-menu-item-to-command-menu-item-dto.util.ts +++ b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/from-flat-command-menu-item-to-command-menu-item-dto.util.ts @@ -7,6 +7,7 @@ export const fromFlatCommandMenuItemToCommandMenuItemDto = ( id: flatCommandMenuItem.id, workflowVersionId: flatCommandMenuItem.workflowVersionId ?? undefined, frontComponentId: flatCommandMenuItem.frontComponentId ?? undefined, + engineComponentKey: flatCommandMenuItem.engineComponentKey ?? undefined, label: flatCommandMenuItem.label, icon: flatCommandMenuItem.icon ?? undefined, shortLabel: flatCommandMenuItem.shortLabel ?? undefined, diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap index 56e690c92bf..3d9ae21bdfa 100644 --- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap +++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap @@ -30,6 +30,7 @@ exports[`ALL_UNIVERSAL_FLAT_ENTITY_PROPERTIES_TO_COMPARE_AND_STRINGIFY should ma "availabilityType", "conditionalAvailabilityExpression", "availabilityObjectMetadataUniversalIdentifier", + "engineComponentKey", ], "propertiesToStringify": [], }, diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts index 8dc9fe17e09..e99789027ff 100644 --- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts +++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts @@ -1032,6 +1032,11 @@ export const ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME = { toStringify: false, universalProperty: 'frontComponentUniversalIdentifier', }, + engineComponentKey: { + toCompare: true, + toStringify: false, + universalProperty: undefined, + }, workflowVersionId: { toCompare: false, toStringify: false, diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/from-page-layout-widget-configuration-to-universal-configuration.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/from-page-layout-widget-configuration-to-universal-configuration.util.ts index 7882abbe777..4ac65935613 100644 --- a/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/from-page-layout-widget-configuration-to-universal-configuration.util.ts +++ b/packages/twenty-server/src/engine/metadata-modules/flat-page-layout-widget/utils/from-page-layout-widget-configuration-to-universal-configuration.util.ts @@ -74,7 +74,8 @@ export const fromPageLayoutWidgetConfigurationToUniversalConfiguration = ({ configuration, fieldMetadataUniversalIdentifierById, frontComponentUniversalIdentifierById = {}, - viewFieldGroupUniversalIdentifierById = {}, + viewFieldGroupUniversalIdentifierById: + _viewFieldGroupUniversalIdentifierById = {}, viewUniversalIdentifierById = {}, shouldThrowOnMissingIdentifier = false, }: { diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-front-component-and-command-menu-item-data-seeds.util.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-front-component-and-command-menu-item-data-seeds.util.ts index 781f2809f57..d7d8e861032 100644 --- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-front-component-and-command-menu-item-data-seeds.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/get-front-component-and-command-menu-item-data-seeds.util.ts @@ -1,4 +1,4 @@ -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; import { COMMAND_MENU_ITEM_SEEDS, FRONT_COMPONENT_SEEDS, diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts index b536bdf8e39..b75302852a5 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts @@ -1,6 +1,7 @@ import { STANDARD_OBJECTS } from 'twenty-shared/metadata'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; +import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum'; import { STANDARD_FRONT_COMPONENTS } from './standard-front-component.constant'; @@ -18,6 +19,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.navigateToNextRecord.universalIdentifier, + engineComponentKey: null, }, navigateToPreviousRecord: { universalIdentifier: 'ec10f871-415b-420b-8150-7e09f6f04833', @@ -32,6 +34,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.navigateToPreviousRecord.universalIdentifier, + engineComponentKey: null, }, createNewRecord: { universalIdentifier: '08d255bf-58cd-47a5-bd82-78c5c58592f1', @@ -44,8 +47,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'pageType == "INDEX_PAGE" and objectPermissions.canUpdateObjectRecords and not hasAnySoftDeleteFilterOnView', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.createNewRecord.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.CREATE_NEW_RECORD, }, deleteSingleRecord: { universalIdentifier: '6652773f-b9a9-4fa3-a52c-e2f2e259e430', @@ -58,8 +61,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'numberOfSelectedRecords == 1 and not hasAnySoftDeleteFilterOnView and objectPermissions.canSoftDeleteObjectRecords and noneDefined(selectedRecords, "deletedAt")', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.deleteSingleRecord.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.DELETE_SINGLE_RECORD, }, deleteMultipleRecords: { universalIdentifier: 'cde86f1f-2c13-42b1-812b-f2b2b468cb83', @@ -72,8 +75,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'numberOfSelectedRecords >= 2 and objectPermissions.canSoftDeleteObjectRecords and not hasAnySoftDeleteFilterOnView and numberOfSelectedRecords < 10000', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.deleteMultipleRecords.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.DELETE_MULTIPLE_RECORDS, }, restoreSingleRecord: { universalIdentifier: '8b3a1cae-3e4d-43c1-a71f-48592b2e47ff', @@ -86,8 +89,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'numberOfSelectedRecords == 1 and everyDefined(selectedRecords, "deletedAt") and objectPermissions.canSoftDeleteObjectRecords and (pageType == "RECORD_PAGE" or hasAnySoftDeleteFilterOnView)', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.restoreSingleRecord.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.RESTORE_SINGLE_RECORD, }, restoreMultipleRecords: { universalIdentifier: '8b740c9d-d99a-45a8-812f-809caaf420ac', @@ -100,8 +103,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'numberOfSelectedRecords >= 2 and objectPermissions.canSoftDeleteObjectRecords and hasAnySoftDeleteFilterOnView and numberOfSelectedRecords < 10000', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.restoreMultipleRecords.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.RESTORE_MULTIPLE_RECORDS, }, destroySingleRecord: { universalIdentifier: '44a78417-c394-4bc8-961f-98b503030ddb', @@ -114,8 +117,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'numberOfSelectedRecords == 1 and objectPermissions.canDestroyObjectRecords and everyDefined(selectedRecords, "deletedAt")', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.destroySingleRecord.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.DESTROY_SINGLE_RECORD, }, destroyMultipleRecords: { universalIdentifier: 'c630b3fb-7920-40d1-9906-77d0aa797608', @@ -128,8 +131,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'numberOfSelectedRecords >= 2 and objectPermissions.canDestroyObjectRecords and hasAnySoftDeleteFilterOnView and numberOfSelectedRecords < 10000', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.destroyMultipleRecords.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.DESTROY_MULTIPLE_RECORDS, }, addToFavorites: { universalIdentifier: '38bf80c3-bd55-4753-80ba-38aa66429a03', @@ -142,8 +145,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'arrayLength(favoriteRecordIds) < numberOfSelectedRecords and noneDefined(selectedRecords, "deletedAt") and not hasAnySoftDeleteFilterOnView', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.addToFavorites.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.ADD_TO_FAVORITES, }, removeFromFavorites: { universalIdentifier: '3ea42507-44fa-4895-a36d-cbfef7355a50', @@ -156,8 +159,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'arrayLength(favoriteRecordIds) == numberOfSelectedRecords and noneDefined(selectedRecords, "deletedAt") and not hasAnySoftDeleteFilterOnView', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.removeFromFavorites.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.REMOVE_FROM_FAVORITES, }, exportNoteToPdf: { universalIdentifier: '86c8f3aa-9276-4c16-8cff-e295e34fbaf0', @@ -172,6 +175,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.exportNoteToPdf.universalIdentifier, + engineComponentKey: null, }, exportFromRecordIndex: { universalIdentifier: 'a934ba8a-ac8f-487d-9cd9-06dfdaec1f49', @@ -185,6 +189,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.exportFromRecordIndex.universalIdentifier, + engineComponentKey: null, }, exportFromRecordShow: { universalIdentifier: 'ba339455-f3c2-4ed1-bf77-3e316d7d6a66', @@ -198,6 +203,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.exportFromRecordShow.universalIdentifier, + engineComponentKey: null, }, updateMultipleRecords: { universalIdentifier: '2e080651-f098-4a78-bea9-7a70002dc57c', @@ -212,6 +218,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.updateMultipleRecords.universalIdentifier, + engineComponentKey: null, }, mergeMultipleRecords: { universalIdentifier: '6c14eb04-8e7e-4d47-93c0-8ec4834e2e60', @@ -224,8 +231,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'numberOfSelectedRecords >= 2 and isDefined(objectMetadataItem.duplicateCriteria) and objectPermissions.canUpdateObjectRecords and objectPermissions.canDestroyObjectRecords and numberOfSelectedRecords <= 9', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.mergeMultipleRecords.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.MERGE_MULTIPLE_RECORDS, }, exportMultipleRecords: { universalIdentifier: 'f71f68e5-7b6e-4c03-8161-c48434d7777c', @@ -239,6 +246,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.exportMultipleRecords.universalIdentifier, + engineComponentKey: null, }, importRecords: { universalIdentifier: 'a2dc9de7-4798-422e-bb55-bfad7b9bdbe8', @@ -252,6 +260,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.importRecords.universalIdentifier, + engineComponentKey: null, }, exportView: { universalIdentifier: '80680f2a-c426-48b3-a839-c63a6183dc4b', @@ -265,6 +274,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.exportView.universalIdentifier, + engineComponentKey: null, }, seeDeletedRecords: { universalIdentifier: 'd63c21c3-9785-4750-be87-5f36269b8e0d', @@ -278,6 +288,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeDeletedRecords.universalIdentifier, + engineComponentKey: null, }, createNewView: { universalIdentifier: '6ec7c339-e167-431d-bec6-d1c737df677c', @@ -291,6 +302,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.createNewView.universalIdentifier, + engineComponentKey: null, }, hideDeletedRecords: { universalIdentifier: '1420db7f-0fba-49e2-b23e-4b7caa0fafa0', @@ -304,6 +316,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.hideDeletedRecords.universalIdentifier, + engineComponentKey: null, }, goToPeople: { universalIdentifier: 'dfe5fef8-d42c-40f0-941f-8e3b5eb01daa', @@ -317,6 +330,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToPeople.universalIdentifier, + engineComponentKey: null, }, goToCompanies: { universalIdentifier: '196e4eec-bfdd-48a6-bcbb-6707ef11951a', @@ -330,6 +344,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToCompanies.universalIdentifier, + engineComponentKey: null, }, goToDashboards: { universalIdentifier: '11dc07d1-21b2-4f86-af8c-6a664c02f00c', @@ -343,6 +358,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToDashboards.universalIdentifier, + engineComponentKey: null, }, goToOpportunities: { universalIdentifier: 'f04f5e00-a208-422f-acf2-ff189769510d', @@ -357,6 +373,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToOpportunities.universalIdentifier, + engineComponentKey: null, }, goToSettings: { universalIdentifier: 'ef9aba44-0068-453e-930a-f8c182af18ee', @@ -370,6 +387,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToSettings.universalIdentifier, + engineComponentKey: null, }, goToTasks: { universalIdentifier: 'e8e3bd0b-5ce9-4577-bb61-588c0b1ad063', @@ -383,6 +401,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToTasks.universalIdentifier, + engineComponentKey: null, }, goToNotes: { universalIdentifier: '08e0f0cc-ac2d-46cd-9bca-39a409b9addf', @@ -396,6 +415,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToNotes.universalIdentifier, + engineComponentKey: null, }, editRecordPageLayout: { universalIdentifier: 'd9794c67-1799-424f-8871-5ea771dd4a6d', @@ -410,6 +430,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.editRecordPageLayout.universalIdentifier, + engineComponentKey: null, }, saveRecordPageLayout: { universalIdentifier: 'a3363589-e2a6-4451-a53c-b8c2710785e2', @@ -422,8 +443,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { conditionalAvailabilityExpression: 'pageType == "RECORD_PAGE" and isPageInEditMode and featureFlags.IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED and noneDefined(selectedRecords, "deletedAt") and objectPermissions.canUpdateObjectRecords', availabilityObjectMetadataUniversalIdentifier: null, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.saveRecordPageLayout.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.SAVE_RECORD_PAGE_LAYOUT, }, cancelRecordPageLayout: { universalIdentifier: '0b9b4e93-2b4e-4ab0-908e-83ed1d674df7', @@ -438,6 +459,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.cancelRecordPageLayout.universalIdentifier, + engineComponentKey: null, }, editDashboardLayout: { universalIdentifier: 'b9b53bbc-3129-4eb9-8344-c3f9628ffa7d', @@ -453,6 +475,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.dashboard.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.editDashboardLayout.universalIdentifier, + engineComponentKey: null, }, saveDashboardLayout: { universalIdentifier: '18b23908-f816-42ab-bc0a-eb5fae29c695', @@ -466,8 +489,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'pageType == "RECORD_PAGE" and isPageInEditMode and noneDefined(selectedRecords, "deletedAt") and everyDefined(selectedRecords, "pageLayoutId") and objectPermissions.canUpdateObjectRecords', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.dashboard.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.saveDashboardLayout.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.SAVE_DASHBOARD_LAYOUT, }, cancelDashboardLayout: { universalIdentifier: '030ecd01-0aaf-4e6d-8400-105996548887', @@ -483,6 +506,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.dashboard.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.cancelDashboardLayout.universalIdentifier, + engineComponentKey: null, }, duplicateDashboard: { universalIdentifier: '2ee07307-60ce-41ef-bfee-7c718f67557e', @@ -496,8 +520,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'noneDefined(selectedRecords, "deletedAt") and objectPermissions.canUpdateObjectRecords', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.dashboard.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.duplicateDashboard.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.DUPLICATE_DASHBOARD, }, goToWorkflows: { universalIdentifier: '4fa778f9-7931-4d18-b895-929e1ef9c31f', @@ -511,6 +535,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToWorkflows.universalIdentifier, + engineComponentKey: null, }, activateWorkflow: { universalIdentifier: '44f19c85-0fd0-482f-a14e-da513c60b1b3', @@ -524,8 +549,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'everyDefined(selectedRecords, "currentVersion.trigger") and everyDefined(selectedRecords, "currentVersion.steps") and every(selectedRecords, "currentVersion.steps.length") and (everyEquals(selectedRecords, "currentVersion.status", "DRAFT") or includesNone(selectedRecords, "statuses", "ACTIVE")) and noneDefined(selectedRecords, "deletedAt")', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.workflow.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.activateWorkflow.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.ACTIVATE_WORKFLOW, }, deactivateWorkflow: { universalIdentifier: '57f21a06-a17a-47b1-a123-90d90dbdf0b7', @@ -539,8 +564,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'everyEquals(selectedRecords, "currentVersion.status", "ACTIVE") and noneDefined(selectedRecords, "deletedAt")', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.workflow.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.deactivateWorkflow.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.DEACTIVATE_WORKFLOW, }, discardDraftWorkflow: { universalIdentifier: '4c227f2e-03bb-4a66-9b13-49f263264f4a', @@ -554,8 +579,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'every(selectedRecords, "versions.length") and everyEquals(selectedRecords, "currentVersion.status", "DRAFT") and noneDefined(selectedRecords, "deletedAt")', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.workflow.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.discardDraftWorkflow.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.DISCARD_DRAFT_WORKFLOW, }, testWorkflow: { universalIdentifier: 'f85d552a-87a3-4667-99f7-71b47917539c', @@ -569,8 +594,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'everyDefined(selectedRecords, "currentVersion.trigger") and everyDefined(selectedRecords, "currentVersion.steps") and every(selectedRecords, "currentVersion.steps.length") and ((everyEquals(selectedRecords, "currentVersion.trigger.type", "MANUAL") and noneDefined(selectedRecords, "currentVersion.trigger.settings.objectType")) or everyEquals(selectedRecords, "currentVersion.trigger.type", "WEBHOOK") or everyEquals(selectedRecords, "currentVersion.trigger.type", "CRON")) and noneDefined(selectedRecords, "deletedAt")', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.workflow.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.testWorkflow.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.TEST_WORKFLOW, }, seeActiveVersionWorkflow: { universalIdentifier: '31790508-75ff-4e4c-a768-83bd1b0718e0', @@ -586,6 +611,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflow.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeActiveVersionWorkflow.universalIdentifier, + engineComponentKey: null, }, seeRunsWorkflow: { universalIdentifier: 'e57efc2d-00a2-493a-b76c-f2dabd23a5eb', @@ -601,6 +627,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflow.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeRunsWorkflow.universalIdentifier, + engineComponentKey: null, }, seeVersionsWorkflow: { universalIdentifier: '92781d24-b875-4282-8cdb-d127f04a5c7d', @@ -616,6 +643,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflow.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeVersionsWorkflow.universalIdentifier, + engineComponentKey: null, }, addNodeWorkflow: { universalIdentifier: '818117fa-6cad-4ebc-83c1-40f4afc28d94', @@ -631,6 +659,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflow.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.addNodeWorkflow.universalIdentifier, + engineComponentKey: null, }, tidyUpWorkflow: { universalIdentifier: '1f3a3cab-161a-4775-af47-11be4d0bf411', @@ -644,8 +673,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'pageType == "RECORD_PAGE" and everyDefined(selectedRecords, "currentVersion.trigger") and everyDefined(selectedRecords, "currentVersion.steps") and every(selectedRecords, "currentVersion.steps.length") and noneDefined(selectedRecords, "deletedAt")', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.workflow.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.tidyUpWorkflow.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.TIDY_UP_WORKFLOW, }, duplicateWorkflow: { universalIdentifier: '91094438-b4c2-46ad-a23b-8af4b23ba514', @@ -659,8 +688,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'everyDefined(selectedRecords, "currentVersion") and noneDefined(selectedRecords, "deletedAt")', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.workflow.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.duplicateWorkflow.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.DUPLICATE_WORKFLOW, }, goToRuns: { universalIdentifier: '1ba959da-ff49-4c1f-a517-2b78ee200508', @@ -675,6 +704,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.goToRuns.universalIdentifier, + engineComponentKey: null, }, seeVersionWorkflowRun: { universalIdentifier: 'cc3a065c-c89e-40ac-9449-4272c55b1bb8', @@ -689,6 +719,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflowRun.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeVersionWorkflowRun.universalIdentifier, + engineComponentKey: null, }, seeWorkflowWorkflowRun: { universalIdentifier: '9d9cc62d-3543-45c3-93f3-23d2d8979f2b', @@ -703,6 +734,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflowRun.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeWorkflowWorkflowRun.universalIdentifier, + engineComponentKey: null, }, stopWorkflowRun: { universalIdentifier: '4c186606-9515-4561-a1eb-9a072b4f5e58', @@ -716,8 +748,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'isSelectAll or someEquals(selectedRecords, "status", "NOT_STARTED") or someEquals(selectedRecords, "status", "ENQUEUED") or someEquals(selectedRecords, "status", "RUNNING")', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.workflowRun.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.stopWorkflowRun.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.STOP_WORKFLOW_RUN, }, seeRunsWorkflowVersion: { universalIdentifier: '44e305c7-4f0a-45ec-803f-6471b56455cb', @@ -733,6 +765,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflowVersion.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeRunsWorkflowVersion.universalIdentifier, + engineComponentKey: null, }, seeWorkflowWorkflowVersion: { universalIdentifier: 'b43052db-023e-4083-9b63-2c2dfbfd1320', @@ -748,6 +781,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflowVersion.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeWorkflowWorkflowVersion.universalIdentifier, + engineComponentKey: null, }, useAsDraftWorkflowVersion: { universalIdentifier: '483c0c1d-ea4d-4a4d-8a59-2dcf9f8e38f6', @@ -761,8 +795,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = { 'noneEquals(selectedRecords, "status", "DRAFT")', availabilityObjectMetadataUniversalIdentifier: STANDARD_OBJECTS.workflowVersion.universalIdentifier, - frontComponentUniversalIdentifier: - STANDARD_FRONT_COMPONENTS.useAsDraftWorkflowVersion.universalIdentifier, + frontComponentUniversalIdentifier: null, + engineComponentKey: EngineComponentKey.USE_AS_DRAFT_WORKFLOW_VERSION, }, seeVersionsWorkflowVersion: { universalIdentifier: '1d4abeb7-2750-4af7-9a92-fbadd2a9e4ba', @@ -778,6 +812,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { STANDARD_OBJECTS.workflowVersion.universalIdentifier, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.seeVersionsWorkflowVersion.universalIdentifier, + engineComponentKey: null, }, searchRecords: { universalIdentifier: 'fa24e25e-68f8-4548-82ff-c7b5168b7c7d', @@ -791,6 +826,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.searchRecords.universalIdentifier, + engineComponentKey: null, }, searchRecordsFallback: { universalIdentifier: 'c659890c-7266-46c9-bfe1-75cefff8b6d0', @@ -804,6 +840,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.searchRecordsFallback.universalIdentifier, + engineComponentKey: null, }, askAi: { universalIdentifier: 'ce5fb54d-2b19-4dd1-b7b4-9532a1761a41', @@ -817,6 +854,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.askAi.universalIdentifier, + engineComponentKey: null, }, viewPreviousAiChats: { universalIdentifier: '3084c3c9-cc23-4dad-9e00-92025f5cba7a', @@ -830,5 +868,6 @@ export const STANDARD_COMMAND_MENU_ITEMS = { availabilityObjectMetadataUniversalIdentifier: null, frontComponentUniversalIdentifier: STANDARD_FRONT_COMPONENTS.viewPreviousAiChats.universalIdentifier, + engineComponentKey: null, }, } as const; diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-front-component.constant.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-front-component.constant.ts index 5d3ce933883..d43db793b22 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-front-component.constant.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-front-component.constant.ts @@ -29,131 +29,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - createNewRecord: { - universalIdentifier: '1e6e57bb-89c4-482e-bf44-d62ad1c05d2f', - name: 'Create new record', - componentName: 'CreateNewRecord', - sourceComponentPath: - 'front-components/record/create-new-record.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.createNewRecord - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.createNewRecord - .builtComponentChecksum, - isHeadless: true, - }, - deleteSingleRecord: { - universalIdentifier: 'cbc7e92f-d4fe-4956-ba66-a81b7f9713c6', - name: 'Delete single record', - componentName: 'DeleteSingleRecord', - sourceComponentPath: - 'front-components/record/delete-single-record.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.deleteSingleRecord - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.deleteSingleRecord - .builtComponentChecksum, - isHeadless: true, - }, - deleteMultipleRecords: { - universalIdentifier: '35c25fd2-6060-440a-b734-aa3016c11f47', - name: 'Delete multiple records', - componentName: 'DeleteMultipleRecords', - sourceComponentPath: - 'front-components/record/delete-multiple-records.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.deleteMultipleRecords - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.deleteMultipleRecords - .builtComponentChecksum, - isHeadless: true, - }, - restoreSingleRecord: { - universalIdentifier: '88262225-1253-4dfe-9bf7-563b73e6d9ea', - name: 'Restore single record', - componentName: 'RestoreSingleRecord', - sourceComponentPath: - 'front-components/record/restore-single-record.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.restoreSingleRecord - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.restoreSingleRecord - .builtComponentChecksum, - isHeadless: true, - }, - restoreMultipleRecords: { - universalIdentifier: '105ff959-838c-44bc-8a92-60d61093ebc4', - name: 'Restore multiple records', - componentName: 'RestoreMultipleRecords', - sourceComponentPath: - 'front-components/record/restore-multiple-records.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.restoreMultipleRecords - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.restoreMultipleRecords - .builtComponentChecksum, - isHeadless: true, - }, - destroySingleRecord: { - universalIdentifier: '212d9e7d-e149-417b-9a0f-5024835349e6', - name: 'Destroy single record', - componentName: 'DestroySingleRecord', - sourceComponentPath: - 'front-components/record/destroy-single-record.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.destroySingleRecord - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.destroySingleRecord - .builtComponentChecksum, - isHeadless: true, - }, - destroyMultipleRecords: { - universalIdentifier: 'f647d17d-b4ae-4a4c-99a9-4e5e4e3068a2', - name: 'Destroy multiple records', - componentName: 'DestroyMultipleRecords', - sourceComponentPath: - 'front-components/record/destroy-multiple-records.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.destroyMultipleRecords - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.destroyMultipleRecords - .builtComponentChecksum, - isHeadless: true, - }, - addToFavorites: { - universalIdentifier: '5694b053-1f42-416c-a26a-375f826aa9b3', - name: 'Add to favorites', - componentName: 'AddToFavorites', - sourceComponentPath: - 'front-components/record/add-to-favorites.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.addToFavorites.builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.addToFavorites - .builtComponentChecksum, - isHeadless: true, - }, - removeFromFavorites: { - universalIdentifier: '21105d6a-33a2-4ae3-8edb-c33c38d2e091', - name: 'Remove from favorites', - componentName: 'RemoveFromFavorites', - sourceComponentPath: - 'front-components/record/remove-from-favorites.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.removeFromFavorites - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.removeFromFavorites - .builtComponentChecksum, - isHeadless: true, - }, exportNoteToPdf: { universalIdentifier: '980399e9-e530-4430-bf47-7f3f482434b4', name: 'Export note to PDF', @@ -210,20 +85,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - mergeMultipleRecords: { - universalIdentifier: '9c6757aa-ecdd-4b21-8466-fb1e8f0bfcb8', - name: 'Merge multiple records', - componentName: 'MergeMultipleRecords', - sourceComponentPath: - 'front-components/record/merge-multiple-records.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.mergeMultipleRecords - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.mergeMultipleRecords - .builtComponentChecksum, - isHeadless: true, - }, exportMultipleRecords: { universalIdentifier: '05381918-8c9c-421f-ab89-10e365a463f8', name: 'Export multiple records', @@ -407,20 +268,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - saveRecordPageLayout: { - universalIdentifier: '7956ba3a-fd4d-466e-96b5-9e3e8b637c44', - name: 'Save record page layout', - componentName: 'SaveRecordPageLayout', - sourceComponentPath: - 'front-components/page-layout/save-record-page-layout.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.saveRecordPageLayout - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.saveRecordPageLayout - .builtComponentChecksum, - isHeadless: true, - }, cancelRecordPageLayout: { universalIdentifier: 'd392762b-4c42-4471-9c45-c92e66728380', name: 'Cancel record page layout edition', @@ -449,20 +296,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - saveDashboardLayout: { - universalIdentifier: '5d7b4510-79e8-440f-8707-21741c00d262', - name: 'Save dashboard layout', - componentName: 'SaveDashboardLayout', - sourceComponentPath: - 'front-components/dashboard/save-dashboard-layout.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.saveDashboardLayout - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.saveDashboardLayout - .builtComponentChecksum, - isHeadless: true, - }, cancelDashboardLayout: { universalIdentifier: 'dac81512-3890-4ba5-8471-bd94738ab80a', name: 'Cancel dashboard layout edition', @@ -477,20 +310,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - duplicateDashboard: { - universalIdentifier: 'e2bec30e-a6b0-47ff-9708-45855ae96fe7', - name: 'Duplicate dashboard', - componentName: 'DuplicateDashboard', - sourceComponentPath: - 'front-components/dashboard/duplicate-dashboard.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.duplicateDashboard - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.duplicateDashboard - .builtComponentChecksum, - isHeadless: true, - }, goToWorkflows: { universalIdentifier: '9d313f79-170f-47cc-b9c4-a2076a86232f', name: 'Go to Workflows', @@ -504,61 +323,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - activateWorkflow: { - universalIdentifier: '97b89dc4-cef9-4439-9358-35c98616eb1e', - name: 'Activate workflow', - componentName: 'ActivateWorkflow', - sourceComponentPath: - 'front-components/workflow/activate-workflow.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.activateWorkflow - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.activateWorkflow - .builtComponentChecksum, - isHeadless: true, - }, - deactivateWorkflow: { - universalIdentifier: 'cbf92077-1892-47e0-9435-14ea8f50a510', - name: 'Deactivate workflow', - componentName: 'DeactivateWorkflow', - sourceComponentPath: - 'front-components/workflow/deactivate-workflow.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.deactivateWorkflow - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.deactivateWorkflow - .builtComponentChecksum, - isHeadless: true, - }, - discardDraftWorkflow: { - universalIdentifier: '972dc871-7f9c-4035-957c-e6662f4df7c5', - name: 'Discard draft workflow', - componentName: 'DiscardDraftWorkflow', - sourceComponentPath: - 'front-components/workflow/discard-draft-workflow.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.discardDraftWorkflow - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.discardDraftWorkflow - .builtComponentChecksum, - isHeadless: true, - }, - testWorkflow: { - universalIdentifier: '39e9aa5a-cacc-4543-9053-f1fbf923e170', - name: 'Test workflow', - componentName: 'TestWorkflow', - sourceComponentPath: - 'front-components/workflow/test-workflow.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.testWorkflow.builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.testWorkflow - .builtComponentChecksum, - isHeadless: true, - }, seeActiveVersionWorkflow: { universalIdentifier: '6259a4a5-428e-41b9-a032-333c2d51e15f', name: 'See active version', @@ -615,33 +379,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - tidyUpWorkflow: { - universalIdentifier: '3dac631e-dfb7-4570-ac27-15d98ee8ec43', - name: 'Tidy up workflow', - componentName: 'TidyUpWorkflow', - sourceComponentPath: - 'front-components/workflow/tidy-up-workflow.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.tidyUpWorkflow.builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.tidyUpWorkflow - .builtComponentChecksum, - isHeadless: true, - }, - duplicateWorkflow: { - universalIdentifier: '566a48c5-5342-446f-a041-9db59bcdab6b', - name: 'Duplicate workflow', - componentName: 'DuplicateWorkflow', - sourceComponentPath: - 'front-components/workflow/duplicate-workflow.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.duplicateWorkflow - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.duplicateWorkflow - .builtComponentChecksum, - isHeadless: true, - }, goToRuns: { universalIdentifier: '0bd0ccfc-1909-4d19-b694-610878f07a3a', name: 'Go to runs', @@ -682,20 +419,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - stopWorkflowRun: { - universalIdentifier: '110fb676-2a09-4ac0-bd19-7261bc588967', - name: 'Stop workflow run', - componentName: 'StopWorkflowRun', - sourceComponentPath: - 'front-components/workflow-run/stop-workflow-run.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.stopWorkflowRun - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.stopWorkflowRun - .builtComponentChecksum, - isHeadless: true, - }, seeRunsWorkflowVersion: { universalIdentifier: '3d673f94-ecf9-4e38-8eac-684cf4cad617', name: 'See runs (workflow version)', @@ -724,20 +447,6 @@ export const STANDARD_FRONT_COMPONENTS = { .builtComponentChecksum, isHeadless: true, }, - useAsDraftWorkflowVersion: { - universalIdentifier: 'cb11ab5c-974a-4942-bb8a-77efa6b5bb26', - name: 'Use as draft (workflow version)', - componentName: 'UseAsDraftWorkflowVersion', - sourceComponentPath: - 'front-components/workflow-version/use-as-draft-workflow-version.front-component.tsx', - builtComponentPath: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.useAsDraftWorkflowVersion - .builtComponentPath, - builtComponentChecksum: - STANDARD_FRONT_COMPONENT_BUILD_MANIFEST.useAsDraftWorkflowVersion - .builtComponentChecksum, - isHeadless: true, - }, seeVersionsWorkflowVersion: { universalIdentifier: 'a93c9f09-7a7f-4665-982a-0709a652c5bd', name: 'See versions history (workflow version)', diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/command-menu-item/create-standard-command-menu-item-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/command-menu-item/create-standard-command-menu-item-flat-metadata.util.ts index 79ac469b2be..66f5105763a 100644 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/command-menu-item/create-standard-command-menu-item-flat-metadata.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/command-menu-item/create-standard-command-menu-item-flat-metadata.util.ts @@ -28,15 +28,24 @@ export const createStandardCommandMenuItemFlatMetadata = ({ }): FlatCommandMenuItem => { const definition = STANDARD_COMMAND_MENU_ITEMS[commandMenuItemName]; - const flatFrontComponent = findFlatEntityByUniversalIdentifier({ - flatEntityMaps: flatFrontComponentMaps, - universalIdentifier: definition.frontComponentUniversalIdentifier, - }); + let resolvedFrontComponentId: string | null = null; + let resolvedFrontComponentUniversalIdentifier: string | null = null; - if (!isDefined(flatFrontComponent)) { - throw new Error( - `Front component not found for universal identifier ${definition.frontComponentUniversalIdentifier}`, - ); + if (isDefined(definition.frontComponentUniversalIdentifier)) { + const flatFrontComponent = findFlatEntityByUniversalIdentifier({ + flatEntityMaps: flatFrontComponentMaps, + universalIdentifier: definition.frontComponentUniversalIdentifier, + }); + + if (!isDefined(flatFrontComponent)) { + throw new Error( + `Front component not found for universal identifier ${definition.frontComponentUniversalIdentifier}`, + ); + } + + resolvedFrontComponentId = flatFrontComponent.id; + resolvedFrontComponentUniversalIdentifier = + flatFrontComponent.universalIdentifier; } let resolvedObjectMetadataId: string | null = null; @@ -75,8 +84,10 @@ export const createStandardCommandMenuItemFlatMetadata = ({ availabilityType: definition.availabilityType, conditionalAvailabilityExpression: definition.conditionalAvailabilityExpression ?? null, - frontComponentId: flatFrontComponent.id, - frontComponentUniversalIdentifier: flatFrontComponent.universalIdentifier, + frontComponentId: resolvedFrontComponentId, + frontComponentUniversalIdentifier: + resolvedFrontComponentUniversalIdentifier, + engineComponentKey: definition.engineComponentKey, workflowVersionId: null, availabilityObjectMetadataId: resolvedObjectMetadataId, availabilityObjectMetadataUniversalIdentifier: diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/command-menu-item/create-standard-command-menu-item-folder-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/command-menu-item/create-standard-command-menu-item-folder-flat-metadata.util.ts deleted file mode 100644 index 21f1da26d0b..00000000000 --- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/command-menu-item/create-standard-command-menu-item-folder-flat-metadata.util.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { isDefined } from 'twenty-shared/utils'; - -import { type CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; -import { type FlatCommandMenuItem } from 'src/engine/metadata-modules/flat-command-menu-item/types/flat-command-menu-item.type'; -import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type'; -import { findFlatEntityByUniversalIdentifier } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-universal-identifier.util'; -import { type FlatFrontComponent } from 'src/engine/metadata-modules/flat-front-component/types/flat-front-component.type'; -import { type FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-metadata/types/flat-object-metadata.type'; -import { TWENTY_STANDARD_APPLICATION } from 'src/engine/workspace-manager/twenty-standard-application/constants/twenty-standard-applications'; - -export const createStandardCommandMenuItemFolderFlatMetadata = ({ - universalIdentifier, - label, - shortLabel, - icon, - position, - isPinned, - availabilityType, - frontComponentUniversalIdentifier, - availabilityObjectMetadataUniversalIdentifier, - conditionalAvailabilityExpression = null, - commandMenuItemId, - workspaceId, - twentyStandardApplicationId, - dependencyFlatEntityMaps: { flatFrontComponentMaps, flatObjectMetadataMaps }, - now, -}: { - universalIdentifier: string; - label: string; - shortLabel: string | null; - icon: string; - position: number; - isPinned: boolean; - availabilityType: CommandMenuItemAvailabilityType; - frontComponentUniversalIdentifier: string; - availabilityObjectMetadataUniversalIdentifier: string | null; - conditionalAvailabilityExpression?: string | null; - commandMenuItemId: string; - workspaceId: string; - twentyStandardApplicationId: string; - dependencyFlatEntityMaps: { - flatFrontComponentMaps: FlatEntityMaps; - flatObjectMetadataMaps: FlatEntityMaps; - }; - now: string; -}): FlatCommandMenuItem => { - const flatFrontComponent = findFlatEntityByUniversalIdentifier({ - flatEntityMaps: flatFrontComponentMaps, - universalIdentifier: frontComponentUniversalIdentifier, - }); - - if (!isDefined(flatFrontComponent)) { - throw new Error( - `Front component not found for universal identifier ${frontComponentUniversalIdentifier}`, - ); - } - - let resolvedObjectMetadataId: string | null = null; - let resolvedObjectMetadataUniversalIdentifier: string | null = null; - - if (isDefined(availabilityObjectMetadataUniversalIdentifier)) { - const flatObjectMetadata = findFlatEntityByUniversalIdentifier({ - flatEntityMaps: flatObjectMetadataMaps, - universalIdentifier: availabilityObjectMetadataUniversalIdentifier, - }); - - if (!isDefined(flatObjectMetadata)) { - throw new Error( - `Object metadata not found for universal identifier ${availabilityObjectMetadataUniversalIdentifier}`, - ); - } - - resolvedObjectMetadataId = flatObjectMetadata.id; - resolvedObjectMetadataUniversalIdentifier = - flatObjectMetadata.universalIdentifier; - } - - return { - id: commandMenuItemId, - universalIdentifier, - applicationId: twentyStandardApplicationId, - applicationUniversalIdentifier: - TWENTY_STANDARD_APPLICATION.universalIdentifier, - workspaceId, - label, - shortLabel, - icon, - position, - isPinned, - availabilityType, - conditionalAvailabilityExpression: - conditionalAvailabilityExpression ?? null, - frontComponentId: flatFrontComponent.id, - frontComponentUniversalIdentifier: flatFrontComponent.universalIdentifier, - workflowVersionId: null, - availabilityObjectMetadataId: resolvedObjectMetadataId, - availabilityObjectMetadataUniversalIdentifier: - resolvedObjectMetadataUniversalIdentifier, - createdAt: now, - updatedAt: now, - }; -}; diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service.ts index 82f5eb0256b..5be8fa807d5 100644 --- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service.ts +++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-builder/validators/services/flat-command-menu-item-validator.service.ts @@ -41,12 +41,21 @@ export class FlatCommandMenuItemValidatorService { const hasFrontComponentUniversalIdentifier = isDefined( flatCommandMenuItem.frontComponentUniversalIdentifier, ); + const hasEngineComponentKey = isDefined( + flatCommandMenuItem.engineComponentKey, + ); - if (hasWorkflowVersionId === hasFrontComponentUniversalIdentifier) { + const sourceCount = [ + hasWorkflowVersionId, + hasFrontComponentUniversalIdentifier, + hasEngineComponentKey, + ].filter(Boolean).length; + + if (sourceCount !== 1) { validationResult.errors.push({ code: CommandMenuItemExceptionCode.WORKFLOW_OR_FRONT_COMPONENT_REQUIRED, - message: t`Exactly one of workflowVersionId or frontComponentUniversalIdentifier is required`, - userFriendlyMessage: msg`Exactly one of workflow version or front component is required`, + message: t`Exactly one of workflowVersionId, frontComponentUniversalIdentifier or engineComponentKey is required`, + userFriendlyMessage: msg`Exactly one of workflow version, front component or engine component key is required`, }); } diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/page-layout-widget/services/utils/from-universal-configuration-to-flat-page-layout-widget-configuration.util.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/page-layout-widget/services/utils/from-universal-configuration-to-flat-page-layout-widget-configuration.util.ts index 1c0963c7300..b01c4f6ea0b 100644 --- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/page-layout-widget/services/utils/from-universal-configuration-to-flat-page-layout-widget-configuration.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/workspace-migration-runner/action-handlers/page-layout-widget/services/utils/from-universal-configuration-to-flat-page-layout-widget-configuration.util.ts @@ -72,7 +72,7 @@ export const fromUniversalConfigurationToFlatPageLayoutWidgetConfiguration = ({ flatFieldMetadataMaps, flatFrontComponentMaps, flatViewMaps, - flatViewFieldGroupMaps, + flatViewFieldGroupMaps: _flatViewFieldGroupMaps, }: { universalConfiguration: FlatPageLayoutWidget['universalConfiguration']; flatFieldMetadataMaps: MetadataFlatEntityMaps<'fieldMetadata'>; diff --git a/packages/twenty-server/src/modules/workflow/workflow-trigger/workspace-services/workflow-trigger.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-trigger/workspace-services/workflow-trigger.workspace-service.ts index 0ce5ada0d4e..67b8da00c4c 100644 --- a/packages/twenty-server/src/modules/workflow/workflow-trigger/workspace-services/workflow-trigger.workspace-service.ts +++ b/packages/twenty-server/src/modules/workflow/workflow-trigger/workspace-services/workflow-trigger.workspace-service.ts @@ -6,7 +6,7 @@ import { type ActorMetadata, FeatureFlagKey } from 'twenty-shared/types'; import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service'; import { CommandMenuItemService } from 'src/engine/metadata-modules/command-menu-item/command-menu-item.service'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; import { GlobalWorkspaceOrmManager } from 'src/engine/twenty-orm/global-workspace-datasource/global-workspace-orm.manager'; import { type WorkspaceRepository } from 'src/engine/twenty-orm/repository/workspace.repository'; import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util'; diff --git a/packages/twenty-server/test/integration/metadata/suites/command-menu-item/__snapshots__/failing-command-menu-item-creation.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/command-menu-item/__snapshots__/failing-command-menu-item-creation.integration-spec.ts.snap index f3239151f9e..e9da8cec0df 100644 --- a/packages/twenty-server/test/integration/metadata/suites/command-menu-item/__snapshots__/failing-command-menu-item-creation.integration-spec.ts.snap +++ b/packages/twenty-server/test/integration/metadata/suites/command-menu-item/__snapshots__/failing-command-menu-item-creation.integration-spec.ts.snap @@ -7,7 +7,7 @@ exports[`CommandMenuItem creation should fail when creating with both workflowVe "subCode": "WORKFLOW_OR_FRONT_COMPONENT_REQUIRED", "userFriendlyMessage": "Either workflow version or front component is required.", }, - "message": "Exactly one of workflowVersionId or frontComponentId is required", + "message": "Exactly one of workflowVersionId, frontComponentId or engineComponentKey is required", "name": "UserInputError", } `; @@ -98,7 +98,7 @@ exports[`CommandMenuItem creation should fail when creating with missing workflo "subCode": "WORKFLOW_OR_FRONT_COMPONENT_REQUIRED", "userFriendlyMessage": "Either workflow version or front component is required.", }, - "message": "Exactly one of workflowVersionId or frontComponentId is required", + "message": "Exactly one of workflowVersionId, frontComponentId or engineComponentKey is required", "name": "UserInputError", } `; diff --git a/packages/twenty-server/test/integration/metadata/suites/command-menu-item/successful-command-menu-item-creation.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/command-menu-item/successful-command-menu-item-creation.integration-spec.ts index 5bd661d686e..dc4b32734cc 100644 --- a/packages/twenty-server/test/integration/metadata/suites/command-menu-item/successful-command-menu-item-creation.integration-spec.ts +++ b/packages/twenty-server/test/integration/metadata/suites/command-menu-item/successful-command-menu-item-creation.integration-spec.ts @@ -9,7 +9,7 @@ import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update import { jestExpectToBeDefined } from 'test/utils/jest-expect-to-be-defined.util.test'; import { FeatureFlagKey } from 'twenty-shared/types'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; describe('CommandMenuItem creation should succeed', () => { let createdCommandMenuItemId: string; diff --git a/packages/twenty-server/test/integration/metadata/suites/command-menu-item/successful-command-menu-item-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/command-menu-item/successful-command-menu-item-update.integration-spec.ts index 2e8085b99a5..b5a6f726119 100644 --- a/packages/twenty-server/test/integration/metadata/suites/command-menu-item/successful-command-menu-item-update.integration-spec.ts +++ b/packages/twenty-server/test/integration/metadata/suites/command-menu-item/successful-command-menu-item-update.integration-spec.ts @@ -7,7 +7,7 @@ import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update import { jestExpectToBeDefined } from 'test/utils/jest-expect-to-be-defined.util.test'; import { FeatureFlagKey } from 'twenty-shared/types'; -import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/entities/command-menu-item.entity'; +import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum'; describe('CommandMenuItem update should succeed', () => { let createdCommandMenuItemId: string; diff --git a/packages/twenty-standard-application/src/front-components/dashboard/duplicate-dashboard.front-component.tsx b/packages/twenty-standard-application/src/front-components/dashboard/duplicate-dashboard.front-component.tsx deleted file mode 100644 index 3d5dbfcb4cd..00000000000 --- a/packages/twenty-standard-application/src/front-components/dashboard/duplicate-dashboard.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const DuplicateDashboard = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: 'e2bec30e-a6b0-47ff-9708-45855ae96fe7', - name: 'Duplicate dashboard', - component: DuplicateDashboard, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/dashboard/save-dashboard-layout.front-component.tsx b/packages/twenty-standard-application/src/front-components/dashboard/save-dashboard-layout.front-component.tsx deleted file mode 100644 index c970bfdb97b..00000000000 --- a/packages/twenty-standard-application/src/front-components/dashboard/save-dashboard-layout.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const SaveDashboardLayout = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '5d7b4510-79e8-440f-8707-21741c00d262', - name: 'Save dashboard layout', - component: SaveDashboardLayout, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/page-layout/save-record-page-layout.front-component.tsx b/packages/twenty-standard-application/src/front-components/page-layout/save-record-page-layout.front-component.tsx deleted file mode 100644 index f45f9edf53e..00000000000 --- a/packages/twenty-standard-application/src/front-components/page-layout/save-record-page-layout.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const SaveRecordPageLayout = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '7956ba3a-fd4d-466e-96b5-9e3e8b637c44', - name: 'Save record page layout', - component: SaveRecordPageLayout, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/add-to-favorites.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/add-to-favorites.front-component.tsx deleted file mode 100644 index 9c4a01cdcf2..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/add-to-favorites.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const AddToFavorites = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '5694b053-1f42-416c-a26a-375f826aa9b3', - name: 'Add to favorites', - component: AddToFavorites, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/create-new-record.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/create-new-record.front-component.tsx deleted file mode 100644 index 3625f48917f..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/create-new-record.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const CreateNewRecord = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '1e6e57bb-89c4-482e-bf44-d62ad1c05d2f', - name: 'Create new record', - component: CreateNewRecord, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/delete-multiple-records.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/delete-multiple-records.front-component.tsx deleted file mode 100644 index 9e8b1e621ce..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/delete-multiple-records.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const DeleteMultipleRecords = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '35c25fd2-6060-440a-b734-aa3016c11f47', - name: 'Delete multiple records', - component: DeleteMultipleRecords, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/delete-single-record.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/delete-single-record.front-component.tsx deleted file mode 100644 index 43668147f55..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/delete-single-record.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const DeleteSingleRecord = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: 'cbc7e92f-d4fe-4956-ba66-a81b7f9713c6', - name: 'Delete single record', - component: DeleteSingleRecord, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/destroy-multiple-records.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/destroy-multiple-records.front-component.tsx deleted file mode 100644 index 5d86e35461a..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/destroy-multiple-records.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const DestroyMultipleRecords = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: 'f647d17d-b4ae-4a4c-99a9-4e5e4e3068a2', - name: 'Destroy multiple records', - component: DestroyMultipleRecords, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/destroy-single-record.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/destroy-single-record.front-component.tsx deleted file mode 100644 index c713ba31cb1..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/destroy-single-record.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const DestroySingleRecord = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '212d9e7d-e149-417b-9a0f-5024835349e6', - name: 'Destroy single record', - component: DestroySingleRecord, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/merge-multiple-records.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/merge-multiple-records.front-component.tsx deleted file mode 100644 index 3d7bd348dde..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/merge-multiple-records.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const MergeMultipleRecords = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '9c6757aa-ecdd-4b21-8466-fb1e8f0bfcb8', - name: 'Merge multiple records', - component: MergeMultipleRecords, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/remove-from-favorites.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/remove-from-favorites.front-component.tsx deleted file mode 100644 index 23565e1307e..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/remove-from-favorites.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const RemoveFromFavorites = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '21105d6a-33a2-4ae3-8edb-c33c38d2e091', - name: 'Remove from favorites', - component: RemoveFromFavorites, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/restore-multiple-records.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/restore-multiple-records.front-component.tsx deleted file mode 100644 index b0aff6b87df..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/restore-multiple-records.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const RestoreMultipleRecords = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '105ff959-838c-44bc-8a92-60d61093ebc4', - name: 'Restore multiple records', - component: RestoreMultipleRecords, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/record/restore-single-record.front-component.tsx b/packages/twenty-standard-application/src/front-components/record/restore-single-record.front-component.tsx deleted file mode 100644 index 02447d0e7a0..00000000000 --- a/packages/twenty-standard-application/src/front-components/record/restore-single-record.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const RestoreSingleRecord = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '88262225-1253-4dfe-9bf7-563b73e6d9ea', - name: 'Restore single record', - component: RestoreSingleRecord, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/workflow-run/stop-workflow-run.front-component.tsx b/packages/twenty-standard-application/src/front-components/workflow-run/stop-workflow-run.front-component.tsx deleted file mode 100644 index 4813ce114ed..00000000000 --- a/packages/twenty-standard-application/src/front-components/workflow-run/stop-workflow-run.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const StopWorkflowRun = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '110fb676-2a09-4ac0-bd19-7261bc588967', - name: 'Stop workflow run', - component: StopWorkflowRun, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/workflow-version/use-as-draft-workflow-version.front-component.tsx b/packages/twenty-standard-application/src/front-components/workflow-version/use-as-draft-workflow-version.front-component.tsx deleted file mode 100644 index 806b7f6357c..00000000000 --- a/packages/twenty-standard-application/src/front-components/workflow-version/use-as-draft-workflow-version.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const UseAsDraftWorkflowVersion = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: 'cb11ab5c-974a-4942-bb8a-77efa6b5bb26', - name: 'Use as draft (workflow version)', - component: UseAsDraftWorkflowVersion, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/workflow/activate-workflow.front-component.tsx b/packages/twenty-standard-application/src/front-components/workflow/activate-workflow.front-component.tsx deleted file mode 100644 index 02a62bca33e..00000000000 --- a/packages/twenty-standard-application/src/front-components/workflow/activate-workflow.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const ActivateWorkflow = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '97b89dc4-cef9-4439-9358-35c98616eb1e', - name: 'Activate workflow', - component: ActivateWorkflow, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/workflow/deactivate-workflow.front-component.tsx b/packages/twenty-standard-application/src/front-components/workflow/deactivate-workflow.front-component.tsx deleted file mode 100644 index 7034b240e5a..00000000000 --- a/packages/twenty-standard-application/src/front-components/workflow/deactivate-workflow.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const DeactivateWorkflow = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: 'cbf92077-1892-47e0-9435-14ea8f50a510', - name: 'Deactivate workflow', - component: DeactivateWorkflow, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/workflow/discard-draft-workflow.front-component.tsx b/packages/twenty-standard-application/src/front-components/workflow/discard-draft-workflow.front-component.tsx deleted file mode 100644 index c6553252213..00000000000 --- a/packages/twenty-standard-application/src/front-components/workflow/discard-draft-workflow.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const DiscardDraftWorkflow = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '972dc871-7f9c-4035-957c-e6662f4df7c5', - name: 'Discard draft workflow', - component: DiscardDraftWorkflow, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/workflow/duplicate-workflow.front-component.tsx b/packages/twenty-standard-application/src/front-components/workflow/duplicate-workflow.front-component.tsx deleted file mode 100644 index 20b4b751616..00000000000 --- a/packages/twenty-standard-application/src/front-components/workflow/duplicate-workflow.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const DuplicateWorkflow = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '566a48c5-5342-446f-a041-9db59bcdab6b', - name: 'Duplicate workflow', - component: DuplicateWorkflow, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/workflow/test-workflow.front-component.tsx b/packages/twenty-standard-application/src/front-components/workflow/test-workflow.front-component.tsx deleted file mode 100644 index 5453f2acc0e..00000000000 --- a/packages/twenty-standard-application/src/front-components/workflow/test-workflow.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const TestWorkflow = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '39e9aa5a-cacc-4543-9053-f1fbf923e170', - name: 'Test workflow', - component: TestWorkflow, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/front-components/workflow/tidy-up-workflow.front-component.tsx b/packages/twenty-standard-application/src/front-components/workflow/tidy-up-workflow.front-component.tsx deleted file mode 100644 index 1b8b20b76b2..00000000000 --- a/packages/twenty-standard-application/src/front-components/workflow/tidy-up-workflow.front-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Command, defineFrontComponent } from 'twenty-sdk'; - -// TODO: implement execute logic -const TidyUpWorkflow = () => {}} />; - -export default defineFrontComponent({ - universalIdentifier: '3dac631e-dfb7-4570-ac27-15d98ee8ec43', - name: 'Tidy up workflow', - component: TidyUpWorkflow, - isHeadless: true, -}); diff --git a/packages/twenty-standard-application/src/standard-front-component-build-manifest.ts b/packages/twenty-standard-application/src/standard-front-component-build-manifest.ts index b01314a1336..0e790a1c6c1 100644 --- a/packages/twenty-standard-application/src/standard-front-component-build-manifest.ts +++ b/packages/twenty-standard-application/src/standard-front-component-build-manifest.ts @@ -12,18 +12,10 @@ export const STANDARD_FRONT_COMPONENT_BUILD_MANIFEST = { "builtComponentPath": "dashboard/cancel-dashboard-layout.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" }, - "duplicateDashboard": { - "builtComponentPath": "dashboard/duplicate-dashboard.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "editDashboardLayout": { "builtComponentPath": "dashboard/edit-dashboard-layout.front-component.mjs", "builtComponentChecksum": "2d8373187861b98be2b46922308787b0" }, - "saveDashboardLayout": { - "builtComponentPath": "dashboard/save-dashboard-layout.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "goToCompanies": { "builtComponentPath": "navigation/go-to-companies.front-component.mjs", "builtComponentChecksum": "26828ed9d08676e9ea1ab53ca4379c8e" @@ -68,38 +60,10 @@ export const STANDARD_FRONT_COMPONENT_BUILD_MANIFEST = { "builtComponentPath": "page-layout/edit-record-page-layout.front-component.mjs", "builtComponentChecksum": "2d8373187861b98be2b46922308787b0" }, - "saveRecordPageLayout": { - "builtComponentPath": "page-layout/save-record-page-layout.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "addToFavorites": { - "builtComponentPath": "record/add-to-favorites.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "createNewRecord": { - "builtComponentPath": "record/create-new-record.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "createNewView": { "builtComponentPath": "record/create-new-view.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" }, - "deleteMultipleRecords": { - "builtComponentPath": "record/delete-multiple-records.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "deleteSingleRecord": { - "builtComponentPath": "record/delete-single-record.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "destroyMultipleRecords": { - "builtComponentPath": "record/destroy-multiple-records.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "destroySingleRecord": { - "builtComponentPath": "record/destroy-single-record.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "exportFromRecordIndex": { "builtComponentPath": "record/export-from-record-index.front-component.mjs", "builtComponentChecksum": "2d8373187861b98be2b46922308787b0" @@ -128,10 +92,6 @@ export const STANDARD_FRONT_COMPONENT_BUILD_MANIFEST = { "builtComponentPath": "record/import-records.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" }, - "mergeMultipleRecords": { - "builtComponentPath": "record/merge-multiple-records.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "navigateToNextRecord": { "builtComponentPath": "record/navigate-to-next-record.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" @@ -140,18 +100,6 @@ export const STANDARD_FRONT_COMPONENT_BUILD_MANIFEST = { "builtComponentPath": "record/navigate-to-previous-record.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" }, - "removeFromFavorites": { - "builtComponentPath": "record/remove-from-favorites.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "restoreMultipleRecords": { - "builtComponentPath": "record/restore-multiple-records.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "restoreSingleRecord": { - "builtComponentPath": "record/restore-single-record.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "seeDeletedRecords": { "builtComponentPath": "record/see-deleted-records.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" @@ -184,10 +132,6 @@ export const STANDARD_FRONT_COMPONENT_BUILD_MANIFEST = { "builtComponentPath": "workflow-run/see-workflow-workflow-run.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" }, - "stopWorkflowRun": { - "builtComponentPath": "workflow-run/stop-workflow-run.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "seeRunsWorkflowVersion": { "builtComponentPath": "workflow-version/see-runs-workflow-version.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" @@ -200,30 +144,10 @@ export const STANDARD_FRONT_COMPONENT_BUILD_MANIFEST = { "builtComponentPath": "workflow-version/see-workflow-workflow-version.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" }, - "useAsDraftWorkflowVersion": { - "builtComponentPath": "workflow-version/use-as-draft-workflow-version.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "activateWorkflow": { - "builtComponentPath": "workflow/activate-workflow.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "addNodeWorkflow": { "builtComponentPath": "workflow/add-node-workflow.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" }, - "deactivateWorkflow": { - "builtComponentPath": "workflow/deactivate-workflow.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "discardDraftWorkflow": { - "builtComponentPath": "workflow/discard-draft-workflow.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "duplicateWorkflow": { - "builtComponentPath": "workflow/duplicate-workflow.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, "seeActiveVersionWorkflow": { "builtComponentPath": "workflow/see-active-version-workflow.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" @@ -235,13 +159,5 @@ export const STANDARD_FRONT_COMPONENT_BUILD_MANIFEST = { "seeVersionsWorkflow": { "builtComponentPath": "workflow/see-versions-workflow.front-component.mjs", "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "testWorkflow": { - "builtComponentPath": "workflow/test-workflow.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" - }, - "tidyUpWorkflow": { - "builtComponentPath": "workflow/tidy-up-workflow.front-component.mjs", - "builtComponentChecksum": "1233c1c6b371e623c29b58aa3ca9dfec" } } as const;