From 67e6a7958fc67d693431e9e954c56c6d245fee39 Mon Sep 17 00:00:00 2001 From: Alex <41288429+Dvinyanin@users.noreply.github.com> Date: Fri, 29 Apr 2022 23:39:48 +0700 Subject: [PATCH] Add BoardMenu (#1592) Signed-off-by: Dvinyanin Alexandr --- models/board/src/index.ts | 25 ++++++++- plugins/board-assets/lang/en.json | 1 + plugins/board-assets/lang/ru.json | 1 + .../src/components/Archive.svelte | 29 ++++++++++ .../src/components/BoardHeader.svelte | 18 +++--- .../src/components/BoardMenu.svelte | 52 ++++++++++++++++++ .../src/components/MenuMainPage.svelte | 12 ++++ .../src/components/popups/Menu.svelte | 55 ------------------- plugins/board-resources/src/index.ts | 8 ++- plugins/board-resources/src/plugin.ts | 8 ++- plugins/board/src/index.ts | 15 ++++- 11 files changed, 153 insertions(+), 71 deletions(-) create mode 100644 plugins/board-resources/src/components/Archive.svelte create mode 100644 plugins/board-resources/src/components/BoardMenu.svelte create mode 100644 plugins/board-resources/src/components/MenuMainPage.svelte delete mode 100644 plugins/board-resources/src/components/popups/Menu.svelte diff --git a/models/board/src/index.ts b/models/board/src/index.ts index 7e88a4ea78..c0fd749bf3 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 } from '@anticrm/board' +import type { Board, Card, CardAction, CardDate, CardLabel, MenuPage } from '@anticrm/board' import type { Employee } from '@anticrm/contact' import { TxOperations as Client, Doc, DOMAIN_MODEL, FindOptions, IndexKind, Ref, Type, Timestamp } from '@anticrm/core' import { @@ -122,8 +122,26 @@ export class TCardAction extends TDoc implements CardAction { supported?: Resource<(card: Card, client: Client) => boolean> } +@Model(board.class.MenuPage, core.class.Doc, DOMAIN_MODEL) +export class TMenuPage extends TDoc implements MenuPage { + component!: AnyComponent + pageId!: string + label!: IntlString +} + export function createModel (builder: Builder): void { - builder.createModel(TBoard, TCard, TCardLabel, TCardDate, TCardAction) + builder.createModel(TBoard, TCard, TCardLabel, TCardDate, TCardAction, TMenuPage) + + builder.createDoc(board.class.MenuPage, core.space.Model, { + component: board.component.Archive, + pageId: board.menuPageId.Archive, + label: board.string.Archive + }) + builder.createDoc(board.class.MenuPage, core.space.Model, { + component: board.component.MenuMainPage, + pageId: board.menuPageId.Main, + label: board.string.Menu + }) builder.mixin(board.class.Board, core.class.Class, workbench.mixin.SpaceView, { view: { @@ -151,7 +169,8 @@ export function createModel (builder: Builder): void { addSpaceLabel: board.string.BoardCreateLabel, createComponent: board.component.CreateBoard } - ] + ], + aside: board.component.BoardMenu } }, board.app.Board diff --git a/plugins/board-assets/lang/en.json b/plugins/board-assets/lang/en.json index 288162dcc1..e83a29138f 100644 --- a/plugins/board-assets/lang/en.json +++ b/plugins/board-assets/lang/en.json @@ -91,6 +91,7 @@ "DeleteCard": "All actions will be removed from the activity feed and you won’t be able to re-open the card. There is no undo.", "SearchMembers": "Search members", "Menu": "Menu", + "ShowMenu": "Show menu", "ToArchive": "Archive", "CopyCard": "Copy card", "AlsoCopy": "Keep...", diff --git a/plugins/board-assets/lang/ru.json b/plugins/board-assets/lang/ru.json index 6e614c6065..48706fb855 100644 --- a/plugins/board-assets/lang/ru.json +++ b/plugins/board-assets/lang/ru.json @@ -91,6 +91,7 @@ "DeleteCard": "Все действия будут удалены из ленты, и вы не сможете повторно открыть карточку. Отмена невозможна.", "SearchMembers": "Поиск участников", "Menu": "Меню", + "ShowMenu": "Показать меню", "ToArchive": "Архивировать", "CopyCard": "Копировать карточку", "AlsoCopy": "Также копировать...", diff --git a/plugins/board-resources/src/components/Archive.svelte b/plugins/board-resources/src/components/Archive.svelte new file mode 100644 index 0000000000..4daadaded2 --- /dev/null +++ b/plugins/board-resources/src/components/Archive.svelte @@ -0,0 +1,29 @@ + + +
+