Fix various quick search bugs [SCI-10714]

This commit is contained in:
Andrej 2024-05-20 10:35:06 +02:00
parent 2c8a2bd295
commit 89210bbd17
5 changed files with 9 additions and 8 deletions

View file

@ -13,7 +13,7 @@ class TeamsController < ApplicationController
before_action :check_export_projects_permissions, only: %i(export_projects_modal export_projects)
def visible_teams
teams = current_user.teams
teams = current_user.teams.order(:name)
render json: teams, each_serializer: TeamSerializer
end

View file

@ -53,7 +53,7 @@
</div>
<button class="btn btn-light btn-sm" @click="filterModalOpened = true">
<i class="sn-icon sn-icon-search-options"></i>
<span class="tw-hidden lg:inline">{{ i18n.t('search.index.more_search_options') }}</span>
<span class="tw-hidden xl:inline">{{ i18n.t('search.index.more_search_options') }}</span>
<span
v-if="activeFilters.length > 0"
class="absolute -right-1 -top-1 rounded-full bg-sn-science-blue text-white flex items-center justify-center w-4 h-4 text-[9px]"
@ -65,12 +65,12 @@
<div class="h-4 w-[1px] bg-sn-grey"></div>
<button class="btn btn-light btn-sm" @click="resetFilters">
<i class="sn-icon sn-icon-close"></i>
<span class="tw-hidden lg:inline">{{ i18n.t('search.index.clear_filters') }}</span>
<span class="tw-hidden xl:inline">{{ i18n.t('search.index.clear_filters') }}</span>
</button>
</template>
<button v-if="activeGroup" class="btn btn-light btn-sm" @click="resetGroup">
<i class="sn-icon sn-icon-undo"></i>
<span class="tw-hidden lg:inline">{{ i18n.t('search.index.all_results') }}</span>
<span class="tw-hidden xl:inline">{{ i18n.t('search.index.all_results') }}</span>
</button>
</div>
<template v-for="group in searchGroups">
@ -87,7 +87,7 @@
@updated="calculateTotalElements"
/>
</template>
<div v-if="totalElements === 0" class="bg-white rounded p-4">
<div v-if="totalElements === 0 && activeGroup === null" class="bg-white rounded p-4">
<NoSearchResult />
</div>
<teleport to='body'>

View file

@ -35,8 +35,8 @@ module BreadcrumbsHelper
parent = subject.team
url = repository_path(subject)
when RepositoryRow
parent = subject.team
url = repository_path(subject.repository)
parent = subject.repository
url = repository_path(subject.repository, landing_page: true, row_id: subject.id)
when Report
parent = subject.team

View file

@ -7,7 +7,7 @@ class QuickSearchSerializer < ActiveModel::Serializer
attributes :updated_at, :archived, :breadcrumbs, :code
def archived
@object.archived?
@object.respond_to?(:archived_branch?) ? @object.archived_branch? : @object.archived?
rescue StandardError
false
end

View file

@ -508,6 +508,7 @@ en:
protocol_templates: "Protocol templates"
label_templates: "Label templates"
format: "Format"
archived: "Archived"
reports: "Reports"
repository: "Inventory"
more_search_options: "More search options"