05a81c82a9
Add hotkeys column to the entity and plug it to the front end command menu item display --------- Co-authored-by: Charles Bochet <charles@twenty.com> Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
79 lines
1.8 KiB
TypeScript
79 lines
1.8 KiB
TypeScript
import { Field, Float, InputType } from '@nestjs/graphql';
|
|
|
|
import {
|
|
IsBoolean,
|
|
IsEnum,
|
|
IsNotEmpty,
|
|
IsNumber,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
} from 'class-validator';
|
|
|
|
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
|
import { CommandMenuItemAvailabilityType } from 'src/engine/metadata-modules/command-menu-item/enums/command-menu-item-availability-type.enum';
|
|
import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum';
|
|
|
|
@InputType()
|
|
export class CreateCommandMenuItemInput {
|
|
@IsUUID()
|
|
@IsOptional()
|
|
@Field(() => UUIDScalarType, { nullable: true })
|
|
workflowVersionId?: string;
|
|
|
|
@IsUUID()
|
|
@IsOptional()
|
|
@Field(() => UUIDScalarType, { nullable: true })
|
|
frontComponentId?: string;
|
|
|
|
@IsEnum(EngineComponentKey)
|
|
@IsOptional()
|
|
@Field(() => EngineComponentKey, { nullable: true })
|
|
engineComponentKey?: EngineComponentKey;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@Field()
|
|
label: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
@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 })
|
|
isPinned?: boolean;
|
|
|
|
@IsEnum(CommandMenuItemAvailabilityType)
|
|
@IsOptional()
|
|
@Field(() => CommandMenuItemAvailabilityType, { nullable: true })
|
|
availabilityType?: CommandMenuItemAvailabilityType;
|
|
|
|
@IsString({ each: true })
|
|
@IsOptional()
|
|
@Field(() => [String], { nullable: true })
|
|
hotKeys?: string[];
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
@Field({ nullable: true })
|
|
conditionalAvailabilityExpression?: string;
|
|
|
|
@IsUUID()
|
|
@IsOptional()
|
|
@Field(() => UUIDScalarType, { nullable: true })
|
|
availabilityObjectMetadataId?: string;
|
|
}
|