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
1f508334
Commit
1f508334
authored
Mar 30, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated tests
parent
ccc64676
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+9
-5
features/steps/shared/note.rb
features/steps/shared/note.rb
+1
-1
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+1
-1
No files found.
app/assets/javascripts/notes.js.coffee
View file @
1f508334
...
@@ -65,6 +65,8 @@ class @Notes
...
@@ -65,6 +65,8 @@ class @Notes
# add diff note
# add diff note
$
(
document
).
on
"click"
,
".js-add-diff-note-button"
,
@
addDiffNote
$
(
document
).
on
"click"
,
".js-add-diff-note-button"
,
@
addDiffNote
$
(
document
).
on
"mouseover"
,
".js-add-diff-note-button"
,
->
console
.
log
$
(
this
).
data
(
'line-code'
)
# hide diff note form
# hide diff note form
$
(
document
).
on
"click"
,
".js-close-discussion-note-form"
,
@
cancelDiscussionForm
$
(
document
).
on
"click"
,
".js-close-discussion-note-form"
,
@
cancelDiscussionForm
...
@@ -264,6 +266,8 @@ class @Notes
...
@@ -264,6 +266,8 @@ class @Notes
form
.
removeClass
"js-new-note-form"
form
.
removeClass
"js-new-note-form"
form
.
addClass
"js-main-target-form"
form
.
addClass
"js-main-target-form"
form
.
find
(
"#note_line_code"
).
remove
()
###
###
General note form setup.
General note form setup.
...
@@ -500,8 +504,9 @@ class @Notes
...
@@ -500,8 +504,9 @@ class @Notes
###
###
addDiffNote
:
(
e
)
=>
addDiffNote
:
(
e
)
=>
e
.
preventDefault
()
e
.
preventDefault
()
link
=
e
.
currentTarget
$link
=
$
(
e
.
currentTarget
)
row
=
$
(
link
).
closest
(
"tr"
)
console
.
log
$link
.
data
(
'line-code'
)
row
=
$link
.
closest
(
"tr"
)
nextRow
=
row
.
next
()
nextRow
=
row
.
next
()
hasNotes
=
nextRow
.
is
(
".notes_holder"
)
hasNotes
=
nextRow
.
is
(
".notes_holder"
)
addForm
=
false
addForm
=
false
...
@@ -510,7 +515,7 @@ class @Notes
...
@@ -510,7 +515,7 @@ class @Notes
# In parallel view, look inside the correct left/right pane
# In parallel view, look inside the correct left/right pane
if
@
isParallelView
()
if
@
isParallelView
()
lineType
=
$
(
link
)
.
data
(
"lineType"
)
lineType
=
$
link
.
data
(
"lineType"
)
targetContent
+=
"."
+
lineType
targetContent
+=
"."
+
lineType
rowCssToAdd
=
"<tr class=
\"
notes_holder js-temp-notes-holder
\"
><td class=
\"
notes_line
\"
></td><td class=
\"
notes_content parallel old
\"
></td><td class=
\"
notes_line
\"
></td><td class=
\"
notes_content parallel new
\"
></td></tr>"
rowCssToAdd
=
"<tr class=
\"
notes_holder js-temp-notes-holder
\"
><td class=
\"
notes_line
\"
></td><td class=
\"
notes_content parallel old
\"
></td><td class=
\"
notes_line
\"
></td><td class=
\"
notes_content parallel new
\"
></td></tr>"
...
@@ -536,7 +541,7 @@ class @Notes
...
@@ -536,7 +541,7 @@ class @Notes
newForm
.
appendTo
row
.
next
().
find
(
targetContent
)
newForm
.
appendTo
row
.
next
().
find
(
targetContent
)
# show the form
# show the form
@
setupDiscussionNoteForm
$
(
link
)
,
newForm
@
setupDiscussionNoteForm
$
link
,
newForm
###
###
Called in response to "cancel" on a diff note form.
Called in response to "cancel" on a diff note form.
...
@@ -561,7 +566,6 @@ class @Notes
...
@@ -561,7 +566,6 @@ class @Notes
cancelDiscussionForm
:
(
e
)
=>
cancelDiscussionForm
:
(
e
)
=>
e
.
preventDefault
()
e
.
preventDefault
()
form
=
$
(
".js-new-note-form"
)
form
=
$
(
e
.
target
).
closest
(
".js-discussion-note-form"
)
form
=
$
(
e
.
target
).
closest
(
".js-discussion-note-form"
)
@
removeDiscussionNoteForm
(
form
)
@
removeDiscussionNoteForm
(
form
)
...
...
features/steps/shared/note.rb
View file @
1f508334
...
@@ -128,7 +128,7 @@ module SharedNote
...
@@ -128,7 +128,7 @@ module SharedNote
end
end
step
'I edit the last comment with a +1'
do
step
'I edit the last comment with a +1'
do
page
.
within
(
".
notes
"
)
do
page
.
within
(
".
main-notes-list
"
)
do
find
(
".note"
).
hover
find
(
".note"
).
hover
find
(
'.js-note-edit'
).
click
find
(
'.js-note-edit'
).
click
end
end
...
...
spec/features/notes_on_merge_requests_spec.rb
View file @
1f508334
...
@@ -225,6 +225,6 @@ describe 'Comments', feature: true do
...
@@ -225,6 +225,6 @@ describe 'Comments', feature: true do
end
end
def
click_diff_line
(
data
=
line_code
)
def
click_diff_line
(
data
=
line_code
)
page
.
find
(
%Q{button[data-line-code="
#{
data
}
"]}
,
visible:
false
).
click
execute_script
(
"$('button[data-line-code=
\"
#{
data
}
\"
]').click()"
)
end
end
end
end
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