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
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
4 deletions
+24
-4
issue.js.coffee
app/assets/javascripts/issue.js.coffee
+0
-2
merge_request.js.coffee
app/assets/javascripts/merge_request.js.coffee
+22
-0
_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
...
@@ -33,7 +33,6 @@ class @Issue
url
:
url
,
url
:
url
,
error
:
(
jqXHR
,
textStatus
,
errorThrown
)
->
error
:
(
jqXHR
,
textStatus
,
errorThrown
)
->
issueStatus
=
if
isClose
then
'close'
else
'open'
issueStatus
=
if
isClose
then
'close'
else
'open'
console
.
log
(
'failed here'
)
new
Flash
(
issueFailMessage
,
'alert'
)
new
Flash
(
issueFailMessage
,
'alert'
)
success
:
(
data
,
textStatus
,
jqXHR
)
->
success
:
(
data
,
textStatus
,
jqXHR
)
->
if
data
.
saved
if
data
.
saved
...
@@ -48,7 +47,6 @@ class @Issue
...
@@ -48,7 +47,6 @@ class @Issue
$
(
'div.status-box-closed'
).
addClass
(
'hidden'
)
$
(
'div.status-box-closed'
).
addClass
(
'hidden'
)
$
(
'div.status-box-open'
).
removeClass
(
'hidden'
)
$
(
'div.status-box-open'
).
removeClass
(
'hidden'
)
else
else
console
.
log
(
'failed there'
)
new
Flash
(
issueFailMessage
,
'alert'
)
new
Flash
(
issueFailMessage
,
'alert'
)
$this
.
prop
(
'disabled'
,
false
)
$this
.
prop
(
'disabled'
,
false
)
...
...
app/assets/javascripts/merge_request.js.coffee
View file @
f01d0520
...
@@ -19,6 +19,7 @@ class @MergeRequest
...
@@ -19,6 +19,7 @@ class @MergeRequest
# Prevent duplicate event bindings
# Prevent duplicate event bindings
@
disableTaskList
()
@
disableTaskList
()
@
initMRBtnListeners
()
if
$
(
"a.btn-close"
).
length
if
$
(
"a.btn-close"
).
length
@
initTaskList
()
@
initTaskList
()
...
@@ -43,6 +44,27 @@ class @MergeRequest
...
@@ -43,6 +44,27 @@ class @MergeRequest
$
(
'.detail-page-description .js-task-list-container'
).
taskList
(
'enable'
)
$
(
'.detail-page-description .js-task-list-container'
).
taskList
(
'enable'
)
$
(
document
).
on
'tasklist:changed'
,
'.detail-page-description .js-task-list-container'
,
@
updateTaskList
$
(
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
:
->
disableTaskList
:
->
$
(
'.detail-page-description .js-task-list-container'
).
taskList
(
'disable'
)
$
(
'.detail-page-description .js-task-list-container'
).
taskList
(
'disable'
)
$
(
document
).
off
'tasklist:changed'
,
'.detail-page-description .js-task-list-container'
$
(
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
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:update_merge_request
,
@merge_request
)
-
if
can?
(
current_user
,
:update_merge_request
,
@merge_request
)
-
if
@merge_request
.
open?
-
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?
-
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"
#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