Refactor: Unify command menu item execution (#18908)
- Makes engineComponentKey non-nullable on CommandMenuItem. Adds two new engine component keys: TRIGGER_WORKFLOW_VERSION and FRONT_COMPONENT_RENDERER to cover the former standalone cases. - Unifies the previously separated engine, front component and workflow runners into a single `CommandRunner` component with a unified `useMountCommand` hook that handles all command types.
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
||||
import { type CommandMenuItemManifest } from 'twenty-shared/application';
|
||||
|
||||
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 { 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,7 +39,7 @@ export const fromCommandMenuItemManifestToUniversalFlatCommandMenuItem = ({
|
||||
commandMenuItemManifest.frontComponentUniversalIdentifier,
|
||||
availabilityObjectMetadataUniversalIdentifier:
|
||||
commandMenuItemManifest.availabilityObjectUniversalIdentifier ?? null,
|
||||
engineComponentKey: null,
|
||||
engineComponentKey: EngineComponentKey.FRONT_COMPONENT_RENDERER,
|
||||
hotKeys: null,
|
||||
workflowVersionId: null,
|
||||
createdAt: now,
|
||||
|
||||
Reference in New Issue
Block a user