Tracker: add context menu to the "EditIssue" dialog (#1788)

Signed-off-by: Sergei Ogorelkov <sergei.ogorelkov@xored.com>
This commit is contained in:
Sergei Ogorelkov 2022-05-18 22:58:06 +07:00 committed by GitHub
parent 4824d911e5
commit 9f5b620dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,18 @@
import { Panel } from '@anticrm/panel'
import presentation, { createQuery, getClient, MessageViewer } from '@anticrm/presentation'
import type { Issue, IssueStatus, Team } from '@anticrm/tracker'
import { Button, EditBox, IconDownOutline, IconEdit, IconMoreH, IconUpOutline, Scroller } from '@anticrm/ui'
import {
ActionIcon,
Button,
EditBox,
IconDownOutline,
IconEdit,
IconMoreH,
IconUpOutline,
Scroller,
showPopup
} from '@anticrm/ui'
import { ContextMenu } from '@anticrm/view-resources'
import { StyledTextArea } from '@anticrm/text-editor'
import { createEventDispatcher, onMount } from 'svelte'
import tracker from '../../../plugin'
@ -109,6 +120,12 @@
isEditing = false
}
function showMenu (ev?: Event): void {
if (issue) {
showPopup(ContextMenu, { object: issue }, (ev as MouseEvent).target as HTMLElement)
}
}
onMount(() => {
dispatch('open', { ignoreKeys: ['comments', 'name', 'description', 'number'] })
})
@ -149,6 +166,7 @@
<Button disabled={!canSave} label={presentation.string.Save} on:click={save} />
{:else}
<Button icon={IconEdit} kind="transparent" size="medium" on:click={edit} />
<ActionIcon icon={IconMoreH} size={'medium'} action={showMenu} />
{/if}
</svelte:fragment>