Board: Fix labels model (#1405)

Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
Anna No 2022-04-16 09:56:31 +07:00 committed by GitHub
parent 8d89816e8f
commit 16e3ae59bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -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: {

View File

@ -42,8 +42,6 @@ export interface BoardView extends SpaceWithStates {
* @public
*/
export interface CardLabel extends AttachedDoc {
attachedTo: Ref<Board>
title: string
color: number
}