2021-08-07 14:49:14 +00:00
|
|
|
//
|
2022-04-16 02:59:50 +00:00
|
|
|
// Copyright © 2022 Hardcore Engineering Inc.
|
2021-08-07 14:49:14 +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.
|
|
|
|
//
|
|
|
|
|
2022-09-21 08:08:25 +00:00
|
|
|
import type { Employee } from '@hcengineering/contact'
|
|
|
|
import contact from '@hcengineering/contact'
|
2023-04-04 06:11:49 +00:00
|
|
|
import { Arr, Attribute, Class, Doc, Domain, IndexKind, Ref, Space, Status, Timestamp } from '@hcengineering/core'
|
2022-01-18 10:21:32 +00:00
|
|
|
import {
|
|
|
|
Builder,
|
2022-04-16 02:59:50 +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-04-16 02:59:50 +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
|
2022-09-21 08:08:25 +00:00
|
|
|
} from '@hcengineering/model'
|
2023-04-04 06:11:49 +00:00
|
|
|
import core, { TAttachedDoc, TClass, TDoc, TSpace, TStatus } from '@hcengineering/model-core'
|
2023-04-25 07:34:10 +00:00
|
|
|
import view, { createAction, template, actionTemplates as viewTemplates } from '@hcengineering/model-view'
|
2023-04-29 15:46:13 +00:00
|
|
|
import {} from '@hcengineering/notification'
|
2022-09-21 08:08:25 +00:00
|
|
|
import { IntlString } from '@hcengineering/platform'
|
|
|
|
import tags from '@hcengineering/tags'
|
2022-05-06 17:48:43 +00:00
|
|
|
import {
|
2022-04-16 02:59:50 +00:00
|
|
|
DoneState,
|
|
|
|
DoneStateTemplate,
|
|
|
|
Kanban,
|
|
|
|
KanbanCard,
|
|
|
|
KanbanTemplate,
|
|
|
|
KanbanTemplateSpace,
|
|
|
|
LostState,
|
|
|
|
LostStateTemplate,
|
|
|
|
Sequence,
|
|
|
|
State,
|
|
|
|
StateTemplate,
|
|
|
|
Task,
|
|
|
|
TodoItem,
|
|
|
|
WonState,
|
|
|
|
WonStateTemplate
|
2022-09-21 08:08:25 +00:00
|
|
|
} from '@hcengineering/task'
|
|
|
|
import { AnyComponent } from '@hcengineering/ui'
|
|
|
|
import { ViewAction } from '@hcengineering/view'
|
2022-01-21 09:05:55 +00:00
|
|
|
import task from './plugin'
|
2021-08-07 14:49:14 +00:00
|
|
|
|
2023-04-25 07:34:10 +00:00
|
|
|
export { taskId } from '@hcengineering/task'
|
2022-05-04 08:08:12 +00:00
|
|
|
export { createKanbanTemplate, createSequence, 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_KANBAN = 'kanban' as Domain
|
2023-04-04 06:11:49 +00:00
|
|
|
@Model(task.class.State, core.class.Status)
|
2022-01-19 09:09:08 +00:00
|
|
|
@UX(task.string.TaskState, task.icon.TaskState, undefined, 'rank')
|
2023-04-04 06:11:49 +00:00
|
|
|
export class TState extends TStatus implements State {
|
|
|
|
isArchived!: boolean
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
@Model(task.class.DoneState, core.class.Status)
|
|
|
|
@UX(task.string.TaskStateDone, task.icon.TaskState, undefined, 'name')
|
|
|
|
export class TDoneState extends TStatus implements DoneState {}
|
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
|
|
|
|
*/
|
2023-04-04 06:11:49 +00:00
|
|
|
@Model(task.class.Task, core.class.AttachedDoc, DOMAIN_TASK)
|
2022-03-22 09:09:58 +00:00
|
|
|
@UX(task.string.Task, task.icon.Task, task.string.Task)
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TTask extends TAttachedDoc implements Task {
|
2023-04-04 06:11:49 +00:00
|
|
|
@Prop(TypeRef(task.class.State), task.string.TaskState, { _id: task.attribute.State })
|
2022-11-02 08:50:14 +00:00
|
|
|
state!: Ref<State>
|
2021-12-15 09:04:43 +00:00
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
@Prop(TypeRef(task.class.DoneState), task.string.TaskStateDone, { _id: task.attribute.DoneState })
|
2022-11-02 08:50:14 +00:00
|
|
|
doneState!: Ref<DoneState> | null
|
2021-12-15 09:04:43 +00:00
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.TaskNumber)
|
2023-01-24 13:42:47 +00:00
|
|
|
@Index(IndexKind.FullText)
|
2023-01-31 17:18:07 +00:00
|
|
|
@Hidden()
|
2022-11-02 08:50:14 +00:00
|
|
|
number!: number
|
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
|
|
|
assignee!: Ref<Employee> | null
|
2021-12-17 09:08:37 +00:00
|
|
|
|
2023-05-12 05:42:15 +00:00
|
|
|
@Prop(TypeDate(), task.string.DueDate, { editor: task.component.DueDateEditor })
|
2022-11-02 08:50:14 +00:00
|
|
|
dueDate!: Timestamp | null
|
2022-05-23 07:28:41 +00:00
|
|
|
|
|
|
|
@Prop(TypeDate(), task.string.StartDate)
|
2022-11-02 08:50:14 +00:00
|
|
|
startDate!: Timestamp | null
|
2022-05-23 07:28:41 +00:00
|
|
|
|
2021-12-17 09:08:37 +00:00
|
|
|
declare rank: string
|
2021-12-20 10:18:29 +00:00
|
|
|
|
2022-05-27 16:43:11 +00:00
|
|
|
@Prop(Collection(tags.class.TagReference, task.string.TaskLabels), task.string.TaskLabels)
|
2022-11-02 08:50:14 +00:00
|
|
|
labels!: number
|
2021-12-20 10:18:29 +00:00
|
|
|
}
|
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
@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-05-04 13:52:31 +00:00
|
|
|
@Prop(TypeMarkup(), task.string.TodoName, task.icon.Task)
|
2022-02-08 09:02:35 +00:00
|
|
|
@Index(IndexKind.FullText)
|
2022-11-02 08:50:14 +00:00
|
|
|
name!: string
|
2021-12-20 10:18:29 +00:00
|
|
|
|
2022-05-04 13:52:31 +00:00
|
|
|
@Prop(TypeRef(contact.class.Employee), task.string.TaskAssignee)
|
2022-11-02 08:50:14 +00:00
|
|
|
assignee!: Ref<Employee> | null
|
2022-05-04 13:52:31 +00:00
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeBoolean(), task.string.TaskDone)
|
2022-11-02 08:50:14 +00:00
|
|
|
done!: boolean
|
2021-12-20 10:18:29 +00:00
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeDate(), task.string.TaskDueTo)
|
2022-11-02 08:50:14 +00:00
|
|
|
dueTo!: Timestamp | null
|
2022-05-04 13:52:31 +00:00
|
|
|
|
|
|
|
@Prop(Collection(task.class.TodoItem), task.string.Todos)
|
2022-11-02 08:50:14 +00:00
|
|
|
items!: number
|
2022-05-26 09:36:44 +00:00
|
|
|
|
|
|
|
declare rank: string
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@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>
|
|
|
|
}
|
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
@Model(task.class.SpaceWithStates, core.class.Space)
|
|
|
|
export class TSpaceWithStates extends TSpace {}
|
|
|
|
|
2023-03-02 03:31:47 +00:00
|
|
|
@Model(task.class.KanbanTemplateSpace, core.class.Space)
|
|
|
|
export class TKanbanTemplateSpace extends TSpace implements KanbanTemplateSpace {
|
2022-02-23 16:10:11 +00:00
|
|
|
name!: IntlString
|
|
|
|
description!: IntlString
|
2021-12-15 09:04:43 +00:00
|
|
|
icon!: AnyComponent
|
2022-11-09 11:24:02 +00:00
|
|
|
editor!: AnyComponent
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
@Model(task.class.StateTemplate, core.class.AttachedDoc, DOMAIN_KANBAN)
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TStateTemplate extends TAttachedDoc implements StateTemplate {
|
2023-04-04 06:11:49 +00:00
|
|
|
// We attach to attribute, so we could distinguish between
|
|
|
|
ofAttribute!: Ref<Attribute<Status>>
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.StateTemplateTitle)
|
2023-04-04 06:11:49 +00:00
|
|
|
name!: string
|
2021-12-15 09:04:43 +00:00
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.StateTemplateColor)
|
2022-11-02 08:50:14 +00:00
|
|
|
color!: number
|
2021-12-17 09:08:37 +00:00
|
|
|
|
|
|
|
declare rank: string
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
@Model(task.class.DoneStateTemplate, core.class.AttachedDoc, DOMAIN_KANBAN)
|
2021-12-15 09:04:43 +00:00
|
|
|
export class TDoneStateTemplate extends TAttachedDoc implements DoneStateTemplate {
|
2023-04-04 06:11:49 +00:00
|
|
|
// We attach to attribute, so we could distinguish between
|
|
|
|
ofAttribute!: Ref<Attribute<Status>>
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(TypeString(), task.string.StateTemplateTitle)
|
2023-04-04 06:11:49 +00:00
|
|
|
name!: 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)
|
2022-11-02 08:50:14 +00:00
|
|
|
title!: string
|
2021-12-15 09:04:43 +00:00
|
|
|
|
2022-11-09 11:24:02 +00:00
|
|
|
@Prop(TypeString(), task.string.Description)
|
|
|
|
description!: string
|
|
|
|
|
|
|
|
@Prop(TypeString(), task.string.ShortDescription)
|
|
|
|
shortDescription!: string
|
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(Collection(task.class.StateTemplate), task.string.States)
|
2022-11-02 08:50:14 +00:00
|
|
|
statesC!: number
|
2021-12-15 09:04:43 +00:00
|
|
|
|
2022-01-19 09:09:08 +00:00
|
|
|
@Prop(Collection(task.class.DoneStateTemplate), task.string.DoneStates)
|
2022-11-02 08:50:14 +00:00
|
|
|
doneStatesC!: number
|
2021-12-15 09:04:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@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()
|
2022-11-02 08:50:14 +00:00
|
|
|
rank!: string
|
2021-12-21 09:09:46 +00:00
|
|
|
}
|
|
|
|
|
2022-05-04 08:08:12 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const actionTemplates = template({
|
|
|
|
editStatus: {
|
|
|
|
label: task.string.EditStates,
|
|
|
|
icon: view.icon.Statuses,
|
|
|
|
action: task.actionImpl.EditStatuses,
|
|
|
|
input: 'focus',
|
|
|
|
category: task.category.Task
|
|
|
|
},
|
|
|
|
archiveSpace: {
|
|
|
|
label: task.string.Archive,
|
|
|
|
icon: view.icon.Archive,
|
|
|
|
action: view.actionImpl.UpdateDocument as ViewAction,
|
|
|
|
actionProps: {
|
|
|
|
key: 'archived',
|
|
|
|
value: true,
|
|
|
|
ask: true,
|
|
|
|
label: task.string.Archive,
|
|
|
|
message: task.string.ArchiveConfirm
|
|
|
|
},
|
2022-06-30 03:36:15 +00:00
|
|
|
input: 'any',
|
2022-05-04 08:08:12 +00:00
|
|
|
category: task.category.Task,
|
|
|
|
query: {
|
|
|
|
archived: false
|
|
|
|
},
|
|
|
|
context: {
|
2022-06-24 12:36:08 +00:00
|
|
|
mode: ['context', 'browser'],
|
|
|
|
group: 'tools'
|
2023-05-10 11:41:21 +00:00
|
|
|
},
|
|
|
|
override: [view.action.Archive, view.action.Delete]
|
2022-05-04 08:08:12 +00:00
|
|
|
},
|
|
|
|
unarchiveSpace: {
|
|
|
|
label: task.string.Unarchive,
|
|
|
|
icon: view.icon.Archive,
|
|
|
|
action: view.actionImpl.UpdateDocument as ViewAction,
|
|
|
|
actionProps: {
|
|
|
|
key: 'archived',
|
|
|
|
ask: true,
|
|
|
|
value: false,
|
|
|
|
label: task.string.Unarchive,
|
|
|
|
message: task.string.UnarchiveConfirm
|
|
|
|
},
|
2022-06-30 03:36:15 +00:00
|
|
|
input: 'any',
|
2022-05-04 08:08:12 +00:00
|
|
|
category: task.category.Task,
|
|
|
|
query: {
|
|
|
|
archived: true
|
|
|
|
},
|
|
|
|
context: {
|
2022-06-24 12:36:08 +00:00
|
|
|
mode: ['context', 'browser'],
|
|
|
|
group: 'tools'
|
2022-05-04 08:08:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
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,
|
2023-04-04 06:11:49 +00:00
|
|
|
TTodoItem,
|
|
|
|
TSpaceWithStates
|
2021-12-17 09:04:49 +00:00
|
|
|
)
|
2021-08-07 14:49:14 +00:00
|
|
|
|
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,
|
2022-11-09 11:24:02 +00:00
|
|
|
icon: task.icon.ManageTemplates,
|
2021-12-21 09:36:50 +00:00
|
|
|
component: task.component.StatusTableView
|
|
|
|
},
|
|
|
|
task.viewlet.StatusTable
|
|
|
|
)
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
builder.mixin(task.class.Task, core.class.Class, view.mixin.ObjectPresenter, {
|
2022-03-22 09:09:58 +00:00
|
|
|
presenter: view.component.ObjectPresenter
|
|
|
|
})
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
builder.mixin(task.class.KanbanTemplate, core.class.Class, view.mixin.ObjectPresenter, {
|
2022-11-09 11:24:02 +00:00
|
|
|
presenter: task.component.KanbanTemplatePresenter
|
|
|
|
})
|
|
|
|
|
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-17 09:04:49 +00:00
|
|
|
builder.createDoc(
|
2022-05-04 08:08:12 +00:00
|
|
|
view.class.ActionCategory,
|
2021-12-17 09:04:49 +00:00
|
|
|
core.space.Model,
|
2022-05-04 08:08:12 +00:00
|
|
|
{ label: task.string.Task, visible: true },
|
|
|
|
task.category.Task
|
2021-12-17 09:04:49 +00:00
|
|
|
)
|
|
|
|
|
2022-05-04 08:08:12 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
2021-12-17 09:04:49 +00:00
|
|
|
{
|
2022-05-04 08:08:12 +00:00
|
|
|
...actionTemplates.editStatus,
|
|
|
|
target: task.class.SpaceWithStates,
|
|
|
|
query: {
|
|
|
|
archived: false
|
|
|
|
},
|
|
|
|
context: {
|
2022-06-24 12:36:08 +00:00
|
|
|
mode: ['context', 'browser'],
|
|
|
|
group: 'edit'
|
2022-05-04 08:08:12 +00:00
|
|
|
}
|
2021-12-17 09:04:49 +00:00
|
|
|
},
|
|
|
|
task.action.EditStatuses
|
|
|
|
)
|
2021-12-15 09:04:43 +00:00
|
|
|
|
|
|
|
builder.mixin(task.class.State, core.class.Class, view.mixin.AttributeEditor, {
|
2022-06-15 17:25:58 +00:00
|
|
|
inlineEditor: task.component.StateEditor
|
2021-12-15 09:04:43 +00:00
|
|
|
})
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
builder.mixin(task.class.State, core.class.Class, view.mixin.ObjectPresenter, {
|
2021-12-15 09:04:43 +00:00
|
|
|
presenter: task.component.StatePresenter
|
|
|
|
})
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
builder.mixin(task.class.State, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: task.component.StateRefPresenter
|
|
|
|
})
|
|
|
|
|
2022-06-15 09:44:27 +00:00
|
|
|
builder.mixin(task.class.State, core.class.Class, view.mixin.IgnoreActions, {
|
|
|
|
actions: [view.action.Delete]
|
|
|
|
})
|
|
|
|
|
2022-01-31 09:07:56 +00:00
|
|
|
builder.mixin(task.class.DoneState, core.class.Class, view.mixin.AttributeEditor, {
|
2022-06-15 17:25:58 +00:00
|
|
|
inlineEditor: task.component.DoneStateEditor
|
2022-01-31 09:07:56 +00:00
|
|
|
})
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
builder.mixin(task.class.DoneState, core.class.Class, view.mixin.ObjectPresenter, {
|
2022-01-31 09:07:56 +00:00
|
|
|
presenter: task.component.DoneStatePresenter
|
|
|
|
})
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
builder.mixin(task.class.DoneState, core.class.Class, view.mixin.AttributePresenter, {
|
|
|
|
presenter: task.component.DoneStateRefPresenter
|
|
|
|
})
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2022-07-05 05:38:19 +00:00
|
|
|
builder.createDoc(
|
|
|
|
view.class.ViewletDescriptor,
|
|
|
|
core.space.Model,
|
|
|
|
{
|
|
|
|
label: task.string.Dashboard,
|
|
|
|
icon: task.icon.Dashboard,
|
|
|
|
component: task.component.Dashboard
|
|
|
|
},
|
|
|
|
task.viewlet.Dashboard
|
|
|
|
)
|
|
|
|
|
2022-05-06 17:48:43 +00:00
|
|
|
builder.mixin(task.class.TodoItem, core.class.Class, view.mixin.CollectionEditor, {
|
2021-12-20 10:18:29 +00:00
|
|
|
editor: task.component.Todos
|
|
|
|
})
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
builder.mixin(task.class.TodoItem, core.class.Class, view.mixin.ObjectPresenter, {
|
2021-12-20 10:18:29 +00:00
|
|
|
presenter: task.component.TodoItemPresenter
|
|
|
|
})
|
|
|
|
|
2022-05-04 08:08:12 +00:00
|
|
|
createAction(builder, {
|
|
|
|
label: task.string.MarkAsDone,
|
|
|
|
icon: task.icon.TodoCheck,
|
|
|
|
action: view.actionImpl.UpdateDocument,
|
|
|
|
actionProps: {
|
|
|
|
key: 'done',
|
|
|
|
value: true
|
2021-12-20 10:18:29 +00:00
|
|
|
},
|
2022-05-04 08:08:12 +00:00
|
|
|
input: 'focus',
|
|
|
|
category: task.category.Task,
|
2021-12-20 10:18:29 +00:00
|
|
|
query: {
|
|
|
|
done: false
|
2022-04-19 09:38:31 +00:00
|
|
|
},
|
2022-05-04 08:08:12 +00:00
|
|
|
target: task.class.TodoItem,
|
2022-04-19 09:38:31 +00:00
|
|
|
context: {
|
2022-06-24 12:36:08 +00:00
|
|
|
mode: ['context', 'browser'],
|
|
|
|
group: 'edit'
|
2021-12-20 10:18:29 +00:00
|
|
|
}
|
|
|
|
})
|
2022-05-04 08:08:12 +00:00
|
|
|
|
|
|
|
createAction(builder, {
|
|
|
|
label: task.string.MarkAsUndone,
|
|
|
|
icon: task.icon.TodoUnCheck,
|
|
|
|
action: view.actionImpl.UpdateDocument,
|
|
|
|
actionProps: {
|
|
|
|
key: 'done',
|
|
|
|
value: false
|
|
|
|
},
|
|
|
|
input: 'focus',
|
|
|
|
category: task.category.Task,
|
2021-12-20 10:18:29 +00:00
|
|
|
query: {
|
|
|
|
done: true
|
2022-04-19 09:38:31 +00:00
|
|
|
},
|
|
|
|
context: {
|
2022-06-24 12:36:08 +00:00
|
|
|
mode: ['context', 'browser'],
|
|
|
|
group: 'edit'
|
2022-05-04 08:08:12 +00:00
|
|
|
},
|
|
|
|
target: task.class.TodoItem
|
2021-12-20 10:18:29 +00:00
|
|
|
})
|
2021-12-07 18:45:11 +00:00
|
|
|
|
2022-05-17 08:36:11 +00:00
|
|
|
createAction(
|
|
|
|
builder,
|
|
|
|
{
|
|
|
|
...viewTemplates.move,
|
|
|
|
target: task.class.Task,
|
|
|
|
context: {
|
2022-06-24 12:36:08 +00:00
|
|
|
mode: ['context', 'browser'],
|
|
|
|
group: 'tools'
|
2022-05-17 08:36:11 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
task.action.Move
|
|
|
|
)
|
2022-05-20 19:41:26 +00:00
|
|
|
|
|
|
|
createAction(
|
|
|
|
builder,
|
|
|
|
{
|
|
|
|
action: view.actionImpl.UpdateDocument,
|
|
|
|
actionProps: {
|
|
|
|
key: 'isArchived',
|
|
|
|
value: true,
|
|
|
|
ask: true,
|
|
|
|
label: task.string.Archive,
|
|
|
|
message: task.string.ArchiveConfirm
|
|
|
|
},
|
|
|
|
query: {
|
|
|
|
isArchived: { $nin: [true] }
|
|
|
|
},
|
|
|
|
label: task.string.Archive,
|
2022-05-25 06:08:26 +00:00
|
|
|
icon: view.icon.Archive,
|
2022-05-20 19:41:26 +00:00
|
|
|
input: 'any',
|
|
|
|
category: task.category.Task,
|
|
|
|
target: task.class.State,
|
|
|
|
context: {
|
2022-06-24 12:36:08 +00:00
|
|
|
mode: ['context', 'browser'],
|
|
|
|
group: 'tools'
|
2022-05-20 19:41:26 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
task.action.ArchiveState
|
|
|
|
)
|
2022-09-16 02:57:32 +00:00
|
|
|
|
2023-04-25 08:34:38 +00:00
|
|
|
// builder.createDoc(
|
|
|
|
// notification.class.NotificationType,
|
|
|
|
// core.space.Model,
|
|
|
|
// {
|
|
|
|
// label: task.string.Assigned,
|
|
|
|
// hidden: false,
|
|
|
|
// textTemplate: '{doc} was assigned to you by {sender}',
|
|
|
|
// htmlTemplate: '<p>{doc} was assigned to you by {sender}</p>',
|
|
|
|
// subjectTemplate: '{doc} was assigned to you'
|
|
|
|
// },
|
|
|
|
// task.ids.AssigneedNotification
|
|
|
|
// )
|
2022-01-21 09:05:55 +00:00
|
|
|
}
|