Edit section in sidebar menu: edit page of selected item / collection / community does not refresh #2308
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.
References
Description
Fixed the behavior of collection/community/item components in order to initialize the form correctly and to ensure that the item's template is always up to date.
Instructions for Reviewers
List of changes in this PR:
NavigationEnd
or aScroll
event followed by aNavigationEnd
event is finished.This way we track the URL change or the refresh of the page.
CollectionFormComponent
the logic from thengOnInit
is separated to a new methodinitializeForm()
, in order to call this method onngOnChanges
. Since we get the data asInput
, we need to initialize the form as often as the data changes (the component is initialized only once).first()
operator from the pipe when getting so latest data from route, because it was causing the page to not load the new data when the user navigates to the page after choosing a new element to edit.src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts
, in order to provide and mock theRouter
.Include guidance for how to test or review your PR.
Steps to reproduce the behavior are the same as mentioned on #2300.
Checklist
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.