mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-23 20:13:20 +00:00
UBERF-4324: While indexing is still in progress we see undefined (#4017)
Signed-off-by: Maxim Karmatskikh <mkarmatskih@gmail.com>
This commit is contained in:
parent
7621bccf22
commit
dc94123e2a
@ -63,7 +63,7 @@ export class TObjectDDParticipant extends TClass implements ObjectDDParticipant
|
||||
@Mixin(serverCore.mixin.SearchPresenter, core.class.Class)
|
||||
export class TSearchPresenter extends TClass implements SearchPresenter {
|
||||
searchConfig!: ClassSearchConfig
|
||||
getSearchObjectId!: Resource<SearchPresenterFunc>
|
||||
getSearchShortTitle!: Resource<SearchPresenterFunc>
|
||||
getSearchTitle!: Resource<SearchPresenterFunc>
|
||||
}
|
||||
|
||||
|
@ -164,39 +164,43 @@
|
||||
$: updateItems(query)
|
||||
</script>
|
||||
|
||||
<form class="antiPopup mentionPoup" on:keydown={onKeyDown} use:resizeObserver={() => dispatch('changeSize')}>
|
||||
<div class="ap-scroll" bind:this={scrollContainer}>
|
||||
<div class="ap-box">
|
||||
{#if items.length === 0 && query !== ''}
|
||||
<div class="noResults"><Label label={presentation.string.NoResults} /></div>
|
||||
{/if}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<ListView bind:this={list} bind:selection count={items.length}>
|
||||
<svelte:fragment slot="category" let:item={num}>
|
||||
{@const item = items[num]}
|
||||
{#if item.num === 0}
|
||||
<div class="mentonCategory">
|
||||
<Label label={item.category.title} />
|
||||
</div>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="item" let:item={num}>
|
||||
{@const item = items[num]}
|
||||
{@const doc = item.item}
|
||||
<div
|
||||
class="ap-menuItem withComp"
|
||||
on:click={() => {
|
||||
dispatchItem(doc)
|
||||
}}
|
||||
>
|
||||
<MentionResult value={doc} />
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
</ListView>
|
||||
{#if (items.length === 0 && query !== '') || items.length > 0}
|
||||
<form class="antiPopup mentionPoup" on:keydown={onKeyDown} use:resizeObserver={() => dispatch('changeSize')}>
|
||||
<div class="ap-scroll" bind:this={scrollContainer}>
|
||||
<div class="ap-box">
|
||||
{#if items.length === 0 && query !== ''}
|
||||
<div class="noResults"><Label label={presentation.string.NoResults} /></div>
|
||||
{/if}
|
||||
{#if items.length > 0}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<ListView bind:this={list} bind:selection count={items.length}>
|
||||
<svelte:fragment slot="category" let:item={num}>
|
||||
{@const item = items[num]}
|
||||
{#if item.num === 0}
|
||||
<div class="mentonCategory">
|
||||
<Label label={item.category.title} />
|
||||
</div>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="item" let:item={num}>
|
||||
{@const item = items[num]}
|
||||
{@const doc = item.item}
|
||||
<div
|
||||
class="ap-menuItem withComp"
|
||||
on:click={() => {
|
||||
dispatchItem(doc)
|
||||
}}
|
||||
>
|
||||
<MentionResult value={doc} />
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
</ListView>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ap-space x2" />
|
||||
</form>
|
||||
<div class="ap-space x2" />
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
.noResults {
|
||||
|
@ -85,7 +85,7 @@ export async function updateDocWithPresenter (hierarchy: Hierarchy, doc: Indexed
|
||||
props.push({
|
||||
name: 'searchShortTitle',
|
||||
config: searchPresenter.searchConfig.shortTitle,
|
||||
provider: searchPresenter.getSearchObjectId
|
||||
provider: searchPresenter.getSearchShortTitle
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -365,6 +365,6 @@ export interface ClassSearchConfig {
|
||||
*/
|
||||
export interface SearchPresenter extends Class<Doc> {
|
||||
searchConfig: ClassSearchConfig
|
||||
getSearchObjectId?: Resource<SearchPresenterFunc>
|
||||
getSearchShortTitle?: Resource<SearchPresenterFunc>
|
||||
getSearchTitle?: Resource<SearchPresenterFunc>
|
||||
}
|
||||
|
@ -128,7 +128,12 @@ class ElasticAdapter implements FullTextAdapter {
|
||||
size: options.limit ?? DEFAULT_LIMIT
|
||||
}
|
||||
|
||||
const filter = []
|
||||
const filter: any = [
|
||||
{
|
||||
exists: { field: 'searchTitle' }
|
||||
}
|
||||
]
|
||||
|
||||
if (query.spaces !== undefined) {
|
||||
filter.push({
|
||||
terms: { 'space.keyword': query.spaces }
|
||||
|
Loading…
Reference in New Issue
Block a user