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

[LTD-5738] Content tweaks to queue view exclude flags filter #2269

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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"]
Loading