Skip to content

Commit

Permalink
prevent showing the section filter button for short queries
Browse files Browse the repository at this point in the history
also prevent the search bar from yelling at me and downgrade
"danger" to info and warning
  • Loading branch information
martenson committed May 3, 2024
1 parent 23fe064 commit b9b9f83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions client/src/components/History/HistoryScrollList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ async function loadMore(noScroll = false) {
<template>
<div :class="isMultiviewPanel ? 'unified-panel' : 'flex-column-overflow'">
<div class="unified-panel-controls">
<BBadge v-if="props.filter && !validFilter" class="alert-danger w-100 mb-2">
Search string too short!
<BBadge v-if="props.filter && !validFilter" class="alert-warning w-100 mb-2">
Search term is too short
</BBadge>
<BAlert v-else-if="!busy && hasNoResults" class="mb-2" variant="danger" show>No histories found.</BAlert>
</div>
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Panels/ToolBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ function onToggle() {
</b-button>
</div>
<div v-else-if="queryTooShort" class="pb-2">
<b-badge class="alert-danger w-100">Search string too short!</b-badge>
<b-badge class="alert-info w-100">Search term is too short</b-badge>
</div>
<div v-else-if="queryFinished && !hasResults" class="pb-2">
<b-badge class="alert-danger w-100">No results found!</b-badge>
<b-badge class="alert-warning w-100">No results found</b-badge>
</div>
<div v-if="closestTerm" class="pb-2">
<b-badge class="alert-danger w-100">
Expand Down Expand Up @@ -304,7 +304,7 @@ function onToggle() {
v-if="panel"
:category="panel || {}"
:query-filter="queryFilter || undefined"
:has-filter-button="!!query && currentPanelView === 'default'"
:has-filter-button="!!query && !queryTooShort && currentPanelView === 'default'"
@onClick="onToolClick"
@onFilter="onSectionFilter" />
</div>
Expand Down

0 comments on commit b9b9f83

Please sign in to comment.