2022-06-15 04:59:43 +00:00
|
|
|
<!--
|
|
|
|
// Copyright © 2022 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.
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
2023-04-04 06:11:49 +00:00
|
|
|
import contact from '@hcengineering/contact'
|
|
|
|
import { employeeByIdStore } from '@hcengineering/contact-resources'
|
|
|
|
import {
|
|
|
|
CategoryType,
|
|
|
|
Class,
|
|
|
|
Doc,
|
|
|
|
DocumentQuery,
|
|
|
|
DocumentUpdate,
|
|
|
|
generateId,
|
|
|
|
Lookup,
|
|
|
|
Ref,
|
|
|
|
WithLookup
|
|
|
|
} from '@hcengineering/core'
|
|
|
|
import { Item, Kanban } from '@hcengineering/kanban'
|
2022-09-21 08:08:25 +00:00
|
|
|
import notification from '@hcengineering/notification'
|
2023-01-14 10:54:54 +00:00
|
|
|
import { getResource } from '@hcengineering/platform'
|
2023-04-04 06:11:49 +00:00
|
|
|
import { createQuery, getClient, statusStore } from '@hcengineering/presentation'
|
2022-09-21 08:08:25 +00:00
|
|
|
import tags from '@hcengineering/tags'
|
2023-04-04 06:11:49 +00:00
|
|
|
import { Issue, IssuesGrouping, IssuesOrdering, Project } from '@hcengineering/tracker'
|
2022-08-05 07:48:31 +00:00
|
|
|
import {
|
|
|
|
Button,
|
|
|
|
Component,
|
|
|
|
getEventPositionElement,
|
|
|
|
IconAdd,
|
2023-04-04 06:11:49 +00:00
|
|
|
Label,
|
2022-08-05 07:48:31 +00:00
|
|
|
Loading,
|
|
|
|
showPanel,
|
|
|
|
showPopup,
|
2023-05-02 03:46:47 +00:00
|
|
|
tooltip,
|
|
|
|
deviceOptionsStore as deviceInfo,
|
|
|
|
hslToRgb,
|
|
|
|
rgbToHsl,
|
|
|
|
AccentColor
|
2022-09-21 08:08:25 +00:00
|
|
|
} from '@hcengineering/ui'
|
2023-04-04 06:11:49 +00:00
|
|
|
import {
|
|
|
|
AttributeModel,
|
|
|
|
CategoryOption,
|
|
|
|
Viewlet,
|
|
|
|
ViewOptionModel,
|
|
|
|
ViewOptions,
|
|
|
|
ViewQueryOption
|
|
|
|
} from '@hcengineering/view'
|
2023-01-14 10:54:54 +00:00
|
|
|
import {
|
2023-03-22 02:48:57 +00:00
|
|
|
ActionContext,
|
2023-01-14 10:54:54 +00:00
|
|
|
focusStore,
|
2023-03-22 02:48:57 +00:00
|
|
|
getCategories,
|
2023-04-14 14:34:03 +00:00
|
|
|
getCategorySpaces,
|
2023-04-04 06:11:49 +00:00
|
|
|
getGroupByValues,
|
|
|
|
getPresenter,
|
|
|
|
groupBy,
|
2023-01-14 10:54:54 +00:00
|
|
|
ListSelectionProvider,
|
2023-03-22 02:48:57 +00:00
|
|
|
Menu,
|
2023-01-14 10:54:54 +00:00
|
|
|
noCategory,
|
|
|
|
SelectDirection,
|
2023-04-04 06:11:49 +00:00
|
|
|
selectionStore,
|
|
|
|
setGroupByValues
|
2023-01-14 10:54:54 +00:00
|
|
|
} from '@hcengineering/view-resources'
|
2023-04-04 06:11:49 +00:00
|
|
|
import view from '@hcengineering/view-resources/src/plugin'
|
2023-05-02 03:46:47 +00:00
|
|
|
import { AttachmentsPresenter } from '@hcengineering/attachment-resources'
|
|
|
|
import { CommentsPresenter } from '@hcengineering/chunter-resources'
|
2022-06-15 04:59:43 +00:00
|
|
|
import { onMount } from 'svelte'
|
|
|
|
import tracker from '../../plugin'
|
2023-03-17 06:17:53 +00:00
|
|
|
import ComponentEditor from '../components/ComponentEditor.svelte'
|
2023-03-17 16:05:22 +00:00
|
|
|
import CreateIssue from '../CreateIssue.svelte'
|
2022-06-15 04:59:43 +00:00
|
|
|
import AssigneePresenter from './AssigneePresenter.svelte'
|
2022-06-16 04:24:17 +00:00
|
|
|
import SubIssuesSelector from './edit/SubIssuesSelector.svelte'
|
2022-06-15 04:59:43 +00:00
|
|
|
import IssuePresenter from './IssuePresenter.svelte'
|
2022-06-27 06:04:26 +00:00
|
|
|
import ParentNamesPresenter from './ParentNamesPresenter.svelte'
|
2022-06-15 04:59:43 +00:00
|
|
|
import PriorityEditor from './PriorityEditor.svelte'
|
2022-07-04 18:14:53 +00:00
|
|
|
import StatusEditor from './StatusEditor.svelte'
|
2022-10-11 11:50:56 +00:00
|
|
|
import EstimationEditor from './timereport/EstimationEditor.svelte'
|
2023-04-21 10:29:47 +00:00
|
|
|
import DueDatePresenter from './DueDatePresenter.svelte'
|
2022-06-15 04:59:43 +00:00
|
|
|
|
2023-03-17 06:17:53 +00:00
|
|
|
export let space: Ref<Project> | undefined = undefined
|
2022-06-15 04:59:43 +00:00
|
|
|
export let baseMenuClass: Ref<Class<Doc>> | undefined = undefined
|
2022-06-23 11:09:18 +00:00
|
|
|
export let query: DocumentQuery<Issue> = {}
|
2023-01-18 05:14:59 +00:00
|
|
|
export let viewOptionsConfig: ViewOptionModel[] | undefined
|
|
|
|
export let viewOptions: ViewOptions
|
2023-03-23 05:41:27 +00:00
|
|
|
export let viewlet: Viewlet
|
2022-06-15 04:59:43 +00:00
|
|
|
|
2023-03-17 06:17:53 +00:00
|
|
|
$: currentSpace = space || tracker.project.DefaultProject
|
2023-04-04 06:11:49 +00:00
|
|
|
$: groupByKey = (viewOptions.groupBy[0] ?? noCategory) as IssuesGrouping
|
2023-01-18 05:14:59 +00:00
|
|
|
$: orderBy = viewOptions.orderBy
|
2023-01-14 10:54:54 +00:00
|
|
|
$: sort = { [orderBy[0]]: orderBy[1] }
|
2023-04-04 06:11:49 +00:00
|
|
|
|
2023-05-03 05:47:38 +00:00
|
|
|
$: lth = $deviceInfo.theme === 'theme-light'
|
|
|
|
const accentColors: AccentColor[] = []
|
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
// issuesGroupBySorting[groupByKey]
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
$: dontUpdateRank = orderBy[0] !== IssuesOrdering.Manual
|
2022-06-15 04:59:43 +00:00
|
|
|
|
2022-06-16 04:24:17 +00:00
|
|
|
const spaceQuery = createQuery()
|
|
|
|
|
2023-03-17 06:17:53 +00:00
|
|
|
let currentProject: Project | undefined
|
|
|
|
$: spaceQuery.query(tracker.class.Project, { _id: currentSpace }, (res) => {
|
|
|
|
currentProject = res.shift()
|
2022-06-16 04:24:17 +00:00
|
|
|
})
|
|
|
|
|
2023-01-14 10:54:54 +00:00
|
|
|
let resultQuery: DocumentQuery<any> = query
|
2023-01-18 05:14:59 +00:00
|
|
|
$: getResultQuery(query, viewOptionsConfig, viewOptions).then((p) => (resultQuery = p))
|
2023-01-14 10:54:54 +00:00
|
|
|
|
|
|
|
const client = getClient()
|
|
|
|
const hierarchy = client.getHierarchy()
|
|
|
|
|
|
|
|
async function getResultQuery (
|
|
|
|
query: DocumentQuery<Issue>,
|
|
|
|
viewOptions: ViewOptionModel[] | undefined,
|
|
|
|
viewOptionsStore: ViewOptions
|
|
|
|
): Promise<DocumentQuery<Issue>> {
|
|
|
|
if (viewOptions === undefined) return query
|
|
|
|
let result = hierarchy.clone(query)
|
|
|
|
for (const viewOption of viewOptions) {
|
2023-03-23 05:41:27 +00:00
|
|
|
if (viewOption.actionTarget !== 'query') continue
|
2023-01-14 10:54:54 +00:00
|
|
|
const queryOption = viewOption as ViewQueryOption
|
|
|
|
const f = await getResource(queryOption.action)
|
|
|
|
result = f(viewOptionsStore[queryOption.key] ?? queryOption.defaultValue, query)
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
2022-06-15 04:59:43 +00:00
|
|
|
function toIssue (object: any): WithLookup<Issue> {
|
|
|
|
return object as WithLookup<Issue>
|
|
|
|
}
|
|
|
|
|
2022-06-28 06:53:39 +00:00
|
|
|
const lookup: Lookup<Issue> = {
|
2023-03-17 06:17:53 +00:00
|
|
|
space: tracker.class.Project,
|
2023-04-04 06:11:49 +00:00
|
|
|
status: tracker.class.IssueStatus,
|
|
|
|
component: tracker.class.Component,
|
|
|
|
sprint: tracker.class.Sprint,
|
2022-06-28 06:53:39 +00:00
|
|
|
_id: {
|
2023-04-04 06:11:49 +00:00
|
|
|
subIssues: tracker.class.Issue,
|
|
|
|
labels: tags.class.TagReference
|
2022-06-15 04:59:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let kanbanUI: Kanban
|
|
|
|
const listProvider = new ListSelectionProvider((offset: 1 | -1 | 0, of?: Doc, dir?: SelectDirection) => {
|
2023-04-23 03:50:41 +00:00
|
|
|
kanbanUI?.select(offset, of, dir)
|
2022-06-15 04:59:43 +00:00
|
|
|
})
|
|
|
|
onMount(() => {
|
|
|
|
;(document.activeElement as HTMLElement)?.blur()
|
|
|
|
})
|
|
|
|
|
|
|
|
const showMenu = async (ev: MouseEvent, items: Doc[]): Promise<void> => {
|
|
|
|
ev.preventDefault()
|
2023-04-28 14:31:06 +00:00
|
|
|
showPopup(Menu, { object: items, baseMenuClass }, getEventPositionElement(ev))
|
2022-06-15 04:59:43 +00:00
|
|
|
}
|
2022-07-06 06:11:32 +00:00
|
|
|
const issuesQuery = createQuery()
|
2023-02-08 06:42:26 +00:00
|
|
|
let issues: Issue[] = []
|
2023-04-04 06:11:49 +00:00
|
|
|
|
|
|
|
$: groupByDocs = groupBy(issues, groupByKey, categories)
|
|
|
|
|
2022-07-06 06:11:32 +00:00
|
|
|
$: issuesQuery.query(
|
|
|
|
tracker.class.Issue,
|
|
|
|
resultQuery,
|
2023-02-08 06:42:26 +00:00
|
|
|
(result) => {
|
|
|
|
issues = result
|
2022-07-06 06:11:32 +00:00
|
|
|
},
|
|
|
|
{
|
2023-04-04 06:11:49 +00:00
|
|
|
lookup,
|
|
|
|
sort
|
2023-02-08 06:42:26 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2023-04-23 03:50:41 +00:00
|
|
|
$: listProvider.update(issues)
|
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
let categories: CategoryType[] = []
|
2023-02-08 06:42:26 +00:00
|
|
|
|
2023-02-08 15:37:50 +00:00
|
|
|
const queryId = generateId()
|
|
|
|
|
2023-04-04 06:11:49 +00:00
|
|
|
$: updateCategories(tracker.class.Issue, issues, groupByKey, viewOptions, viewOptionsConfig)
|
2023-02-08 06:42:26 +00:00
|
|
|
|
2023-02-08 15:37:50 +00:00
|
|
|
function update () {
|
2023-04-04 06:11:49 +00:00
|
|
|
updateCategories(tracker.class.Issue, issues, groupByKey, viewOptions, viewOptionsConfig)
|
2023-02-08 15:37:50 +00:00
|
|
|
}
|
|
|
|
|
2023-02-08 06:42:26 +00:00
|
|
|
async function updateCategories (
|
|
|
|
_class: Ref<Class<Doc>>,
|
|
|
|
docs: Doc[],
|
|
|
|
groupByKey: string,
|
|
|
|
viewOptions: ViewOptions,
|
2023-04-04 06:11:49 +00:00
|
|
|
viewOptionsModel: ViewOptionModel[] | undefined
|
2022-07-06 06:11:32 +00:00
|
|
|
) {
|
2023-04-04 06:11:49 +00:00
|
|
|
categories = await getCategories(client, _class, docs, groupByKey, $statusStore, viewlet.descriptor)
|
2023-05-02 03:46:47 +00:00
|
|
|
categories.forEach((_, i) => {
|
|
|
|
if (accentColors[i] === undefined) {
|
|
|
|
accentColors[i] = {
|
|
|
|
textColor: 'var(--theme-caption-color)',
|
2023-05-03 05:47:38 +00:00
|
|
|
backgroundColor: lth ? '230, 230, 230' : '100, 100, 108'
|
2023-05-02 03:46:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2023-02-08 06:42:26 +00:00
|
|
|
for (const viewOption of viewOptionsModel ?? []) {
|
2023-03-23 05:41:27 +00:00
|
|
|
if (viewOption.actionTarget !== 'category') continue
|
2023-02-08 06:42:26 +00:00
|
|
|
const categoryFunc = viewOption as CategoryOption
|
|
|
|
if (viewOptions[viewOption.key] ?? viewOption.defaultValue) {
|
2023-04-04 06:11:49 +00:00
|
|
|
const categoryAction = await getResource(categoryFunc.action)
|
2023-04-14 14:34:03 +00:00
|
|
|
|
|
|
|
const spaces = getCategorySpaces(categories)
|
|
|
|
if (space !== undefined) {
|
|
|
|
spaces.push(space)
|
|
|
|
}
|
2023-04-10 07:55:22 +00:00
|
|
|
const res = await categoryAction(
|
|
|
|
_class,
|
2023-04-14 14:34:03 +00:00
|
|
|
spaces.length > 0 ? { space: { $in: Array.from(spaces.values()) } } : {},
|
2023-04-10 07:55:22 +00:00
|
|
|
groupByKey,
|
|
|
|
update,
|
|
|
|
queryId,
|
|
|
|
$statusStore,
|
|
|
|
viewlet.descriptor
|
|
|
|
)
|
2023-02-08 06:42:26 +00:00
|
|
|
if (res !== undefined) {
|
2023-04-04 06:11:49 +00:00
|
|
|
categories = res
|
2023-02-08 06:42:26 +00:00
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-06 06:11:32 +00:00
|
|
|
}
|
2022-07-07 02:21:30 +00:00
|
|
|
|
|
|
|
const fullFilled: { [key: string]: boolean } = {}
|
2023-04-04 06:11:49 +00:00
|
|
|
|
|
|
|
function getHeader (_class: Ref<Class<Doc>>, groupByKey: string): void {
|
|
|
|
if (groupByKey === noCategory) {
|
|
|
|
headerComponent = undefined
|
|
|
|
} else {
|
|
|
|
getPresenter(client, _class, { key: groupByKey }, { key: groupByKey }).then((p) => (headerComponent = p))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let headerComponent: AttributeModel | undefined
|
|
|
|
$: getHeader(tracker.class.Issue, groupByKey)
|
|
|
|
|
|
|
|
const getUpdateProps = (doc: Doc, category: CategoryType): DocumentUpdate<Item> | undefined => {
|
|
|
|
const groupValue =
|
|
|
|
typeof category === 'object' ? category.values.find((it) => it.space === doc.space)?._id : category
|
|
|
|
if (groupValue === undefined) {
|
|
|
|
return undefined
|
|
|
|
}
|
2023-04-18 08:22:02 +00:00
|
|
|
if ((doc as any)[groupByKey] === groupValue) {
|
|
|
|
return
|
|
|
|
}
|
2023-04-04 06:11:49 +00:00
|
|
|
return {
|
|
|
|
[groupByKey]: groupValue,
|
|
|
|
space: doc.space
|
|
|
|
}
|
|
|
|
}
|
2023-05-02 03:46:47 +00:00
|
|
|
|
|
|
|
const setAccentColor = (n: number, ev: CustomEvent) => {
|
|
|
|
const accColor = rgbToHsl(ev.detail.r, ev.detail.g, ev.detail.b)
|
|
|
|
const textColor = !lth ? { r: 255, g: 255, b: 255 } : hslToRgb(accColor.h, accColor.s, 0.3)
|
|
|
|
const bgColor = !lth ? hslToRgb(accColor.h, accColor.s, 0.55) : hslToRgb(accColor.h, accColor.s, 0.9)
|
|
|
|
accentColors[n] = {
|
|
|
|
textColor: !lth ? 'var(--theme-caption-color)' : `rgb(${textColor.r}, ${textColor.g}, ${textColor.b})`,
|
|
|
|
backgroundColor: `${bgColor.r}, ${bgColor.g}, ${bgColor.b}`
|
|
|
|
}
|
|
|
|
}
|
2022-06-15 04:59:43 +00:00
|
|
|
</script>
|
|
|
|
|
2023-04-11 13:39:23 +00:00
|
|
|
{#if categories.length === 0}
|
2022-07-06 06:11:32 +00:00
|
|
|
<Loading />
|
|
|
|
{:else}
|
2022-06-15 04:59:43 +00:00
|
|
|
<ActionContext
|
|
|
|
context={{
|
|
|
|
mode: 'browser'
|
|
|
|
}}
|
|
|
|
/>
|
2023-01-18 05:14:59 +00:00
|
|
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
2022-06-15 04:59:43 +00:00
|
|
|
<Kanban
|
|
|
|
bind:this={kanbanUI}
|
2023-04-04 06:11:49 +00:00
|
|
|
{categories}
|
2023-01-14 10:54:54 +00:00
|
|
|
{dontUpdateRank}
|
2023-04-04 06:11:49 +00:00
|
|
|
objects={issues}
|
|
|
|
getGroupByValues={(groupByDocs, category) =>
|
|
|
|
groupByKey === noCategory ? issues : getGroupByValues(groupByDocs, category)}
|
|
|
|
{setGroupByValues}
|
|
|
|
{getUpdateProps}
|
|
|
|
{groupByDocs}
|
2022-06-15 04:59:43 +00:00
|
|
|
on:obj-focus={(evt) => {
|
|
|
|
listProvider.updateFocus(evt.detail)
|
|
|
|
}}
|
|
|
|
selection={listProvider.current($focusStore)}
|
|
|
|
checked={$selectionStore ?? []}
|
|
|
|
on:check={(evt) => {
|
|
|
|
listProvider.updateSelection(evt.detail.docs, evt.detail.value)
|
|
|
|
}}
|
|
|
|
on:contextmenu={(evt) => showMenu(evt.detail.evt, evt.detail.objects)}
|
|
|
|
>
|
2023-05-02 03:46:47 +00:00
|
|
|
<svelte:fragment slot="header" let:state let:count let:index>
|
2023-04-04 06:11:49 +00:00
|
|
|
<!-- {@const status = $statusStore.get(state._id)} -->
|
2023-05-02 03:46:47 +00:00
|
|
|
{#key lth}
|
|
|
|
<div
|
2023-05-04 08:51:26 +00:00
|
|
|
style:--kanban-header-rgb-color={accentColors[index]?.backgroundColor}
|
2023-05-02 03:46:47 +00:00
|
|
|
class="header flex-between"
|
|
|
|
class:gradient={!lth}
|
|
|
|
>
|
2023-04-07 17:15:22 +00:00
|
|
|
<div class="flex-row-center gap-1">
|
2023-05-02 03:46:47 +00:00
|
|
|
<span
|
|
|
|
class="clear-mins fs-bold overflow-label pointer-events-none"
|
2023-05-04 08:51:26 +00:00
|
|
|
style:color={accentColors[index]?.textColor}
|
2023-05-02 03:46:47 +00:00
|
|
|
>
|
|
|
|
{#if groupByKey === noCategory}
|
2023-04-07 17:15:22 +00:00
|
|
|
<Label label={view.string.NoGrouping} />
|
2023-05-02 03:46:47 +00:00
|
|
|
{:else if headerComponent}
|
|
|
|
<svelte:component
|
|
|
|
this={headerComponent.presenter}
|
|
|
|
value={state}
|
|
|
|
{space}
|
|
|
|
size={'small'}
|
|
|
|
kind={'list-header'}
|
|
|
|
colorInherit={lth}
|
|
|
|
accent
|
|
|
|
on:accent-color={(ev) => setAccentColor(index, ev)}
|
|
|
|
/>
|
|
|
|
{/if}
|
|
|
|
</span>
|
|
|
|
<span class="counter">
|
2023-04-07 17:15:22 +00:00
|
|
|
{count}
|
2023-04-04 06:11:49 +00:00
|
|
|
</span>
|
2023-04-07 17:15:22 +00:00
|
|
|
</div>
|
2023-05-02 03:46:47 +00:00
|
|
|
<div class="tools gap-1">
|
2023-01-14 10:54:54 +00:00
|
|
|
<Button
|
|
|
|
icon={IconAdd}
|
|
|
|
kind={'transparent'}
|
|
|
|
showTooltip={{ label: tracker.string.AddIssueTooltip, direction: 'left' }}
|
|
|
|
on:click={() => {
|
2023-04-04 06:11:49 +00:00
|
|
|
showPopup(CreateIssue, { space: currentSpace, [groupByKey]: state._id }, 'top')
|
2023-01-14 10:54:54 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
2022-06-15 04:59:43 +00:00
|
|
|
</div>
|
2023-05-02 03:46:47 +00:00
|
|
|
{/key}
|
2022-06-15 04:59:43 +00:00
|
|
|
</svelte:fragment>
|
|
|
|
<svelte:fragment slot="card" let:object>
|
|
|
|
{@const issue = toIssue(object)}
|
2022-07-07 02:21:30 +00:00
|
|
|
{@const issueId = object._id}
|
2023-05-03 05:47:38 +00:00
|
|
|
{@const reports =
|
|
|
|
issue.reportedTime + (issue.childInfo ?? []).map((it) => it.reportedTime).reduce((a, b) => a + b, 0)}
|
|
|
|
{@const estimations = (issue.childInfo ?? []).map((it) => it.estimation).reduce((a, b) => a + b, 0)}
|
2023-04-04 06:11:49 +00:00
|
|
|
{#key issueId}
|
|
|
|
<div
|
|
|
|
class="tracker-card"
|
|
|
|
on:click={() => {
|
|
|
|
showPanel(tracker.component.EditIssue, object._id, object._class, 'content')
|
|
|
|
}}
|
|
|
|
>
|
2023-05-02 03:46:47 +00:00
|
|
|
<div class="card-header flex-between">
|
|
|
|
<div class="flex-row-center text-sm">
|
|
|
|
<!-- {#if groupByKey !== 'status'} -->
|
|
|
|
<div class="mr-1">
|
|
|
|
<StatusEditor value={issue} kind="list" isEditable={false} />
|
|
|
|
</div>
|
|
|
|
<!-- {/if} -->
|
2023-04-04 06:11:49 +00:00
|
|
|
<IssuePresenter value={issue} />
|
|
|
|
<ParentNamesPresenter value={issue} />
|
|
|
|
</div>
|
2023-05-02 03:46:47 +00:00
|
|
|
<div class="flex-row-center gap-2 reverse flex-no-shrink">
|
2023-04-04 06:11:49 +00:00
|
|
|
<Component is={notification.component.NotificationPresenter} props={{ value: object }} />
|
2023-05-02 03:46:47 +00:00
|
|
|
<AssigneePresenter
|
|
|
|
value={issue.assignee ? $employeeByIdStore.get(issue.assignee) : null}
|
|
|
|
defaultClass={contact.class.Employee}
|
|
|
|
object={issue}
|
|
|
|
isEditable={true}
|
|
|
|
avatarSize={'card'}
|
|
|
|
/>
|
2023-04-04 06:11:49 +00:00
|
|
|
</div>
|
2022-06-16 04:24:17 +00:00
|
|
|
</div>
|
2023-05-02 03:46:47 +00:00
|
|
|
<div class="card-content text-md caption-color lines-limit-2">
|
|
|
|
{object.title}
|
|
|
|
</div>
|
|
|
|
<div class="card-labels">
|
2023-04-04 06:11:49 +00:00
|
|
|
{#if issue && issue.subIssues > 0}
|
2023-05-02 03:46:47 +00:00
|
|
|
<SubIssuesSelector value={issue} {currentProject} size={'small'} />
|
2023-04-04 06:11:49 +00:00
|
|
|
{/if}
|
2023-05-02 03:46:47 +00:00
|
|
|
<PriorityEditor value={issue} isEditable={true} kind={'link-bordered'} size={'small'} justify={'center'} />
|
2023-04-04 06:11:49 +00:00
|
|
|
<ComponentEditor
|
|
|
|
value={issue}
|
|
|
|
isEditable={true}
|
|
|
|
kind={'link-bordered'}
|
2023-05-02 03:46:47 +00:00
|
|
|
size={'small'}
|
2023-04-04 06:11:49 +00:00
|
|
|
justify={'center'}
|
|
|
|
width={''}
|
|
|
|
bind:onlyIcon={fullFilled[issueId]}
|
2022-07-07 02:21:30 +00:00
|
|
|
/>
|
2023-05-02 03:46:47 +00:00
|
|
|
<DueDatePresenter value={issue} size={'small'} kind={'link-bordered'} />
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
class="card-labels labels"
|
|
|
|
use:tooltip={{
|
|
|
|
component: fullFilled[issueId] ? tags.component.LabelsPresenter : undefined,
|
|
|
|
props: { object: issue, kind: 'full' }
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Component
|
|
|
|
is={tags.component.LabelsPresenter}
|
|
|
|
props={{ object: issue, ckeckFilled: fullFilled[issueId], lookupField: 'labels', kind: 'kanban' }}
|
|
|
|
on:change={(res) => {
|
|
|
|
if (res.detail.full) fullFilled[issueId] = true
|
2023-04-04 06:11:49 +00:00
|
|
|
}}
|
2023-05-02 03:46:47 +00:00
|
|
|
/>
|
|
|
|
</div>
|
2023-05-03 05:47:38 +00:00
|
|
|
{#if reports > 0 || estimations > 0 || (object.comments ?? 0) > 0 || (object.$lookup?.attachedTo !== undefined && (object.$lookup.attachedTo.comments ?? 0) > 0)}
|
|
|
|
<div class="card-footer flex-between">
|
|
|
|
<EstimationEditor kind={'list'} size={'small'} value={issue} />
|
|
|
|
<!-- {@debug issue} -->
|
|
|
|
<div class="flex-row-center gap-3 reverse">
|
|
|
|
{#if (object.attachments ?? 0) > 0}
|
|
|
|
<AttachmentsPresenter value={object.attachments} {object} />
|
|
|
|
{/if}
|
2023-05-02 03:46:47 +00:00
|
|
|
{#if (object.comments ?? 0) > 0}
|
|
|
|
<CommentsPresenter value={object.comments} {object} />
|
|
|
|
{/if}
|
|
|
|
{#if object.$lookup?.attachedTo !== undefined && (object.$lookup.attachedTo.comments ?? 0) > 0}
|
|
|
|
<CommentsPresenter value={object.$lookup?.attachedTo?.comments} object={object.$lookup?.attachedTo} />
|
|
|
|
{/if}
|
2023-05-03 05:47:38 +00:00
|
|
|
</div>
|
2023-04-04 06:11:49 +00:00
|
|
|
</div>
|
2023-05-03 05:47:38 +00:00
|
|
|
{:else}
|
|
|
|
<div class="min-h-4 max-h-4 h-4" />
|
|
|
|
{/if}
|
2022-06-15 04:59:43 +00:00
|
|
|
</div>
|
2023-04-04 06:11:49 +00:00
|
|
|
{/key}
|
2022-06-15 04:59:43 +00:00
|
|
|
</svelte:fragment>
|
|
|
|
</Kanban>
|
2022-07-06 06:11:32 +00:00
|
|
|
{/if}
|
2022-06-15 04:59:43 +00:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.header {
|
2023-05-02 03:46:47 +00:00
|
|
|
margin: 0 0.75rem 0.5rem;
|
|
|
|
padding: 0 0.5rem 0 1.25rem;
|
|
|
|
height: 2.5rem;
|
|
|
|
min-height: 2.5rem;
|
|
|
|
border: 1px solid var(--theme-divider-color);
|
|
|
|
border-radius: 0.25rem;
|
2022-06-15 04:59:43 +00:00
|
|
|
|
2023-05-02 03:46:47 +00:00
|
|
|
&:not(.gradient) {
|
|
|
|
background: rgba(var(--kanban-header-rgb-color), 1);
|
|
|
|
}
|
|
|
|
&.gradient {
|
|
|
|
background: linear-gradient(
|
|
|
|
90deg,
|
|
|
|
rgba(var(--kanban-header-rgb-color), 0.15),
|
|
|
|
rgba(var(--kanban-header-rgb-color), 0.05)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
.counter {
|
|
|
|
color: var(--theme-dark-color);
|
|
|
|
}
|
|
|
|
.tools {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
&:hover .tools {
|
|
|
|
opacity: 1;
|
2022-06-15 04:59:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
.tracker-card {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
min-height: 6.5rem;
|
2023-05-03 05:47:38 +00:00
|
|
|
border-radius: 0.25rem;
|
2023-05-02 03:46:47 +00:00
|
|
|
|
|
|
|
.card-header {
|
|
|
|
padding: 0.75rem 1rem 0;
|
|
|
|
}
|
|
|
|
.card-content {
|
|
|
|
margin: 0.5rem 1rem;
|
|
|
|
}
|
|
|
|
/* Global styles in components.scss */
|
|
|
|
.card-labels {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
margin: 0 0.75rem 0 1rem;
|
|
|
|
min-width: 0;
|
|
|
|
|
|
|
|
&.labels {
|
|
|
|
overflow: hidden;
|
|
|
|
margin: 0 1rem;
|
|
|
|
width: calc(100% - 2rem);
|
|
|
|
border-radius: 0 0.24rem 0.24rem 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.card-footer {
|
|
|
|
margin-top: 1rem;
|
|
|
|
padding: 0.75rem 1rem;
|
|
|
|
background-color: var(--theme-kanban-card-footer);
|
|
|
|
border-radius: 0 0 0.25rem 0.25rem;
|
|
|
|
}
|
2022-07-07 02:21:30 +00:00
|
|
|
}
|
2022-06-15 04:59:43 +00:00
|
|
|
</style>
|