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 typeahead templates in the search auto-complete #1326

Merged
merged 3 commits into from
Jun 2, 2022

Conversation

kinow
Copy link
Collaborator

@kinow kinow commented Jun 1, 2022

The template appears to be more or less like the previous one. One thing that I noticed is that we have two div's (in both 2.14, and current version). So my first guess appears to be correct, that Twitter Typeahead drops the second div, instead of displaying it as before.

  • Use a single div to keep the Vocabulary information
  • Fix the CSS style (colors, font)
  • Fix the concept mapping (for some reason we are showing the URI only)

Reasons for creating this PR

After #1182 , apparently we got a regression in the search auto-complete.

Link to relevant issue(s), if any

Description of the changes in this PR

Trying to match the previous design/appearance as much as possible.

Known problems or uncertainties in this PR

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if not, explain why below)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@kinow
Copy link
Collaborator Author

kinow commented Jun 1, 2022

After the previous commit, here's the auto-complete, now showing the vocabulary information.

image

The URI displayed is the one for General Concept, I reckon. Just need to understand why it is not showing the mapped text instead, and adjust CSS now.

@codecov
Copy link

codecov bot commented Jun 1, 2022

Codecov Report

Merging #1326 (ad414ea) into master (5d193c2) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #1326   +/-   ##
=========================================
  Coverage     70.68%   70.68%           
  Complexity     1646     1646           
=========================================
  Files            32       32           
  Lines          3786     3786           
=========================================
  Hits           2676     2676           
  Misses         1110     1110           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d193c2...ad414ea. Read the comment docs.

@kinow
Copy link
Collaborator Author

kinow commented Jun 1, 2022

I think the highlighted text had the link color? Hard to inspect the HTML element in the browser as finto.fi appears to remove the element (whereas in 2.15-dev, the element is hidden, so I can force it to be displayed again).

Screenshot from 2022-06-01 23-35-32

@kinow kinow force-pushed the typeahead-post-bootstrap branch from ea82b13 to 4b7af3a Compare June 1, 2022 11:36
@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kinow kinow marked this pull request as ready for review June 1, 2022 12:12
@kinow
Copy link
Collaborator Author

kinow commented Jun 1, 2022

@osma, got stuck with the item “ Fix the concept mapping (for some reason we are showing the URI only)”, but I'm thinking it might be my environment.

After I cleared my local storage, and reloaded Skosmos, I can see the request to http://localhost:9090/rest/v1/types?lang=en, that returns very little data.

image

And in <finto.fi> I can see a similar request, but returning a lot more data.

image

Any idea what I might be doing wrong?

If it's just my environment settings, then this PR should be ready for an initial review :-) The CSS style should be closer to what it was, and the information displayed too.

Thanks!
-Bruno 😴

@osma
Copy link
Member

osma commented Jun 1, 2022

Any idea what I might be doing wrong?

Not getting labels for concept types seems to be a recurring problem... In this case, I think it could be caused by this issue - try enabling the union default graph setting for your Fuseki.

If it's just my environment settings, then this PR should be ready for an initial review :-) The CSS style should be closer to what it was, and the information displayed too.

Thanks a lot! Will review soon...

@kinow
Copy link
Collaborator Author

kinow commented Jun 1, 2022

Not getting labels for concept types seems to be a recurring problem... In this case, I think it could be caused by #678 - try enabling the union default graph setting for your Fuseki.

That fixed it. I simply uncommented that setting in our config file and re-created my environment.

Here's a preview of the final version in this PR:

image

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.

LGTM, works great! Thanks a lot!

@osma osma merged commit 290296c into NatLibFi:master Jun 2, 2022
@kinow
Copy link
Collaborator Author

kinow commented Jun 2, 2022

LGTM, works great! Thanks a lot!

Wohoo! Thanks for reviewing it so quickly @osma!

@kinow kinow deleted the typeahead-post-bootstrap branch June 2, 2022 09:29
@osma osma added the bug label Jun 2, 2022
@osma osma added this to the 2.15 milestone Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vocabulary information is missing from the drop-down results list
2 participants