Update Command Menu Item entity (#18391)

Closes https://github.com/twentyhq/core-team-issues/issues/2256
This commit is contained in:
Raphaël Bosi
2026-03-05 11:21:56 +01:00
committed by GitHub
parent 9d4ff7820d
commit abd9709291
19 changed files with 163 additions and 27 deletions
@@ -1,5 +1,6 @@
import {
Field,
Float,
HideField,
ObjectType,
registerEnumType,
@@ -10,6 +11,7 @@ import {
IsDateString,
IsEnum,
IsNotEmpty,
IsNumber,
IsOptional,
IsString,
IsUUID,
@@ -53,6 +55,15 @@ export class CommandMenuItemDTO {
@Field({ nullable: true })
icon?: string;
@IsString()
@IsOptional()
@Field({ nullable: true })
shortLabel?: string;
@IsNumber()
@Field(() => Float)
position: number;
@IsBoolean()
@Field()
isPinned: boolean;
@@ -1,9 +1,10 @@
import { Field, InputType } from '@nestjs/graphql';
import { Field, Float, InputType } from '@nestjs/graphql';
import {
IsBoolean,
IsEnum,
IsNotEmpty,
IsNumber,
IsOptional,
IsString,
IsUUID,
@@ -34,6 +35,16 @@ export class CreateCommandMenuItemInput {
@Field({ nullable: true })
icon?: string;
@IsString()
@IsOptional()
@Field({ nullable: true })
shortLabel?: string;
@IsNumber()
@IsOptional()
@Field(() => Float, { nullable: true })
position?: number;
@IsBoolean()
@IsOptional()
@Field({ nullable: true })
@@ -1,9 +1,10 @@
import { Field, InputType } from '@nestjs/graphql';
import { Field, Float, InputType } from '@nestjs/graphql';
import {
IsBoolean,
IsEnum,
IsNotEmpty,
IsNumber,
IsOptional,
IsString,
IsUUID,
@@ -29,6 +30,16 @@ export class UpdateCommandMenuItemInput {
@Field({ nullable: true })
icon?: string;
@IsString()
@IsOptional()
@Field({ nullable: true })
shortLabel?: string;
@IsNumber()
@IsOptional()
@Field(() => Float, { nullable: true })
position?: number;
@IsBoolean()
@IsOptional()
@Field({ nullable: true })
@@ -17,8 +17,7 @@ import { SyncableEntity } from 'src/engine/workspace-manager/types/syncable-enti
export enum CommandMenuItemAvailabilityType {
GLOBAL = 'GLOBAL',
SINGLE_RECORD = 'SINGLE_RECORD',
BULK_RECORDS = 'BULK_RECORDS',
RECORD_SELECTION = 'RECORD_SELECTION',
}
@Entity({ name: 'commandMenuItem', schema: 'core' })
@@ -63,6 +62,12 @@ export class CommandMenuItemEntity
@Column({ nullable: true, type: 'varchar' })
icon: string | null;
@Column({ nullable: true, type: 'varchar' })
shortLabel: string | null;
@Column({ nullable: false, type: 'double precision', default: 0 })
position: number;
@Column({ default: false })
isPinned: boolean;