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

Edit section in sidebar menu: edit page of selected item / collection / community does not refresh #2308

Merged
merged 4 commits into from
Jun 16, 2023

Conversation

alisaismailati
Copy link
Contributor

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:

  • First, the initialization of CollectionMetadataComponent is changed in order to ensure that the item's template is always up to date. To do so it is checked if the NavigationEnd or a Scroll event followed by a NavigationEnd event is finished.
    This way we track the URL change or the refresh of the page.
  • Second, in CollectionFormComponent the logic from the ngOnInit is separated to a new method initializeForm() , in order to call this method on ngOnChanges . Since we get the data as Input, we need to initialize the form as often as the data changes (the component is initialized only once).
  • Other changes include removing 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.
  • Lastly, is worked on unit tests on src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts, in order to provide and mock the Router.

Include guidance for how to test or review your PR.
Steps to reproduce the behavior are the same as mentioned on #2300.

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 self-requested a review June 14, 2023 14:22
@tdonohue tdonohue added bug component: administrative tools Related to the admin menu or tools 1 APPROVAL pull request only requires a single approval to merge performance / caching Related to performance, caching or embedded objects labels Jun 14, 2023
@tdonohue tdonohue added this to the 7.6 milestone Jun 14, 2023
@tdonohue tdonohue requested a review from artlowel June 15, 2023 14:11
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 @alisaismailati ! This has fixed all the bugs listed in #2300

  • Verified editing one community and then another causes the "Edit Community" form to reload
  • Verified editing one collection and then another causes the "Edit Collection" form to reload
  • Verified editing one Item and then another, causes the Item Status page to reload.

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: administrative tools Related to the admin menu or tools performance / caching Related to performance, caching or embedded objects
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

edit section in sidebar menu: edit page of selected item / collection / community does not refresh
2 participants