Skip to content

Commit

Permalink
add instructions_for_publishers to Content Block schemas
Browse files Browse the repository at this point in the history
We want to add a field to all Content Blocks that
will be a short string containing an internal-only
message.

This adds the field `instructions_for_publishers`
to a shared definitions file, and then uses it in
the email and postal address schemas.

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 the
details key.
  • Loading branch information
Harriethw committed Nov 8, 2024
1 parent f5fed1f commit 3e11be8
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@
"email_address": {
"type": "string",
"format": "email"
},
"instructions_for_publishers": {
"$ref": "#/definitions/instructions_for_publishers"
}
}
},
Expand Down Expand Up @@ -544,6 +547,11 @@
},
"uniqueItems": true
},
"instructions_for_publishers": {
"description": "An internal message to be added to content blocks",
"type": "string",
"additionalProperties": false
},
"locale": {
"type": "string",
"enum": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@
"email_address": {
"type": "string",
"format": "email"
},
"instructions_for_publishers": {
"$ref": "#/definitions/instructions_for_publishers"
}
}
},
Expand All @@ -219,6 +222,11 @@
},
"uniqueItems": true
},
"instructions_for_publishers": {
"description": "An internal message to be added to content blocks",
"type": "string",
"additionalProperties": false
},
"locale": {
"type": "string",
"enum": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@
"county": {
"type": "string"
},
"instructions_for_publishers": {
"$ref": "#/definitions/instructions_for_publishers"
},
"line_1": {
"type": "string"
},
Expand Down Expand Up @@ -557,6 +560,11 @@
},
"uniqueItems": true
},
"instructions_for_publishers": {
"description": "An internal message to be added to content blocks",
"type": "string",
"additionalProperties": false
},
"locale": {
"type": "string",
"enum": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@
"county": {
"type": "string"
},
"instructions_for_publishers": {
"$ref": "#/definitions/instructions_for_publishers"
},
"line_1": {
"type": "string"
},
Expand Down Expand Up @@ -232,6 +235,11 @@
},
"uniqueItems": true
},
"instructions_for_publishers": {
"description": "An internal message to be added to content blocks",
"type": "string",
"additionalProperties": false
},
"locale": {
"type": "string",
"enum": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"schema_name": "content_block_email_address",
"document_type": "content_block_email_address",
"title": "Government Digital Service - General contact",
"description": "General contact email address for Government Digital Service",
"content_id_alias": "gds-general",
"details": {
"instructions_for_publishers": "General contact email address for Government Digital Service",
"email_address": "[email protected]"
},
"links": {
Expand Down
5 changes: 4 additions & 1 deletion content_schemas/formats/content_block_email_address.jsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(import "shared/content_block.jsonnet") + {
document_type: "content_block_email_address",
definitions: {
definitions: (import "shared/definitions/_content_block_manager.jsonnet") + {
details: {
type: "object",
additionalProperties: false,
Expand All @@ -10,6 +10,9 @@
type: "string",
format: "email",
},
instructions_for_publishers: {
"$ref": "#/definitions/instructions_for_publishers",
}
},
},
},
Expand Down
5 changes: 4 additions & 1 deletion content_schemas/formats/content_block_postal_address.jsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(import "shared/content_block.jsonnet") + {
document_type: "content_block_postal_address",
definitions: {
definitions: (import "shared/definitions/_content_block_manager.jsonnet") + {
details: {
type: "object",
additionalProperties: false,
Expand All @@ -21,6 +21,9 @@
postcode: {
type: "string"
},
instructions_for_publishers: {
"$ref": "#/definitions/instructions_for_publishers",
}
},
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
instructions_for_publishers: {
description: "An internal message to be added to content blocks",
type: "string",
additionalProperties: false,
}
}

0 comments on commit 3e11be8

Please sign in to comment.