diff --git a/models/board/package.json b/models/board/package.json index a6c8b8e5a2..9e5c009e9c 100644 --- a/models/board/package.json +++ b/models/board/package.json @@ -41,6 +41,7 @@ "@anticrm/view": "~0.6.0", "@anticrm/task": "~0.6.0", "@anticrm/model-task": "~0.6.0", - "@anticrm/workbench": "~0.6.1" + "@anticrm/workbench": "~0.6.1", + "@anticrm/model-preference": "~0.6.0" } } diff --git a/models/board/src/index.ts b/models/board/src/index.ts index b26129140e..b81f2aa924 100644 --- a/models/board/src/index.ts +++ b/models/board/src/index.ts @@ -14,7 +14,7 @@ // // To help typescript locate view plugin properly -import type { Board, Card, CardAction, CardDate, CardLabel, MenuPage } from '@anticrm/board' +import type { Board, Card, CardAction, CardDate, CardLabel, MenuPage, LabelsCompactMode } from '@anticrm/board' import type { Employee } from '@anticrm/contact' import { TxOperations as Client, @@ -49,6 +49,7 @@ import view from '@anticrm/model-view' import workbench from '@anticrm/model-workbench' import { Asset, IntlString, Resource } from '@anticrm/platform' import type { AnyComponent } from '@anticrm/ui' +import preference, { TPreference } from '@anticrm/model-preference' import board from './plugin' /** @@ -81,6 +82,12 @@ export class TCardLabel extends TAttachedDoc implements CardLabel { isHidden?: boolean } +@Model(board.class.LabelsCompactMode, preference.class.Preference) +export class TLabelsCompactMode extends TPreference implements LabelsCompactMode { + @Prop(TypeRef(board.class.Board), board.string.LabelsCompactMode) + attachedTo!: Ref +} + @Model(board.class.Card, task.class.Task) @UX(board.string.Card, board.icon.Card, undefined, 'title') export class TCard extends TTask implements Card { @@ -140,7 +147,7 @@ export class TMenuPage extends TDoc implements MenuPage { } export function createModel (builder: Builder): void { - builder.createModel(TBoard, TCard, TCardLabel, TCardDate, TCardAction, TMenuPage) + builder.createModel(TBoard, TCard, TCardLabel, TCardDate, TCardAction, TMenuPage, TLabelsCompactMode) builder.createDoc(board.class.MenuPage, core.space.Model, { component: board.component.Archive, diff --git a/models/board/src/plugin.ts b/models/board/src/plugin.ts index 3eac1af135..3c1ffc807f 100644 --- a/models/board/src/plugin.ts +++ b/models/board/src/plugin.ts @@ -17,7 +17,7 @@ import { boardId } from '@anticrm/board' import board from '@anticrm/board-resources/src/plugin' import type { Ref, Space } from '@anticrm/core' -import { mergeIds } from '@anticrm/platform' +import { IntlString, mergeIds } from '@anticrm/platform' import { KanbanTemplate, Sequence } from '@anticrm/task' import type { AnyComponent } from '@anticrm/ui' import { ViewletDescriptor } from '@anticrm/view' @@ -46,5 +46,8 @@ export default mergeIds(boardId, board, { }, viewlet: { Kanban: '' as Ref + }, + string: { + LabelsCompactMode: '' as IntlString } }) diff --git a/plugins/board-resources/package.json b/plugins/board-resources/package.json index 1415b3357b..8902214a69 100644 --- a/plugins/board-resources/package.json +++ b/plugins/board-resources/package.json @@ -53,6 +53,7 @@ "@anticrm/view-resources": "~0.6.0", "@anticrm/workbench": "~0.6.1", "svelte": "^3.47", - "@anticrm/kanban": "~0.6.0" + "@anticrm/kanban": "~0.6.0", + "@anticrm/preference": "~0.6.0" } } diff --git a/plugins/board-resources/src/components/editor/CardLabels.svelte b/plugins/board-resources/src/components/editor/CardLabels.svelte index d262ae14b5..22269dfa85 100644 --- a/plugins/board-resources/src/components/editor/CardLabels.svelte +++ b/plugins/board-resources/src/components/editor/CardLabels.svelte @@ -13,10 +13,11 @@ // limitations under the License. -->