From 4905f2903ee211eaf2f9009a86563f245b1c77b4 Mon Sep 17 00:00:00 2001 From: Darius Pirvulescu Date: Sat, 29 Mar 2025 11:20:15 -0300 Subject: [PATCH 1/8] Add form-select class to inputs --- app/views/organizations/edit.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/edit.html.erb b/app/views/organizations/edit.html.erb index 8d5ae3bbae..bd812d1533 100644 --- a/app/views/organizations/edit.html.erb +++ b/app/views/organizations/edit.html.erb @@ -66,7 +66,7 @@ <%= f.input_field :short_name, disabled: true, class: "form-control" %> <% end %> <%= f.input :ndbn_member, label: 'NDBN Membership', wrapper: :input_group do %> - <%= f.association :ndbn_member, label_method: :full_name, value_method: :id, label: false %> + <%= f.association :ndbn_member, label_method: :full_name, value_method: :id, label: false, input_html: { class: "form-select"}%> <% end %> <%= f.input :url, as: :url, placeholder: "http://www.example.com", wrapper: :input_group do %> @@ -92,14 +92,14 @@ <%= f.rich_text_area :reminder_email_text, placeholder: 'Enter reminder email content...' %> <% end %> - <%= f.input :intake_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Intake Location", :include_blank => true, wrapper: :input_group %> + <%= f.input :intake_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Intake Location", :include_blank => true, wrapper: :input_group, input_html: { class: 'form-select' } %> <%= f.label :partner_form_fields, 'Partner Profile Sections' %> <%= f.select(:partner_form_fields, Organization::ALL_PARTIALS, { include_hidden: true }, { multiple: true, class: 'form-control custom-select', 'data-controller': 'select2', 'data-select2-config-value': '{}'}) %>
- <%= f.input :default_storage_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Storage Location", :include_blank => true, wrapper: :input_group %> + <%= f.input :default_storage_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Storage Location", :include_blank => true, wrapper: :input_group, input_html: { class: 'form-select' } %> <%= f.input :invitation_text, label: "Custom Partner Invitation Message", wrapper: :input_group do %> <%= f.text_area :invitation_text, class: "form-control" %> From 8e1440e86a6c274af5a34906c094bb049e52bc39 Mon Sep 17 00:00:00 2001 From: Darius Pirvulescu Date: Sun, 30 Mar 2025 20:50:20 -0300 Subject: [PATCH 2/8] Revert input_html changes --- app/views/organizations/edit.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/edit.html.erb b/app/views/organizations/edit.html.erb index bd812d1533..8d5ae3bbae 100644 --- a/app/views/organizations/edit.html.erb +++ b/app/views/organizations/edit.html.erb @@ -66,7 +66,7 @@ <%= f.input_field :short_name, disabled: true, class: "form-control" %> <% end %> <%= f.input :ndbn_member, label: 'NDBN Membership', wrapper: :input_group do %> - <%= f.association :ndbn_member, label_method: :full_name, value_method: :id, label: false, input_html: { class: "form-select"}%> + <%= f.association :ndbn_member, label_method: :full_name, value_method: :id, label: false %> <% end %> <%= f.input :url, as: :url, placeholder: "http://www.example.com", wrapper: :input_group do %> @@ -92,14 +92,14 @@ <%= f.rich_text_area :reminder_email_text, placeholder: 'Enter reminder email content...' %> <% end %> - <%= f.input :intake_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Intake Location", :include_blank => true, wrapper: :input_group, input_html: { class: 'form-select' } %> + <%= f.input :intake_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Intake Location", :include_blank => true, wrapper: :input_group %> <%= f.label :partner_form_fields, 'Partner Profile Sections' %> <%= f.select(:partner_form_fields, Organization::ALL_PARTIALS, { include_hidden: true }, { multiple: true, class: 'form-control custom-select', 'data-controller': 'select2', 'data-select2-config-value': '{}'}) %>
- <%= f.input :default_storage_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Storage Location", :include_blank => true, wrapper: :input_group, input_html: { class: 'form-select' } %> + <%= f.input :default_storage_location, :collection => current_organization.storage_locations.active.alphabetized, :label_method => :name, :value_method => :id, :label => "Default Storage Location", :include_blank => true, wrapper: :input_group %> <%= f.input :invitation_text, label: "Custom Partner Invitation Message", wrapper: :input_group do %> <%= f.text_area :invitation_text, class: "form-control" %> From e7a307fbec99d9d59507fdc3de5936bb02b7e0da Mon Sep 17 00:00:00 2001 From: Darius Pirvulescu Date: Sun, 30 Mar 2025 20:50:42 -0300 Subject: [PATCH 3/8] Add form-select to all select tags under input-group --- .../simple_form-bootstrap/_form_multi_select.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss b/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss index 9f4deae6ba..a434e466b1 100644 --- a/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss +++ b/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss @@ -16,4 +16,10 @@ margin-left: 0 !important; margin-right: 0 !important; } -} \ No newline at end of file +} + +.input-group { + select { + @extend .form-select; + } +} From cd2184823f64c54770d12f8c0be511360ee5cb16 Mon Sep 17 00:00:00 2001 From: Darius Pirvulescu Date: Sun, 30 Mar 2025 22:14:39 -0300 Subject: [PATCH 4/8] Exted form-select class for select2-selection --- .../simple_form-bootstrap/_form_multi_select.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss b/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss index a434e466b1..7aeb0f3fe4 100644 --- a/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss +++ b/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss @@ -23,3 +23,8 @@ @extend .form-select; } } + +.select2-selection { + @extend .form-select; + padding: 0; +} From ebbe4a32343e2e600b2b32c219d0a4b600618f48 Mon Sep 17 00:00:00 2001 From: Darius Pirvulescu Date: Sun, 30 Mar 2025 22:47:46 -0300 Subject: [PATCH 5/8] Add form-select class in select2 controller --- .../simple_form-bootstrap/_form_multi_select.scss | 5 ----- app/javascript/controllers/select2_controller.js | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss b/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss index 7aeb0f3fe4..a434e466b1 100644 --- a/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss +++ b/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss @@ -23,8 +23,3 @@ @extend .form-select; } } - -.select2-selection { - @extend .form-select; - padding: 0; -} diff --git a/app/javascript/controllers/select2_controller.js b/app/javascript/controllers/select2_controller.js index 1fe03f39c6..0911c3d41d 100644 --- a/app/javascript/controllers/select2_controller.js +++ b/app/javascript/controllers/select2_controller.js @@ -10,6 +10,7 @@ export default class extends Controller { connect() { const select2 = $(this.element).select2(this.configValue); + if (select2.data('select2')) select2.data('select2').$selection.addClass('form-select p-0') if (this.hideDropdownValue) { select2.on('select2:open', function (e) { From 8a40987384b0be96e0e652146d4a520988fb2e14 Mon Sep 17 00:00:00 2001 From: Darius Pirvulescu Date: Tue, 1 Apr 2025 18:25:45 -0300 Subject: [PATCH 6/8] Remove form-select class from select2 --- app/javascript/controllers/select2_controller.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/javascript/controllers/select2_controller.js b/app/javascript/controllers/select2_controller.js index 0911c3d41d..1fe03f39c6 100644 --- a/app/javascript/controllers/select2_controller.js +++ b/app/javascript/controllers/select2_controller.js @@ -10,7 +10,6 @@ export default class extends Controller { connect() { const select2 = $(this.element).select2(this.configValue); - if (select2.data('select2')) select2.data('select2').$selection.addClass('form-select p-0') if (this.hideDropdownValue) { select2.on('select2:open', function (e) { From c991006dfba17fe5d098cc407d59c0924f49169b Mon Sep 17 00:00:00 2001 From: Darius Pirvulescu Date: Tue, 1 Apr 2025 18:28:37 -0300 Subject: [PATCH 7/8] Add selects under form-group class --- .../stylesheets/simple_form-bootstrap/_form_multi_select.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss b/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss index a434e466b1..2f573808da 100644 --- a/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss +++ b/app/assets/stylesheets/simple_form-bootstrap/_form_multi_select.scss @@ -18,7 +18,7 @@ } } -.input-group { +.input-group, .form-group { select { @extend .form-select; } From eabe58d3b072ad94b47755bebca5fe78d219d999 Mon Sep 17 00:00:00 2001 From: Darius Pirvulescu Date: Fri, 4 Apr 2025 20:49:50 -0300 Subject: [PATCH 8/8] Add missing dropdown arrow to request --- .../partners/individuals_requests/_item_request.html.erb | 2 +- app/views/partners/requests/_item_request.html.erb | 4 ++-- app/views/requests/_new.html.erb | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/partners/individuals_requests/_item_request.html.erb b/app/views/partners/individuals_requests/_item_request.html.erb index b6bfbf708c..14728740d0 100644 --- a/app/views/partners/individuals_requests/_item_request.html.erb +++ b/app/views/partners/individuals_requests/_item_request.html.erb @@ -2,7 +2,7 @@ <%= field.label :item_id, "Item Requested", {class: 'sr-only'} %> - <%= field.select :item_id, @requestable_items, {include_blank: 'Select an item'}, {class: 'form-control'} %> + <%= field.select :item_id, @requestable_items, {include_blank: 'Select an item'}, {class: 'form-control form-select'} %> diff --git a/app/views/partners/requests/_item_request.html.erb b/app/views/partners/requests/_item_request.html.erb index 3eb615d18a..2afdbcc112 100644 --- a/app/views/partners/requests/_item_request.html.erb +++ b/app/views/partners/requests/_item_request.html.erb @@ -5,7 +5,7 @@ <%= field.select :item_id, @requestable_items, {include_blank: 'Select an item'}, data: { :'item-units-target' => 'itemSelect', action: 'change->item-units#itemSelected'}, - class: 'form-control' %> + class: 'form-control form-select' %> <%= field.label :quantity, "Quantity", {class: 'sr-only'} %> @@ -16,7 +16,7 @@ <%= field.label :request_unit, "Unit", {class: 'sr-only'} %> <%= field.select :request_unit, [], {include_blank: 'units'}, - { :'data-item-units-target' => 'requestSelect', class: 'form-control'} %> + { :'data-item-units-target' => 'requestSelect', class: 'form-control form-select'} %> <% end %> diff --git a/app/views/requests/_new.html.erb b/app/views/requests/_new.html.erb index 265f1c5667..9463b0b9ff 100644 --- a/app/views/requests/_new.html.erb +++ b/app/views/requests/_new.html.erb @@ -9,7 +9,9 @@