[Dashboards] Rich text editor frontend (#16437)
closes https://github.com/twentyhq/core-team-issues/issues/1894
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
type GridPosition,
|
||||
type PageLayoutWidget,
|
||||
type RichTextV2Body,
|
||||
WidgetType,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
export const createDefaultStandaloneRichTextWidget = (
|
||||
id: string,
|
||||
pageLayoutTabId: string,
|
||||
body: RichTextV2Body,
|
||||
gridPosition: GridPosition,
|
||||
objectMetadataId?: string | null,
|
||||
): PageLayoutWidget => {
|
||||
return {
|
||||
__typename: 'PageLayoutWidget',
|
||||
id,
|
||||
pageLayoutTabId,
|
||||
title: 'Untitled Rich Text',
|
||||
type: WidgetType.STANDALONE_RICH_TEXT,
|
||||
configuration: {
|
||||
body,
|
||||
},
|
||||
gridPosition,
|
||||
objectMetadataId: objectMetadataId ?? null,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
deletedAt: null,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user