From 19c1edf7191947ff38342a4558cd9731b0c9156e Mon Sep 17 00:00:00 2001 From: Kristina Date: Mon, 12 Feb 2024 12:55:37 +0400 Subject: [PATCH] UBERF-5438: fix edit issue attributes keys (#4602) Signed-off-by: Kristina Fefelova --- .../issues/edit/ControlPanel.svelte | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte b/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte index 51653b9f8e..a1efdf7576 100644 --- a/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte @@ -16,12 +16,12 @@ import { PersonAccount } from '@hcengineering/contact' import { EmployeeBox, personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources' 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 type { Issue } from '@hcengineering/tracker' 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 ComponentEditor from '../../components/ComponentEditor.svelte' import MilestoneEditor from '../../milestones/MilestoneEditor.svelte' @@ -44,11 +44,25 @@ const client = getClient() const hierarchy = client.getHierarchy() + const ignoreKeys = [ + 'title', + 'description', + 'priority', + 'status', + 'number', + 'assignee', + 'component', + 'dueDate', + 'milestone', + 'relations', + 'blockedBy', + 'identifier' + ] let keys: KeyedAttribute[] = [] - function updateKeys (ignoreKeys: string[]): void { - const filtredKeys = getFiltredKeys(hierarchy, issue._class, ignoreKeys) + function updateKeys (_class: Ref>, ignoreKeys: string[]): void { + const filtredKeys = getFiltredKeys(hierarchy, _class, ignoreKeys) keys = filtredKeys.filter((key) => !isCollectionAttr(hierarchy, key)) } @@ -75,24 +89,10 @@ [], hierarchy.isMixin(mixinClass.extends as Ref>) ? mixinClass.extends : issue._class ) - const res = filtredKeys.filter((key) => !isCollectionAttr(hierarchy, key)) - return res + return filtredKeys.filter((key) => !isCollectionAttr(hierarchy, key)) } - $: updateKeys([ - 'title', - 'description', - 'priority', - 'status', - 'number', - 'assignee', - 'component', - 'dueDate', - 'milestone', - 'relations', - 'blockedBy', - 'identifier' - ]) + $: updateKeys(issue._class, ignoreKeys) let account: PersonAccount | undefined