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