Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[DO NOT MERGE] Add Subgroups to the results page #1731
PEP restricted PR
The Brexit checker can return a large number of results, this can be overwhelming for the user.
Actions and criteria were previously passed to the frontend as two separate variables. Both were arrays that could be ordered and then chucked into the frontend.
This PR makes that setup more complicated. An array of "audiences" (Business/Individual) are provided, with Business ordered first.
An audience has a heading, and groups. Groups then optionally have their own heading, actions and relevant criteria. The frontend now uses this structure to build the view.
Criteria do not come with any prior grouping. To obtain them for a given group we start with the results criteria, representing the User's choices and stored in the URL. We then extract the criteria from all actions in a group. Flatten these and use that to select relevant criteria from the page.
What it looks like
@markwoods37 / @trevor_saint I've got this up here:
There's only a single test here anyway, so it doesn't dry out much, and there's an irregular test failure reporting 'No such file or directory @ rb_sysopen - /tmp/downloaded.csv20191111-37-uz5lkw', this is an attempt to resolve any ordering issues
Cool, might want to check in on how we fix these