Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/4717 accessibility improvements aria #4747

Merged
merged 6 commits into from
Nov 12, 2024

Conversation

robinmolen
Copy link
Contributor

Closes #4717

Changes

The site logo now provides a better textual alternative, the error message element now has the appropriate role and the PDF's are now screenreader friendly :)

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

@robinmolen robinmolen linked an issue Oct 10, 2024 that may be closed by this pull request
3 tasks
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.55%. Comparing base (4c53505) to head (b5daa22).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4747   +/-   ##
=======================================
  Coverage   96.55%   96.55%           
=======================================
  Files         748      748           
  Lines       25413    25417    +4     
  Branches     3358     3361    +3     
=======================================
+ Hits        24538    24542    +4     
  Misses        610      610           
  Partials      265      265           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robinmolen robinmolen force-pushed the feature/4717-accessibility-improvements-aria branch from 3754d30 to 588e215 Compare October 17, 2024 11:47
@robinmolen robinmolen marked this pull request as ready for review October 17, 2024 11:51
@robinmolen robinmolen force-pushed the feature/4717-accessibility-improvements-aria branch from 588e215 to 051122f Compare October 22, 2024 08:25
Comment on lines 118 to 139
renderer = Renderer(self.submission, mode=RenderModes.pdf, as_html=True)
# set up mock registry without special fieldset/editgrid behaviour
register = Registry()

nodelist = []
with patch("openforms.formio.rendering.registry.register", new=register):
for component in self.step.form_step.form_definition.configuration[
"components"
]:
if component["type"] == "selectboxes" or component["type"] == "radio":
component_node = ChoicesNode(
step_data=self.step.data, component=component, renderer=renderer
)
elif component["type"] == "select":
component_node = SelectNode(
step_data=self.step.data, component=component, renderer=renderer
)
elif component["type"] == "textfield":
component_node = TextNode(
step_data=self.step.data, component=component, renderer=renderer
)
nodelist += list(component_node)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supposed to use our actual implemetnations, no? I don't understand why a separate registry is being set up and component nodes instantiated directly rather than that the factory ComponentNode.build_node(...) is used for each component which looks up the appropriate specialized class in the registry.

I'd also expect this test to be a test def test_render_mode_pdf_with_list_values(self) in openforms.formio.rendering.tests.test_component_node rather than its own class and file. Note that I also renamed that test case name in my PR because it was a bad copy paste, so if you apply that same change we shouldn't get any merge conflicts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... this is a part of the value_list concept..
With my changes to remove the value_list and to add the expected html to the display_value, i've also changed this test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand your comment about the test case naming... but I think it should be fine now..

Comment on lines 13 to 15
@classmethod
def setUpTestData(cls):
super().setUpTestData()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferably set up the test data inside the test itself rather than creating context switches. You only have a single test, so this test data is only relevant for that single test anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay check, i'll keep that in mind.. 👍

src/openforms/submissions/tests/test_tasks_pdf.py Outdated Show resolved Hide resolved
src/openforms/utils/pdf.py Show resolved Hide resolved
src/openforms/ui/tests/test_header.py Outdated Show resolved Hide resolved
src/openforms/submissions/tests/test_submission_report.py Outdated Show resolved Hide resolved
src/openforms/formio/rendering/default.py Outdated Show resolved Hide resolved
@robinmolen robinmolen force-pushed the feature/4717-accessibility-improvements-aria branch 2 times, most recently from 8160754 to f3ac6c9 Compare November 4, 2024 16:12
@robinmolen robinmolen force-pushed the feature/4717-accessibility-improvements-aria branch from f3ac6c9 to 97fbb37 Compare November 11, 2024 11:50
@robinmolen robinmolen force-pushed the feature/4717-accessibility-improvements-aria branch from 97fbb37 to 973f78d Compare November 11, 2024 13:34
@robinmolen robinmolen force-pushed the feature/4717-accessibility-improvements-aria branch from 973f78d to b5daa22 Compare November 11, 2024 13:49
@sergei-maertens sergei-maertens merged commit 6b715c6 into master Nov 12, 2024
34 checks passed
@sergei-maertens sergei-maertens deleted the feature/4717-accessibility-improvements-aria branch November 12, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility improvements - Aria tags
2 participants