summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-06-07 14:48:55 +0200
committerToon Claes <toon@gitlab.com>2017-06-07 15:08:57 +0200
commitf79a9fae4d7c50a4ce58646d015e3df42014f1c4 (patch)
tree7eed73450f52cb69380a37a7b4c11529f7bf5a5f
parent434b7d6bcd83eb3915013bdec4976b8645c8f725 (diff)
downloadgitlab-ce-tc-namespace-license-checks--multiple-assignees.tar.gz
Use FormHelper#issue_assignees_dropdown_options for Issue Board sidebartc-namespace-license-checks--multiple-assignees
Avoid code duplication and limit the number of CE -> EE merge conflict by reusing `FormHelper#issue_assignees_dropdown_options` to set some button attributes.
-rw-r--r--app/views/projects/boards/components/sidebar/_assignee.html.haml5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/views/projects/boards/components/sidebar/_assignee.html.haml b/app/views/projects/boards/components/sidebar/_assignee.html.haml
index e8db868f49b..c314573bdea 100644
--- a/app/views/projects/boards/components/sidebar/_assignee.html.haml
+++ b/app/views/projects/boards/components/sidebar/_assignee.html.haml
@@ -19,10 +19,11 @@
":data-name" => "assignee.name",
":data-username" => "assignee.username" }
.dropdown
- %button.dropdown-menu-toggle.js-user-search.js-author-search.js-multiselect.js-save-user-data.js-issue-board-sidebar{ type: "button", ref: "assigneeDropdown", data: { toggle: "dropdown", field_name: "issue[assignee_ids][]", first_user: (current_user.username if current_user), current_user: "true", project_id: @project.id, null_user: "true", multi_select: "true", 'max-select' => 1, dropdown: { header: 'Assignee' } },
+ - dropdown_options = issue_assignees_dropdown_options
+ %button.dropdown-menu-toggle.js-user-search.js-author-search.js-multiselect.js-save-user-data.js-issue-board-sidebar{ type: 'button', ref: 'assigneeDropdown', data: { toggle: 'dropdown', field_name: 'issue[assignee_ids][]', first_user: current_user&.username, current_user: 'true', project_id: @project.id, null_user: 'true', multi_select: 'true', 'dropdown-header': dropdown_options[:data][:'dropdown-header'], 'max-select': dropdown_options[:data][:'max-select'] },
":data-issuable-id" => "issue.id",
":data-issue-update" => "'#{namespace_project_issues_path(@project.namespace, @project)}/' + issue.id + '.json'" }
- Select assignee
+ = dropdown_options[:title]
= icon("chevron-down")
.dropdown-menu.dropdown-select.dropdown-menu-user.dropdown-menu-selectable.dropdown-menu-author
= dropdown_title("Assign to")