Tracker Issue tracking system (#1243)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2022-03-31 15:32:42 +07:00
committed by GitHub
parent 944cfafcba
commit 8cd1797696
87 changed files with 2382 additions and 175 deletions
@@ -0,0 +1,12 @@
<script lang='ts'>
import { Ref } from '@anticrm/core'
import { IssueStatus, Team } from '@anticrm/tracker'
import Issues from './Issues.svelte'
export let currentSpace: Ref<Team>
let todalIssues = 0
</script>
<div class='fs-title'>
Active issues {todalIssues}
</div>
<Issues currentSpace={currentSpace} categories={[IssueStatus.InProgress, IssueStatus.Todo]} on:content={(evt) => { todalIssues = evt.detail.length } }></Issues>
@@ -0,0 +1,7 @@
<script lang='ts'>
import { Ref } from '@anticrm/core'
import { IssueStatus, Team } from '@anticrm/tracker'
import Issues from './Issues.svelte'
export let currentSpace: Ref<Team>
</script>
<Issues {currentSpace} categories={[IssueStatus.Backlog]}></Issues>
@@ -0,0 +1,52 @@
<script lang="ts">
import { DocumentQuery, FindOptions } from '@anticrm/core'
import { Issue, IssueStatus, Team } from '@anticrm/tracker'
import { Scroller } from '@anticrm/ui'
import { Table } from '@anticrm/view-resources'
import tracker from '../../plugin'
import contact from '@anticrm/contact'
export let query: DocumentQuery<Issue>
export let category: IssueStatus
export let currentTeam: Team
const options: FindOptions<Issue> = {
lookup: {
assignee: contact.class.Employee
}
}
let visible = false
</script>
<div class='category' class:visible={visible}>
<div class='fs-title'>
{IssueStatus[category]}
</div>
<Scroller>
<Table
_class={tracker.class.Issue}
config={[
{ key: '', presenter: tracker.component.IssuePresenter, props: { currentTeam }, label: tracker.string.Issue },
'title',
// 'status',
'$lookup.assignee',
'modifiedOn'
]}
options={options}
query={{ ...query, status: category }}
showNotification
highlightRows
on:content={(evt) => { visible = evt.detail.length > 0 }}
/>
</Scroller>
</div>
<style lang="scss">
.category {
display: none;
&.visible {
display: block;
}
}
</style>
@@ -0,0 +1,81 @@
<!--
// 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.
-->
<script lang="ts">
import contact from '@anticrm/contact'
import { getClient, UserBox } from '@anticrm/presentation'
import type { Issue } from '@anticrm/tracker'
import { StyledTextBox } from '@anticrm/text-editor'
import { EditBox, Grid } from '@anticrm/ui'
import { createEventDispatcher, onMount } from 'svelte'
import tracker from '../../plugin'
import Card from '../Card.svelte'
export let object: Issue
const dispatch = createEventDispatcher()
const client = getClient()
function change (field: string, value: any) {
client.update(object, { [field]: value })
}
onMount(() => {
dispatch('open', { ignoreKeys: ['comments', 'name', 'description', 'number'] })
})
</script>
<Card
label={tracker.string.NewIssue}
okAction={() => {}}
canSave={true}
on:close={() => {
dispatch('close')
}}
>
{#if object !== undefined}
<Grid column={1} rowGap={1.5}>
<EditBox
label={tracker.string.Title}
bind:value={object.title}
placeholder={tracker.string.IssueTitlePlaceholder}
maxWidth={'16rem'}
focus
on:change={() => change('title', object.title) }
/>
<StyledTextBox alwaysEdit bind:content={object.description} placeholder={tracker.string.IssueDescriptionPlaceholder}
on:change={() => change('description', object.description) }/>
<UserBox
_class={contact.class.Employee}
title={tracker.string.Assignee}
caption={tracker.string.Assignee}
bind:value={object.assignee}
allowDeselect
titleDeselect={tracker.string.TaskUnAssign}
on:change={() => change('assignee', object.assignee) }
/>
</Grid>
{/if}
</Card>
<style lang="scss">
.description {
display: flex;
padding: 1rem;
height: 12rem;
border-radius: .25rem;
background-color: var(--theme-bg-accent-color);
border: 1px solid var(--theme-bg-accent-color);
}
</style>
@@ -0,0 +1,45 @@
<!--
// 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.
-->
<script lang="ts">
import { getClient } from '@anticrm/presentation'
import type { Issue, Team } from '@anticrm/tracker'
import { Icon, showPopup } from '@anticrm/ui'
import tracker from '../../plugin'
export let value: Issue
export let currentTeam: Team
export let inline: boolean = false
const client = getClient()
const shortLabel = client.getHierarchy().getClass(value._class).shortLabel
function show (evt: Event) {
showPopup(tracker.component.EditIssue, { object: value }, evt.currentTarget)
}
</script>
{#if value && shortLabel}
<div
class="flex-presenter"
class:inline-presenter={inline}
on:click={show}
>
<div class="icon">
<Icon icon={tracker.icon.Issue} size={'small'} />
</div>
<span class="label nowrap">{currentTeam.identifier}-{value.number}</span>
</div>
{/if}
@@ -0,0 +1,55 @@
<!--
// 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">
import type { DocumentQuery, Ref } from '@anticrm/core'
import { createQuery } from '@anticrm/presentation'
import { Issue, IssueStatus, Team } from '@anticrm/tracker'
import { ScrollBox } from '@anticrm/ui'
import CategoryPresenter from './CategoryPresenter.svelte'
import tracker from '../../plugin'
export let currentSpace: Ref<Team>
export let categories = [
IssueStatus.InProgress,
IssueStatus.Todo,
IssueStatus.Backlog,
IssueStatus.Done,
IssueStatus.Canceled
]
export let query: DocumentQuery<Issue> = {}
export let search: string = ''
$: resultQuery =
search === '' ? { space: currentSpace, ...query } : { $search: search, space: currentSpace, ...query }
const spaceQuery = createQuery()
let currentTeam: Team | undefined
$: spaceQuery.query(tracker.class.Team, { _id: currentSpace }, (res) => {
currentTeam = res.shift()
})
</script>
{#if currentTeam}
<ScrollBox vertical stretch>
<div class="ml-4 mt-4">
{#each categories as category}
<CategoryPresenter {category} query={resultQuery} {currentTeam} />
{/each}
</div>
</ScrollBox>
{/if}