Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONOTMERGE: CRM457-2154 NSM: add 'high value' filter to search #846

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/controllers/dashboards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def search_params
:caseworker_id,
:sort_by,
:sort_direction,
:application_type
:application_type,
:high_value
).merge(default_params)
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/nsm/searches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def search_params
:updated_from,
:updated_to,
:status_with_assignment,
:high_value,
:caseworker_id,
:sort_by,
:sort_direction
Expand Down
5 changes: 5 additions & 0 deletions app/forms/search_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 11 additions & 0 deletions app/views/shared/_search.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@
</fieldset>
</div>
<div>
<% if @search_form.application_type == 'crm7' %>
imtiazAhmd marked this conversation as resolved.
Show resolved Hide resolved
<div class="govuk-date-input__item">
<div class="govuk-form-group">
<%= f.govuk_collection_select :high_value,
@search_form.claim_values,
:value,
:label,
label: { text: t(".claim_value"), size: 's' } %>
</div>
</div>
<% end %>
<div class="govuk-date-input__item">
<div class="govuk-form-group">
<%= f.govuk_collection_select :status_with_assignment,
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ en:
updated_filter_hint: Enter a start date, end date or both, for example, 17/5/2024
updated_from: Last updated from
updated_to: Last updated to
claim_value: Claim value
search_results:
zero: There are no results that match the search criteria
one: "%{count} Search result"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en/nsm/search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ en:
rejected: Rejected
expired: Expired
unassigned: Unassigned
claim_values:
high_value: High value
nsm:
searches:
show:
Expand Down