diff --git a/models/board/src/index.ts b/models/board/src/index.ts index 2f1b8c016d..9235a6c1ef 100644 --- a/models/board/src/index.ts +++ b/models/board/src/index.ts @@ -22,7 +22,7 @@ import { Builder, Collection, Index, Model, Prop, TypeBoolean, TypeMarkup, TypeR import attachment from '@anticrm/model-attachment' import chunter from '@anticrm/model-chunter' import contact from '@anticrm/model-contact' -import core, { TDoc } from '@anticrm/model-core' +import core, { TAttachedDoc, TDoc } from '@anticrm/model-core' import task, { TSpaceWithStates, TTask } from '@anticrm/model-task' import view from '@anticrm/model-view' import workbench from '@anticrm/model-workbench' @@ -37,6 +37,13 @@ export class TBoard extends TSpaceWithStates implements Board { background!: string } +@Model(board.class.CardLabel, core.class.AttachedDoc, DOMAIN_MODEL) +@UX(board.string.Labels) +export class TCardLabel extends TAttachedDoc implements CardLabel { + title!: string; + color!: number; +} + @Model(board.class.Card, task.class.Task) @UX(board.string.Card, board.icon.Card, undefined, 'title') export class TCard extends TTask implements Card { @@ -88,7 +95,7 @@ export class TCardAction extends TDoc implements CardAction { } export function createModel (builder: Builder): void { - builder.createModel(TBoard, TCard, TCardAction) + builder.createModel(TBoard, TCard, TCardLabel, TCardAction) builder.mixin(board.class.Board, core.class.Class, workbench.mixin.SpaceView, { view: { diff --git a/plugins/board/src/index.ts b/plugins/board/src/index.ts index 09af3d38c8..b44cddb399 100644 --- a/plugins/board/src/index.ts +++ b/plugins/board/src/index.ts @@ -42,8 +42,6 @@ export interface BoardView extends SpaceWithStates { * @public */ export interface CardLabel extends AttachedDoc { - attachedTo: Ref - title: string color: number }