Skip to content

Render hierarchy without topconcepts#1818

Merged
UnniKohonen merged 6 commits intomainfrom
render-hierarchy-without-topconcepts
Oct 30, 2025
Merged

Render hierarchy without topconcepts#1818
UnniKohonen merged 6 commits intomainfrom
render-hierarchy-without-topconcepts

Conversation

@UnniKohonen
Copy link
Contributor

@UnniKohonen UnniKohonen commented Oct 29, 2025

Reasons for creating this PR

Trying to open the hierarchy tab on a concept page in vocabs without top concepts results in a JS error (see e.g. /ysa/fi/page/Y169060). This PR fixes the rendering of these hierarchies.

Link to relevant issue(s), if any

Description of the changes in this PR

  • Add concepts without broader concepts to hierarchy as topmost concepts
  • Fix setting top concepts in hierarchy in REST controller
  • Add CSS and a tooltip for disabled hierarchy tab
  • Cypress test for hierarchies in vocabs with no top concepts

Addresses requirement 6e in #1521

Known problems or uncertainties in this PR

  • All branches of the hierarchy containing the concept are rendered. In Skosmos 2, only one topmost concept is visible in hierarchy. (See e.g. /ysa/fi/page/Y107898)

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-beta.1 milestone Oct 29, 2025
@UnniKohonen UnniKohonen self-assigned this Oct 29, 2025
@UnniKohonen UnniKohonen requested a review from osma October 29, 2025 11:06
@UnniKohonen UnniKohonen moved this to In progress in Skosmos 3.x Backlog Oct 30, 2025
@osma
Copy link
Member

osma commented Oct 30, 2025

I noticed a problem with the Hierarchy tab tooltip. It is shown also on the concept page after a partial page load:

image

To replicate:

  1. Go to YSA vocab home page (note: Hierarchy tab is disabled)
  2. Click on "aakkoset" in the hierarchy (Hierarchy tab becomes enabled)
  3. Hover mouse over the Hierarchy tab -> the tooltip is shown, even though the tab is enabled

@sonarqubecloud
Copy link

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.

Excellent!

@UnniKohonen UnniKohonen merged commit 965bb55 into main Oct 30, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Issue/PR closed in Skosmos 3.x Backlog Oct 30, 2025
@UnniKohonen UnniKohonen deleted the render-hierarchy-without-topconcepts branch October 30, 2025 09:15
@UnniKohonen UnniKohonen modified the milestones: 3.0-beta.1, 3.0-beta.2 Nov 5, 2025
@osma osma moved this from Issue/PR closed to Done (verified in test.dev.finto.fi, set Milestone 3.0 for both issue & PR, update docs) in Skosmos 3.x Backlog Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants