mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-30 17:04:31 +08:00
Merge pull request #7582 from aignatov-bio/ai-sci-10694-small-fixes-for-global-search
Small fixes for global search [SCI-10694]
This commit is contained in:
commit
c7fe8711ea
2 changed files with 19 additions and 12 deletions
|
@ -3,7 +3,10 @@
|
|||
<div class="content-header">
|
||||
<div class="title-row">
|
||||
<h1 class="mt-0 truncate !inline">
|
||||
{{ i18n.t('search.index.results_title_html', { query: localQuery }) }}
|
||||
<StringWithEllipsis
|
||||
class="w-full"
|
||||
:endCharacters="5"
|
||||
:text="i18n.t('search.index.results_title_html', { query: localQuery })"></StringWithEllipsis>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,14 +32,16 @@
|
|||
</div>
|
||||
</template>
|
||||
<template v-slot:flyout >
|
||||
<div v-for="(query, i) in reversedPreviousQueries" @click="setQuery(query)" :key="i"
|
||||
ref="historyItems"
|
||||
@keydown="focusHistoryItem"
|
||||
tabindex="1"
|
||||
@keydown.enter="setQuery(query)"
|
||||
class="flex px-3 min-h-11 items-center gap-2 hover:bg-sn-super-light-grey cursor-pointer">
|
||||
<i class="sn-icon sn-icon-history-search"></i>
|
||||
{{ query }}
|
||||
<div class="max-w-[600px]">
|
||||
<div v-for="(query, i) in reversedPreviousQueries" @click="setQuery(query)" :key="i"
|
||||
ref="historyItems"
|
||||
@keydown="focusHistoryItem"
|
||||
tabindex="1"
|
||||
@keydown.enter="setQuery(query)"
|
||||
class="flex px-3 min-h-11 items-center gap-2 hover:bg-sn-super-light-grey cursor-pointer">
|
||||
<i class="sn-icon sn-icon-history-search"></i>
|
||||
{{ query }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</GeneralDropdown>
|
||||
|
@ -121,6 +126,7 @@ import ReportsComponent from './groups/reports.vue';
|
|||
import FiltersModal from './filters_modal.vue';
|
||||
import GeneralDropdown from '../shared/general_dropdown.vue';
|
||||
import NoSearchResult from './groups/helpers/no_search_result.vue';
|
||||
import StringWithEllipsis from '../shared/string_with_ellipsis.vue';
|
||||
|
||||
export default {
|
||||
emits: ['search', 'selectGroup'],
|
||||
|
@ -161,7 +167,8 @@ export default {
|
|||
ReportsComponent,
|
||||
FiltersModal,
|
||||
GeneralDropdown,
|
||||
NoSearchResult
|
||||
NoSearchResult,
|
||||
StringWithEllipsis
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<hr class="my-2">
|
||||
<button class="btn btn-light truncate !block leading-10" @click="searchValue">
|
||||
<button class="btn btn-light truncate !block leading-10 max-w-[600px]" @click="searchValue">
|
||||
{{ i18n.t('search.quick_search.all_results', {query: searchQuery}) }}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -297,7 +297,7 @@ export default {
|
|||
this.fetchQuickSearchResults();
|
||||
},
|
||||
fetchQuickSearchResults() {
|
||||
if (this.loading) return;
|
||||
if (this.loading || this.invalidQuery) return;
|
||||
|
||||
this.loading = true;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue