Update pageLayout* data models for backend recordPageLayout refactor (#17446)

<img width="814" height="356" alt="Screenshot 2026-01-26 at 16 09 27"
src="https://github.com/user-attachments/assets/91d95a1d-cc33-4bf0-a63e-4d1815030983"
/>
This commit is contained in:
Weiko
2026-01-29 14:39:46 +01:00
committed by GitHub
parent 09de762285
commit 7d69000ab7
31 changed files with 194 additions and 9 deletions
@@ -1,10 +1,15 @@
import { Field, Float, ObjectType } from '@nestjs/graphql';
import { Field, Float, ObjectType, registerEnumType } from '@nestjs/graphql';
import { IDField } from '@ptc-org/nestjs-query-graphql';
import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { PageLayoutWidgetDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/page-layout-widget.dto';
registerEnumType(PageLayoutTabLayoutMode, {
name: 'PageLayoutTabLayoutMode',
});
@ObjectType('PageLayoutTab')
export class PageLayoutTabDTO {
@IDField(() => UUIDScalarType)
@@ -22,6 +27,15 @@ export class PageLayoutTabDTO {
@Field(() => [PageLayoutWidgetDTO], { nullable: true })
widgets?: PageLayoutWidgetDTO[] | null;
@Field(() => String, { nullable: true })
icon?: string | null;
@Field(() => PageLayoutTabLayoutMode, {
nullable: true, // Not nullable in the database, but we need to make it nullable here until the frontend consumes the new type
defaultValue: PageLayoutTabLayoutMode.GRID,
})
layoutMode: PageLayoutTabLayoutMode;
@Field()
createdAt: Date;
@@ -1,5 +1,6 @@
import { ObjectType } from '@nestjs/graphql';
import { PageLayoutTabLayoutMode } from 'twenty-shared/types';
import {
Column,
CreateDateColumn,
@@ -52,6 +53,17 @@ export class PageLayoutTabEntity
})
widgets: Relation<PageLayoutWidgetEntity[]>;
@Column({ nullable: true, type: 'varchar' })
icon: string | null;
@Column({
type: 'enum',
enum: Object.values(PageLayoutTabLayoutMode),
nullable: false,
default: PageLayoutTabLayoutMode.GRID,
})
layoutMode: PageLayoutTabLayoutMode;
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;