-
Notifications
You must be signed in to change notification settings - Fork 17
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
Render Get Involved page on Government Frontend #1939
Conversation
f5592c1
to
f8ff4f9
Compare
091a0b7
to
f8ff4f9
Compare
facb3c2
to
cbe2ae1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, congrats on getting through this very chunky piece of work - I know it wasn't easy!
I have no major concerns about the overall approach in the code, but it does seem to be missing quite a few tests which ought to be added before merging. The commit history is also quite confusing to follow. I've made some suggestions below, hopefully it's not too painful to rebase!
cbe2ae1
to
9f7bb72
Compare
b2b53bf
to
826309a
Compare
0dfe35e
to
6ffee78
Compare
3ed7333
to
9c8f23b
Compare
9c8f23b
to
808dc5b
Compare
808dc5b
to
3c84fde
Compare
0d63dcb
to
06ef82e
Compare
06ef82e
to
0567be7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @Tetrino. It's great to see such a substantial piece of work come together nicely.
I've done a quick first pass review and left some comments, that shouldn't be too much effort to resolve.
I can't say I'm content with reviewing the frontend code as there's quite a lot of moving parts, so maybe a frontend developer could be sought to look over this?
Have you got some instructions for running this locally in |
f5a7135
to
7b0cda1
Compare
b53225f
to
0e2e3aa
Compare
6ddd460
to
6c0c2f6
Compare
6c0c2f6
to
6cff742
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great @Tetrino.
I've done a side-by-side comparison of the page rendered by Whitehall and Government Frontend, which identified a few minor things. They should all be easy to change.
8d68a10
to
0ffe74e
Compare
Also fixed, but I lost the comment @brucebolt, was the lack of rel attribute and class name here:
|
a574c7d
to
1dab0a3
Compare
This commit is focused on moving the required assets from Whitehall to government frontend with little in the way of changes to make them compatible. Controllers and helpers from Whitehall were left behind as they are not useful in the GF framework.
The core logic of the controller is a migration of a set of function calls in whitehall/app/controllers/home_controller.rb for populating the Get Involved page with relevant data. Main bulk of controlling calls from Whitehall were taken from here and applied into this new controller: https://github.com/alphagov/whitehall/blob/bcda05ec43d87b3bec1541e644c1373bafa2a3e8/app/controllers/home_controller.rb#L17-L25 In this case the function calls are replaced with calls to the publishing-api and respective filtering of those results to give us what we need in Government Frontend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work and thank you for persevering with all the review comments, @Tetrino.
This looks good to be merged now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, Jon 👍 happy for this to be merged. I did leave a few comments that I ended up deleting as they were resolved in later commits, and I appreciate that a PR like this would be difficult and risky to unpick in a rebase.
Nothing blocking below, though would be nice to see a couple of tests for the helper (which can be added in a new commit). I'll leave it up to you.
@@ -0,0 +1,34 @@ | |||
module GetInvolvedHelper | |||
def date_microformat(attribute_name) | |||
attribute_name.to_date.strftime("%d %B %Y") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this helper is missing a test file. Don't need to test every method (e.g. page_title
is fine!) but probably worth testing the method above, as well as time_until_closure
(which I see no reason to be kept private
).
1dab0a3
to
8dba7fc
Compare
The helper in this case handles a selection of time to string filtering/ labelling and a single routing function to allow us to link to the search page for a given set of consultations (feature match to Whitehall original version). The presenter is empty and is included for consistency with other content.
When Get Involved existed in Whitehall it relied on an outdated set of styling frameworks that we no longer support. Of course, none of these were present in Government Frontend, so a large chunk of the related work was in modernising this style system. Also included in the Get Involved page specifically are calls to the correct functions in the controller such that we have the needed data to display.
Previously we were retrieving all data for the get involved page from the Publishing API. This was particularly heavy on our system with extra unneeded pings that were not correctly cached. Moving to the Search API where possible allows us to use cached results and saves a lot of overhead.
The Frontend team removed many functions being used in the original port of this page from Whitehall. This commit updates the page to fit the component ecosystem from govuk_publishing_components with the added benefit of losing a lot of now unnecessary CSS content for the same end result.
The summation of a bunch of work to migrate the Get Involved static page from Whitehall to Government Frontend.
This took more time than it really should of, in part due to modernising elements in Whitehall that we do not support in Government Frontend, and in part due to other unrelated concerns.
Important that while this repo is continuously deployed, this work will not be visible until enabled by a related rake task. With this in mind it is safe to deploy.
Testing is being handled primarily through an upcoming Smokey test, as the actual search-api calls are not ideal for a contract test nor can they be relied on for consistent unit testing.
https://trello.com/c/EZt2QYbz/2717-migrate-rendering-of-government-get-involved-from-whitehall-frontend-to-government-frontend