Commit 98568146 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '260340-wiki-render-like-issues' into 'master'

Improve the look of wikis in search results

See merge request gitlab-org/gitlab!47470
parents c3951323 221b14b1
- project = wiki_blob.project - project = wiki_blob.project
- wiki_blob_link = project_wiki_path(project, wiki_blob.basename) - wiki_blob_link = project_wiki_path(project, wiki_blob.basename)
= render partial: 'search/results/blob_data', locals: { blob: wiki_blob, project: project, path: wiki_blob.path, blob_link: wiki_blob_link } %div{ class: 'search-result-row gl-pb-3! gl-mt-5 gl-mb-0!' }
%span.gl-display-flex.gl-align-items-center
= link_to wiki_blob_link, data: { track_event: 'click_text', track_label: "wiki_title", track_property: 'search_result' }, class: 'gl-w-full' do
%span.term.str-truncated.gl-font-weight-bold= ::Gitlab::Git::Wiki::GollumSlug.canonicalize_filename(wiki_blob.path)
.description.term.col-sm-10.gl-px-0
= simple_search_highlight_and_truncate(wiki_blob.data, @search_term)
---
title: Improve the look of wikis in search results
merge_request: 47470
author:
type: changed
...@@ -164,15 +164,14 @@ RSpec.describe 'Global elastic search', :elastic, :sidekiq_inline do ...@@ -164,15 +164,14 @@ RSpec.describe 'Global elastic search', :elastic, :sidekiq_inline do
ensure_elasticsearch_index! ensure_elasticsearch_index!
end end
it "finds files" do it "finds wiki pages" do
visit dashboard_projects_path visit dashboard_projects_path
submit_search('term') submit_search('term')
select_search_scope('Wiki') select_search_scope('Wiki')
expect(page).to have_selector('.file-content .code') expect(page).to have_selector('.search-result-row .description', text: '# term')
expect(page).to have_link('test')
expect(page).to have_selector("span.line[lang='markdown']")
end end
end end
......
...@@ -71,12 +71,12 @@ RSpec.describe 'Group elastic search', :js, :elastic, :sidekiq_might_not_need_in ...@@ -71,12 +71,12 @@ RSpec.describe 'Group elastic search', :js, :elastic, :sidekiq_might_not_need_in
ensure_elasticsearch_index! ensure_elasticsearch_index!
end end
it 'finds pages' do it 'finds wiki pages' do
submit_search('term') submit_search('term')
select_search_scope('Wiki') select_search_scope('Wiki')
expect(page).to have_selector('.file-content .code') expect(page).to have_selector('.search-result-row .description', text: '# term')
expect(page).to have_selector('span.line[lang="markdown"]') expect(page).to have_link('test')
end end
end end
......
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