From a53277f7aa6d67e01a857508b326b22cf4a7119a Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Thu, 7 Apr 2022 17:31:30 +0700 Subject: [PATCH] Separate Board Kanban view (#1318) Signed-off-by: Andrey Sobolev --- models/board/src/index.ts | 13 ++++- models/board/src/plugin.ts | 7 ++- plugins/board-resources/package.json | 1 + .../src/components/KanbanView.svelte | 48 +++++++++++++++++++ plugins/board-resources/src/index.ts | 4 +- plugins/task-resources/src/index.ts | 2 + 6 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 plugins/board-resources/src/components/KanbanView.svelte diff --git a/models/board/src/index.ts b/models/board/src/index.ts index 43dd942ce2..aa40032310 100644 --- a/models/board/src/index.ts +++ b/models/board/src/index.ts @@ -146,7 +146,7 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: board.class.Card, - descriptor: task.viewlet.Kanban, + descriptor: board.viewlet.Kanban, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: {} @@ -176,6 +176,17 @@ export function createModel (builder: Builder): void { }, board.space.BoardTemplates ) + + builder.createDoc( + view.class.ViewletDescriptor, + core.space.Model, + { + label: task.string.Kanban, + icon: task.icon.Kanban, + component: board.component.KanbanView + }, + board.viewlet.Kanban + ) } export { createDeps } from './creation' diff --git a/models/board/src/plugin.ts b/models/board/src/plugin.ts index bf77a81e28..09d4385169 100644 --- a/models/board/src/plugin.ts +++ b/models/board/src/plugin.ts @@ -20,6 +20,7 @@ import type { Ref, Space } from '@anticrm/core' import { mergeIds } from '@anticrm/platform' import { KanbanTemplate, Sequence } from '@anticrm/task' import type { AnyComponent } from '@anticrm/ui' +import { ViewletDescriptor } from '@anticrm/view' export default mergeIds(boardId, board, { component: { @@ -28,7 +29,8 @@ export default mergeIds(boardId, board, { KanbanCard: '' as AnyComponent, CardPresenter: '' as AnyComponent, TemplatesIcon: '' as AnyComponent, - Cards: '' as AnyComponent + Cards: '' as AnyComponent, + KanbanView: '' as AnyComponent }, space: { DefaultBoard: '' as Ref @@ -38,5 +40,8 @@ export default mergeIds(boardId, board, { }, ids: { Sequence: '' as Ref + }, + viewlet: { + Kanban: '' as Ref } }) diff --git a/plugins/board-resources/package.json b/plugins/board-resources/package.json index 2424cf9825..31c6834e3a 100644 --- a/plugins/board-resources/package.json +++ b/plugins/board-resources/package.json @@ -37,6 +37,7 @@ "@anticrm/chunter-resources": "~0.6.0", "@anticrm/contact": "~0.6.5", "@anticrm/contact-resources": "~0.6.0", + "@anticrm/task-resources": "~0.6.0", "@anticrm/core": "~0.6.16", "@anticrm/notification": "~0.6.0", "@anticrm/panel": "~0.6.0", diff --git a/plugins/board-resources/src/components/KanbanView.svelte b/plugins/board-resources/src/components/KanbanView.svelte new file mode 100644 index 0000000000..4dfb02fd7a --- /dev/null +++ b/plugins/board-resources/src/components/KanbanView.svelte @@ -0,0 +1,48 @@ + + + + + + // eslint-disable-next-line no-undef + diff --git a/plugins/board-resources/src/index.ts b/plugins/board-resources/src/index.ts index 90247a42fc..aa711efb6f 100644 --- a/plugins/board-resources/src/index.ts +++ b/plugins/board-resources/src/index.ts @@ -21,6 +21,7 @@ import CreateCard from './components/CreateCard.svelte' import EditCard from './components/EditCard.svelte' import KanbanCard from './components/KanbanCard.svelte' import TemplatesIcon from './components/TemplatesIcon.svelte' +import KanbanView from './components/KanbanView.svelte' export default async (): Promise => ({ component: { @@ -29,6 +30,7 @@ export default async (): Promise => ({ EditCard, KanbanCard, CardPresenter, - TemplatesIcon + TemplatesIcon, + KanbanView } }) diff --git a/plugins/task-resources/src/index.ts b/plugins/task-resources/src/index.ts index 1114623613..27d2797033 100644 --- a/plugins/task-resources/src/index.ts +++ b/plugins/task-resources/src/index.ts @@ -43,6 +43,8 @@ import TodoStatePresenter from './components/todos/TodoStatePresenter.svelte' import AssignedTasks from './components/AssignedTasks.svelte' import task from './plugin' +export { default as Kanban } from './components/kanban/Kanban.svelte' + async function createTask (object: Doc): Promise { showPopup(CreateTask, { parent: object._id, space: object.space }) }