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

Party list page filtering #1659

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Party list page filtering #1659

merged 1 commit into from
Jul 25, 2023

Conversation

Bekabyx
Copy link
Contributor

@Bekabyx Bekabyx commented Jul 17, 2023

Asana

This work adds filters to the party list page @ /parties/ and updates the descriptive text at the top of the page. Text changes were spitballed between Peter and I but this can be modified if you have any suggestions on how to improve it 📈

Initially the filters only include the most high level categories - nation, register and status.

Most of the code which handles the filtering has been lifted from YNR's photo review filter code, as that implements both advanced filters and "shortcut" filters which were useful in this scenario. Shortcut filters allow us to have "quick filters" spanning multiple fields and values (e.g. a quick one-click filter for "Deregistered parties in Great Britain"). The advanced filters allow the user to curate their own filter and add functionality that allows the user to filter for nation - applicable to GB parties which must specify which nation(s) they operate in.

NB: The nations filter is inclusive. That is to say, if you filter for "Wales" you will get parties that include Wales within their nation list, but may also contain other nations in their nation list. There is no way to filter for parties that stand exclusively in one or two nations.

Screenshot 2023-07-21 at 15 35 45 Screenshot 2023-07-21 at 15 35 59

To Test

Set-up

  • You have probably done this already, but make sure you're up to date on migrations and you've run manage.py import_parties. You need the nations for this one!

Quick filters

Work through the four quick filters. In some cases it's impossible to check exhaustively, but just a couple of parties checked should be sufficient :)

  • Registered in Great Britain and Registered in Northern Ireland shouldn't show any parties which have (Deregistered) after their names.
  • All parties shown for Deregistered in Great Britain and Deregistered in Northern Ireland should show (Deregistered) after their names
  • All parties shown for Deregistered in Great Britain and Registered in Great Britain should be on the Great Britain register
  • All parties shown for Deregistered in Northern Ireland and Registered in Northern Ireland should be on the Northern Ireland register

Advanced filters

This is mostly just "having a play" and combining the filters. The quick filters rely on the advanced filters to function, so no additional steps will be given for party register and party status because there's no need to test twice.

Nations

  • Check that when you filter "Wales" you don't get parties only registered in one other nation, e.g. SNP
  • Check that when you filter "Scotland" you don't get parties only registered in one other nation, e.g. PC
  • Check that when you filter "England" you don't get parties only registered in one other nation, e.g. SNP, PC
  • Check that when you filter nations = (one of ENG,WAL,SCO) and filter register = Northern Ireland no parties are shown

PR Checklist

Preview Give feedback

@Bekabyx Bekabyx force-pushed the feature/party_filters branch 2 times, most recently from 42ba926 to baf111c Compare July 20, 2023 13:14
@coveralls
Copy link

coveralls commented Jul 21, 2023

Coverage Status

coverage: 61.454% (+0.5%) from 60.931% when pulling e2037ec on feature/party_filters into 6059f98 on master.

@Bekabyx Bekabyx requested review from VirginiaDooley and symroe July 21, 2023 16:03
@Bekabyx Bekabyx force-pushed the feature/party_filters branch from 8ea2d4e to 8293793 Compare July 21, 2023 16:05
@Bekabyx Bekabyx marked this pull request as ready for review July 21, 2023 16:06
Copy link
Contributor

@VirginiaDooley VirginiaDooley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test as instructed, works well 👍

- Update party intro text at top of page
- Update translations
- Add "shortcut" filters
- Add advanced filters
@Bekabyx Bekabyx force-pushed the feature/party_filters branch from e64ba07 to e2037ec Compare July 24, 2023 14:41
@Bekabyx Bekabyx requested a review from symroe July 24, 2023 15:32
@Bekabyx Bekabyx merged commit 42b2386 into master Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants