diff --git a/packages/presentation/src/components/ObjectSearchPopup.svelte b/packages/presentation/src/components/ObjectSearchPopup.svelte index b6d84e566f..1ad3596fad 100644 --- a/packages/presentation/src/components/ObjectSearchPopup.svelte +++ b/packages/presentation/src/components/ObjectSearchPopup.svelte @@ -32,12 +32,14 @@ import presentation from '../plugin' import { ObjectSearchCategory, ObjectSearchResult } from '../types' import { getClient } from '../utils' + import { hasResource } from '..' export let query: string = '' export let label: IntlString | undefined = undefined export let relatedDocuments: RelatedDocument[] | undefined = undefined export let ignore: RelatedDocument[] | undefined = undefined export let allowCategory: Ref[] | undefined = undefined + export let hideButtons = false let items: ObjectSearchResult[] = [] @@ -52,7 +54,7 @@ allowCategory !== undefined ? { _id: { $in: allowCategory } } : {} ) .then((r) => { - categories = r + categories = r.filter((it) => hasResource(it.query)) category = categories[0] }) @@ -151,7 +153,11 @@ -
dispatch('changeSize')}> + dispatch('changeSize')} +>
{#if label}
@@ -188,22 +194,24 @@ />
-
+
+ {@const doc = items[item]} -
dispatchItem(doc)}>
- -
+ {/if} diff --git a/packages/text-editor/src/components/MentionList.svelte b/packages/text-editor/src/components/MentionList.svelte index 4f7f0cb771..b8eaaf6c12 100644 --- a/packages/text-editor/src/components/MentionList.svelte +++ b/packages/text-editor/src/components/MentionList.svelte @@ -95,7 +95,7 @@ updateStyle() }} > - dispatchItem(evt.detail)} /> + dispatchItem(evt.detail)} hideButtons={true} />