Skip to content
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

Allow additional properties in frontend links #232

Merged
merged 2 commits into from Feb 5, 2016
Merged

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Feb 5, 2016

To render topical event about pages the frontend needs some extra information from the topical event - its start and end date.

Rather than including the specific details and start/end dates in the properties, we are allowing additonalProperties. Per format link definitions are hard to define at the moment, for instance start/end date may have different meaning based on format.

This is a short term solution in lieu of more programatically generated frontend links schemas. When the new pub api dependency work is completed the schemas will be used to drive what fields are included so it'll be able to be embedded correctly in the frontend schema.

Unblocks https://trello.com/c/P4KCL1UJ/

Additional changes need to be made to content-store to do the expansion so that the content-items returned look like the included examples in this PR.

cc @boffbowsh @jamiecobbett

@boffbowsh
Copy link
Contributor

@boffbowsh boffbowsh commented Feb 5, 2016

This approach was discussed and agreed with @danielroseman

For topical event about pages we want some extra information - the
topical event start and end date. This will allow the front-end to show
whether the topical event is archived or not.

Rather than including the specific details and start/end dates in the
properties, we are allowing additionalProperties. Per format link
definitions are hard to define at the moment, for instance start/end
date may have different meaning based on format.

This is a short term solution in lieu of more programatically generated
frontend links schemas. When the new pub api dependency work is completed
the schemas will be used to drive what fields are included so it'll be
able to be embedded correctly in the frontend schema.
@fofr fofr force-pushed the expand-topic-event-link branch from b6c4fca to 993a191 Feb 5, 2016
Topical events have optional start and end dates. Front-ends should be
able to test and develop against an example that has no date range.
boffbowsh added a commit that referenced this pull request Feb 5, 2016
Allow additional properties in frontend links
@boffbowsh boffbowsh merged commit e01b549 into master Feb 5, 2016
16 checks passed
16 checks passed
Specialist frontend contract tests Build #479 succeeded on Jenkins
Details
Verify collections against content schemas Build #605 succeeded on Jenkins
Details
Verify collections-publisher against content schemas Build #579 succeeded on Jenkins
Details
Verify contacts-admin against content schemas Build #713 succeeded on Jenkins
Details
Verify contacts-frontend against content schemas Build #242 succeeded on Jenkins
Details
Verify government-frontend against content format examples Build #744 succeeded on Jenkins
Details
Verify hmrc-manuals-api against content schemas Build #397 succeeded on Jenkins
Details
Verify manuals-frontend against schema examples Build #573 succeeded on Jenkins
Details
Verify publisher against content schemas Build #630 succeeded on Jenkins
Details
Verify specialist-publisher against content schemas Build #677 succeeded on Jenkins
Details
Verify static components against schema examples Build #113 succeeded on Jenkins
Details
Verify travel-advice-publisher against content schemas Build #379 succeeded on Jenkins
Details
default Build #699 succeeded on Jenkins
Details
finder frontend contract tests Build #742 succeeded on Jenkins
Details
policy publisher contract tests Build #738 succeeded on Jenkins
Details
whitehall contract tests Build #791 succeeded on Jenkins
Details
@boffbowsh boffbowsh deleted the expand-topic-event-link branch Feb 5, 2016
tijmenb added a commit that referenced this pull request Sep 16, 2016
This changes the way the `links` are validated in frontend schemas.

Since #232 the
frontend links have `additionalProperties` set to true. I think this is
undesirable because it allows all data in the frontend links, defeating
the purpose of schemas.

- Two detailed guide examples have the links incorrectly nested (`links
-> parent -> parent` instead of `links -> parent -> links -> parent`).
This wasn't picked up by the validation. This could have caused
developers to build pages that work only with the incorrect example.
- The service manual example included a `expanded_links` example, which
is not used anymore (and should never have been used in frontends).
tijmenb added a commit that referenced this pull request Sep 16, 2016
This changes the way the links are validated in frontend schemas.

Since #232 the frontend links have additionalProperties set to true. I
think this is undesirable because it allows all data in the frontend
links, defeating the purpose of schemas.

- Two detailed guide examples have the links incorrectly nested (links
-> parent -> parent instead of links -> parent -> links -> parent).
This wasn't picked up by the validation. This could have caused
developers to build pages that work only with the incorrect example.
- The service manual example included a expanded_links example, which
is not used anymore (and should never have been used in frontends).
tijmenb added a commit that referenced this pull request Sep 16, 2016
This changes the way the links are validated in frontend schemas.

Since #232 the frontend links have additionalProperties set to true. I
think this is undesirable because it allows all data in the frontend
links, defeating the purpose of schemas.

- Two detailed guide examples have the links incorrectly nested (links
-> parent -> parent instead of links -> parent -> links -> parent).
This wasn't picked up by the validation. This could have caused
developers to build pages that work only with the incorrect example.
- The service manual example included a expanded_links example, which
is not used anymore (and should never have been used in frontends).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.