From f096cc0471267e2aee289b9b60212d5cb5d259af Mon Sep 17 00:00:00 2001 From: Alfredo Sumaran Date: Fri, 5 Aug 2016 17:04:10 -0500 Subject: [PATCH] Set for for labels and ID for dropdowns on create form --- .../protected_branch_access_dropdown.js.es6 | 1 + .../_create_protected_branch.html.haml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/protected_branch_access_dropdown.js.es6 b/app/assets/javascripts/protected_branch_access_dropdown.js.es6 index eb5d3cc3128..2fbb088fa04 100644 --- a/app/assets/javascripts/protected_branch_access_dropdown.js.es6 +++ b/app/assets/javascripts/protected_branch_access_dropdown.js.es6 @@ -8,6 +8,7 @@ $dropdown.glDropdown({ data: data, selectable: true, + inputId: $dropdown.data('input-id'), fieldName: $dropdown.data('field-name'), toggleLabel(item) { return item.text; diff --git a/app/views/projects/protected_branches/_create_protected_branch.html.haml b/app/views/projects/protected_branches/_create_protected_branch.html.haml index 34bc465c356..85d0c494ba8 100644 --- a/app/views/projects/protected_branches/_create_protected_branch.html.haml +++ b/app/views/projects/protected_branches/_create_protected_branch.html.haml @@ -6,7 +6,7 @@ .panel-body .form-horizontal .form-group - %label.col-md-2.text-right + = f.label :name, class: 'col-md-2 text-right' do Branch: .col-md-10 = render partial: "dropdown", locals: { f: f } @@ -18,19 +18,19 @@ %code production/* are supported .form-group - %label.col-md-2.text-right + %label.col-md-2.text-right{ for: 'merge_access_level_attributes' } Allowed to merge: .col-md-10 = dropdown_tag('Select', options: { toggle_class: 'js-allowed-to-merge wide', - data: { field_name: 'protected_branch[merge_access_level_attributes][access_level]' }}) + data: { field_name: 'protected_branch[merge_access_level_attributes][access_level]', input_id: 'merge_access_level_attributes' }}) .form-group - %label.col-md-2.text-right + %label.col-md-2.text-right{ for: 'push_access_level_attributes' } Allowed to push: .col-md-10 = dropdown_tag('Select', options: { toggle_class: 'js-allowed-to-push wide', - data: { field_name: 'protected_branch[push_access_level_attributes][access_level]' }}) + data: { field_name: 'protected_branch[push_access_level_attributes][access_level]', input_id: 'push_access_level_attributes' }}) .panel-footer = f.submit 'Protect', class: 'btn-create btn', disabled: true -- GitLab