Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
PR excludes important features which will block switching the rendering app. These will be in later PRs:
Requesting content item from part rather than parent
Details in 1767b1c
The content store used to return a 404 when requesting the content item for a part (eg
The returned content item is the same for all parts and performs a 301 for any part slug, the frontend must determine which part was requested and whether it was valid.
The content store used to return a 404 when requesting the content item for a part (eg /foreign-travel-advice/albania/money). We needed custom routing for travel advice to request the parent content item (/foreign-travel-advice/albania/). Content store has been updated to return a 301 when requesting a document's part, so a request to /foreign-travel-advice/albania/money will return the content we need. See: https://trello.com/c/w8HN3M4A/ The returned content item is the same for all parts and performs a 301 for _any part slug_, the frontend must determine which part was requested and whether it was valid. * Guides do not have a common prefix so cannot be determined to be content with parts before making a request to the content store * Guides and travel advice use the same pattern for parts * Remove special case travel advice controller, route and tests – any format could have parts * Pass the requested content item path to each presenter to determine what part is requested, if any * Check whether a part is being requested in the content_item_controller and redirect to base_path if part is invalid * Use part_slug to determine which part to show, if part is a valid
A guide without parts is technically valid according to the schema. The Publisher also currently allows it, although no guides have no parts. We expect this to never be the case as a guide without parts shouldn’t ever be approved and published. However, it could be true of the draft content – ie a new content item without any parts _yet_. Protect against no parts and send Airbrake notification if detected.