Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
To Test
Set-up
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
andRegistered in Northern Ireland
shouldn't show any parties which have(Deregistered)
after their names.Deregistered in Great Britain
andDeregistered in Northern Ireland
should show(Deregistered)
after their namesDeregistered in Great Britain
andRegistered in Great Britain
should be on theGreat Britain
registerDeregistered in Northern Ireland
andRegistered in Northern Ireland
should be on theNorthern Ireland
registerAdvanced 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
Northern Ireland
no parties are shownPR Checklist