Refactor sorting code for hierarchical and groups tabs #1391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
toscripts.js
so that they can be utilized in bothhierarchy.js
andgroups.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
.sr-only
class, color contrast)