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

Order hierarchy by notation #1651

Merged
merged 4 commits into from
Aug 20, 2024
Merged

Order hierarchy by notation #1651

merged 4 commits into from
Aug 20, 2024

Conversation

UnniKohonen
Copy link
Contributor

Reasons for creating this PR

Hierarchy is currently only ordered by labels. It should be possible to order it by notation codes as well

Link to relevant issue(s), if any

Description of the changes in this PR

Sort concepts based on notation codes using both lexical and natural sorting.

Addresses requirement 6d in #1521

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 15, 2024
@UnniKohonen UnniKohonen self-assigned this Aug 15, 2024
@UnniKohonen UnniKohonen requested a review from osma August 15, 2024 10:32
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.

Seems to work very well on the example vocabularies I tested (YKL, YSO-aika, okm-tieteenala). However, we don't really have a recent use case for numeric sorting of notations (the PTVL classification that required this was removed from Finto some time ago) so I couldn't test that with a real example. Anyway, I suppose it's good enough given that we don't even need it at the moment :)

I'd like to see Cypress tests that verify that the order in the hierarchy follows the notations, could you add some? I know that we're currently lacking Cypress tests for a lot of sidebar functionality, so adding tests could also be done as a separate effort if you prefer.

I made a suggestion to rename the compareStrs function to compareConcepts.

resource/js/tab-hierarchy.js Outdated Show resolved Hide resolved
Copy link

@UnniKohonen UnniKohonen requested a review from osma August 20, 2024 07:27
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.

LGTM!

@UnniKohonen UnniKohonen merged commit 9f332a9 into main Aug 20, 2024
9 of 10 checks passed
@UnniKohonen UnniKohonen deleted the order-hierarhcy-by-notation branch August 20, 2024 07:36
@osma osma modified the milestones: 3.x, 3.0 Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done (verified in test.dev.finto.fi, set Milestone 3.0 for both issue & PR)
Development

Successfully merging this pull request may close these issues.

2 participants