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

Custom labels and tooltips for properties in concept view #1244

Merged
merged 6 commits into from
Nov 11, 2021

Conversation

joelit
Copy link
Contributor

@joelit joelit commented Nov 10, 2021

Reasons for creating this PR

There was a need for renaming property labels in concept view for certain controlled vocabularies (metatietosanasto, kanto) and classifications. These do not strictly follow the normally assumed naming conventions for the concept properties.

Link to relevant issue(s), if any

Description of the changes in this PR

  • Possibility for adding new property labels via config.ttl
  • Possibility for adding new tooltips for customized property labels via config.ttl
  • Example of the configuration:
:vocab 
    skosmos:propertyLabelOverride
        [ skosmos:property skos:prefLabel ;
          rdfs:label "Caption"@en, "Luokka"@fi ],
        [ skosmos:property skos:notation ;
          rdfs:label "UDC number"@en, "UDC-numero"@fi, "UDC-nummer"@sv ;
          schema:description "Class Number"@en ] ;
.

Known problems or uncertainties in this PR

Haven't tested if it's possible to create just new tooltips for existing property labels

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)

@codecov
Copy link

codecov bot commented Nov 10, 2021

Codecov Report

Merging #1244 (dc4342a) into master (30ce5d0) will increase coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1244      +/-   ##
============================================
+ Coverage     69.07%   69.25%   +0.18%     
- Complexity     1638     1646       +8     
============================================
  Files            32       32              
  Lines          4016     4040      +24     
============================================
+ Hits           2774     2798      +24     
  Misses         1242     1242              
Impacted Files Coverage Δ
controller/WebController.php 16.56% <100.00%> (+0.50%) ⬆️
model/VocabularyConfig.php 96.12% <100.00%> (+0.32%) ⬆️

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 30ce5d0...dc4342a. Read the comment docs.

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.

Looks good in general, though I have some concerns in the comment.
I will see if I can fix those and then test to see if this can be merged.

@@ -71,7 +73,6 @@ public function getPluginArray() : array

/**
* Sets array of parameterized plugins
* @param Easyrdf\Resource $pluginResource
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't relevant to the PR, but OK, it's a valid docstring fix.

model/VocabularyConfig.php Outdated Show resolved Hide resolved
view/concept-shared.twig Outdated Show resolved Hide resolved
view/concept-shared.twig Outdated Show resolved Hide resolved
view/concept-shared.twig Outdated Show resolved Hide resolved
view/concept-shared.twig Outdated Show resolved Hide resolved
@osma osma self-assigned this Nov 11, 2021
@sonarcloud
Copy link

sonarcloud bot commented Nov 11, 2021

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

I fixed the problems I saw, I think this is now good enough for merging.

@osma osma merged commit ba263f0 into master Nov 11, 2021
@osma osma added this to the 2.13 milestone Nov 11, 2021
@osma osma assigned joelit and unassigned osma Nov 11, 2021
@osma osma deleted the issue806-custom-labels-for-concept-properties branch January 20, 2022 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New labels for classification concept views
2 participants