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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
1f893022
Commit
1f893022
authored
Dec 10, 2015
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove note from MR discussion when deleting it in the changes tab
parent
e2b6a462
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
8 deletions
+45
-8
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+16
-8
features/project/merge_requests.feature
features/project/merge_requests.feature
+10
-0
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+19
-0
No files found.
app/assets/javascripts/notes.js.coffee
View file @
1f893022
...
@@ -350,7 +350,12 @@ class @Notes
...
@@ -350,7 +350,12 @@ class @Notes
###
###
removeNote
:
->
removeNote
:
->
note
=
$
(
this
).
closest
(
".note"
)
note
=
$
(
this
).
closest
(
".note"
)
note_id
=
note
.
attr
(
'id'
)
$
(
'.note[id="'
+
note_id
+
'"]'
).
each
->
note
=
$
(
this
)
notes
=
note
.
closest
(
".notes"
)
notes
=
note
.
closest
(
".notes"
)
count
=
notes
.
closest
(
".notes_holder"
).
find
(
".discussion-notes-count"
)
# check if this is the last note for this line
# check if this is the last note for this line
if
notes
.
find
(
".note"
).
length
is
1
if
notes
.
find
(
".note"
).
length
is
1
...
@@ -360,6 +365,9 @@ class @Notes
...
@@ -360,6 +365,9 @@ class @Notes
# for diff lines
# for diff lines
notes
.
closest
(
"tr"
).
remove
()
notes
.
closest
(
"tr"
).
remove
()
else
# update notes count
count
.
get
(
0
).
lastChild
.
nodeValue
=
"
#{
notes
.
children
().
length
-
1
}
"
note
.
remove
()
note
.
remove
()
...
...
features/project/merge_requests.feature
View file @
1f893022
...
@@ -94,6 +94,16 @@ Feature: Project Merge Requests
...
@@ -94,6 +94,16 @@ Feature: Project Merge Requests
Then
I should not see a diff comment saying
"Line is wrong"
Then
I should not see a diff comment saying
"Line is wrong"
And
I should see a diff comment saying
"Typo, please fix"
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
@javascript
Scenario
:
I
comment on a line of a commit in merge request
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
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
...
...
features/steps/project/merge_requests.rb
View file @
1f893022
...
@@ -211,6 +211,25 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -211,6 +211,25 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
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
step
'I should see a discussion has started on diff'
do
page
.
within
(
".notes .discussion"
)
do
page
.
within
(
".notes .discussion"
)
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion"
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