Skip to content

Commit

Permalink
Content tweaks to queue view exclude flags filter
Browse files Browse the repository at this point in the history
  • Loading branch information
currycoder committed Dec 20, 2024
1 parent 7b149bf commit bd16d46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions caseworker/queues/views/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,16 @@ def __init__(self, queue, filters_data, all_flags, all_cles, all_regimes, countr

flag_url = reverse("flags:flags")
self.fields["flags"] = forms.MultipleChoiceField(
label="Flags",
label="Show only cases with these flags",
choices=flags_choices,
required=False,
help_text=f'<a href="{flag_url}" class="govuk-link govuk-link--no-visited-state" target="_blank">Flag information (open in a new window)</a>',
# setting id for javascript to use
widget=forms.SelectMultiple(attrs={"id": "flags"}),
)
self.fields["exclude_flags"] = forms.MultipleChoiceField(
label="Exclude flags",
label="Do not show cases with these flags",
choices=flags_choices,
required=False,
help_text=f'<a href="{flag_url}" class="govuk-link govuk-link--no-visited-state" target="_blank">Flag information (open in a new window)</a>',
# setting id for javascript to use
widget=forms.SelectMultiple(attrs={"id": "exclude_flags"}),
)
Expand Down Expand Up @@ -229,6 +227,11 @@ def __init__(self, queue, filters_data, all_flags, all_cles, all_regimes, countr
"submitted_to",
Field("flags", css_class="multi-select-filter"),
Field("exclude_flags", css_class="multi-select-filter"),
HTML(
'<div class="govuk-!-margin-bottom-3">'
f'<a href="{flag_url}" class="govuk-link govuk-link--no-visited-state" target="_blank">Flag information (open in a new window)</a>'
"</div>"
),
"finalised_from",
"finalised_to",
]
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/caseworker/cases/views/test_case_bookmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ def test_bookmarks_present(
assert third["filter_json"] == {
"flags": ["64cbcf98-9beb-41ad-8f5d-276dee768990", "8f02e308-9861-4284-a7f0-f05495efce31"]
}
assert third["description"] == "Flags: AG Biological, AG Chemical"
assert third["description"] == "Show only cases with these flags: AG Biological, AG Chemical"
assert "flags=64cbcf98-9beb-41ad-8f5d-276dee768990" in third["url"]
assert "flags=8f02e308-9861-4284-a7f0-f05495efce31" in third["url"]

0 comments on commit bd16d46

Please sign in to comment.