-
Notifications
You must be signed in to change notification settings - Fork 95
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
Vocabulary search list Twig-templates #1470
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## skosmos-3 #1470 +/- ##
============================================
Coverage 70.51% 70.51%
Complexity 1642 1642
============================================
Files 32 32
Lines 4314 4314
============================================
Hits 3042 3042
Misses 1272 1272 ☔ View full report in Codecov by Sentry. |
Search-results.inc produces more or less similar html compared to the static examples
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good start, I gave some quick comments.
Please make sure the PR description is up to date.
There's something wrong with this PR, there are now over 100 commits. I think it should be rebased on current skosmos-3 branch. |
7c1afa5
to
f265f1e
Compare
I tested this locally. Some quick comments:
Layout issuesI found some layout issues in the templates: When searching YSA for Problems:
I did the same search for KOKO and got this: Problems:
I also searched YSO for Problems:
|
a50f656
to
cbae060
Compare
Good points @osma ! I should have tested the template with vocabularies other than YSO. I resolved all of the above, and made some minor tweaks. |
Global search implemented Updated property icons Initial commit Layout for the vocabulary search page hard-coded colour scheme css CSS tweaks Overhaul of search-results.inc Fixed a typo Removed debug info CSS tweaks Fixed a HTML tag Remove colour definitions from the Twig layer Added cypress tests for vocab search Added a missing newline to the end of the file Added Skosmos variant color sheme CSS files CSS font size tweak Vocab search translations Global search twig template Global search implemented Updated property icons Initial commit Layout for the vocabulary search page CSS tweaks Overhaul of search-results.inc Removed debug info CSS tweaks Fixed a HTML tag Remove colour definitions from the Twig layer Translation templates Working cypress test for the search result list CSS tweaks Fixed bugs in the twig template logic
cbae060
to
003179a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting better. A few brief comments:
- There seems to be something wrong with the commit history. I see duplicated commits and I cannot merge this from the command line (although GitHub doesn't indicate a merge conflict). I suggest doing a rebase+squash, combining all current work into a single commit against the current skosmos-3 branch.
- The title of the page doesn't reflect that a search has been performed. E.g. on Skosmos 2, the page title is constructed as
Finto: YSO 'kissa'
(service name, vocabulary and search term). A similar title should be used. - I gave you slightly wrong advice on the header font for matched terms (e.g. flunssa) in the previous review. The font of the matching label should be the one used for regular text, same size and styling.
- The arrows for broader/narrower do not match the layout spec. They should be rotated. Also, the alignment of icons is currently problematic, I think that center-align could be better.
- Long lines are wrapped in an ugly way. They should be truncated, with a possibility to click them to reveal the full line. (This could be turned into a separate issue.)
- For terms in other languages, the prefLabel should be emphasized (bold style, different color).
- The HTML contains many
span
elements and uses ofversal
class. These are remnants from Skosmos 2 which are unnecessary. IMHO we should try to use simpler HTML structure, as in the static example. - The copy to clipboard button should be white
- The URI text/icon is too large
The latest update of the PR contains:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again getting much better. But I do have more comments!
PR title
Could you change the PR title to something a bit more informative?
global-search.inc
Is this file actually needed in this PR? It seems like a preliminary version of the global search template (e.g. doesn't include translations).
General page layout
There's a lot of empty space above the search result content:
Compare this with the Finto spec:
Extra language tags & untranslated types
I searched YSO for "vaatteet" and got this:
For some reason, there are (fi)
language tags (without a preceding space) on the third narrower concept and all later ones, but not the first and second. (This happens with Skosmos 2 as well). I don't think they should be there or at least it should be consistent.
Also, the types isothes:ThesaurusArray and skos:Collection are not properly translated. (This is a regression compared to Skosmos 2.)
Extra whitespace and padding
The result for "kisat" looks like this:
I've selected the altlabels to show that there is an extra space before "kilvat". The same happens with all other property values as well. It would be better to omit this space (removing unnecessary whitespace from the template or using twig whitespace control).
But I think there should be slightly more padding between the icon and the text (best added after removing the whitespace). Compare with the Finto spec:
Possibly unnecessary functionality in the template
I've pointed out in the comments a couple of if
clauses which I think are unlikely to be ever true (deprecated concepts & submembers). Unless there is a known use for these, I think these should be left out. (And if there is a use, a Cypress test to verify the functionality would be great!)
Cypress tests
The current test is very minimal. I suggested in a comment some additional test cases that could be implemented. I realize that making the tests may require the "mini YSO" test vocabulary that is currently being developed (see #1516).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty minimal test for what is a fairly advanced page type. Could we come up with more tests?
Examples:
- the "X results for Y" text is there, with the correct values for X and Y
- the search returns the correct number of search-result DIV elements
- for one of the search results, verify the basic information, e.g.
- heading information (also check that the link points where it should)
- prefLabels in all languages
- altLabels
- broader / narrower / related
- group
- URI
- same as above for non-Concept types e.g. ThesaurusArray ("vaatteet vuodenajan mukaan")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added more texts for the search result properties. We should maye wait for test-yso before writing tests for the non-concept types.
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reasons for creating this PR
Twig template for vocabulary search
Link to relevant issue(s), if any
Fixes #1483
Description of the changes in this PR
This PR is built on the PR #1469 as it uses the same search-results.inc
Known problems or uncertainties in this PR
Checklist
.sr-only
class, color contrast)