Skip to content

Commit

Permalink
ezqms-976: exclude other types mixins (#5795)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Zinoviev <[email protected]>
  • Loading branch information
lexiv0re authored Jun 12, 2024
1 parent 83a1317 commit 617d835
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 617d835

Please sign in to comment.