dspace-angular
dspace-angular copied to clipboard
Restore hierarchical tree original behaviour
References
- https://github.com/DSpace/dspace-angular/issues/815
- https://github.com/DSpace/dspace-angular/pull/2215
Description
The goal of this PR is to reinstate a behavior of the hierarchical tree component when it's used for controlled vocabulary fields within the submission form. Indeed during a submission when opening the hierarchical tree for controlled vocabulary field which already contained a selected value the tree were shown opened directly to the tree element related to the field value, with the value marked as green. e.g.
This behavior has been lost starting from the dspace 7.5 version, probably due to some refactoring done on the hierarchical tree component
Instructions for Reviewers
- To test this Pr we need to have a submission form configuration which use the hierarchical tree for a controlled vocabulary field. To do so you can simply change the input type from tag to onebox in the traditionalpagetwo form configuration
- create a new submission which use a traditionalpagetwo form, for example you can create a new publication
- fill out the controlled vocabulary field by selecting an element in the hierarchical tree
- after saved the form open again the hierarchical tree and verify the tree is shown opened directly to the tree element related to the field value, with the value marked as green
You can verify that this behavior is exactly what happened before 7.5 release by using the tag dspace-7.4 (you can run over the current rest server version, it's working anyway)
List of changes in this PR:
- Reinstate a behavior of the hierarchical tree component
- Added a flag to show/hide add button in the hierarchical tree component. This is because in some case like the when the componente is used for the search filter or the hierarchical browse the add button should not displayed
Checklist
- [x] 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.
- [x] My PR passes ESLint validation using
yarn lint
- [x] My PR doesn't introduce circular dependencies (verified via
yarn check-circ-deps
) - [x] My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
- [x] My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
- [x] 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. - [x] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
- [x] If my PR fixes an issue ticket, I've linked them together.
Hi @atarix83, Conflicts have been detected against the base branch. Please resolve these conflicts as soon as you can. Thanks!
@atarix83 : This has code conflicts. If you wish to have it still considered for 8.0, please get this PR cleaned up and updated to latest main
. Otherwise, we'll have to reschedule for 9.0. Thanks!
We have tested this PR on May 13th and it worked for us.
What we do:
- Changed the dc.subject input-type to onebox advised.
- Checked out the PR, created a new Item in Test Collection.
- Selected Business Studies for subject.
- Clicked in the input field again.
- The tree is opened at the correct value.
Print screen:
@atarix83 : Could you rebase this against main
and resolve the merge conflicts? It'd be nice to get this into 8.0 and backported to 7.6.x
@tdonohue done
Backport failed for dspace-7_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-7_x
git worktree add -d .worktree/backport-2738-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-2738-to-dspace-7_x
git switch --create backport-2738-to-dspace-7_x
git cherry-pick -x 11974740093dd5bb75da843f2a8bb3752c5029cd 9268ef985362ef52c007d53e9087d07d095044e0 a989bebf50f3ea322d1ae39e3909d6ebe0430f63 585c49caef31bb34f1695baf929d47654f73799c
@atarix83 : This was unable to be automatically ported to dspace-7_x
in order to fix this in 7.6.x. If you feel we should also fix this in 7.6.x, then please have someone create a separate PR against dspace-7_x
, and I'll review it. Otherwise, we'll only include this fix in 8.0