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

Fix catalog search dropdown #6867

Merged
merged 2 commits into from
Aug 5, 2024
Merged

Fix catalog search dropdown #6867

merged 2 commits into from
Aug 5, 2024

Conversation

kirkkwang
Copy link
Contributor

Summary

Fix catalog search form dropdown not changing

7a2d476

On the home page when the user is logged in, the dropdown next to the
search was not changing when the user selects a different option. This
was because the javascript was changing the data-search-element="label"
span but what is actually being shown is the aria-hidden="true" span.

Before:

  <span class="sr-only" data-search-element="label">All</span>
  <span aria-hidden="true">All</span>

  *user selects a different option*

  <span class="sr-only" data-search-element="label">My Works</span>
  <span aria-hidden="true">All</span>

After:

  <span class="sr-only" data-search-element="label">All</span>
  <span aria-hidden="true">All</span>

  *user selects a different option*

  <span class="sr-only" data-search-element="label">My Works</span>
  <span aria-hidden="true">My Works</span>

Change html structure for search dropdown

9b2ffae

This change will align how Bootstrap 4 does dropdown menus. The
exmaples that I see in the documentation show that it should be in a

tag with tags inside of it.

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

  • Sign in to Hyrax
  • On the search form, click the dropdown (should say All by default) and choose something else
  • Observe that the label changes accordingly

Type of change (for release notes)

  • notes-bugfix Bug Fixes

Changes proposed in this pull request:

  • Fix a bug where the label doesn't change for the search form when the user clicks it
  • Change the html structure to be more Bootstrap 4 friendly
9c720eb8-0f74-4044-8de4-8a4521a5239a.mp4

@samvera/hyrax-code-reviewers

On the home page when the user is logged in, the dropdown next to the
search was not changing when the user selects a different option.  This
was because the javascript was changing the data-search-element="label"
span but what is actually being shown is the aria-hidden="true" span.

Before:
  <span class="sr-only" data-search-element="label">All</span>
  <span aria-hidden="true">All</span>

  *user selects a different option*

  <span class="sr-only" data-search-element="label">My Works</span>
  <span aria-hidden="true">All</span>

After:
  <span class="sr-only" data-search-element="label">All</span>
  <span aria-hidden="true">All</span>

  *user selects a different option*

  <span class="sr-only" data-search-element="label">My Works</span>
  <span aria-hidden="true">My Works</span>
This change will align how Bootstrap 4 does dropdown menus.  The
exmaples that I see in the documentation show that it should be in a
<div> tag with <a> tags inside of it.
Copy link

github-actions bot commented Jul 30, 2024

Test Results

    17 files  ±0      17 suites  ±0   2h 17m 11s ⏱️ - 4m 15s
 6 705 tests ±0   6 408 ✅ +1  297 💤 ±0  0 ❌  - 1 
13 178 runs  ±0  12 783 ✅ +1  395 💤 ±0  0 ❌  - 1 

Results for commit 9b2ffae. ± Comparison against base commit 59a42ad.

This pull request removes 273 and adds 273 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 #<Hyrax::PermissionTemplate:0x00007f14897bd708>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fba83ec5c80>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f148a194600>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fba83ffc450>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 133a9822-768b-48ad-a346-396b70d63b8b
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: d2a1f5ab-99e3-4f8a-af33-0f3fdb07e5a2
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: c5cdc4e2-8185-4228-a98c-b012fbea7e7f
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 67871b8d-cc2d-4fee-8a21-c9ae70f921ec
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: 84ed5efd-d6ce-4bf0-9187-6e1f28380843
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: 7f6fdad7-4891-48e5-b492-1da2b3ab04db
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f06559762d0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f1f864a6e18>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f065904cd18>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f1f86dbb918>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: a58fa56b-cc11-4bd2-9eba-f168c46d612e
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 3e20f8dd-de5a-44f8-8573-0a5c916c72ae
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 418bddcb-407b-4167-bf5f-311523ffde8d
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 45225359-07b1-4a45-a557-772e98c06e19
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: a732d216-ffc7-44e8-a0f0-7cded4a17e50
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: 1a175fe0-407a-42a9-b59c-4dae2bc3f870
…

♻️ This comment has been updated with latest results.

@orangewolf orangewolf added the notes-bugfix Release Notes: Fixed a bug label Aug 5, 2024
@orangewolf orangewolf merged commit 4273c06 into main Aug 5, 2024
22 checks passed
@orangewolf orangewolf deleted the fix-search-dropdown branch August 5, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-bugfix Release Notes: Fixed a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants