diff --git a/app/controllers/dashboards_controller.rb b/app/controllers/dashboards_controller.rb index e027dbcf4..4e091b4a8 100644 --- a/app/controllers/dashboards_controller.rb +++ b/app/controllers/dashboards_controller.rb @@ -46,7 +46,8 @@ def search_params :caseworker_id, :sort_by, :sort_direction, - :application_type + :application_type, + :high_value ).merge(default_params) end diff --git a/app/controllers/nsm/searches_controller.rb b/app/controllers/nsm/searches_controller.rb index ee3bdc483..bd4058125 100644 --- a/app/controllers/nsm/searches_controller.rb +++ b/app/controllers/nsm/searches_controller.rb @@ -24,6 +24,7 @@ def search_params :updated_from, :updated_to, :status_with_assignment, + :high_value, :caseworker_id, :sort_by, :sort_direction diff --git a/app/forms/search_form.rb b/app/forms/search_form.rb index 39688c020..99de36964 100644 --- a/app/forms/search_form.rb +++ b/app/forms/search_form.rb @@ -13,6 +13,7 @@ class SearchForm < SearchResults attribute :status_with_assignment, :string attribute :caseworker_id, :string attribute :application_type, :string + attribute :high_value, :boolean validate :at_least_one_field_set validates :application_type, presence: true @@ -26,6 +27,10 @@ def caseworkers [show_all] + User.order(:last_name, :first_name).map { Option.new(_1.id, _1.display_name) } end + def claim_values + [show_all] + %i[high_value].map { Option.new(_1, I18n.t("search.claim_values.#{_1}")) } + end + def statuses [show_all] + %i[ not_assigned @@ -50,7 +55,7 @@ def at_least_one_field_set fields = [:query, :submitted_from, :submitted_to, :updated_from, :updated_to, :status_with_assignment, - :caseworker_id] + :caseworker_id, :high_value] field_set = fields.any? do |field| send(field).present? diff --git a/app/views/shared/_search.html.erb b/app/views/shared/_search.html.erb index e531e2ea6..ea0ab2696 100644 --- a/app/views/shared/_search.html.erb +++ b/app/views/shared/_search.html.erb @@ -65,6 +65,17 @@