Add select type to field metadata decorator (#3471)

* Add select type to field metadata decorator

* add option id generation for new field
This commit is contained in:
Weiko
2024-01-17 15:03:11 +01:00
committed by GitHub
parent 5d4e226aad
commit f3c9854be3
5 changed files with 48 additions and 11 deletions

View File

@ -31,11 +31,16 @@ export class MessageParticipantObjectMetadata extends BaseObjectMetadata {
message: MessageObjectMetadata;
@FieldMetadata({
// this will be a type select: from, to, cc, bcc
type: FieldMetadataType.TEXT,
type: FieldMetadataType.SELECT,
label: 'Role',
description: 'Role',
icon: 'IconAt',
options: [
{ value: 'from', label: 'From', position: 0, color: 'green' },
{ value: 'to', label: 'To', position: 1, color: 'blue' },
{ value: 'cc', label: 'Cc', position: 2, color: 'orange' },
{ value: 'bcc', label: 'Bcc', position: 3, color: 'red' },
],
defaultValue: { value: 'from' },
})
role: string;