2022-04-02 03:49:23 +00:00
|
|
|
//
|
2022-04-16 02:59:50 +00:00
|
|
|
// Copyright © 2022 Hardcore Engineering Inc.
|
2022-04-02 03:49:23 +00:00
|
|
|
//
|
|
|
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License. You may
|
|
|
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
//
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
|
|
|
// To help typescript locate view plugin properly
|
2022-09-21 08:08:25 +00:00
|
|
|
import automation, { AutomationSupport } from '@hcengineering/automation'
|
|
|
|
import { Board, boardId, Card, CardCover, CommonBoardPreference, MenuPage } from '@hcengineering/board'
|
|
|
|
import type { Employee } from '@hcengineering/contact'
|
|
|
|
import { Class, DOMAIN_MODEL, IndexKind, Markup, Ref, Type } from '@hcengineering/core'
|
2022-04-16 02:59:50 +00:00
|
|
|
import {
|
2022-04-28 08:11:09 +00:00
|
|
|
ArrOf,
|
2022-04-16 02:59:50 +00:00
|
|
|
Builder,
|
|
|
|
Collection,
|
|
|
|
Index,
|
|
|
|
Model,
|
|
|
|
Prop,
|
|
|
|
TypeBoolean,
|
|
|
|
TypeMarkup,
|
|
|
|
TypeRef,
|
|
|
|
TypeString,
|
|
|
|
UX
|
2022-09-21 08:08:25 +00:00
|
|
|
} from '@hcengineering/model'
|
|
|
|
import attachment from '@hcengineering/model-attachment'
|
|
|
|
import chunter from '@hcengineering/model-chunter'
|
|
|
|
import contact from '@hcengineering/model-contact'
|
|
|
|
import core, { TDoc, TType } from '@hcengineering/model-core'
|
|
|
|
import preference, { TPreference } from '@hcengineering/model-preference'
|
|
|
|
import tags from '@hcengineering/model-tags'
|
|
|
|
import task, { TSpaceWithStates, TTask } from '@hcengineering/model-task'
|
|
|
|
import view, { actionTemplates, createAction, actionTemplates as viewTemplates } from '@hcengineering/model-view'
|
|
|
|
import workbench, { Application } from '@hcengineering/model-workbench'
|
|
|
|
import { IntlString } from '@hcengineering/platform'
|
|
|
|
import type { AnyComponent } from '@hcengineering/ui'
|
2022-04-02 03:49:23 +00:00
|
|
|
import board from './plugin'
|
|
|
|
|
|
|
|
@Model(board.class.Board, task.class.SpaceWithStates)
|
|
|
|
@UX(board.string.Board, board.icon.Board)
|
|
|
|
export class TBoard extends TSpaceWithStates implements Board {
|
|
|
|
color!: number
|
|
|
|
background!: string
|
|
|
|
}
|
|
|
|
|
2022-05-24 12:56:42 +00:00
|
|
|
function TypeCardCover (): Type<CardCover> {
|
|
|
|
return { _class: board.class.CardCover, label: board.string.Cover }
|
|
|
|
}
|
|
|
|
|
|
|
|
@UX(board.string.Cover)
|
|
|
|
@Model(board.class.CardCover, core.class.Type)
|
|
|
|
export class TCardCover extends TType implements CardCover {
|
|
|
|
size!: 'large' | 'small'
|
|
|
|
color!: number
|
|
|
|
}
|
|
|
|
|
2022-05-20 07:19:45 +00:00
|
|
|
@Model(board.class.CommonBoardPreference, preference.class.Preference)
|
|
|
|
export class TCommonBoardPreference extends TPreference implements CommonBoardPreference {
|
|
|
|
@Prop(TypeRef(workbench.class.Application), board.string.CommonBoardPreference)
|
|
|
|
attachedTo!: Ref<Application>
|
2022-05-12 15:38:29 +00:00
|
|
|
}
|
|
|
|
|
2022-04-02 03:49:23 +00:00
|
|
|
@Model(board.class.Card, task.class.Task)
|
|
|
|
@UX(board.string.Card, board.icon.Card, undefined, 'title')
|
|
|
|
export class TCard extends TTask implements Card {
|
|
|
|
@Prop(TypeString(), board.string.Title)
|
|
|
|
@Index(IndexKind.FullText)
|
|
|
|
title!: string
|
|
|
|
|
2022-04-08 18:07:21 +00:00
|
|
|
@Prop(TypeBoolean(), board.string.IsArchived)
|
|
|
|
isArchived?: boolean
|
|
|
|
|
2022-04-02 03:49:23 +00:00
|
|
|
@Prop(TypeMarkup(), board.string.Description)
|
|
|
|
@Index(IndexKind.FullText)
|
2022-05-04 13:52:31 +00:00
|
|
|
description!: Markup
|
2022-04-02 03:49:23 +00:00
|
|
|
|
|
|
|
@Prop(TypeString(), board.string.Location)
|
|
|
|
@Index(IndexKind.FullText)
|
2022-04-08 18:07:21 +00:00
|
|
|
location?: string
|
2022-04-02 03:49:23 +00:00
|
|
|
|
|
|
|
@Prop(Collection(chunter.class.Comment), chunter.string.Comments)
|
|
|
|
comments?: number
|
|
|
|
|
2022-05-19 07:14:05 +00:00
|
|
|
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, undefined, attachment.string.Files)
|
2022-04-02 03:49:23 +00:00
|
|
|
attachments?: number
|
|
|
|
|
|
|
|
@Prop(TypeRef(contact.class.Employee), board.string.Assignee)
|
|
|
|
declare assignee: Ref<Employee> | null
|
|
|
|
|
2022-04-28 08:11:09 +00:00
|
|
|
@Prop(ArrOf(TypeRef(contact.class.Employee)), board.string.Members)
|
2022-04-08 18:07:21 +00:00
|
|
|
members?: Ref<Employee>[]
|
2022-05-24 12:56:42 +00:00
|
|
|
|
|
|
|
@Prop(TypeCardCover(), board.string.Cover)
|
|
|
|
cover?: CardCover
|
2022-04-02 03:49:23 +00:00
|
|
|
}
|
|
|
|
|
2022-04-29 16:39:48 +00:00
|
|
|
@Model(board.class.MenuPage, core.class.Doc, DOMAIN_MODEL)
|
|
|
|
export class TMenuPage extends TDoc implements MenuPage {
|
|
|
|
component!: AnyComponent
|
|
|
|
pageId!: string
|
|
|
|
label!: IntlString
|
|
|
|
}
|
|
|
|
|
2022-04-02 03:49:23 +00:00
|
|
|
export function createModel (builder: Builder): void {
|
2022-05-27 16:43:11 +00:00
|
|
|
builder.createModel(TBoard, TCard, TMenuPage, TCommonBoardPreference, TCardCover)
|
2022-04-29 16:39:48 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
})
|
2022-04-02 03:49:23 +00:00
|
|
|
|
|
|
|
builder.mixin(board.class.Board, core.class.Class, workbench.mixin.SpaceView, {
|
|
|
|
view: {
|
2022-04-06 10:20:35 +00:00
|
|
|
class: board.class.Card
|
|
|
|
// createItemDialog: board.component.CreateCard,
|
|
|
|
// createItemLabel: board.string.CardCreateLabel
|
2022-04-02 03:49:23 +00:00
|
|
|
}
|
|
|
|
})
|
2022-04-24 05:06:20 +00:00
|
|
|
builder.mixin(board.class.Board, core.class.Class, view.mixin.SpaceHeader, {
|
|
|
|
header: board.component.BoardHeader
|
|
|
|
})
|
2022-04-02 03:49:23 +00:00
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
workbench.class.Application,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
label: board.string.BoardApplication,
|
|
|
|
icon: board.icon.Board,
|
2022-06-29 08:08:59 +00:00
|
|
|
alias: boardId,
|
2022-04-02 03:49:23 +00:00
|
|
|
hidden: false,
|
|
|
|
navigatorModel: {
|
|
|
|
spaces: [
|
|
|
|
{
|
|
|
|
label: board.string.MyBoards,
|
|
|
|
spaceClass: board.class.Board,
|
|
|
|
addSpaceLabel: board.string.BoardCreateLabel,
|
|
|
|
createComponent: board.component.CreateBoard
|
|
|
|
}
|
2022-04-29 16:39:48 +00:00
|
|
|
],
|
2022-06-09 15:28:55 +00:00
|
|
|
specials: [
|
|
|
|
{
|
|
|
|
id: 'labels',
|
|
|
|
component: board.component.LabelsView,
|
|
|
|
icon: tags.icon.Tags,
|
|
|
|
label: board.string.Labels,
|
|
|
|
createItemLabel: board.string.Labels,
|
|
|
|
position: 'bottom'
|
|
|
|
}
|
|
|
|
],
|
2022-04-29 16:39:48 +00:00
|
|
|
aside: board.component.BoardMenu
|
2022-04-02 03:49:23 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
board.app.Board
|
|
|
|
)
|
|
|
|
|
|
|
|
// const leadLookup: Lookup<Card> =
|
|
|
|
// {
|
|
|
|
// state: task.class.State,
|
|
|
|
// doneState: task.class.DoneState
|
|
|
|
// }
|
|
|
|
|
|
|
|
// builder.createDoc(view.class.Viewlet, core.space.Model, {
|
|
|
|
// attachTo: board.class.Card,
|
|
|
|
// descriptor: task.viewlet.StatusTable,
|
|
|
|
// // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
|
|
// options: {
|
|
|
|
// lookup: leadLookup
|
|
|
|
// } as FindOptions<Doc>, // TODO: fix
|
|
|
|
// config: [
|
|
|
|
// '',
|
|
|
|
// '$lookup.attachedTo',
|
|
|
|
// '$lookup.state',
|
|
|
|
// '$lookup.doneState',
|
|
|
|
// { presenter: attachment.component.AttachmentsPresenter, label: attachment.string.Files, sortingKey: 'attachments' },
|
|
|
|
// { presenter: chunter.component.CommentsPresenter, label: chunter.string.Comments, sortingKey: 'comments' },
|
|
|
|
// 'modifiedOn',
|
|
|
|
// '$lookup.attachedTo.$lookup.channels'
|
|
|
|
// ]
|
|
|
|
// })
|
|
|
|
|
|
|
|
builder.createDoc(view.class.Viewlet, core.space.Model, {
|
|
|
|
attachTo: board.class.Card,
|
2022-04-07 10:31:30 +00:00
|
|
|
descriptor: board.viewlet.Kanban,
|
2022-04-02 03:49:23 +00:00
|
|
|
config: []
|
|
|
|
})
|
|
|
|
|
2022-05-17 07:12:33 +00:00
|
|
|
builder.createDoc(view.class.Viewlet, core.space.Model, {
|
|
|
|
attachTo: board.class.Card,
|
|
|
|
descriptor: board.viewlet.Table,
|
|
|
|
config: []
|
|
|
|
})
|
|
|
|
|
2022-04-02 03:49:23 +00:00
|
|
|
builder.mixin(board.class.Card, core.class.Class, task.mixin.KanbanCard, {
|
|
|
|
card: board.component.KanbanCard
|
|
|
|
})
|
|
|
|
|
|
|
|
builder.mixin(board.class.Card, core.class.Class, view.mixin.ObjectEditor, {
|
|
|
|
editor: board.component.EditCard
|
|
|
|
})
|
|
|
|
|
|
|
|
builder.mixin(board.class.Card, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: board.component.CardPresenter
|
|
|
|
})
|
|
|
|
|
2022-04-18 07:44:15 +00:00
|
|
|
builder.mixin(board.class.Board, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: board.component.BoardPresenter
|
|
|
|
})
|
|
|
|
|
2022-05-24 12:56:42 +00:00
|
|
|
builder.mixin(board.class.CardCover, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: board.component.CardCoverPresenter
|
|
|
|
})
|
|
|
|
|
|
|
|
builder.mixin(board.class.CardCover, core.class.Class, view.mixin.AttributeEditor, {
|
2022-06-15 17:25:58 +00:00
|
|
|
inlineEditor: board.component.CardCoverEditor
|
2022-05-24 12:56:42 +00:00
|
|
|
})
|
|
|
|
|
2022-04-02 03:49:23 +00:00
|
|
|
builder.createDoc(
|
|
|
|
task.class.KanbanTemplateSpace,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
name: board.string.Boards,
|
|
|
|
description: board.string.ManageBoardStatuses,
|
|
|
|
icon: board.component.TemplatesIcon
|
|
|
|
},
|
|
|
|
board.space.BoardTemplates
|
|
|
|
)
|
2022-04-07 10:31:30 +00:00
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
view.class.ViewletDescriptor,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
label: task.string.Kanban,
|
|
|
|
icon: task.icon.Kanban,
|
|
|
|
component: board.component.KanbanView
|
|
|
|
},
|
|
|
|
board.viewlet.Kanban
|
2022-05-17 07:12:33 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
view.class.ViewletDescriptor,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
label: view.string.Table,
|
|
|
|
icon: view.icon.Table,
|
|
|
|
component: board.component.TableView
|
|
|
|
},
|
|
|
|
board.viewlet.Table
|
2022-04-07 10:31:30 +00:00
|
|
|
)
|
2022-04-08 03:08:30 +00:00
|
|
|
|
2022-05-23 07:28:41 +00:00
|
|
|
builder.createDoc(
|
|
|
|
task.class.WonState,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
title: board.string.Completed,
|
|
|
|
rank: '0'
|
|
|
|
},
|
|
|
|
board.state.Completed
|
|
|
|
)
|
|
|
|
|
2022-04-08 03:08:30 +00:00
|
|
|
// card actions
|
2022-05-25 06:08:26 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
|
|
|
{
|
|
|
|
action: view.actionImpl.ShowPanel,
|
|
|
|
actionProps: {
|
|
|
|
component: board.component.EditCard
|
|
|
|
},
|
|
|
|
label: view.string.Open,
|
|
|
|
icon: board.icon.Card,
|
|
|
|
input: 'any',
|
|
|
|
category: board.category.Card,
|
|
|
|
target: board.class.Card,
|
2022-06-24 12:36:08 +00:00
|
|
|
context: { mode: 'context', application: board.app.Board, group: 'create' }
|
2022-05-25 06:08:26 +00:00
|
|
|
},
|
|
|
|
board.action.Open
|
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
2022-04-08 03:08:30 +00:00
|
|
|
{
|
2022-05-17 08:36:11 +00:00
|
|
|
action: view.actionImpl.ShowPopup,
|
|
|
|
actionProps: {
|
2022-05-31 04:28:40 +00:00
|
|
|
component: tags.component.TagsEditorPopup,
|
|
|
|
element: view.popup.PositionElementAlignment,
|
2022-06-24 12:36:08 +00:00
|
|
|
fillProps: {
|
2022-07-05 10:00:47 +00:00
|
|
|
_object: 'object'
|
2022-06-24 12:36:08 +00:00
|
|
|
}
|
2022-05-17 08:36:11 +00:00
|
|
|
},
|
2022-04-08 03:08:30 +00:00
|
|
|
label: board.string.Labels,
|
2022-06-09 12:50:51 +00:00
|
|
|
icon: tags.icon.Tags,
|
2022-05-17 08:36:11 +00:00
|
|
|
input: 'any',
|
2022-05-25 06:08:26 +00:00
|
|
|
inline: true,
|
2022-05-17 08:36:11 +00:00
|
|
|
category: board.category.Card,
|
|
|
|
target: board.class.Card,
|
2022-06-24 12:36:08 +00:00
|
|
|
context: { mode: 'context', application: board.app.Board, group: 'create' }
|
2022-04-08 03:08:30 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
board.action.Labels
|
2022-04-08 03:08:30 +00:00
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
2022-04-08 03:08:30 +00:00
|
|
|
{
|
2022-05-17 08:36:11 +00:00
|
|
|
action: view.actionImpl.ShowPopup,
|
|
|
|
actionProps: {
|
|
|
|
component: board.component.DatesActionPopup,
|
2022-07-05 10:00:47 +00:00
|
|
|
element: view.popup.PositionElementAlignment,
|
|
|
|
fillProps: {
|
|
|
|
_object: 'value'
|
|
|
|
}
|
2022-05-17 08:36:11 +00:00
|
|
|
},
|
2022-04-08 03:08:30 +00:00
|
|
|
label: board.string.Dates,
|
|
|
|
icon: board.icon.Card,
|
2022-05-17 08:36:11 +00:00
|
|
|
input: 'any',
|
2022-05-25 06:08:26 +00:00
|
|
|
inline: true,
|
2022-05-17 08:36:11 +00:00
|
|
|
category: board.category.Card,
|
|
|
|
target: board.class.Card,
|
2022-06-24 12:36:08 +00:00
|
|
|
context: { mode: 'context', application: board.app.Board, group: 'create' }
|
2022-04-08 03:08:30 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
board.action.Dates
|
2022-04-08 03:08:30 +00:00
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
2022-04-08 18:12:09 +00:00
|
|
|
{
|
2022-05-17 08:36:11 +00:00
|
|
|
action: view.actionImpl.ShowPopup,
|
|
|
|
actionProps: {
|
|
|
|
component: board.component.CoverActionPopup,
|
2022-05-25 06:08:26 +00:00
|
|
|
element: view.popup.PositionElementAlignment,
|
2022-06-24 12:36:08 +00:00
|
|
|
fillProps: {
|
|
|
|
_object: 'value'
|
|
|
|
}
|
2022-05-17 08:36:11 +00:00
|
|
|
},
|
2022-04-08 18:12:09 +00:00
|
|
|
label: board.string.Cover,
|
2022-04-08 03:08:30 +00:00
|
|
|
icon: board.icon.Card,
|
2022-05-17 08:36:11 +00:00
|
|
|
input: 'any',
|
2022-05-25 06:08:26 +00:00
|
|
|
inline: true,
|
2022-05-17 08:36:11 +00:00
|
|
|
category: board.category.Card,
|
|
|
|
target: board.class.Card,
|
2022-06-24 12:36:08 +00:00
|
|
|
context: { mode: 'context', application: board.app.Board, group: 'create' }
|
2022-04-08 03:08:30 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
board.action.Cover
|
2022-04-08 03:08:30 +00:00
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
2022-04-08 03:08:30 +00:00
|
|
|
{
|
2022-05-17 08:36:11 +00:00
|
|
|
...actionTemplates.move,
|
|
|
|
action: view.actionImpl.ShowPopup,
|
|
|
|
actionProps: {
|
|
|
|
component: board.component.MoveActionPopup,
|
2022-07-05 10:00:47 +00:00
|
|
|
element: view.popup.PositionElementAlignment,
|
|
|
|
fillProps: {
|
|
|
|
_object: 'value'
|
|
|
|
}
|
2022-05-17 08:36:11 +00:00
|
|
|
},
|
|
|
|
input: 'any',
|
2022-05-25 06:08:26 +00:00
|
|
|
inline: true,
|
2022-05-17 08:36:11 +00:00
|
|
|
category: board.category.Card,
|
|
|
|
target: board.class.Card,
|
2022-05-25 06:08:26 +00:00
|
|
|
context: { mode: ['context', 'editor'], application: board.app.Board, group: 'tools' }
|
2022-04-08 03:08:30 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
board.action.Move
|
2022-04-08 03:08:30 +00:00
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
2022-04-08 03:08:30 +00:00
|
|
|
{
|
2022-05-17 08:36:11 +00:00
|
|
|
action: view.actionImpl.ShowPopup,
|
|
|
|
actionProps: {
|
|
|
|
component: board.component.CopyActionPopup,
|
2022-07-05 10:00:47 +00:00
|
|
|
element: view.popup.PositionElementAlignment,
|
|
|
|
fillProps: {
|
|
|
|
_object: 'value'
|
|
|
|
}
|
2022-05-17 08:36:11 +00:00
|
|
|
},
|
2022-04-08 03:08:30 +00:00
|
|
|
label: board.string.Copy,
|
|
|
|
icon: board.icon.Card,
|
2022-05-17 08:36:11 +00:00
|
|
|
input: 'any',
|
2022-05-25 06:08:26 +00:00
|
|
|
inline: true,
|
2022-05-17 08:36:11 +00:00
|
|
|
category: board.category.Card,
|
|
|
|
target: board.class.Card,
|
2022-05-25 06:08:26 +00:00
|
|
|
context: { mode: ['context', 'editor'], application: board.app.Board, group: 'tools' }
|
2022-04-08 03:08:30 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
board.action.Copy
|
2022-04-08 03:08:30 +00:00
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
|
|
|
|
createAction(
|
|
|
|
builder,
|
2022-04-08 03:08:30 +00:00
|
|
|
{
|
2022-05-17 08:36:11 +00:00
|
|
|
action: view.actionImpl.UpdateDocument,
|
|
|
|
actionProps: {
|
|
|
|
key: 'isArchived',
|
|
|
|
value: true,
|
|
|
|
ask: true,
|
|
|
|
label: task.string.Archive,
|
|
|
|
message: task.string.ArchiveConfirm
|
|
|
|
},
|
|
|
|
query: {
|
|
|
|
isArchived: { $nin: [true] }
|
|
|
|
},
|
|
|
|
label: board.string.Archive,
|
2022-05-25 06:08:26 +00:00
|
|
|
icon: view.icon.Archive,
|
2022-05-17 08:36:11 +00:00
|
|
|
input: 'any',
|
|
|
|
category: board.category.Card,
|
|
|
|
target: board.class.Card,
|
2022-05-25 06:08:26 +00:00
|
|
|
context: { mode: ['context', 'editor'], application: board.app.Board, group: 'tools' }
|
2022-04-08 03:08:30 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
board.action.Archive
|
2022-04-08 03:08:30 +00:00
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
2022-04-08 18:12:09 +00:00
|
|
|
{
|
2022-05-17 08:36:11 +00:00
|
|
|
action: view.actionImpl.UpdateDocument,
|
|
|
|
actionProps: {
|
|
|
|
key: 'isArchived',
|
|
|
|
value: false
|
|
|
|
},
|
|
|
|
query: {
|
|
|
|
isArchived: true
|
|
|
|
},
|
2022-04-08 18:12:09 +00:00
|
|
|
label: board.string.SendToBoard,
|
2022-05-17 08:36:11 +00:00
|
|
|
icon: board.icon.Card,
|
|
|
|
input: 'any',
|
|
|
|
category: board.category.Card,
|
|
|
|
target: board.class.Card,
|
2022-05-25 06:08:26 +00:00
|
|
|
context: { mode: ['context', 'editor'], application: board.app.Board, group: 'tools' }
|
2022-04-08 18:12:09 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
board.action.SendToBoard
|
2022-04-08 18:12:09 +00:00
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
|
|
|
|
createAction(
|
|
|
|
builder,
|
2022-04-08 18:12:09 +00:00
|
|
|
{
|
2022-05-17 08:36:11 +00:00
|
|
|
action: view.actionImpl.Delete,
|
|
|
|
query: {
|
|
|
|
isArchived: true
|
|
|
|
},
|
|
|
|
label: view.string.Delete,
|
|
|
|
icon: view.icon.Delete,
|
|
|
|
keyBinding: ['Meta + Backspace', 'Ctrl + Backspace'],
|
|
|
|
category: board.category.Card,
|
|
|
|
input: 'any',
|
|
|
|
target: board.class.Card,
|
2022-05-25 06:08:26 +00:00
|
|
|
context: { mode: ['context', 'editor'], application: board.app.Board, group: 'tools' }
|
2022-04-08 18:12:09 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
board.action.Delete
|
2022-04-08 18:12:09 +00:00
|
|
|
)
|
2022-05-17 08:36:11 +00:00
|
|
|
|
|
|
|
builder.mixin(board.class.Card, core.class.Class, view.mixin.IgnoreActions, {
|
|
|
|
actions: [view.action.Delete, task.action.Move]
|
|
|
|
})
|
2022-06-23 08:54:58 +00:00
|
|
|
builder.mixin<Class<Card>, AutomationSupport<Card>>(
|
|
|
|
board.class.Card,
|
|
|
|
core.class.Class,
|
|
|
|
automation.mixin.AutomationSupport,
|
|
|
|
{
|
|
|
|
attributes: [
|
|
|
|
{
|
|
|
|
name: 'isArchived'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'title'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'description'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
trigger: {
|
|
|
|
action: {
|
|
|
|
mode: ['context', 'editor']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
builder.mixin<Class<Board>, AutomationSupport<Board>>(
|
|
|
|
board.class.Board,
|
|
|
|
core.class.Class,
|
|
|
|
automation.mixin.AutomationSupport,
|
|
|
|
{
|
|
|
|
attributes: [
|
|
|
|
{
|
|
|
|
name: 'name'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'description'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'private'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'archived'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
trigger: {
|
|
|
|
action: {
|
|
|
|
mode: ['context']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2022-05-21 11:20:34 +00:00
|
|
|
|
|
|
|
// TODO: update query when nested query is available
|
|
|
|
createAction(
|
|
|
|
builder,
|
|
|
|
{
|
|
|
|
action: board.actionImpl.ConvertToCard,
|
|
|
|
label: board.string.ConvertToCard,
|
|
|
|
icon: board.icon.Card,
|
|
|
|
category: board.category.Card,
|
|
|
|
query: {
|
|
|
|
attachedToClass: task.class.TodoItem
|
|
|
|
},
|
|
|
|
input: 'any',
|
|
|
|
target: task.class.TodoItem,
|
|
|
|
context: { mode: ['context', 'browser'] }
|
|
|
|
},
|
|
|
|
board.action.ConvertToCard
|
|
|
|
)
|
2022-09-20 06:42:24 +00:00
|
|
|
|
|
|
|
createAction(builder, {
|
|
|
|
...viewTemplates.open,
|
|
|
|
target: board.class.Board,
|
|
|
|
context: {
|
|
|
|
mode: ['browser', 'context'],
|
|
|
|
group: 'create'
|
|
|
|
},
|
|
|
|
action: workbench.actionImpl.Navigate,
|
|
|
|
actionProps: {
|
|
|
|
mode: 'space'
|
|
|
|
}
|
|
|
|
})
|
2022-04-02 03:49:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export { boardOperation } from './migration'
|
|
|
|
export { default } from './plugin'
|