Fix typeahead and handlebars template. #1303
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reasons for creating this PR
Fix styles and UI behavior, broken in #1182
Link to relevant issue(s), if any
Description of the changes in this PR
I noticed that the data was present for Typeahead to display it, but for some reason we only saw part of the data when values were replaced (e.g. Catalans & Catalan People). I couldn't find anything in the Typeahead docs, but then it occurred to me that it could be now handling templates the same way Vue.js does, by forcing to have a single root-node.
I moved things under a
<div>
in the template rendered for each autocomplete entry, and then it finally display all the information received and used in the template.Known problems or uncertainties in this PR
I left a question in Autocomplete problems after Bootstrap 5 upgrade #1301 asking about the color of the text. This is a 1 minute change, just pending a reply over there 👍
@osma I couldn't understand why my types are not being replaced by shorter text. I wonder if it's because I have been using old vocabularies I exported from finto and/or finto.dev?
I set a few breakpoints, and after clearing my local storage, I can confirm the UI is sending a request to
http://localhost:9090/rest/v1/types?lang=en
to retrieve types, and is also using the@context
returned from the autocomplete request.But the right-most information is still using the URI instead of a value like "General Concept" as in your screenshot attached to #1301. See my screenshot below for an example:
It shows skos:Concept, and other URI's instead of a simpler text 😞 . Thanks!
Checklist