mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 08:48:01 +00:00
UBERF-5438: fix edit issue attributes keys (#4602)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
808d484a3c
commit
19c1edf719
@ -16,12 +16,12 @@
|
|||||||
import { PersonAccount } from '@hcengineering/contact'
|
import { PersonAccount } from '@hcengineering/contact'
|
||||||
import { EmployeeBox, personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
import { EmployeeBox, personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
||||||
import core, { Class, ClassifierKind, Doc, Mixin, Ref } from '@hcengineering/core'
|
import core, { Class, ClassifierKind, Doc, Mixin, Ref } from '@hcengineering/core'
|
||||||
import { AttributeBarEditor, KeyedAttribute, createQuery, getClient } from '@hcengineering/presentation'
|
import { AttributeBarEditor, createQuery, getClient, KeyedAttribute } from '@hcengineering/presentation'
|
||||||
|
|
||||||
import tags from '@hcengineering/tags'
|
import tags from '@hcengineering/tags'
|
||||||
import type { Issue } from '@hcengineering/tracker'
|
import type { Issue } from '@hcengineering/tracker'
|
||||||
import { Component, Label } from '@hcengineering/ui'
|
import { Component, Label } from '@hcengineering/ui'
|
||||||
import { ObjectBox, getFiltredKeys, isCollectionAttr } from '@hcengineering/view-resources'
|
import { getFiltredKeys, isCollectionAttr, ObjectBox } from '@hcengineering/view-resources'
|
||||||
import tracker from '../../../plugin'
|
import tracker from '../../../plugin'
|
||||||
import ComponentEditor from '../../components/ComponentEditor.svelte'
|
import ComponentEditor from '../../components/ComponentEditor.svelte'
|
||||||
import MilestoneEditor from '../../milestones/MilestoneEditor.svelte'
|
import MilestoneEditor from '../../milestones/MilestoneEditor.svelte'
|
||||||
@ -44,11 +44,25 @@
|
|||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
|
const ignoreKeys = [
|
||||||
|
'title',
|
||||||
|
'description',
|
||||||
|
'priority',
|
||||||
|
'status',
|
||||||
|
'number',
|
||||||
|
'assignee',
|
||||||
|
'component',
|
||||||
|
'dueDate',
|
||||||
|
'milestone',
|
||||||
|
'relations',
|
||||||
|
'blockedBy',
|
||||||
|
'identifier'
|
||||||
|
]
|
||||||
|
|
||||||
let keys: KeyedAttribute[] = []
|
let keys: KeyedAttribute[] = []
|
||||||
|
|
||||||
function updateKeys (ignoreKeys: string[]): void {
|
function updateKeys (_class: Ref<Class<Issue>>, ignoreKeys: string[]): void {
|
||||||
const filtredKeys = getFiltredKeys(hierarchy, issue._class, ignoreKeys)
|
const filtredKeys = getFiltredKeys(hierarchy, _class, ignoreKeys)
|
||||||
keys = filtredKeys.filter((key) => !isCollectionAttr(hierarchy, key))
|
keys = filtredKeys.filter((key) => !isCollectionAttr(hierarchy, key))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,24 +89,10 @@
|
|||||||
[],
|
[],
|
||||||
hierarchy.isMixin(mixinClass.extends as Ref<Class<Doc>>) ? mixinClass.extends : issue._class
|
hierarchy.isMixin(mixinClass.extends as Ref<Class<Doc>>) ? mixinClass.extends : issue._class
|
||||||
)
|
)
|
||||||
const res = filtredKeys.filter((key) => !isCollectionAttr(hierarchy, key))
|
return filtredKeys.filter((key) => !isCollectionAttr(hierarchy, key))
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$: updateKeys([
|
$: updateKeys(issue._class, ignoreKeys)
|
||||||
'title',
|
|
||||||
'description',
|
|
||||||
'priority',
|
|
||||||
'status',
|
|
||||||
'number',
|
|
||||||
'assignee',
|
|
||||||
'component',
|
|
||||||
'dueDate',
|
|
||||||
'milestone',
|
|
||||||
'relations',
|
|
||||||
'blockedBy',
|
|
||||||
'identifier'
|
|
||||||
])
|
|
||||||
|
|
||||||
let account: PersonAccount | undefined
|
let account: PersonAccount | undefined
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user