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

Refactor sorting code for hierarchical and groups tabs #1391

Open
wants to merge 1 commit into
base: skosmos-2
Choose a base branch
from

Conversation

kouralex
Copy link
Contributor

Reasons for creating this PR

Tackling issues described in #1390

Link to relevant issue(s), if any

Description of the changes in this PR

This PR changes the code base via refactoring as some methods (namely: getLabel, pickLabel, nodeLabelSortKey, hierarchySort) and their respective code lines have been transferred from hierarchy.js to scripts.js so that they can be utilized in both hierarchy.jsand groups.js.

Additional changes were made to how $(document).on('click','div.group-hierarchy a', ... (clicking groups) was handled as there were apparent issues that stood out whilst testing the now-refactored code. A careful research and comparison with $(document).on('click', '.concept-hierarchy a', (clicking the hierarchy concepts) revealed that the code for clicking groups lacked some features the more-tested clicking hierarchy concepts had so I added them - now the jsTree hiearchy in groups tab seems to be working as expected.

Known problems or uncertainties in this PR

I noticed that autocomplete shows notation codes even after applying skosmos:showNotation "false" setting and this is how it is working in https://finto.fi/yso-aika/fi/. It may be OK for YSO-aika vocabulary, but for the vocabulary I am currently testing it certainly is not. However, fixing the aforementioned is out of the scope of 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)

@kouralex kouralex added this to the Next Tasks milestone Nov 24, 2022
@sonarcloud
Copy link

sonarcloud bot commented Nov 24, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 12 Code Smells

No Coverage information No Coverage information
6.9% 6.9% Duplication

@joelit
Copy link
Contributor

joelit commented Feb 9, 2023

I asked for further clarifications in the comment section for the related issue #1390

@kouralex
Copy link
Contributor Author

@joelit I have given further clarifications in the comment section for the related issue #1390, any news on this?

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.

Sorting by notation does not work in groups tab if showNotation is false
2 participants