BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
48eccdb2
Commit
48eccdb2
authored
Dec 11, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-delete-notes-on-merge-request-diff' into 'master'
Fix delete notes on merge request diff Fixes #3971 See merge request !2061
parents
a2a68858
1a9d6ec7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
8 deletions
+46
-8
CHANGELOG
CHANGELOG
+1
-0
notes.js.coffee
app/assets/javascripts/notes.js.coffee
+16
-8
merge_requests.feature
features/project/merge_requests.feature
+10
-0
merge_requests.rb
features/steps/project/merge_requests.rb
+19
-0
No files found.
CHANGELOG
View file @
48eccdb2
...
...
@@ -45,6 +45,7 @@ v 8.3.0 (unreleased)
- Accept COPYING,COPYING.lesser, and licence as license file (Zeger-Jan van de Weg)
- Fix emoji aliases problem
- Fix award-emojis Flash alert's width
- Fix deleting notes on a merge request diff
v 8.2.3
- Fix application settings cache not expiring after changes (Stan Hu)
...
...
app/assets/javascripts/notes.js.coffee
View file @
48eccdb2
...
...
@@ -350,18 +350,26 @@ class @Notes
###
removeNote
:
->
note
=
$
(
this
).
closest
(
".note"
)
note
s
=
note
.
closest
(
".notes"
)
note
_id
=
note
.
attr
(
'id'
)
# check if this is the last note for this line
if
notes
.
find
(
".note"
).
length
is
1
$
(
'.note[id="'
+
note_id
+
'"]'
).
each
->
note
=
$
(
this
)
notes
=
note
.
closest
(
".notes"
)
count
=
notes
.
closest
(
".notes_holder"
).
find
(
".discussion-notes-count"
)
#
for discussions
notes
.
closest
(
".discussion"
).
remove
()
#
check if this is the last note for this line
if
notes
.
find
(
".note"
).
length
is
1
# for diff line
s
notes
.
closest
(
"tr
"
).
remove
()
# for discussion
s
notes
.
closest
(
".discussion
"
).
remove
()
note
.
remove
()
# for diff lines
notes
.
closest
(
"tr"
).
remove
()
else
# update notes count
count
.
get
(
0
).
lastChild
.
nodeValue
=
"
#{
notes
.
children
().
length
-
1
}
"
note
.
remove
()
###
Called in response to clicking the delete attachment link
...
...
features/project/merge_requests.feature
View file @
48eccdb2
...
...
@@ -95,6 +95,16 @@ Feature: Project Merge Requests
And
I should see a diff comment saying
"Typo, please fix"
@javascript
Scenario
:
I
delete a comment on a merge request diff
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
And
I click on the Changes tab
And
I leave a comment like
"Line is wrong"
on diff
And
I delete the comment
"Line is wrong"
on diff
And
I click on the Discussion tab
Then
I should not see any discussion
@javascript
Scenario
:
I
comment on a line of a commit in merge request
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
...
...
features/steps/project/merge_requests.rb
View file @
48eccdb2
...
...
@@ -211,6 +211,25 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I delete the comment "Line is wrong" on diff'
do
page
.
within
(
'.diff-file:nth-of-type(5) .note'
)
do
find
(
'.js-note-delete'
).
click
end
end
step
'I click on the Discussion tab'
do
page
.
within
'.merge-request-tabs'
do
click_link
'Discussion'
end
# Waits for load
expect
(
page
).
to
have_css
(
'.tab-content #notes.active'
)
end
step
'I should not see any discussion'
do
expect
(
page
).
not_to
have_css
(
'.notes .discussion'
)
end
step
'I should see a discussion has started on diff'
do
page
.
within
(
".notes .discussion"
)
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion"
...
...
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