mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-26 18:29:51 +00:00
Fix remove tag (#2939)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
50b0f3b7c6
commit
fdae734430
@ -59,7 +59,7 @@
|
|||||||
{value.title}
|
{value.title}
|
||||||
</span>
|
</span>
|
||||||
{#if isEditable}
|
{#if isEditable}
|
||||||
<button class="btn-close" on:click|stopPropagation={() => dispatch('remove', value.tag)}>
|
<button class="btn-close" on:click|stopPropagation={() => dispatch('remove', value)}>
|
||||||
<Icon icon={IconClose} size={'x-small'} />
|
<Icon icon={IconClose} size={'x-small'} />
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { AnyAttribute, Doc } from '@hcengineering/core'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
import { AnyAttribute, Doc, Ref } from '@hcengineering/core'
|
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import type { TagReference, TagElement } from '@hcengineering/tags'
|
import type { TagReference } from '@hcengineering/tags'
|
||||||
import tags from '@hcengineering/tags'
|
import tags from '@hcengineering/tags'
|
||||||
import { getEventPopupPositionElement, Icon, IconAdd, Label, showPopup } from '@hcengineering/ui'
|
import { Icon, IconAdd, Label, getEventPopupPositionElement, showPopup } from '@hcengineering/ui'
|
||||||
import TagReferencePresenter from './TagReferencePresenter.svelte'
|
import TagReferencePresenter from './TagReferencePresenter.svelte'
|
||||||
import TagsEditorPopup from './TagsEditorPopup.svelte'
|
import TagsEditorPopup from './TagsEditorPopup.svelte'
|
||||||
|
|
||||||
@ -24,9 +24,8 @@
|
|||||||
if (readonly) return
|
if (readonly) return
|
||||||
showPopup(TagsEditorPopup, { object }, getEventPopupPositionElement(evt))
|
showPopup(TagsEditorPopup, { object }, getEventPopupPositionElement(evt))
|
||||||
}
|
}
|
||||||
async function removeTag (tag: Ref<TagElement>): Promise<void> {
|
async function removeTag (tag: TagReference): Promise<void> {
|
||||||
const tagRef = await client.findOne(tags.class.TagReference, { tag })
|
if (tag !== undefined) await client.remove(tag)
|
||||||
if (tagRef) await client.remove(tagRef)
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user