49afe5dbc4
- Makes engineComponentKey non-nullable on CommandMenuItem. Adds two new engine component keys: TRIGGER_WORKFLOW_VERSION and FRONT_COMPONENT_RENDERER to cover the former standalone cases. - Unifies the previously separated engine, front component and workflow runners into a single `CommandRunner` component with a unified `useMountCommand` hook that handles all command types.
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)
|
|
@IsNotEmpty()
|
|
@Field(() => EngineComponentKey)
|
|
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;
|
|
}
|