-
Notifications
You must be signed in to change notification settings - Fork 438
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
Change - Metadata field selector, add infinite scroll for data paginated #3096
base: main
Are you sure you want to change the base?
Conversation
this.input.valueChanges.pipe( | ||
debounceTime(this.debounceTime), | ||
startWith(''), | ||
tap( () => this.currentPage$.next(1) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a good idea to "perform work" in a tap. Taps are meant for debugging purposes, and shouldn't affect anything else. The main reason for that is that the code in the tap won't be executed if nothing is subscribed to the pipe in the end. Since you're subscribing immediately underneath this line that's not an issue here, but then there's also no good reason not to move this code to the subscribe as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@artlowel Hi, I changed this observable in the subscribe function
debounceTime(this.debounceTime), | ||
startWith(''), | ||
tap( () => this.currentPage$.next(1) ) | ||
).subscribe((valueChange) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add this subscribe to the subs array, so it can be unsubscribed onDestroy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@artlowel I aded to subs array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VictorHugoDuranS : We reviewed this as a team in our weekly DevMtg today. Some of the feedback can be found above. One other note to add is that we'd need to have a version of this PR built against main
, so that we can port it to 8.x and 9.0. If you could create a separate PR for main
, that'd be appreciated. (An alternative would be to update this PR to be against main
, and we can then just apply this fix in 9.0 and 8.x only). Thanks!
</ng-container> | ||
<button *ngIf="loading" | ||
class="list-group-item list-group-item-action border-0 list-entry"> | ||
<ds-themed-loading [showMessage]="false"></ds-themed-loading> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this is ported to main
, I believe this <ds-themed-loading>
tag will need to be <ds-loading>
because of the changes in 8.0 applied in #2865.
So, this is an example of why we need a separate PR for main
. This current code is correct for 7.x, but will fail in 8.x or main
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tdonohue. I merged the main branch with this branch and changed the "ds-loading" import. Thanks for the feedback
# Conflicts: # src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts # src/app/dso-shared/dso-shared.module.ts
Hi @VictorHugoDuranS, |
Hi @tdonohue , I'm @jtimal partner, I like to share this PR with you:
References
Description
I changed metadata field selector add infinite scroll for pagination all data from metadata field service, this change load all options in the start
Instructions for Reviewers
To see the new implementation, I attch a video with the functionality: https://youtu.be/8D-EjhubABI
List of changes in this PR:
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.