diff options
Diffstat (limited to 'app/helpers/search_helper.rb')
-rw-r--r-- | app/helpers/search_helper.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index d55ad878b92..36b58be60fc 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module SearchHelper - SEARCH_PERMITTED_PARAMS = [:search, :scope, :project_id, :group_id, :repository_ref, :snippets, :state].freeze + SEARCH_PERMITTED_PARAMS = [:search, :scope, :project_id, :group_id, :repository_ref, :snippets, :sort, :state, :confidential].freeze def search_autocomplete_opts(term) return unless current_user @@ -86,6 +86,11 @@ module SearchHelper }).html_safe end + def repository_ref(project) + # Always #to_s the repository_ref param in case the value is also a number + params[:repository_ref].to_s.presence || project.default_branch + end + # Overridden in EE def search_blob_title(project, path) path @@ -294,9 +299,12 @@ module SearchHelper sanitize(html, tags: %w(a p ol ul li pre code)) end - def show_user_search_tab? - return false if Feature.disabled?(:users_search, default_enabled: true) + # _search_highlight is used in EE override + def highlight_and_truncate_issue(issue, search_term, _search_highlight) + simple_search_highlight_and_truncate(issue.description, search_term, highlighter: '<span class="gl-text-black-normal gl-font-weight-bold">\1</span>') + end + def show_user_search_tab? if @project project_search_tabs?(:members) else |