mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +00:00
Fix tags editor (#3071)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
8e389c2cb1
commit
b259173407
@ -44,7 +44,8 @@
|
||||
async function addRef ({ title, color, _id: tag }: TagElement): Promise<void> {
|
||||
await Promise.all(
|
||||
objects.map(async (object) => {
|
||||
if (tagRefs.findIndex((p) => p.attachedTo === object._id) !== -1) return
|
||||
if (tagRefs.findIndex((p) => p.attachedTo === object._id && p.tag === tag) !== -1) return
|
||||
|
||||
await client.addCollection(tags.class.TagReference, object.space, object._id, object._class, 'labels', {
|
||||
title,
|
||||
color,
|
||||
|
@ -81,10 +81,8 @@
|
||||
}
|
||||
const checkSelected = (_selected: Ref<TagElement>[], element: TagElement): void => {
|
||||
if (isSelected(_selected, element)) {
|
||||
selected = _selected.filter((p) => p !== element._id)
|
||||
dispatch('update', { action: 'remove', tag: element })
|
||||
} else {
|
||||
selected = [..._selected, element._id]
|
||||
dispatch('update', { action: 'add', tag: element })
|
||||
}
|
||||
dispatch('update', { action: 'selected', selected })
|
||||
|
@ -178,7 +178,6 @@
|
||||
return
|
||||
}
|
||||
|
||||
console.log(statePos, objState, offset)
|
||||
if (offset === -1) {
|
||||
if (dir === undefined || dir === 'vertical') {
|
||||
if (statePos - 1 < 0 && objState > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user