Single Upload of Image Kind [WHIT-2857]#10998
Merged
Merged
Conversation
62a0df5 to
35d14d6
Compare
35d14d6 to
bde9caa
Compare
| "kind": "govspeak_embed", | ||
| "multiple": true | ||
| } | ||
| ] |
Contributor
There was a problem hiding this comment.
I'm loving this as an API 👍
1610c58 to
23953ca
Compare
a4abfaa to
5480c15
Compare
0a1e43e to
d8de361
Compare
ryanb-gds
reviewed
Jan 21, 2026
Contributor
ryanb-gds
left a comment
There was a problem hiding this comment.
Just a few thoughts from me before somebody else does a proper review
| end | ||
|
|
||
| def lead_image | ||
| block_content["image"] |
Contributor
There was a problem hiding this comment.
This is an assumption that probably won't make sense soon but I think it's ok for now
e368a35 to
5a377fb
Compare
The `images_enabled` setting in configurable document schema has been renamed to `images` and is now an object with attributes: - `enabled` which sets if the document supports images being uploaded - `permitted_image_kinds` which is a list of the image kinds that can be uploaded to the document, if image uploading is `enabled` without this attribute set then by default the document will support embeddable images and within `permitted_image_kinds` the image kinds take the format of an object with the following attributes: - `multiple` whether or not multiple images of that kind can be uploaded - `kind` which correlates to the `permitted_image_uses` key within each image kind
Rework the previous implementation of edition image partials to accept an image kind as a parameter. If the image kind supports a single upload then only show the upload form if no image has been uploaded. Otherwise show the default (unchanged) edition images view.
5a377fb to
3c70fed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Support adding single upload of image kinds if specified in the schema for a configurable document.
Technical Details
images_enabledtoimagesobjectimageshasenabledattribute to indicate if images are enabled for this documentimageshaspermitted_image_kindsattribute to indicate what kinds of image are allowed to be uploadedkindwhich corresponds to thepermitted_useskey inimage_kinds.ymlandmultipleto indicate if multiple uploads are alloweddefaultVisual Differences
(no visual changes to other document types apart from Landing Page Images which are deemed as not priority to maintain)
Why
Required feature for the configurable Topical Event pages.
This application is owned by the Whitehall Experience team. Please let us know in #govuk-whitehall-experience-tech when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.