use versioning selector for relations (#10360)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2026-01-05 04:09:07 +05:00
committed by GitHub
parent faa562c7e9
commit eec5c8f02f
2 changed files with 8 additions and 4 deletions
@@ -50,6 +50,7 @@
{groupBy}
bind:selectedObjects
bind:ignoreObjects
showVersions
{shadows}
{create}
on:update
@@ -1,13 +1,13 @@
<script lang="ts">
import core, { Association, Doc, WithLookup } from '@hcengineering/core'
import { IntlString } from '@hcengineering/platform'
import { createQuery, getClient, ObjectCreate } from '@hcengineering/presentation'
import { getClient, ObjectCreate } from '@hcengineering/presentation'
import { Button, IconAdd, Label, Scroller, Section, showPopup } from '@hcengineering/ui'
import { Viewlet, ViewletPreference } from '@hcengineering/view'
import { showMenu } from '../actions'
import { Viewlet, ViewletPreference, ViewOptions } from '@hcengineering/view'
import view from '../plugin'
import DocTable from './DocTable.svelte'
import ObjectBoxPopup from './ObjectBoxPopup.svelte'
import view from '../plugin'
import ViewletsSettingButton from './ViewletsSettingButton.svelte'
export let object: Doc
@@ -36,11 +36,14 @@
function add (): void {
const create = getCreate()
const isVersionable = client.getHierarchy().classHierarchyMixin(_class, core.mixin.VersionableClass) !== undefined
const baseQuery = { _id: { $nin: docs.map((p) => p._id) } }
const docQuery = isVersionable ? { isLatest: true, ...baseQuery } : baseQuery
showPopup(
ObjectBoxPopup,
{
_class,
docQuery: { _id: { $nin: docs.map((p) => p._id) } },
docQuery,
docProps: {
shouldShowAvatar: true
},