Skip to content

Conversation

@AAwouters
Copy link
Contributor

@AAwouters AAwouters commented Jan 10, 2025

References

Backports

#3820
#3821

Description

Two changes are made:
Before initializing a treeview, an attempt is made to retrieve the preloadLevel value for the opened vocabulary.
If a value is found the preloadLevel is set to that value, otherwise 1 is used.

Whenever a node is initialized and that node is on a level lower than the preloadLevel, that node is immediately expanded.

Instructions for Reviewers

  • Set config for preLoadLevel, e.g. vocabulary.plugin.srsc.hierarchy.preloadLevel = 3 (values greater than 3 are not recommended for 'srsc')
  • Open Browse 'By Subject Category' page (browse/srsc)
  • The tree is immediately expanded up to 3 levels

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

…-preloadlevel-fix-main

# Conflicts:
#	src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts
#	src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts
@AAwouters AAwouters changed the title Vocabulary preloadlevel fix main Vocabulary preloadlevel fix Jan 10, 2025
@tdonohue tdonohue added bug component: controlled vocabulary related to controlled vocabulary or value-pairs dropdowns 1 APPROVAL pull request only requires a single approval to merge labels Jan 10, 2025
@tdonohue tdonohue added this to the 9.0 milestone Jan 10, 2025
@kanasznagyzoltan
Copy link
Contributor

checked out pr branch, set preLoadLevel to 3, navigated to browse/srsc and the preLoadLevel works correctly

image

@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release May 19, 2025
@tdonohue tdonohue removed this from the 9.0 milestone May 21, 2025
@kanasznagyzoltan
Copy link
Contributor

Hi @tdonohue ,
We’ve reviewed this PR and found it useful and well-implemented on our side. If you have a moment, could you please take a look as well?
Thanks in advance!

Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

Thanks @AAwouters ! I tested this via #3820 , which has identical code, and it works well.

I also found that this "preloadLevel" configuration is undocumented (along with a few other configs in "authority.cfg"), so I've added docs to 7.x/8.x/9.x. For example: https://wiki.lyrasis.org/display/DSDOC9x/Authority+Control+of+Metadata+Values#AuthorityControlofMetadataValues-AdditionalconfigurationsforHierarchicalControlledVocabularies

@github-project-automation github-project-automation bot moved this from 🙋 Needs Reviewers Assigned to 👍 Reviewer Approved in DSpace 10.0 Release Jul 1, 2025
@tdonohue tdonohue added the port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release label Jul 1, 2025
@tdonohue tdonohue added this to the 10.0 milestone Jul 1, 2025
@tdonohue tdonohue merged commit 9c6bb82 into DSpace:main Jul 1, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from 👍 Reviewer Approved to ✅ Done in DSpace 10.0 Release Jul 1, 2025
@dspace-bot
Copy link
Contributor

Backport failed for dspace-9_x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin dspace-9_x
git worktree add -d .worktree/backport-3819-to-dspace-9_x origin/dspace-9_x
cd .worktree/backport-3819-to-dspace-9_x
git switch --create backport-3819-to-dspace-9_x
git cherry-pick -x cee9d0422b5901f3f0265fd19349923baa07df92 9406f7b0850f34a3138efa6f98b6785a05eda64b 4ffde928d46cdfaa0489aeb5760c3cfcff21a76b

@tdonohue
Copy link
Member

tdonohue commented Jul 1, 2025

@AAwouters : Could you please backport this to dspace-9_x? This fix has already been applied to main, dspace-8_x and dspace-7_x. But, the automated port to dspace-9_x has failed (see above).

@AAwouters
Copy link
Contributor Author

@tdonohue I've created a port MR: #4522

@tdonohue tdonohue removed the port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release label Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge bug component: controlled vocabulary related to controlled vocabulary or value-pairs dropdowns

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Vocabulary treeview does not respect preloadLevel configuration

4 participants