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

Upgrade ng-dynamic-forms to v15 and RxJs to v7 #1615

Merged

Conversation

ybnd
Copy link
Member

@ybnd ybnd commented Apr 27, 2022

References

Description

Upgrade ng-dynamic-forms and rxjs, as well as a few others to fix the peer dependency mismatches that arose.

  • isNumeric was deprecated as of RxJs 7.x; lifted it from 6.x into src/shared/numeric.util.ts

  • Fixed a number of tests that broke, things to keep in mind for future tests:

    • debounceTime no longer works with fakeAsync/tick (open issue)

      I've added a temporary workaround based on this comment; it should work in the same way as the built-in operator but doesn't cause the same issue.

      We only need to use this workaround in cases where we're actually waiting for debounce in tests.

    • Subject objects now have a new currentObservers property which may be either null or [] when there are no observers. This makes it less reliable to compare BehaviorSubject objects directly.

      We had one case of this in vocabulary-treeview.service.spec.ts.

      This suite also contains a few other tests comparing BehaviorSubjects that don't fail. It would be good to refactor those tests to compare by emitted values instead, but that's a bit tricky since TreeviewNode contains nested BehaviorSubjects.

      Addressing that would take this PR beyond the estimated 8 hours (and seems out of scope).

Instructions for Reviewers

Run this PR locally and compare functionality & forms to https://demo7.dspace.org

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • 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 TSLint validation using yarn run lint
  • My PR doesn't introduce circular dependencies
  • 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, third-party dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.

ybnd added 2 commits April 25, 2022 15:32
Copied over isNumeric from RxJs 6.x as it was removed from 7.x
Build & tests are broken, fixed in subsequent commit
@ybnd ybnd self-assigned this Apr 27, 2022
@ybnd ybnd added bug dependencies Pull requests that update a dependency file high priority e/8 Estimate in hours labels Apr 27, 2022
@ybnd ybnd marked this pull request as ready for review April 27, 2022 08:29
@artlowel artlowel added this to the 7.3 milestone Apr 27, 2022
@tdonohue tdonohue requested review from tdonohue and atarix83 April 28, 2022 14:49
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 @ybnd ! Gave this a review and test today. Code all looks reasonable & has good comments (thanks!). Tested areas of the UI which appear to have been modified & some areas where forms are used (e.g. submission), and I'm not noticing any differences in behavior. So, this all looks good to me.

Copy link
Contributor

@atarix83 atarix83 left a comment

Choose a reason for hiding this comment

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

thanks @ybnd for this PR

I've tested the application with focus on the submission form and all seems to work fine.

@tdonohue
Copy link
Member

Thanks @ybnd ! Merging with +2

@tdonohue tdonohue merged commit 659a9a6 into DSpace:main May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file e/8 Estimate in hours high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to ng-dynamic-forms v15 and rxjs v7
4 participants