Fix sprints switch url update ()

Signed-off-by: Denis Maslennikov <denis.maslennikov@gmail.com>
This commit is contained in:
Denis Maslennikov 2022-12-21 13:06:37 +07:00 committed by GitHub
parent 2930c51fa1
commit ffe9a70804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions
plugins/tracker-resources/src/components/sprints

View File

@ -4,6 +4,7 @@
import { Sprint } from '@hcengineering/tracker'
import { Button, DatePresenter, EditBox, Icon, IconMoreH, Label, showPopup } from '@hcengineering/ui'
import { ContextMenu, DocAttributeBar } from '@hcengineering/view-resources'
import { createEventDispatcher } from 'svelte'
import { onDestroy } from 'svelte'
import { activeSprint } from '../../issues'
import tracker from '../../plugin'
@ -15,6 +16,7 @@
export let sprint: Sprint
const client = getClient()
const dispatch = createEventDispatcher()
async function change (field: string, value: any) {
await client.update(sprint, { [field]: value })
@ -24,6 +26,7 @@
showPopup(SprintPopup, { _class: tracker.class.Sprint }, container, (value) => {
if (value != null) {
sprint = value
dispatch('sprint', sprint._id)
}
})
}

View File

@ -17,7 +17,7 @@
import { IntlString } from '@hcengineering/platform'
import { createQuery } from '@hcengineering/presentation'
import { Sprint, Team } from '@hcengineering/tracker'
import { closePopup, closeTooltip, location } from '@hcengineering/ui'
import { closePopup, closeTooltip, getCurrentLocation, location, navigate } from '@hcengineering/ui'
import { onDestroy } from 'svelte'
import tracker from '../../plugin'
import { SprintViewMode } from '../../utils'
@ -53,7 +53,14 @@
</script>
{#if sprint}
<EditSprint {sprint} />
<EditSprint
{sprint}
on:sprint={(evt) => {
const loc = getCurrentLocation()
loc.path[5] = evt.detail
navigate(loc)
}}
/>
{:else}
<SprintBrowser {label} query={{ space: currentSpace }} {search} {mode} />
{/if}