add 'instructions for publishers' to Content Block schema #2970
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://trello.com/c/eilOXzrP/677-add-instructions-to-publishers-to-add-edit
We want to add a field to all Content Blocks that will be a short string containing an internal-only message.
As this is a Content Block specific field, it doesn't necessarily make sense to add it to the shared
default-format
, so if I understand the schema process correctly we can only add it to thedetails
key.I think we have a couple of options:
(this PR currently) we add
instructions_for_publishers
to thedetails
object - nothing more would need to be done, at least until we start rendering more complicated blocks. We currently only look for theemail_address
key to get block content. But it could be a concern later down the line that the field would accidentally be made available on the frontend? Maybe it could be nested under another key likeinternal_metadata
? It also causes complications on the frontend when rendering (TBC)we could use the existing
description
top level key on schemas. I think this could be a bit confusing for devs later down the line though, and I thinkdescription
might be subtly different for other documents. But it would be cleaner and mean all content blocks would automatically get the field. Also less possibility of it being rendered on the frontend.This application is owned by the publishing platform team. Please let us know in #govuk-publishing-platform when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.