-
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
Add HTML classes for properties so they can be targeted in JS and CSS #1046
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1046 +/- ##
============================================
+ Coverage 60.32% 61.83% +1.50%
- Complexity 1593 1782 +189
============================================
Files 32 32
Lines 4429 4656 +227
============================================
+ Hits 2672 2879 +207
- Misses 1757 1777 +20
Continue to review full report at Codecov.
|
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 good to me! Great improvement @osma!
0c744b6
to
31619f1
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
Very needed improvement indeed! Thanks @osma for this PR.
I just want to explicitly state that
-
The simplistic way of just adding the
prop-{{property.ID}}
to the class name will only show the most accurate property ID due to the de-duplication procedure, e.g., on https://finto.fi/yso-paikat/fi/page/?uri=http://www.yso.fi/onto/yso/p507412 you will only haveisothes_broaderPartitive
and noskos_broader
. Some implementation could, in theory, only search for the known skos:broader property but maybe that is a minor detail and may be shrugged off (via YAGNI principle). -
The names used for prefixes in
config.ttl
will end up into the class names, which may cause unexpected values to be used (from the perspective of a third party). This cannot be countered as there is no prefix mappings given.
But it is good as it now, I will happily approve!
Thanks @kouralex - I'm aware of those edge cases but I think it's worth merging this as-is and then improve later on if it turns out to be necessary. |
Thank you - works like a charm! :-) |
Fixes #1034
All the
div
blocks which represent properties will get a HTML classproperty
.Additionally, those
div
s will get a specific class identifying the property in question. Usually, the class identifier is generated from the property URI:prop-dc_identifier
orprop-skos_broader
prop-http___rdaregistry_info_Elements_a_P50008
(for rdaa:P50008 - but therdaa
prefix is not known by Skosmos)There are a few special cases for some
div
blocks representing special purpose properties:prop-preflabel
prop-other-languages
prop-uri
prop-mapping
Any comments @CaptSolo @kinow?