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

Bootstrap search bar #1650

Merged
merged 7 commits into from
Aug 20, 2024
Merged

Bootstrap search bar #1650

merged 7 commits into from
Aug 20, 2024

Conversation

joelit
Copy link
Contributor

@joelit joelit commented Aug 15, 2024

Link to relevant issue(s), if any

Description of the changes in this PR

  • Bootstrap dropdown list and JS functions for search language selection
  • Updated cypress tests
  • CSS for the new implementation
  • Accessibility tests for the new implementation

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@joelit joelit requested a review from UnniKohonen August 15, 2024 09:58
@joelit joelit self-assigned this Aug 15, 2024
@joelit joelit added this to the 3.0 milestone Aug 15, 2024
Copy link
Contributor

@UnniKohonen UnniKohonen left a comment

Choose a reason for hiding this comment

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

Looks good so far. The only thing I would maybe change is using a <button> element instead of a <a> element in dropdown toggle.

CSS changes are still missing but I noticed some things that need to be fixed at least:

  • color of the dropdown menu text should be dark blue
  • hover highlight should be added to dropdown menu items
  • cursor should probably be something different in dropdown menu
  • text disappears when clicking on dropdown menu items
  • the arrow on the button should be changed

resource/js/vocab-search.js Outdated Show resolved Hide resolved
@joelit joelit requested a review from osma August 20, 2024 11:10
@joelit joelit marked this pull request as ready for review August 20, 2024 11:10
Copy link
Member

@osma osma left a comment

Choose a reason for hiding this comment

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

I tested this and it looks good. I found one minor issue in the HTML template: the button element probably shouldn't have a href attribute.

I noticed that one Cypress test failed during CI, but the failing test was unrelated to this PR. In fact, I just fixed those flaky tests today in PR #1652 which is already merged so all should be well.


<div class="dropdown" id="language-selector">
<button class="btn btn-outline-secondary dropdown-toggle"
href="#"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the href attribute is useful for a button element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed that from the a-element style implementation. I'll fix it and merge.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
11.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@joelit joelit merged commit fb1cab9 into main Aug 20, 2024
9 of 10 checks passed
@joelit joelit deleted the bootstrap-search-bar branch August 20, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done (verified in test.dev.finto.fi, set Milestone 3.0 for both issue & PR)
Development

Successfully merging this pull request may close these issues.

3 participants