Migrate field widgets to backend (#18808)
- Renamed FieldConfiguration's layout field to fieldDisplayMode as it caused issues with the layout field of BarChartConfiguration - Create relation Field widgets for standard objects --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
committed by
GitHub
parent
d90d2e3151
commit
be89ef30cd
+13
-1
@@ -1,8 +1,10 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { IsIn, IsNotEmpty } from 'class-validator';
|
||||
import { IsEnum, IsIn, IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
import { type FieldConfiguration } from 'twenty-shared/types';
|
||||
|
||||
import { FieldDisplayMode } from 'src/engine/metadata-modules/page-layout-widget/enums/field-display-mode.enum';
|
||||
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
|
||||
|
||||
@ObjectType('FieldConfiguration')
|
||||
@@ -11,4 +13,14 @@ export class FieldConfigurationDTO implements FieldConfiguration {
|
||||
@IsIn([WidgetConfigurationType.FIELD])
|
||||
@IsNotEmpty()
|
||||
configurationType: WidgetConfigurationType.FIELD;
|
||||
|
||||
@Field(() => String)
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
fieldMetadataId: string;
|
||||
|
||||
@Field(() => FieldDisplayMode)
|
||||
@IsEnum(FieldDisplayMode)
|
||||
@IsNotEmpty()
|
||||
fieldDisplayMode: FieldDisplayMode;
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
export enum FieldDisplayMode {
|
||||
CARD = 'CARD',
|
||||
FIELD = 'FIELD',
|
||||
VIEW = 'VIEW',
|
||||
}
|
||||
|
||||
registerEnumType(FieldDisplayMode, {
|
||||
name: 'FieldDisplayMode',
|
||||
description: 'Display mode for field configuration widgets',
|
||||
});
|
||||
Reference in New Issue
Block a user