samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
185 stars 124 forks source link

Disable/enable Save button via aria-disabled attribute #6963

Closed jlhardes closed 2 weeks ago

jlhardes commented 2 weeks ago

Fixes

Fixes #6814

Summary

Present tense short summary (50 characters or less) Disables/enables aria-disabled attribute on Save button in File manager

Guidance for testing, such as acceptance criteria or new user interface behaviors:

Type of change (for release notes)

Detailed Description

Fixing an accessibility issue with the Save button in File Manager. When there are no File Manager changes to save, clicking the button doesn't do anything but assistive tech still registers the Save button as an active button (there is no aria attribute on the button at all). The button is styled as being disabled and thus comes across to assistive tech as not having enough color contrast (because it is still an active button). SiteImprove is flagging the lack of color contrast on this button as an issue.

Adding aria-disabled as an attribute on the button allows assistive tech to disregard the button unless it is not disabled (aka aria-disabled="false"). This allows the Save button to be "greyed out" and functionally disabled for clicking and assistive tech (aria-disabled="true" by default) and then if a change is made in File Manager, the button is then activated via darkened/more contrasting style and enabled for clicking and assistive tech to register (aria-disabled="false").

These changes also correct the SiteImprove error reporting for color contrast not meeting minimum requirement because aria-disabled="true" when the Save button is disabled and it is disregarded for color contrast review.

@samvera/hyrax-code-reviewers

github-actions[bot] commented 2 weeks ago

Test Results

    17 files  ±0      17 suites  ±0   2h 16m 39s ⏱️ +46s  6 729 tests ±0   6 432 ✅ ±0  297 💤 ±0  0 ❌ ±0  13 229 runs  ±0  12 833 ✅ ±0  396 💤 ±0  0 ❌ ±0 

Results for commit 8ebf706b. ± Comparison against base commit c56c4a8a.

This pull request removes 266 and adds 266 tests. Note that renamed tests count towards both. ``` spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: ac5954f2-73c7-43ba-a7cb-ba258dd9ce2f spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 3f8590fe-defd-45ab-8503-3fb4d9cd2a58 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: b9ff3af0-856f-46b3-b0f2-fcd06ed9672f spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 1695e35c-ea8e-4f96-bc21-8295acf9cd3d spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: 1e355e41-0aa0-4fb1-95e6-b31618146bff spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: 01455be7-5abb-47b6-ada6-0820e00027b0 … ``` ``` spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: a9852604-7083-4765-a5ed-7e9d3d68df50 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 449ca900-5066-4af3-9734-d5fa4f28dc40 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: da24197c-e704-4e95-aaca-3148f0df574a spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 48824af9-90c4-4eff-957d-f9552e856979 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: 24e23126-0504-4a44-8cf4-a6b1ddc70c80 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: 034cdd8e-bcfa-4dfb-baa2-8e62aa31bd95 … ```