Add support for new form type image-description #761
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.
Closes ##759
Closes ##760
Why is this the best possible solution? Were any other approaches considered?
This solution and others considered were discussed extensively on the ODK Forum. See https://forum.getodk.org/t/placeholder-alt-text-for-images-eg-screen-readers/50868
What are the regression risks?
This adds new new (optional) translatable form type, to the existing
image
,big-image
,audio
andvideo
media types. It should not impact the existing functionality of these existing media types. XForm clients that do not support or recognize the newimage-description
form type can safely ignore it with no impact on existing XForm functionality.This PR also adds a new testcase for a choice option with a
big-image
specified but without a correspondingimage
, because it is almost identical to the check now needed forimage-description
. This error condition is currently not being checked, and results in an invalid XForm being generated [note, this image prerequisite is being checked in the main survey, but not for choice options. It was probably overlooked]. The newbig-image
check will mean previously invalid XLSForms with this inconsistency will now fail to be processed, but I believe this is actually the desired behavior.Does this change require updates to documentation? If so, please file an issue here and include the link below.
Yes, this new ODK form type will need to be documented in the XLSForm Docs.
See XLSForm/xlsform.github.io#279
Before submitting this PR, please make sure you have:
tests
python -m unittest
and verified all tests passruff format pyxform tests
andruff check pyxform tests
to lint codeOther important notes:
This is my first pyxform PR; please be gentle... :-)
Attn: @RuthShryock