fix for mixins for grouping by custom attributes (#3898)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-10-29 22:23:34 +05:00 committed by GitHub
parent 416dc7a2af
commit e158788f4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,15 @@
})
const customAttributes = classes
.flatMap((c) => Array.from(client.getHierarchy().getOwnAttributes(c).values()))
.flatMap((c) => {
const hierarchy = client.getHierarchy()
return hierarchy.isMixin(c)
? [
...Array.from(hierarchy.getOwnAttributes(c).values()),
...Array.from(hierarchy.getOwnAttributes(hierarchy.getBaseClass(c)).values())
]
: Array.from(client.getHierarchy().getOwnAttributes(c).values())
})
.filter(
(attr) => attr.isCustom && !attr.isHidden && [core.class.RefTo, core.class.EnumOf].includes(attr.type._class)
)