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

Restore hierarchical tree original behaviour #2738

Conversation

atarix83
Copy link
Contributor

References

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.

Schermata del 2024-01-10 17-17-20

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
    Schermata del 2024-01-11 11-30-44
    Schermata del 2024-01-11 11-37-33

Checklist

  • 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 yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn 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.
  • 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.

@tdonohue tdonohue added bug component: submission component: controlled vocabulary related to controlled vocabulary or value-pairs dropdowns port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Jan 11, 2024
Copy link

github-actions bot commented Feb 9, 2024

Hi @atarix83,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue tdonohue requested a review from artlowel March 21, 2024 15:50
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Mar 21, 2024
@tdonohue
Copy link
Member

tdonohue commented May 3, 2024

@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!

@kanasznagyzoltan
Copy link

We have tested this PR on May 13th and it worked for us.

What we do:

  1. Changed the dc.subject input-type to onebox advised.
  2. Checked out the PR, created a new Item in Test Collection.
  3. Selected Business Studies for subject.
  4. Clicked in the input field again.
  5. The tree is opened at the correct value.

Print screen:

image

@tdonohue
Copy link
Member

@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

…iginal-behaviour

# Conflicts:
#	src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts
#	src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts
#	src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts
#	src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts
#	src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts
#	src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts
#	src/app/shared/form/vocabulary-treeview/vocabulary-treeview.service.ts
#	src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts
@atarix83
Copy link
Contributor Author

@tdonohue done

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 @atarix83 ! I've verified this works both in the Submission form (when the dc.subject field is changed to a onebox) and in the Edit Metadata form when editing fields for an archived item. No issues found, so I'm merging this immediately.

@tdonohue tdonohue added this to the 8.0 milestone May 21, 2024
@tdonohue tdonohue merged commit 71bc1ad into DSpace:main May 21, 2024
13 checks passed
@dspace-bot
Copy link
Contributor

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

@tdonohue
Copy link
Member

@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

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 component: submission port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

4 participants