Commit 44d84fdc authored by Andy Soiron's avatar Andy Soiron

Merge branch '347501-remove-default-branch-name-link' into 'master'

Remove the default branch name in the search result page tip

See merge request gitlab-org/gitlab!76880
parents 2cea589c d1e67ea6
......@@ -102,6 +102,10 @@ module EE
search_path(safe_params.except(:repository_ref)),
data: { testid: 'es-search-default-branch' })
.split(PLACEHOLDER)
tags[:docs_link] = link_to(_('Learn more.'),
help_page_path('user/search/advanced_search', anchor: 'use-the-advanced-search-syntax'),
target: '_blank',
rel: 'noopener noreferrer')
end
# making sure all the tags are marked `html_safe`
......@@ -109,7 +113,7 @@ module EE
if enabled
_('%{doc_link_start}Advanced search%{doc_link_end} is enabled.')
else
_('%{doc_link_start}Advanced search%{doc_link_end} is disabled since %{ref_elem} is not the default branch; %{default_branch_link_start}search on %{default_branch} instead%{default_branch_link_end}.')
_('%{doc_link_start}Advanced search%{doc_link_end} is disabled since %{ref_elem} is not the default branch. %{docs_link}')
end % tags.transform_values(&:html_safe)
# wrap it inside a `div` for testing purposes
......
......@@ -100,12 +100,7 @@ RSpec.describe 'Project elastic search', :js, :elastic do
it 'displays that advanced search is disabled' do
expect(page).to have_selector('[data-testid="es-status-marker"][data-enabled="false"]')
default_branch_link = page.find('a[data-testid="es-search-default-branch"]')
params = CGI.parse(URI.parse(default_branch_link[:href]).query)
expect(default_branch_link).to have_content(project.default_branch)
expect(params).not_to include(:repository_ref)
expect(page).to have_link('Learn more.', href: help_page_path('user/search/advanced_search', anchor: 'use-the-advanced-search-syntax'))
end
end
......
......@@ -563,7 +563,7 @@ msgstr ""
msgid "%{description}- Sentry event: %{errorUrl}- First seen: %{firstSeen}- Last seen: %{lastSeen} %{countLabel}: %{count}%{userCountLabel}: %{userCount}"
msgstr ""
msgid "%{doc_link_start}Advanced search%{doc_link_end} is disabled since %{ref_elem} is not the default branch; %{default_branch_link_start}search on %{default_branch} instead%{default_branch_link_end}."
msgid "%{doc_link_start}Advanced search%{doc_link_end} is disabled since %{ref_elem} is not the default branch. %{docs_link}"
msgstr ""
msgid "%{doc_link_start}Advanced search%{doc_link_end} is enabled."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment