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
98450799
Commit
98450799
authored
Jul 29, 2016
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix search results for notes without commits
parent
ab3dd9a1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
CHANGELOG
CHANGELOG
+1
-0
app/views/search/results/_note.html.haml
app/views/search/results/_note.html.haml
+6
-2
spec/features/search_spec.rb
spec/features/search_spec.rb
+20
-0
No files found.
CHANGELOG
View file @
98450799
...
@@ -31,6 +31,7 @@ v 8.11.0 (unreleased)
...
@@ -31,6 +31,7 @@ v 8.11.0 (unreleased)
- Check for Ci::Build artifacts at database level on pipeline partial
- Check for Ci::Build artifacts at database level on pipeline partial
- Make "New issue" button in Issue page less obtrusive !5457 (winniehell)
- Make "New issue" button in Issue page less obtrusive !5457 (winniehell)
- Gitlab::Metrics.current_transaction needs to be public for RailsQueueDuration
- Gitlab::Metrics.current_transaction needs to be public for RailsQueueDuration
- Fix search for notes which belongs to deleted objects
- Add GitLab Workhorse version to admin dashboard (Katarzyna Kobierska Ula Budziszewska)
- Add GitLab Workhorse version to admin dashboard (Katarzyna Kobierska Ula Budziszewska)
- Add the `sprockets-es6` gem
- Add the `sprockets-es6` gem
- Multiple trigger variables show in separate lines (Katarzyna Kobierska Ula Budziszewska)
- Multiple trigger variables show in separate lines (Katarzyna Kobierska Ula Budziszewska)
...
...
app/views/search/results/_note.html.haml
View file @
98450799
-
project
=
note
.
project
-
project
=
note
.
project
-
note_url
=
Gitlab
::
UrlBuilder
.
build
(
note
)
-
note_url
=
Gitlab
::
UrlBuilder
.
build
(
note
)
-
noteable_identifier
=
note
.
noteable
.
try
(
:iid
)
||
note
.
noteable
.
id
-
noteable_identifier
=
note
.
noteable
.
try
(
:iid
)
||
note
.
noteable
.
try
(
:id
)
.search-result-row
.search-result-row
%h5
.note-search-caption.str-truncated
%h5
.note-search-caption.str-truncated
%i
.fa.fa-comment
%i
.fa.fa-comment
...
@@ -10,7 +11,10 @@
...
@@ -10,7 +11,10 @@
·
·
-
if
note
.
for_commit?
-
if
note
.
for_commit?
=
link_to
"Commit
#{
truncate_sha
(
note
.
commit_id
)
}
"
,
note_url
=
link_to_if
(
noteable_identifier
,
"Commit
#{
truncate_sha
(
note
.
commit_id
)
}
"
,
note_url
)
do
=
truncate_sha
(
note
.
commit_id
)
%span
.light
Commit deleted
-
else
-
else
%span
#{
note
.
noteable_type
.
titleize
}
##{noteable_identifier}
%span
#{
note
.
noteable_type
.
titleize
}
##{noteable_identifier}
·
·
...
...
spec/features/search_spec.rb
View file @
98450799
...
@@ -28,6 +28,26 @@ describe "Search", feature: true do
...
@@ -28,6 +28,26 @@ describe "Search", feature: true do
end
end
context
'search for comments'
do
context
'search for comments'
do
context
'when comment belongs to a invalid commit'
do
let
(
:note
)
{
create
(
:note_on_commit
,
author:
user
,
project:
project
,
commit_id:
project
.
repository
.
commit
.
id
,
note:
'Bug here'
)
}
before
{
note
.
update_attributes
(
commit_id:
12345678
)
}
it
'finds comment'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
page
.
within
'.search'
do
fill_in
'search'
,
with:
note
.
note
click_button
'Go'
end
click_link
'Comments'
expect
(
page
).
to
have_text
(
"Commit deleted"
)
expect
(
page
).
to
have_text
(
"12345678"
)
end
end
it
'finds a snippet'
do
it
'finds a snippet'
do
snippet
=
create
(
:project_snippet
,
:private
,
project:
project
,
author:
user
,
title:
'Some title'
)
snippet
=
create
(
:project_snippet
,
:private
,
project:
project
,
author:
user
,
title:
'Some title'
)
note
=
create
(
:note
,
note
=
create
(
:note
,
...
...
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