From 8d62d91d28566abdcbee388b09e1c48f73e31024 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Sun, 3 May 2026 23:41:27 +0500 Subject: [PATCH] Allow to sort attributes for parent and sub class together (#10816) Signed-off-by: Denis Bykhov --- .../src/components/settings/ProperitiesSection.svelte | 1 + .../src/components/ClassAttributes.svelte | 8 ++++++++ .../src/components/ClassAttributesList.svelte | 6 +++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/card-resources/src/components/settings/ProperitiesSection.svelte b/plugins/card-resources/src/components/settings/ProperitiesSection.svelte index 27950a3f77..426c15c88c 100644 --- a/plugins/card-resources/src/components/settings/ProperitiesSection.svelte +++ b/plugins/card-resources/src/components/settings/ProperitiesSection.svelte @@ -62,6 +62,7 @@ showHeader={false} disabled={false} isCard + showAll >
>, to: Ref>): void => { selected = undefined const h = client.getHierarchy() + if (showAll && !h.isMixin(_class)) { + classes = [] + return + } const toAncestors = new Set(h.getAncestors(to)) classes = h .getAncestors(_class) @@ -213,6 +218,7 @@ {_class} {ofClass} {attributeMapper} + showAll={showAll && !hierarchy.isMixin(_class)} {selected} on:deselect={handleDeselect} on:select={handleSelect} @@ -230,6 +236,7 @@ {ofClass} {attributeMapper} {selected} + showAll={showAll && !hierarchy.isMixin(_class)} notUseOfClass on:deselect={handleDeselect} on:select={handleSelect} @@ -244,6 +251,7 @@ {ofClass} {attributeMapper} {selected} + showAll={showAll && !hierarchy.isMixin(_class)} on:deselect={handleDeselect} on:select={handleSelect} /> diff --git a/plugins/setting-resources/src/components/ClassAttributesList.svelte b/plugins/setting-resources/src/components/ClassAttributesList.svelte index 8ab7299d4d..2a1fbf0b6b 100644 --- a/plugins/setting-resources/src/components/ClassAttributesList.svelte +++ b/plugins/setting-resources/src/components/ClassAttributesList.svelte @@ -47,6 +47,7 @@ export let ofClass: Ref> | undefined = undefined export let notUseOfClass: boolean = false export let selected: AnyAttribute | undefined = undefined + export let showAll: boolean = false export let attributeMapper: | { @@ -73,9 +74,8 @@ function getCustomAttributes (_class: Ref>): AnyAttribute[] { const cl = hierarchy.getClass(_class) - const attributes = Array.from( - hierarchy.getAllAttributes(_class, _class === ofClass && !notUseOfClass ? core.class.Doc : cl.extends).values() - ).sort((a, b) => { + const to = showAll ? ofClass : _class === ofClass && !notUseOfClass ? core.class.Doc : cl.extends + const attributes = Array.from(hierarchy.getAllAttributes(_class, to).values()).sort((a, b) => { const rankA = a.rank ?? toRank(a._id) ?? '' const rankB = b.rank ?? toRank(b._id) ?? '' return rankA.localeCompare(rankB)