2021-08-07 14:49:14 +00:00
|
|
|
//
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
|
|
|
|
import type { Employee } from '@anticrm/contact'
|
2021-11-30 15:39:08 +00:00
|
|
|
import contact from '@anticrm/contact'
|
2022-02-08 09:02:35 +00:00
|
|
|
import { Arr, Class, Doc, Domain, DOMAIN_MODEL, FindOptions, IndexKind, Ref, Space, Timestamp } from '@anticrm/core'
|
2022-01-18 10:21:32 +00:00
|
|
|
import {
|
|
|
|
Builder,
|
2022-01-21 09:05:55 +00:00
|
|
|
Collection, Hidden, Implements,
|
2022-02-08 09:02:35 +00:00
|
|
|
Index,
|
2022-01-18 10:21:32 +00:00
|
|
|
Mixin,
|
|
|
|
Model,
|
2022-01-21 09:05:55 +00:00
|
|
|
Prop, TypeBoolean,
|
2022-01-18 10:21:32 +00:00
|
|
|
TypeDate,
|
2022-02-07 09:21:32 +00:00
|
|
|
TypeMarkup,
|
2022-01-18 10:21:32 +00:00
|
|
|
TypeRef,
|
|
|
|
TypeString,
|
|
|
|
UX
|
|
|
|
} from '@anticrm/model'
|
2022-01-21 09:05:55 +00:00
|
|
|
import attachment from '@anticrm/model-attachment'
|
2021-11-30 15:39:08 +00:00
|
|
|
import chunter from '@anticrm/model-chunter'
|
2021-12-15 09:04:43 +00:00
|
|
|
import core, { TAttachedDoc, TClass, TDoc, TSpace } from '@anticrm/model-core'
|
2022-01-21 09:05:55 +00:00
|
|
|
import presentation from '@anticrm/model-presentation'
|
2021-08-07 14:49:14 +00:00
|
|
|
import view from '@anticrm/model-view'
|
2021-11-30 15:39:08 +00:00
|
|
|
import workbench from '@anticrm/model-workbench'
|
|
|
|
import type { IntlString } from '@anticrm/platform'
|
2021-12-17 09:04:49 +00:00
|
|
|
import type {
|
2022-01-21 09:05:55 +00:00
|
|
|
DoneState, DoneStateTemplate, Issue, Kanban,
|
|
|
|
KanbanCard, KanbanTemplate, KanbanTemplateSpace, LostState, LostStateTemplate, Project, Sequence, State, StateTemplate, Task,
|
|
|
|
TodoItem, WonState, WonStateTemplate
|
2021-12-17 09:04:49 +00:00
|
|
|
} from '@anticrm/task'
|
2021-12-15 09:04:43 +00:00
|
|
|
import { AnyComponent } from '@anticrm/ui'
|
2022-01-21 09:05:55 +00:00
|
|
|
import type { ActionTarget } from '@anticrm/view'
|
|
|
|
import task from './plugin'
|
2021-08-07 14:49:14 +00:00
|
|
|
|
2022-01-21 09:05:55 +00:00
|
|
|
export { createDeps, createKanbanTemplate } from './creation'
|
|
|
|
export { taskOperation } from './migration'
|
2021-12-15 09:04:43 +00:00
|
|
|
export { default } from './plugin'
|
|
|
|
|
|
|
|
export const DOMAIN_TASK = 'task' as Domain
|
|
|
|
export const DOMAIN_STATE = 'state' as Domain
|
|
|
|
export const DOMAIN_KANBAN = 'kanban' as Domain
|
2021-12-21 09:09:46 +00:00
|
|
|
@Model(task.class.State, core.class.Doc, DOMAIN_STATE, [task.interface.DocWithRank])
|
2022-01-19 09:09:08 +00:00
|
|
|
@UX(task.string.TaskState, task.icon.TaskState, undefined, 'rank')
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TState extends TDoc implements State {
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.TaskStateTitle)
|
2021-12-15 09:04:43 +00:00
|
|
|
title!: string
|
|
|
|
|
2022-01-14 09:04:56 +00:00
|
|
|
color!: number
|
2021-12-17 09:08:37 +00:00
|
|
|
|
|
|
|
declare rank: string
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 09:09:46 +00:00
|
|
|
@Model(task.class.DoneState, core.class.Doc, DOMAIN_STATE, [task.interface.DocWithRank])
|
2022-01-19 09:09:08 +00:00
|
|
|
@UX(task.string.TaskStateDone, task.icon.TaskState, undefined, 'title')
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TDoneState extends TDoc implements DoneState {
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.TaskStateTitle)
|
2021-12-15 09:04:43 +00:00
|
|
|
title!: string
|
2021-12-17 09:08:37 +00:00
|
|
|
|
|
|
|
declare rank: string
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
2021-12-22 09:25:16 +00:00
|
|
|
@Model(task.class.WonState, task.class.DoneState)
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TWonState extends TDoneState implements WonState {}
|
|
|
|
|
2021-12-22 09:25:16 +00:00
|
|
|
@Model(task.class.LostState, task.class.DoneState)
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TLostState extends TDoneState implements LostState {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*
|
|
|
|
* No domain is specified, since pure Tasks could not exists
|
|
|
|
*/
|
2021-12-21 09:09:46 +00:00
|
|
|
@Model(task.class.Task, core.class.AttachedDoc, DOMAIN_TASK, [task.interface.DocWithRank])
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TTask extends TAttachedDoc implements Task {
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeRef(task.class.State), task.string.TaskState)
|
2021-12-15 09:04:43 +00:00
|
|
|
state!: Ref<State>
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeRef(task.class.DoneState), task.string.TaskStateDone)
|
2021-12-15 09:04:43 +00:00
|
|
|
doneState!: Ref<DoneState> | null
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.TaskNumber)
|
2021-12-15 09:04:43 +00:00
|
|
|
number!: number
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
// @Prop(TypeRef(contact.class.Employee), task.string.TaskAssignee)
|
2021-12-15 09:04:43 +00:00
|
|
|
assignee!: Ref<Employee> | null
|
2021-12-17 09:08:37 +00:00
|
|
|
|
|
|
|
declare rank: string
|
2021-12-20 10:18:29 +00:00
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(Collection(task.class.TodoItem), task.string.Todos)
|
2021-12-20 10:18:29 +00:00
|
|
|
todoItems!: number
|
|
|
|
}
|
|
|
|
|
|
|
|
@Model(task.class.TodoItem, core.class.AttachedDoc, DOMAIN_TASK)
|
2022-01-19 09:09:08 +00:00
|
|
|
@UX(task.string.Todo)
|
2021-12-20 10:18:29 +00:00
|
|
|
export class TTodoItem extends TAttachedDoc implements TodoItem {
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.TodoName, task.icon.Task)
|
2022-02-08 09:02:35 +00:00
|
|
|
@Index(IndexKind.FullText)
|
2021-12-20 10:18:29 +00:00
|
|
|
name!: string
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeBoolean(), task.string.TaskDone)
|
2021-12-20 10:18:29 +00:00
|
|
|
done!: boolean
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeDate(), task.string.TaskDueTo)
|
2021-12-20 10:18:29 +00:00
|
|
|
dueTo?: Timestamp
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Model(task.class.SpaceWithStates, core.class.Space)
|
2021-12-17 09:04:49 +00:00
|
|
|
export class TSpaceWithStates extends TSpace {}
|
2021-12-15 09:04:43 +00:00
|
|
|
|
|
|
|
@Model(task.class.Project, task.class.SpaceWithStates)
|
2022-01-19 09:09:08 +00:00
|
|
|
@UX(task.string.ProjectName, task.icon.Task)
|
2021-12-02 13:12:16 +00:00
|
|
|
export class TProject extends TSpaceWithStates implements Project {}
|
2021-08-07 14:49:14 +00:00
|
|
|
|
2021-12-15 09:04:43 +00:00
|
|
|
@Model(task.class.Issue, task.class.Task, DOMAIN_TASK)
|
2021-12-20 09:06:31 +00:00
|
|
|
@UX('Task' as IntlString, task.icon.Task, 'Task' as IntlString, 'number')
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TIssue extends TTask implements Issue {
|
|
|
|
// We need to declare, to provide property with label
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeRef(core.class.Doc), task.string.TaskParent)
|
2021-12-15 09:04:43 +00:00
|
|
|
declare attachedTo: Ref<Doc>
|
2021-11-30 15:39:08 +00:00
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.IssueName)
|
2022-02-08 09:02:35 +00:00
|
|
|
@Index(IndexKind.FullText)
|
2021-11-30 15:39:08 +00:00
|
|
|
name!: string
|
2021-08-07 14:49:14 +00:00
|
|
|
|
2022-02-07 09:21:32 +00:00
|
|
|
@Prop(TypeMarkup(), task.string.TaskDescription)
|
2022-02-08 09:02:35 +00:00
|
|
|
@Index(IndexKind.FullText)
|
2021-08-07 14:49:14 +00:00
|
|
|
description!: string
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(Collection(chunter.class.Comment), task.string.TaskComments)
|
2021-11-30 15:39:08 +00:00
|
|
|
comments!: number
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(Collection(attachment.class.Attachment), task.string.TaskAttachments)
|
2021-12-02 13:12:16 +00:00
|
|
|
attachments!: number
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.TaskLabels)
|
2022-02-08 09:02:35 +00:00
|
|
|
@Index(IndexKind.FullText)
|
2021-11-30 15:39:08 +00:00
|
|
|
labels!: string
|
2021-12-15 09:04:43 +00:00
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeRef(contact.class.Employee), task.string.TaskAssignee)
|
2021-12-15 09:04:43 +00:00
|
|
|
declare assignee: Ref<Employee> | null
|
|
|
|
}
|
|
|
|
|
|
|
|
@Mixin(task.mixin.KanbanCard, core.class.Class)
|
|
|
|
export class TKanbanCard extends TClass implements KanbanCard {
|
|
|
|
card!: AnyComponent
|
|
|
|
}
|
|
|
|
|
|
|
|
@Model(task.class.Kanban, core.class.Doc, DOMAIN_KANBAN)
|
|
|
|
export class TKanban extends TDoc implements Kanban {
|
|
|
|
states!: Arr<Ref<State>>
|
|
|
|
doneStates!: Arr<Ref<DoneState>>
|
|
|
|
attachedTo!: Ref<Space>
|
|
|
|
}
|
|
|
|
|
|
|
|
@Model(task.class.KanbanTemplateSpace, core.class.Space, DOMAIN_MODEL)
|
|
|
|
export class TKanbanTemplateSpace extends TSpace implements KanbanTemplateSpace {
|
|
|
|
icon!: AnyComponent
|
|
|
|
}
|
|
|
|
|
2021-12-21 09:09:46 +00:00
|
|
|
@Model(task.class.StateTemplate, core.class.AttachedDoc, DOMAIN_KANBAN, [task.interface.DocWithRank])
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TStateTemplate extends TAttachedDoc implements StateTemplate {
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.StateTemplateTitle)
|
2021-12-15 09:04:43 +00:00
|
|
|
title!: string
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.StateTemplateColor)
|
2022-01-14 09:04:56 +00:00
|
|
|
color!: number
|
2021-12-17 09:08:37 +00:00
|
|
|
|
|
|
|
declare rank: string
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 09:09:46 +00:00
|
|
|
@Model(task.class.DoneStateTemplate, core.class.AttachedDoc, DOMAIN_KANBAN, [task.interface.DocWithRank])
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TDoneStateTemplate extends TAttachedDoc implements DoneStateTemplate {
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.StateTemplateTitle)
|
2021-12-15 09:04:43 +00:00
|
|
|
title!: string
|
2021-12-17 09:08:37 +00:00
|
|
|
|
|
|
|
declare rank: string
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
2021-12-22 09:25:16 +00:00
|
|
|
@Model(task.class.WonStateTemplate, task.class.DoneStateTemplate)
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TWonStateTemplate extends TDoneStateTemplate implements WonStateTemplate {}
|
|
|
|
|
2021-12-22 09:25:16 +00:00
|
|
|
@Model(task.class.LostStateTemplate, task.class.DoneStateTemplate)
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TLostStateTemplate extends TDoneStateTemplate implements LostStateTemplate {}
|
|
|
|
|
|
|
|
@Model(task.class.KanbanTemplate, core.class.Doc, DOMAIN_KANBAN)
|
|
|
|
export class TKanbanTemplate extends TDoc implements KanbanTemplate {
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.KanbanTemplateTitle)
|
2022-02-08 09:02:35 +00:00
|
|
|
@Index(IndexKind.FullText)
|
2021-12-15 09:04:43 +00:00
|
|
|
title!: string
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(Collection(task.class.StateTemplate), task.string.States)
|
2021-12-15 09:04:43 +00:00
|
|
|
statesC!: number
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(Collection(task.class.DoneStateTemplate), task.string.DoneStates)
|
2021-12-15 09:04:43 +00:00
|
|
|
doneStatesC!: number
|
|
|
|
}
|
|
|
|
|
|
|
|
@Model(task.class.Sequence, core.class.Doc, DOMAIN_KANBAN)
|
|
|
|
export class TSequence extends TDoc implements Sequence {
|
|
|
|
attachedTo!: Ref<Class<Doc>>
|
|
|
|
sequence!: number
|
2021-08-07 14:49:14 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 09:09:46 +00:00
|
|
|
@Implements(task.interface.DocWithRank)
|
|
|
|
export class TDocWithRank extends TDoc {
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.Rank)
|
2021-12-27 12:01:52 +00:00
|
|
|
@Hidden()
|
2021-12-21 09:09:46 +00:00
|
|
|
rank!: string
|
|
|
|
}
|
|
|
|
|
2021-08-07 14:49:14 +00:00
|
|
|
export function createModel (builder: Builder): void {
|
2021-12-15 09:04:43 +00:00
|
|
|
builder.createModel(
|
2021-12-21 09:09:46 +00:00
|
|
|
TDocWithRank,
|
2021-12-15 09:04:43 +00:00
|
|
|
TState,
|
|
|
|
TDoneState,
|
|
|
|
TWonState,
|
|
|
|
TLostState,
|
|
|
|
TKanbanCard,
|
|
|
|
TKanban,
|
|
|
|
TKanbanTemplateSpace,
|
|
|
|
TStateTemplate,
|
|
|
|
TDoneStateTemplate,
|
|
|
|
TWonStateTemplate,
|
|
|
|
TLostStateTemplate,
|
|
|
|
TKanbanTemplate,
|
|
|
|
TSequence,
|
|
|
|
TTask,
|
|
|
|
TSpaceWithStates,
|
|
|
|
TProject,
|
2021-12-20 10:18:29 +00:00
|
|
|
TIssue,
|
|
|
|
TTodoItem
|
2021-12-17 09:04:49 +00:00
|
|
|
)
|
2021-08-07 14:49:14 +00:00
|
|
|
builder.mixin(task.class.Project, core.class.Class, workbench.mixin.SpaceView, {
|
|
|
|
view: {
|
2021-12-15 09:04:43 +00:00
|
|
|
class: task.class.Issue,
|
2021-08-07 14:49:14 +00:00
|
|
|
createItemDialog: task.component.CreateTask
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2021-12-21 09:36:50 +00:00
|
|
|
builder.createDoc(
|
|
|
|
view.class.ViewletDescriptor,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
2022-01-19 09:09:08 +00:00
|
|
|
label: task.string.States,
|
2021-12-22 09:03:28 +00:00
|
|
|
icon: task.icon.ManageStatuses,
|
2021-12-21 09:36:50 +00:00
|
|
|
component: task.component.StatusTableView
|
|
|
|
},
|
|
|
|
task.viewlet.StatusTable
|
|
|
|
)
|
|
|
|
|
2021-12-17 09:04:49 +00:00
|
|
|
builder.createDoc(
|
|
|
|
workbench.class.Application,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
label: task.string.ApplicationLabelTask,
|
|
|
|
icon: task.icon.Task,
|
|
|
|
hidden: false,
|
|
|
|
navigatorModel: {
|
|
|
|
spaces: [
|
|
|
|
{
|
|
|
|
label: task.string.Projects,
|
|
|
|
spaceClass: task.class.Project,
|
|
|
|
addSpaceLabel: task.string.CreateProject,
|
|
|
|
createComponent: task.component.CreateProject
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
task.app.Tasks
|
|
|
|
)
|
2021-11-30 15:39:08 +00:00
|
|
|
|
|
|
|
builder.createDoc(view.class.Viewlet, core.space.Model, {
|
2021-12-15 09:04:43 +00:00
|
|
|
attachTo: task.class.Issue,
|
2021-11-30 15:39:08 +00:00
|
|
|
descriptor: view.viewlet.Table,
|
|
|
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
|
|
options: {
|
2022-01-31 09:06:30 +00:00
|
|
|
lookup: { assignee: contact.class.Employee }
|
2021-11-30 15:39:08 +00:00
|
|
|
} as FindOptions<Doc>,
|
|
|
|
config: [
|
|
|
|
'',
|
|
|
|
'name',
|
|
|
|
'$lookup.assignee',
|
2021-12-20 09:06:31 +00:00
|
|
|
{ presenter: attachment.component.AttachmentsPresenter, label: 'Files', sortingKey: 'attachments' },
|
|
|
|
{ presenter: chunter.component.CommentsPresenter, label: 'Comments', sortingKey: 'comments' },
|
2021-11-30 15:39:08 +00:00
|
|
|
'modifiedOn'
|
|
|
|
]
|
|
|
|
})
|
|
|
|
|
2021-12-15 09:04:43 +00:00
|
|
|
builder.mixin(task.class.Issue, core.class.Class, view.mixin.AttributePresenter, {
|
2021-11-30 15:39:08 +00:00
|
|
|
presenter: task.component.TaskPresenter
|
2021-08-07 14:49:14 +00:00
|
|
|
})
|
2021-11-30 15:39:08 +00:00
|
|
|
|
2021-12-15 09:04:43 +00:00
|
|
|
builder.mixin(task.class.Issue, core.class.Class, view.mixin.ObjectEditor, {
|
2021-12-17 09:04:49 +00:00
|
|
|
editor: task.component.EditIssue
|
2021-11-30 15:39:08 +00:00
|
|
|
})
|
|
|
|
|
2022-01-18 10:21:32 +00:00
|
|
|
builder.mixin(task.class.Task, core.class.Class, view.mixin.ObjectEditorHeader, {
|
|
|
|
editor: task.component.TaskHeader
|
|
|
|
})
|
|
|
|
|
2021-12-02 13:12:16 +00:00
|
|
|
builder.createDoc(view.class.Viewlet, core.space.Model, {
|
2021-12-15 09:04:43 +00:00
|
|
|
attachTo: task.class.Issue,
|
|
|
|
descriptor: task.viewlet.Kanban,
|
2021-12-02 13:12:16 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
|
|
options: {
|
|
|
|
lookup: {
|
2022-01-31 09:06:30 +00:00
|
|
|
state: task.class.State,
|
|
|
|
assignee: contact.class.Employee
|
2021-12-02 13:12:16 +00:00
|
|
|
}
|
|
|
|
} as FindOptions<Doc>, // TODO: fix
|
2021-12-15 09:04:43 +00:00
|
|
|
config: [
|
|
|
|
// '$lookup.attachedTo',
|
|
|
|
'$lookup.state',
|
2021-12-17 09:04:49 +00:00
|
|
|
'$lookup.assignee'
|
|
|
|
]
|
2021-12-02 13:12:16 +00:00
|
|
|
})
|
|
|
|
|
2021-12-15 09:04:43 +00:00
|
|
|
builder.mixin(task.class.Issue, core.class.Class, task.mixin.KanbanCard, {
|
2021-12-02 13:12:16 +00:00
|
|
|
card: task.component.KanbanCard
|
|
|
|
})
|
|
|
|
|
2021-12-17 09:04:49 +00:00
|
|
|
builder.createDoc(
|
|
|
|
task.class.Project,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
name: 'public',
|
|
|
|
description: 'Public tasks',
|
|
|
|
private: false,
|
2021-12-21 09:08:22 +00:00
|
|
|
archived: false,
|
2021-12-17 09:04:49 +00:00
|
|
|
members: []
|
|
|
|
},
|
|
|
|
task.space.TasksPublic
|
|
|
|
)
|
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
task.class.KanbanTemplateSpace,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
name: 'Projects',
|
|
|
|
description: 'Manage project statuses',
|
|
|
|
members: [],
|
|
|
|
private: false,
|
2021-12-21 09:08:22 +00:00
|
|
|
archived: false,
|
2021-12-17 09:04:49 +00:00
|
|
|
icon: task.component.TemplatesIcon
|
|
|
|
},
|
|
|
|
task.space.ProjectTemplates
|
|
|
|
)
|
2021-12-14 09:24:14 +00:00
|
|
|
|
2021-12-17 09:04:49 +00:00
|
|
|
builder.createDoc(
|
|
|
|
view.class.Action,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
2022-01-19 09:09:08 +00:00
|
|
|
label: task.string.CreateTask,
|
2021-12-17 09:04:49 +00:00
|
|
|
icon: task.icon.Task,
|
|
|
|
action: task.actionImpl.CreateTask
|
|
|
|
},
|
|
|
|
task.action.CreateTask
|
|
|
|
)
|
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
view.class.Action,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
2022-01-19 09:09:08 +00:00
|
|
|
label: task.string.EditStates,
|
2021-12-22 09:03:28 +00:00
|
|
|
icon: view.icon.Statuses,
|
2021-12-17 09:04:49 +00:00
|
|
|
action: task.actionImpl.EditStatuses
|
|
|
|
},
|
|
|
|
task.action.EditStatuses
|
|
|
|
)
|
2021-12-15 09:04:43 +00:00
|
|
|
|
2021-12-21 09:08:22 +00:00
|
|
|
builder.createDoc(
|
|
|
|
view.class.Action,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
2022-01-19 09:09:08 +00:00
|
|
|
label: task.string.Archive,
|
2021-12-21 09:08:22 +00:00
|
|
|
icon: view.icon.Archive,
|
|
|
|
action: task.actionImpl.ArchiveSpace
|
|
|
|
},
|
|
|
|
task.action.ArchiveSpace
|
|
|
|
)
|
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
view.class.Action,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
2022-01-19 09:09:08 +00:00
|
|
|
label: task.string.Unarchive,
|
2021-12-21 09:08:22 +00:00
|
|
|
icon: view.icon.Archive,
|
|
|
|
action: task.actionImpl.UnarchiveSpace
|
|
|
|
},
|
|
|
|
task.action.UnarchiveSpace
|
|
|
|
)
|
|
|
|
|
2021-12-15 09:04:43 +00:00
|
|
|
builder.createDoc(view.class.ActionTarget, core.space.Model, {
|
|
|
|
target: task.class.SpaceWithStates,
|
2021-12-21 09:08:22 +00:00
|
|
|
action: task.action.EditStatuses,
|
|
|
|
query: {
|
|
|
|
archived: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2021-12-15 09:04:43 +00:00
|
|
|
builder.mixin(task.class.State, core.class.Class, view.mixin.AttributeEditor, {
|
|
|
|
editor: task.component.StateEditor
|
|
|
|
})
|
|
|
|
|
|
|
|
builder.mixin(task.class.State, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: task.component.StatePresenter
|
|
|
|
})
|
|
|
|
|
2022-01-31 09:07:56 +00:00
|
|
|
builder.mixin(task.class.DoneState, core.class.Class, view.mixin.AttributeEditor, {
|
|
|
|
editor: task.component.DoneStateEditor
|
|
|
|
})
|
|
|
|
|
|
|
|
builder.mixin(task.class.DoneState, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: task.component.DoneStatePresenter
|
|
|
|
})
|
|
|
|
|
2021-12-17 09:04:49 +00:00
|
|
|
builder.createDoc(
|
|
|
|
view.class.ViewletDescriptor,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
2022-01-19 09:09:08 +00:00
|
|
|
label: task.string.Kanban,
|
2021-12-17 09:04:49 +00:00
|
|
|
icon: task.icon.Kanban,
|
|
|
|
component: task.component.KanbanView
|
|
|
|
},
|
|
|
|
task.viewlet.Kanban
|
|
|
|
)
|
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
core.class.Space,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
name: 'Sequences',
|
|
|
|
description: 'Internal space to store sequence numbers',
|
|
|
|
members: [],
|
2021-12-21 09:08:22 +00:00
|
|
|
private: false,
|
|
|
|
archived: false
|
2021-12-17 09:04:49 +00:00
|
|
|
},
|
|
|
|
task.space.Sequence
|
|
|
|
)
|
2021-12-17 10:00:18 +00:00
|
|
|
|
|
|
|
builder.mixin(task.class.DoneState, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: task.component.DoneStatePresenter
|
|
|
|
})
|
2021-12-20 10:18:29 +00:00
|
|
|
|
|
|
|
builder.mixin(task.class.TodoItem, core.class.Class, view.mixin.AttributeEditor, {
|
|
|
|
editor: task.component.Todos
|
|
|
|
})
|
|
|
|
|
|
|
|
builder.mixin(task.class.TodoItem, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: task.component.TodoItemPresenter
|
|
|
|
})
|
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
view.class.Action,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
2022-01-19 09:09:08 +00:00
|
|
|
label: task.string.MarkAsDone,
|
2021-12-20 10:18:29 +00:00
|
|
|
icon: task.icon.TodoCheck,
|
|
|
|
action: task.actionImpl.TodoItemMarkDone
|
|
|
|
},
|
|
|
|
task.action.TodoItemMarkDone
|
|
|
|
)
|
|
|
|
|
|
|
|
builder.createDoc(
|
|
|
|
view.class.Action,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
2022-01-19 09:09:08 +00:00
|
|
|
label: task.string.MarkAsUndone,
|
2021-12-20 10:18:29 +00:00
|
|
|
icon: task.icon.TodoUnCheck,
|
|
|
|
action: task.actionImpl.TodoItemMarkUnDone
|
|
|
|
},
|
|
|
|
task.action.TodoItemMarkUnDone
|
|
|
|
)
|
|
|
|
|
|
|
|
builder.createDoc<ActionTarget<TodoItem>>(view.class.ActionTarget, core.space.Model, {
|
|
|
|
target: task.class.TodoItem,
|
|
|
|
action: task.action.TodoItemMarkDone,
|
|
|
|
query: {
|
|
|
|
done: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
builder.createDoc(view.class.ActionTarget, core.space.Model, {
|
|
|
|
target: task.class.TodoItem,
|
|
|
|
action: task.action.TodoItemMarkUnDone,
|
|
|
|
query: {
|
|
|
|
done: true
|
|
|
|
}
|
|
|
|
})
|
2021-12-07 18:45:11 +00:00
|
|
|
|
2022-01-21 09:05:55 +00:00
|
|
|
builder.createDoc(presentation.class.ObjectSearchCategory, core.space.Model, {
|
|
|
|
icon: task.icon.Task,
|
|
|
|
label: task.string.SearchTask,
|
|
|
|
query: task.completion.IssueQuery
|
|
|
|
}, task.completion.IssueCategory)
|
2022-01-25 08:50:38 +00:00
|
|
|
|
|
|
|
builder.createDoc(view.class.ActionTarget, core.space.Model, {
|
|
|
|
target: task.class.Task,
|
|
|
|
action: view.action.Move
|
|
|
|
})
|
2022-01-21 09:05:55 +00:00
|
|
|
}
|