Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2023-10-16 18:20:23 +07:00
committed by GitHub
parent d5d98f64e7
commit e1af333fc6
24 changed files with 93 additions and 165 deletions
@@ -246,12 +246,7 @@
<div class="mt-6">
{#key issue._id && currentProject !== undefined}
{#if currentProject !== undefined}
<SubIssues
focusIndex={50}
{issue}
shouldSaveDraft
projects={new Map([[currentProject?._id, currentProject]])}
/>
<SubIssues focusIndex={50} {issue} shouldSaveDraft />
{/if}
{/key}
</div>
@@ -13,9 +13,9 @@
// limitations under the License.
-->
<script lang="ts">
import { Class, Doc, DocumentQuery, Ref, toIdMap } from '@hcengineering/core'
import { Class, Doc, DocumentQuery, Ref } from '@hcengineering/core'
import { createQuery, getClient } from '@hcengineering/presentation'
import { Issue, Project } from '@hcengineering/tracker'
import { Issue } from '@hcengineering/tracker'
import { Button, Chevron, ExpandCollapse, IconAdd, closeTooltip, showPopup } from '@hcengineering/ui'
import view, { ViewOptions, Viewlet, ViewletPreference } from '@hcengineering/view'
import { ViewletsSettingButton } from '@hcengineering/view-resources'
@@ -24,7 +24,6 @@
import CreateIssue from '../../CreateIssue.svelte'
import SubIssueList from './SubIssueList.svelte'
export let projects: Map<Ref<Project>, Project> | undefined = undefined
export let shouldSaveDraft: boolean = false
export let object: Doc
export let query: DocumentQuery<Issue> = {}
@@ -39,23 +38,12 @@
let viewlet: Viewlet | undefined
let viewOptions: ViewOptions | undefined
let _projects = projects
export let focusIndex = -1
const projectsQuery = createQuery()
function openNewIssueDialog (): void {
showPopup(tracker.component.CreateIssue, { space: object.space, ...createParams, shouldSaveDraft }, 'top')
}
$: if (projects === undefined) {
projectsQuery.query(tracker.class.Project, { archived: false }, async (result) => {
_projects = toIdMap(result)
})
} else {
projectsQuery.unsubscribe()
}
let lastIssueId: Ref<Doc>
afterUpdate(() => {
if (lastIssueId !== object._id) {
@@ -178,7 +166,6 @@
createItemLabel={tracker.string.AddIssueTooltip}
createItemDialogProps={{ space: object.space, ...createParams, shouldSaveDraft }}
focusIndex={focusIndex === -1 ? -1 : focusIndex + 1}
projects={_projects}
{configurations}
{preference}
{viewlet}
@@ -16,12 +16,12 @@
import { Class, Doc, DocumentQuery, Ref } from '@hcengineering/core'
import { IntlString } from '@hcengineering/platform'
import { ActionContext } from '@hcengineering/presentation'
import { Issue, Project } from '@hcengineering/tracker'
import { Issue } from '@hcengineering/tracker'
import { AnyComponent, AnySvelteComponent, registerFocus } from '@hcengineering/ui'
import { ViewOptions, Viewlet, ViewletPreference } from '@hcengineering/view'
import { List, ListSelectionProvider, SelectDirection, selectionStore } from '@hcengineering/view-resources'
import tracker from '../../../plugin'
import { createEventDispatcher } from 'svelte'
import tracker from '../../../plugin'
export let query: DocumentQuery<Issue> | undefined = undefined
export let viewlet: Viewlet
@@ -31,9 +31,6 @@
export let configurations: Record<Ref<Class<Doc>>, Viewlet['config']> = {}
export let preference: ViewletPreference[] = []
// Extra properties
export let projects: Map<Ref<Project>, Project> | undefined
let list: List
const listProvider = new ListSelectionProvider(
@@ -87,7 +84,6 @@
{configurations}
{query}
flatHeaders={true}
props={{ projects }}
{disableHeader}
{createItemDialog}
{createItemDialogProps}
@@ -13,15 +13,13 @@
// limitations under the License.
-->
<script lang="ts">
import { Ref } from '@hcengineering/core'
import { Issue, Project, trackerId } from '@hcengineering/tracker'
import { Issue, trackerId } from '@hcengineering/tracker'
import { Button, IconScaleFull, Label, closeTooltip, getCurrentResolvedLocation, navigate } from '@hcengineering/ui'
import { createFilter, setFilters } from '@hcengineering/view-resources'
import tracker from '../../../plugin'
import QueryIssuesList from './QueryIssuesList.svelte'
export let issue: Issue
export let projects: Map<Ref<Project>, Project> | undefined
export let shouldSaveDraft: boolean = false
// showPopup(tracker.component.CreateIssue, { space: issue.space, parentIssue: issue, shouldSaveDraft }, 'top')
@@ -37,7 +35,6 @@
createLabel={tracker.string.AddSubIssues}
hasSubIssues={issue.subIssues > 0}
{focusIndex}
{projects}
{shouldSaveDraft}
on:docs={(evt) => {
size = evt.detail.length