Commit 9ee6b0ce authored by Alfredo Sumaran's avatar Alfredo Sumaran

Display secondary button only in resolvable noteables

parent 46f3e37d
...@@ -12,19 +12,24 @@ class CommentTypeToggle { ...@@ -12,19 +12,24 @@ class CommentTypeToggle {
initDroplab() { initDroplab() {
this.droplab = new DropLab(); this.droplab = new DropLab();
this.droplab.init(this.trigger, this.list, [InputSetter], {
InputSetter: [{ const inputSetterConfig = [{
input: this.input, input: this.input,
valueAttribute: 'data-value', valueAttribute: 'data-value',
}, },
{ {
input: this.button, input: this.button,
valueAttribute: 'data-button-text', valueAttribute: 'data-button-text',
}, }];
{ if (this.secondaryButton) {
inputSetterConfig.push({
input: this.secondaryButton, input: this.secondaryButton,
valueAttribute: 'data-secondary-button-text', valueAttribute: 'data-secondary-button-text',
}], });
}
this.droplab.init(this.trigger, this.list, [InputSetter], {
InputSetter: inputSetterConfig
}); });
} }
} }
......
- noteable_type = @note.noteable_type - noteable_type = @note.noteable_type
.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown .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 %button.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button
Comment Comment
...@@ -12,8 +13,17 @@ ...@@ -12,8 +13,17 @@
%strong Comment %strong Comment
%p= "Add a general comment to this #{noteable_type.titleize.downcase}." %p= "Add a general comment to this #{noteable_type.titleize.downcase}."
%li.divider %li.divider
%li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => 'Start discussion & close merge request' } } - if @note.can_be_resolvable?
= icon('check') %li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => "Start discussion & close #{noteable_type.titleize.downcase}" } }
.description = icon('check')
%strong Start discussion .description
%p= "Discuss a specific suggestion or question#{@note.can_be_resolvable? ? ' that needs to be resolved' : ''}." %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.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment