diff --git a/app/frontend/styles/_filter.scss b/app/frontend/styles/_filter.scss index 42b7e2f6a..43b9d8862 100644 --- a/app/frontend/styles/_filter.scss +++ b/app/frontend/styles/_filter.scss @@ -104,13 +104,12 @@ background-color: govuk-colour("white"); } - .autocomplete__wrapper { - @include govuk-media-query(wide) { - max-width: 20ex; - } - } - .autocomplete__option { @include govuk-font(16); } + + .autocomplete__option__hint { + @include govuk-font(14); + word-break: break-all; + } } diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 5726b5994..f35caf31f 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -89,7 +89,7 @@ module FiltersHelper def assigned_to_filter_options(user) user_options = user.support? ? User.all : (user.organisation.users + user.organisation.managing_agents.flat_map(&:users) + user.organisation.stock_owners.flat_map(&:users)).uniq - [OpenStruct.new(id: "", name: "Select an option")] + user_options.map { |user_option| OpenStruct.new(id: user_option.id, name: user_option.name) } + [OpenStruct.new(id: "", name: "Select an option", hint: "")] + user_options.map { |user_option| OpenStruct.new(id: user_option.id, name: user_option.name, hint: user_option.email) } end def collection_year_options diff --git a/app/views/filters/_radio_filter.html.erb b/app/views/filters/_radio_filter.html.erb index 8f4a790dc..d1a567ff5 100644 --- a/app/views/filters/_radio_filter.html.erb +++ b/app/views/filters/_radio_filter.html.erb @@ -11,6 +11,7 @@ category: option[:conditional_filter][:category], label: option[:conditional_filter][:label], secondary: true, + hint_text: option[:conditional_filter][:hint_text], } %> <% end %> <% end %> diff --git a/app/views/filters/_select_filter.html.erb b/app/views/filters/_select_filter.html.erb index ee274906e..e31326347 100644 --- a/app/views/filters/_select_filter.html.erb +++ b/app/views/filters/_select_filter.html.erb @@ -1,7 +1,10 @@ -<%= f.govuk_collection_select category.to_sym, - collection, - :id, - :name, - label: { hidden: secondary }, - options: { disabled: [""], selected: selected_option(category, @filter_type) }, - "data-controller": %w[accessible-autocomplete conditional-filter] %> +<%= f.govuk_select(category.to_sym, + label: { text: label, hidden: secondary }, + "data-controller": "accessible-autocomplete conditional-filter") do %> + <% collection.each do |answer| %> + + <% end %> + <% end %>