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
9ee6b0ce
Commit
9ee6b0ce
authored
Apr 05, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display secondary button only in resolvable noteables
parent
46f3e37d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
+31
-16
app/assets/javascripts/comment_type_toggle.js
app/assets/javascripts/comment_type_toggle.js
+16
-11
app/views/projects/notes/_comment_type_button.html.haml
app/views/projects/notes/_comment_type_button.html.haml
+15
-5
No files found.
app/assets/javascripts/comment_type_toggle.js
View file @
9ee6b0ce
...
...
@@ -12,19 +12,24 @@ class CommentTypeToggle {
initDroplab
()
{
this
.
droplab
=
new
DropLab
();
this
.
droplab
.
init
(
this
.
trigger
,
this
.
list
,
[
InputSetter
],
{
InputSetter
:
[{
input
:
this
.
input
,
valueAttribute
:
'
data-value
'
,
},
{
input
:
this
.
button
,
valueAttribute
:
'
data-button-text
'
,
},
{
const
inputSetterConfig
=
[{
input
:
this
.
input
,
valueAttribute
:
'
data-value
'
,
},
{
input
:
this
.
button
,
valueAttribute
:
'
data-button-text
'
,
}];
if
(
this
.
secondaryButton
)
{
inputSetterConfig
.
push
({
input
:
this
.
secondaryButton
,
valueAttribute
:
'
data-secondary-button-text
'
,
}],
});
}
this
.
droplab
.
init
(
this
.
trigger
,
this
.
list
,
[
InputSetter
],
{
InputSetter
:
inputSetterConfig
});
}
}
...
...
app/views/projects/notes/_comment_type_button.html.haml
View file @
9ee6b0ce
-
noteable_type
=
@note
.
noteable_type
.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown
%button
.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button
Comment
...
...
@@ -12,8 +13,17 @@
%strong
Comment
%p
=
"Add a general comment to this
#{
noteable_type
.
titleize
.
downcase
}
."
%li
.divider
%li
#discussion
{
data:
{
value:
'DiscussionNote'
,
'button-text'
=>
'Start discussion'
,
'secondary-button-text'
=>
'Start discussion & close merge request'
}
}
=
icon
(
'check'
)
.description
%strong
Start discussion
%p
=
"Discuss a specific suggestion or question
#{
@note
.
can_be_resolvable?
?
' that needs to be resolved'
:
''
}
."
-
if
@note
.
can_be_resolvable?
%li
#discussion
{
data:
{
value:
'DiscussionNote'
,
'button-text'
=>
'Start discussion'
,
'secondary-button-text'
=>
"Start discussion & close #{noteable_type.titleize.downcase}"
}
}
=
icon
(
'check'
)
.description
%strong
Start discussion
%p
Discuss a specific suggestion or question that needs to be resolved.
-
else
%li
#discussion
{
data:
{
value:
'DiscussionNote'
,
'button-text'
=>
'Start discussion'
,
'secondary-button-text'
=>
"Start discussion & close #{noteable_type.titleize.downcase}"
}
}
=
icon
(
'check'
)
.description
%strong
Start discussion
%p
Discuss a specific suggestion or question.
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