NatLibFi / Skosmos

Thesaurus and controlled vocabulary browser using SKOS and SPARQL
Other
224 stars 94 forks source link

Implement autocomplete for search #1589

Closed joelit closed 6 months ago

joelit commented 8 months ago

Link to relevant issue(s), if any

Autocomplete functionality for #1514

Description of the changes in this PR

This PR introduces a Bootstrap 5 dropdown menu for autocomplete, and it aims to fulfill the basic functionality of the search bar's autocomplete part.

Known problems or uncertainties in this PR

Checklist

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.58%. Comparing base (f22c504) to head (ddf2603). Report is 14 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1589 +/- ## ========================================= Coverage 70.58% 70.58% Complexity 1647 1647 ========================================= Files 32 32 Lines 4321 4321 ========================================= Hits 3050 3050 Misses 1271 1271 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 8 months ago

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

joelit commented 6 months ago

I changed the name of the PR and added missing tests. I found one bug with enter search related to encoding the search term, which I also fixed. I also fixed the comments and wrote further specs in the the main issue #1514 . Added parts were 3.5.1 about fethcing the type texts and 4.1 about the accessability and keyboard use of the search.

The PR should be ready for another round! I didn't squash the commits here, fearing I'd mess it up, but the merging to the main branch should be done with a squash.

osma commented 6 months ago

FYI, I changed the base branch of this PR briefly to skosmos-2 and then back to main. This made the diff view much cleaner (before: 14 changed files, after: only 4 changed files) as irrelevant changes that had already been merged to main were dropped from the diff view.

Currently reviewing.

joelit commented 6 months ago

Changed the way special characters are handled for the search itself, and how the matching part of the search results are displayed. Also changed URL parameters into URLSearchParams objects, and adjusted cypress tests to reflect these changes. :+1:

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
5 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud