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
21b028b5
Unverified
Commit
21b028b5
authored
Dec 25, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tests and make preview for notes
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
9305ef89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
notes.js.coffee
app/assets/javascripts/notes.js.coffee
+19
-0
project_merge_requests.rb
features/steps/project/project_merge_requests.rb
+10
-3
No files found.
app/assets/javascripts/notes.js.coffee
View file @
21b028b5
...
...
@@ -41,6 +41,9 @@ class Notes
# add diff note
$
(
document
).
on
"click"
,
".js-add-diff-note-button"
,
@
addDiffNote
# hide diff note form
$
(
document
).
on
"click"
,
".js-close-discussion-note-form"
,
@
cancelDiscussionForm
cleanBinding
:
->
$
(
document
).
off
"ajax:success"
,
".js-main-target-form"
$
(
document
).
off
"ajax:success"
,
".js-discussion-note-form"
...
...
@@ -350,6 +353,15 @@ class Notes
form
.
removeClass
"js-new-note-form"
form
.
removeClass
"js-new-note-form"
GitLab
.
GfmAutoComplete
.
setup
()
# setup preview buttons
previewButton
=
form
.
find
(
".js-note-preview-button"
)
form
.
find
(
".js-note-text"
).
on
"input"
,
->
if
$
(
this
).
val
().
trim
()
isnt
""
previewButton
.
removeClass
(
"turn-off"
).
addClass
"turn-on"
else
previewButton
.
removeClass
(
"turn-on"
).
addClass
"turn-off"
form
.
show
()
###
...
...
@@ -394,4 +406,11 @@ class Notes
# only remove the form
form
.
remove
()
cancelDiscussionForm
:
(
e
)
=>
e
.
preventDefault
()
form
=
$
(
".js-new-note-form"
)
form
=
$
(
e
.
target
).
closest
(
".js-discussion-note-form"
)
@
removeDiscussionNoteForm
(
form
)
@
Notes
=
Notes
features/steps/project/project_merge_requests.rb
View file @
21b028b5
...
...
@@ -115,19 +115,26 @@ class ProjectMergeRequests < Spinach::FeatureSteps
And
'I leave a comment on the diff page'
do
init_diff_note
within
(
'.js-
temp-notes-holder
'
)
do
within
(
'.js-
discussion-note-form
'
)
do
fill_in
"note_note"
,
with:
"One comment to rule them all"
click_button
"Add Comment"
end
within
".note-text"
do
page
.
should
have_content
"One comment to rule them all"
end
end
And
'I leave a comment like "Line is wrong" on line 185 of the first file'
do
init_diff_note
within
(
".js-
temp-notes-holder
"
)
do
within
(
".js-
discussion-note-form
"
)
do
fill_in
"note_note"
,
with:
"Line is wrong"
click_button
"Add Comment"
sleep
0.05
end
within
".note-text"
do
page
.
should
have_content
"Line is wrong"
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