Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ea33df75
Commit
ea33df75
authored
Jul 13, 2021
by
Terri Chu
Committed by
Phil Hughes
Jul 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add file copy ability to code search results
parent
e3516f9d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
1 deletion
+5
-1
app/views/search/results/_blob_data.html.haml
app/views/search/results/_blob_data.html.haml
+1
-0
ee/spec/features/search/elastic/global_search_spec.rb
ee/spec/features/search/elastic/global_search_spec.rb
+1
-1
ee/spec/features/search/elastic/group_search_spec.rb
ee/spec/features/search/elastic/group_search_spec.rb
+1
-0
ee/spec/features/search/elastic/project_search_spec.rb
ee/spec/features/search/elastic/project_search_spec.rb
+1
-0
spec/features/search/user_searches_for_code_spec.rb
spec/features/search/user_searches_for_code_spec.rb
+1
-0
No files found.
app/views/search/results/_blob_data.html.haml
View file @
ea33df75
...
...
@@ -5,6 +5,7 @@
=
sprite_icon
(
'document'
)
%strong
=
search_blob_title
(
project
,
path
)
=
copy_file_path_button
(
path
)
-
if
blob
.
data
.file-content.code.term
{
data:
{
qa_selector:
'file_text_content'
}
}
=
render
'shared/file_highlight'
,
blob:
blob
,
first_line_number:
blob
.
startline
,
blob_link:
blob_link
,
highlight_line:
blob
.
highlight_line
ee/spec/features/search/elastic/global_search_spec.rb
View file @
ea33df75
...
...
@@ -172,8 +172,8 @@ RSpec.describe 'Global elastic search', :elastic, :sidekiq_inline do
select_search_scope
(
'Code'
)
expect
(
page
).
to
have_selector
(
'.file-content .code'
)
expect
(
page
).
to
have_selector
(
"span.line[lang='javascript']"
)
expect
(
page
).
to
have_button
(
'Copy file path'
)
end
it
'ignores nonexistent projects from stale index'
do
...
...
ee/spec/features/search/elastic/group_search_spec.rb
View file @
ea33df75
...
...
@@ -58,6 +58,7 @@ RSpec.describe 'Group elastic search', :js, :elastic, :sidekiq_might_not_need_in
select_search_scope
(
'Code'
)
expect
(
page
).
to
have_selector
(
'.file-content .code'
)
expect
(
page
).
to
have_button
(
'Copy file path'
)
end
end
...
...
ee/spec/features/search/elastic/project_search_spec.rb
View file @
ea33df75
...
...
@@ -84,6 +84,7 @@ RSpec.describe 'Project elastic search', :js, :elastic do
select_search_scope
(
'Code'
)
expect
(
page
).
to
have_selector
(
'.results'
,
text:
'def username_regex'
)
expect
(
page
).
to
have_button
(
'Copy file path'
)
end
end
...
...
spec/features/search/user_searches_for_code_spec.rb
View file @
ea33df75
...
...
@@ -22,6 +22,7 @@ RSpec.describe 'User searches for code' do
expect
(
page
).
to
have_selector
(
'.file-content .code'
)
expect
(
page
).
to
have_selector
(
"span.line[lang='javascript']"
)
expect
(
page
).
to
have_link
(
'application.js'
,
href:
%r{master/files/js/application.js}
)
expect
(
page
).
to
have_button
(
'Copy file path'
)
end
context
'when on a project page'
,
:js
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment