ezqms-976: exclude other types mixins (#5795)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2024-06-12 19:35:39 +04:00 committed by GitHub
parent 83a1317c92
commit 617d835c4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,13 +58,6 @@
const notificationClient = getResource(notification.function.GetInboxNotificationsClient).then((res) => res())
const me = getCurrentAccount()._id
// We need to think about this issue and redesign somehow?
const ignoredMixins = [
core.mixin.SpacesTypeData,
documents.mixin.DocumentSpaceTypeData,
'training:mixin:TrainingsTypeData' as any
]
let object: Product | undefined
let title = ''
let showAllMixins = false
@ -124,7 +117,24 @@
checkMyPermission(core.permission.UpdateObject, core.space.Space, $permissionsStore))
$: descriptionKey = client.getHierarchy().getAttribute(products.class.Product, 'fullDescription')
$: mixins = object !== undefined ? getDocMixins(object, showAllMixins, new Set(ignoredMixins)) : []
$: otherSpaceTypesMixins = new Set(
object !== undefined
? client
.getModel()
.findAllSync(
core.class.SpaceType,
{
_id: { $ne: object.type }
},
{
projection: { targetClass: 1 }
}
)
?.map((st) => st.targetClass) ?? []
: []
)
$: mixins =
object !== undefined ? getDocMixins(object, showAllMixins).filter((m) => !otherSpaceTypesMixins.has(m._id)) : []
</script>
{#if object !== undefined}