-
Notifications
You must be signed in to change notification settings - Fork 3
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
SPP12087 help centre structure refactor #385
base: main
Are you sure you want to change the base?
Conversation
… to build the help centre navigation and build on demand instead Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
…ilt each time a help centre page is accessed Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Note failing tests due to changes in ordering of the content, should be resolved under https://jira.ons.gov.uk/browse/SPP-11740 |
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.
… consistent Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
Hi, this should now be fixed |
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.
sml_builder/__init__.py
Outdated
"label": "Submit a method request", | ||
} | ||
) | ||
nav["categories"] = sorted(nav["categories"], key=lambda x: x["name"]) |
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.
Could we add a comment here just to call out sorting is done in code (rather than in contentful)
sml_builder/__init__.py
Outdated
category["subcategories"] = sorted( | ||
category["subcategories"], key=lambda x: x["label"] | ||
) | ||
app.cache["help_centre_nav"] = nav |
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.
Where does this cache live? If someone navigates to the website and we deploy a new version of the website how does the cache get refreshed?
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.
cache is a dictionary object within the flask application object, each time we deploy that application will be recreated, so in the case of this method we deploy, and during the first request to it we create this navigation and add it to the cache dictionary, it will remain here unless deleted or the app is stopped
If i remember correctly it was the methods page that was made alphabetical, i made a similar change here as you can't ensure that content is gathered in a specific order, my thoughts were displaying it alphabetically made most sense |
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
@gibbardsteve comments added where requested |
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.
Oh right yes thats my mistake, during the freeze process the freeze module would make requests to each page in order to build that page and freeze it, so this process would be happening during that build step |
Signed-off-by: jasonbellONS <jason.bell@ons.gov.uk>
DEPLOY_URL=https://d1uzhgtw86gcqp.cloudfront.net/ |
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.
Approved. We may want to hold off building prod until we get a green light from MQD.
Help centre refactored to no longer pull in the structure page from contentful, structure and navigation built on demand using information from the other help centre pages grabbed from contentful