Conversation
aee622d to
9082e3a
Compare
| struct CustomField { | ||
| 1: required string fieldName | ||
| 2: required string fieldType | ||
| 3: required string defaultValue |
There was a problem hiding this comment.
string is the best we can do for defaultValue as Thrift doesn't support polymorphism.
I assume we will fill defaultValue with stringified JSON.
|
@Fweddi has published a preview version of this PR with release workflow run #23, based on commit 9082e3a: 7.0.0-PREVIEW.fpdefine-custom-fields.2024-12-16T1530.9082e3ad Want to make another preview release?Click 'Run workflow' in the GitHub UI, specifying the fp/define-custom-fields branch, or use the GitHub CLI command: gh workflow run release.yml --ref fp/define-custom-fields Want to make a full release after this PR is merged?Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command: gh workflow run release.yml |
9082e3a to
9769f40
Compare
CustomField for interactive atoms
CustomField for interactive atomsCustomDataDefinition for interactive atoms
…shed by frederickobrien frederickobrien published release version 14.0.0-PREVIEW.fpdefine-custom-fields.2026-08-19T1448.912a1f79 using gha-scala-library-release-workflow: https://github.com/guardian/gha-scala-library-release-workflow Release-Version: 14.0.0-PREVIEW.fpdefine-custom-fields.2026-08-19T1448.912a1f79 Release-Initiated-By: https://github.com/frederickobrien Release-Workflow-Run: https://github.com/guardian/content-atom/actions/runs/32266157001 Release-Notes: #177
|
@frederickobrien has published a preview version of this PR with release workflow run #75, based on commit 912a1f7: 14.0.0-PREVIEW.fpdefine-custom-fields.2026-08-19T1448.912a1f79 Want to make another preview release?Click 'Run workflow' in the GitHub UI, specifying the fp/define-custom-fields branch, or use the GitHub CLI command: gh workflow run release.yml --ref fp/define-custom-fields Want to make a full release after this PR is merged?Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command: gh workflow run release.yml |
|
|
||
| struct CustomDataDefinition { | ||
| 1: required string fieldName | ||
| 2: required string fieldType |
There was a problem hiding this comment.
Do you have any suggestions of what this fieldType will contain?
Are you planning for just string versions of JSON types? (object, array, number, string, boolean) ?
Perhaps add a comment to this thrift explaining what values you think could go into this field?
|
|
||
| struct CustomDataDefinition { | ||
| 1: required string fieldName | ||
| 2: required string fieldType |
There was a problem hiding this comment.
You could go really crazy with fieldTypes if you wanted to do advanced things later in editorial tooling like
- date
- array
- int (not fractional numbers)
- int-range
- number-range
- dropdown of strings
- coordinates
These are future concepts deffo not for this first PR, but will having this field type as a string be good enough to enable that sort of stuff later or is it worth setting it up as an enum or something else now?
|
NB @michaelclapham that a broader discussion is ongoing @ https://github.com/guardian/flexible-model/discussions/103. |
This updates the interactive atom thrift model to add an optional list of
CustomDataDefintionoptions, opening the door to parameterised interactive atoms.A
CustomDataDefinitionitself comprises of four fields:While the atom itself has an optional list of these:
These will allow for a structured interface in Composer, with the description providing some context about the nature/use of the custom data and the default value ensuring a default/fallback behaviour.