Skip to content

Reimplement sidebar tabs and their configuration#1493

Merged
UnniKohonen merged 8 commits intoskosmos-3from
sidebar-tabs-configuration
Aug 31, 2023
Merged

Reimplement sidebar tabs and their configuration#1493
UnniKohonen merged 8 commits intoskosmos-3from
sidebar-tabs-configuration

Conversation

@UnniKohonen
Copy link
Contributor

@UnniKohonen UnniKohonen commented Aug 24, 2023

Reasons for creating this PR

Reimplementing sidebar and its configuration.

Link to relevant issue(s), if any

Description of the changes in this PR

  • Removing old vocabulary configuration options fullAlphabeticalIndex, showAlphabeticalIndex and showChangeList
  • Adding a configuration option sidebarViews which sets available sidebar tabs for a vocabulary (given as an ordered list with possible values hierarchy, alphabetical, fullalphabetical, groups and changes)
  • Adding a configuration option defaultConceptSidebarView which sets default view on concept page
  • Reimplementing sidebar.inc
  • Updating alpha-tab vue component to work with new sidebar

Known problems or uncertainties in this PR

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@UnniKohonen UnniKohonen added this to the 3.0 milestone Aug 24, 2023
@UnniKohonen UnniKohonen self-assigned this Aug 24, 2023
@UnniKohonen UnniKohonen changed the title Issue1465 sidebar tabs and their configuration Reimplement sidebar tabs and their configuration Aug 24, 2023
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 85.18% and project coverage change: +0.09% 🎉

Comparison is base (76def2f) 70.05% compared to head (d1d2112) 70.14%.

Additional details and impacted files
@@               Coverage Diff               @@
##             skosmos-3    #1493      +/-   ##
===============================================
+ Coverage        70.05%   70.14%   +0.09%     
- Complexity        1641     1642       +1     
===============================================
  Files               32       32              
  Lines             4301     4314      +13     
===============================================
+ Hits              3013     3026      +13     
  Misses            1288     1288              
Files Changed Coverage Δ
src/model/VocabularyConfig.php 95.68% <85.18%> (+0.19%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@UnniKohonen UnniKohonen requested a review from joelit August 30, 2023 08:22
Copy link
Contributor

@joelit joelit 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. Couple of situations turned up in testing that might need to be addressed.

  • If you write nonsense in the configuration
    skosmos:sidebarViews ( "alphabetical" "hierarchy" "dog" ) ;
    Skosmos creates sidebar tabs after these - should the invalid configuration strings just be ignored instead?
    • IMO this should be fixed in code
  • What should Skosmsos do in the situation where there is a confict between the sidebar views and the defaultConceptSidebarView:
    skosmos:defaultConceptSidebarView "hierarchy" ;
    skosmos:sidebarViews ( "alphabetical" "groups" ) ;
    Currently this results in behaviour where the vocab page shows those two tabs as it should, but visiting a concept URL directly results in a sidebar that has the configured two tabs, but no content in the sidebar.
    • This could be addressed in code so that Skosmos shows a default concept sidebar if the configuration parameter is not reproduceable, or it could be just mentioned in the (upcoming) Skosmos 3.0 configuration documentation

@UnniKohonen
Copy link
Contributor Author

I changed the config to deal with inconsistencies:

  • If there are incorrect entries in skosmos:sidebarViews, they are filtered out
  • If the values of skosmos:defaultConceptSidebarView or skosmos:defaultSidebarView are not in skosmos:sidebarViews, the first entry in skosmos:sidebarViews is used instead

@sonarqubecloud
Copy link

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 16 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@UnniKohonen UnniKohonen marked this pull request as ready for review August 31, 2023 10:45
@UnniKohonen UnniKohonen requested a review from joelit August 31, 2023 10:45
Copy link
Contributor

@joelit joelit left a comment

Choose a reason for hiding this comment

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

LGTM

@UnniKohonen UnniKohonen merged commit fe8e74a into skosmos-3 Aug 31, 2023
@osma osma deleted the sidebar-tabs-configuration branch October 10, 2024 13:23
@osma osma modified the milestones: 3.x, 3.0 Jan 22, 2025
@UnniKohonen UnniKohonen mentioned this pull request Jan 28, 2025
12 tasks
@osma osma mentioned this pull request Aug 27, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants