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
f01d0520
Commit
f01d0520
authored
Jan 12, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gets merge request discussion working again
parent
d82d3ecd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
app/assets/javascripts/issue.js.coffee
app/assets/javascripts/issue.js.coffee
+0
-2
app/assets/javascripts/merge_request.js.coffee
app/assets/javascripts/merge_request.js.coffee
+22
-0
app/views/projects/merge_requests/_discussion.html.haml
app/views/projects/merge_requests/_discussion.html.haml
+2
-2
No files found.
app/assets/javascripts/issue.js.coffee
View file @
f01d0520
...
...
@@ -33,7 +33,6 @@ class @Issue
url
:
url
,
error
:
(
jqXHR
,
textStatus
,
errorThrown
)
->
issueStatus
=
if
isClose
then
'close'
else
'open'
console
.
log
(
'failed here'
)
new
Flash
(
issueFailMessage
,
'alert'
)
success
:
(
data
,
textStatus
,
jqXHR
)
->
if
data
.
saved
...
...
@@ -48,7 +47,6 @@ class @Issue
$
(
'div.status-box-closed'
).
addClass
(
'hidden'
)
$
(
'div.status-box-open'
).
removeClass
(
'hidden'
)
else
console
.
log
(
'failed there'
)
new
Flash
(
issueFailMessage
,
'alert'
)
$this
.
prop
(
'disabled'
,
false
)
...
...
app/assets/javascripts/merge_request.js.coffee
View file @
f01d0520
...
...
@@ -19,6 +19,7 @@ class @MergeRequest
# Prevent duplicate event bindings
@
disableTaskList
()
@
initMRBtnListeners
()
if
$
(
"a.btn-close"
).
length
@
initTaskList
()
...
...
@@ -43,6 +44,27 @@ class @MergeRequest
$
(
'.detail-page-description .js-task-list-container'
).
taskList
(
'enable'
)
$
(
document
).
on
'tasklist:changed'
,
'.detail-page-description .js-task-list-container'
,
@
updateTaskList
initMRBtnListeners
:
->
_this
=
@
$
(
'a.btn-close, a.btn-reopen'
).
on
'click'
,
(
e
)
->
$this
=
$
(
this
)
if
$this
.
data
(
'submitted'
)
return
e
.
preventDefault
()
e
.
stopImmediatePropagation
()
shouldSubmit
=
$this
.
hasClass
(
'btn-comment'
)
console
.
log
(
"shouldSubmit"
)
if
shouldSubmit
_this
.
submitNoteForm
(
$this
.
closest
(
'form'
),
$this
)
submitNoteForm
:
(
form
,
$button
)
=>
noteText
=
form
.
find
(
"textarea.js-note-text"
).
val
()
if
noteText
.
trim
().
length
>
0
form
.
submit
()
$button
.
data
(
'submitted'
,
true
)
$button
.
trigger
(
'click'
)
disableTaskList
:
->
$
(
'.detail-page-description .js-task-list-container'
).
taskList
(
'disable'
)
$
(
document
).
off
'tasklist:changed'
,
'.detail-page-description .js-task-list-container'
...
...
app/views/projects/merge_requests/_discussion.html.haml
View file @
f01d0520
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:update_merge_request
,
@merge_request
)
-
if
@merge_request
.
open?
=
link_to
'Close'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-nr btn-grouped btn-close close-mr-link js-note-target-close"
,
title:
"Close merge request"
=
link_to
'Close'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-nr btn-
comment btn-
grouped btn-close close-mr-link js-note-target-close"
,
title:
"Close merge request"
-
if
@merge_request
.
closed?
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-nr btn-grouped btn-reopen reopen-mr-link js-note-target-reopen"
,
title:
"Reopen merge request"
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-nr btn-
comment btn-
grouped btn-reopen reopen-mr-link js-note-target-reopen"
,
title:
"Reopen merge request"
#notes
=
render
"projects/notes/notes_with_form"
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