mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-11 12:17:44 +02:00
use versioning selector for relations (#10360)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user