7da8450075
## Description - Add `isHeadless` field to `FrontComponent` entity so front components can run without rendering UI in the command menu - Introduce headless front component mounting logic: `HeadlessFrontComponentMountRoot` at the application root, `useMountHeadlessFrontComponent`, and `useUnmountHeadlessFrontComponent` hooks to mount/unmount headless components - Expand the SDK with new action components (`Action`, `ActionLink`, `ActionOpenSidePanelPage`) and host communication functions (`openSidePanelPage`, `unmountFrontComponent`) - Move `CommandMenuPages` type to twenty-shared so the SDK can reference it for side panel navigation ## Video QA https://github.com/user-attachments/assets/4f9e3bb1-fcd1-42be-b3f4-a97e80c2add2
27 lines
1.2 KiB
TypeScript
27 lines
1.2 KiB
TypeScript
import { isDefined } from 'twenty-shared/utils';
|
|
|
|
import { type FlatFrontComponent } from 'src/engine/metadata-modules/flat-front-component/types/flat-front-component.type';
|
|
import { type FrontComponentDTO } from 'src/engine/metadata-modules/front-component/dtos/front-component.dto';
|
|
|
|
export const fromFlatFrontComponentToFrontComponentDto = (
|
|
flatFrontComponent: FlatFrontComponent,
|
|
): FrontComponentDTO => ({
|
|
id: flatFrontComponent.id,
|
|
name: flatFrontComponent.name,
|
|
description: isDefined(flatFrontComponent.description)
|
|
? flatFrontComponent.description
|
|
: undefined,
|
|
sourceComponentPath: flatFrontComponent.sourceComponentPath,
|
|
builtComponentPath: flatFrontComponent.builtComponentPath,
|
|
componentName: flatFrontComponent.componentName,
|
|
builtComponentChecksum: flatFrontComponent.builtComponentChecksum,
|
|
universalIdentifier: isDefined(flatFrontComponent.universalIdentifier)
|
|
? flatFrontComponent.universalIdentifier
|
|
: undefined,
|
|
workspaceId: flatFrontComponent.workspaceId,
|
|
applicationId: flatFrontComponent.applicationId,
|
|
isHeadless: flatFrontComponent.isHeadless,
|
|
createdAt: new Date(flatFrontComponent.createdAt),
|
|
updatedAt: new Date(flatFrontComponent.updatedAt),
|
|
});
|