2022-04-02 03:49:23 +00:00
|
|
|
//
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
// Copyright © 2021 Hardcore Engineering Inc.
|
|
|
|
//
|
|
|
|
// 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 { Employee } from '@anticrm/contact'
|
2022-05-27 16:43:11 +00:00
|
|
|
import type { Class, Doc, Markup, Ref, Type } from '@anticrm/core'
|
2022-05-17 08:36:11 +00:00
|
|
|
import type { Asset, IntlString, Plugin } from '@anticrm/platform'
|
2022-04-02 03:49:23 +00:00
|
|
|
import { plugin } from '@anticrm/platform'
|
2022-05-17 08:36:11 +00:00
|
|
|
import type { Preference } from '@anticrm/preference'
|
2022-05-23 07:28:41 +00:00
|
|
|
import type { DoneState, KanbanTemplateSpace, SpaceWithStates, Task } from '@anticrm/task'
|
2022-04-08 18:07:21 +00:00
|
|
|
import type { AnyComponent } from '@anticrm/ui'
|
2022-05-17 08:36:11 +00:00
|
|
|
import { Action, ActionCategory } from '@anticrm/view'
|
2022-05-27 16:43:11 +00:00
|
|
|
import { TagCategory } from '@anticrm/tags'
|
2022-04-02 03:49:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface Board extends SpaceWithStates {
|
|
|
|
color?: number
|
|
|
|
background?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface BoardView extends SpaceWithStates {
|
|
|
|
title: string
|
|
|
|
type: 'table' | 'calendar'
|
|
|
|
boards: Ref<Board>[]
|
|
|
|
}
|
|
|
|
|
2022-05-06 06:43:44 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface CardCover {
|
2022-05-24 12:56:42 +00:00
|
|
|
color: number
|
2022-05-06 06:43:44 +00:00
|
|
|
size: 'large' | 'small'
|
|
|
|
}
|
|
|
|
|
2022-04-02 03:49:23 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface Card extends Task {
|
|
|
|
title: string
|
|
|
|
description: Markup
|
|
|
|
|
2022-04-08 18:07:21 +00:00
|
|
|
isArchived?: boolean
|
|
|
|
|
|
|
|
members?: Ref<Employee>[]
|
|
|
|
|
|
|
|
location?: string
|
2022-04-02 03:49:23 +00:00
|
|
|
|
2022-05-06 06:43:44 +00:00
|
|
|
cover?: CardCover | null
|
2022-04-02 03:49:23 +00:00
|
|
|
|
|
|
|
comments?: number
|
|
|
|
attachments?: number
|
|
|
|
}
|
2022-05-17 08:36:11 +00:00
|
|
|
|
2022-04-29 16:39:48 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface MenuPage extends Doc {
|
|
|
|
component: AnyComponent
|
|
|
|
pageId: string
|
|
|
|
label: IntlString
|
|
|
|
}
|
2022-04-02 03:49:23 +00:00
|
|
|
|
2022-05-12 15:38:29 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2022-05-20 07:19:45 +00:00
|
|
|
export interface CommonBoardPreference extends Preference {
|
|
|
|
cardLabelsCompactMode: boolean
|
2022-05-12 15:38:29 +00:00
|
|
|
}
|
2022-04-02 03:49:23 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const boardId = 'board' as Plugin
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
const boards = plugin(boardId, {
|
|
|
|
app: {
|
|
|
|
Board: '' as Ref<Doc>
|
|
|
|
},
|
|
|
|
class: {
|
|
|
|
Board: '' as Ref<Class<Board>>,
|
2022-04-08 03:08:30 +00:00
|
|
|
Card: '' as Ref<Class<Card>>,
|
2022-05-12 15:38:29 +00:00
|
|
|
MenuPage: '' as Ref<Class<MenuPage>>,
|
2022-05-24 12:56:42 +00:00
|
|
|
CommonBoardPreference: '' as Ref<Class<CommonBoardPreference>>,
|
|
|
|
CardCover: '' as Ref<Class<Type<CardCover>>>
|
2022-04-02 03:49:23 +00:00
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
category: {
|
2022-05-27 16:43:11 +00:00
|
|
|
Card: '' as Ref<ActionCategory>,
|
|
|
|
Other: '' as Ref<TagCategory>
|
2022-05-17 08:36:11 +00:00
|
|
|
},
|
2022-05-23 07:28:41 +00:00
|
|
|
state: {
|
|
|
|
Completed: '' as Ref<DoneState>
|
|
|
|
},
|
2022-05-17 08:36:11 +00:00
|
|
|
action: {
|
2022-05-25 06:08:26 +00:00
|
|
|
Open: '' as Ref<Action>,
|
2022-05-17 08:36:11 +00:00
|
|
|
Cover: '' as Ref<Action>,
|
|
|
|
Dates: '' as Ref<Action>,
|
|
|
|
Labels: '' as Ref<Action>,
|
|
|
|
Move: '' as Ref<Action>,
|
|
|
|
Copy: '' as Ref<Action>,
|
|
|
|
Archive: '' as Ref<Action>,
|
|
|
|
SendToBoard: '' as Ref<Action>,
|
|
|
|
Delete: '' as Ref<Action>
|
|
|
|
},
|
2022-04-02 03:49:23 +00:00
|
|
|
icon: {
|
|
|
|
Board: '' as Asset,
|
|
|
|
Card: '' as Asset
|
|
|
|
},
|
|
|
|
space: {
|
|
|
|
BoardTemplates: '' as Ref<KanbanTemplateSpace>
|
2022-04-12 07:59:36 +00:00
|
|
|
},
|
2022-04-29 16:39:48 +00:00
|
|
|
menuPageId: {
|
|
|
|
Main: 'main',
|
|
|
|
Archive: 'archive'
|
2022-04-02 03:49:23 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export default boards
|