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

Change - Metadata field selector, add infinite scroll for data paginated #3096

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

VictorHugoDuranS
Copy link
Contributor

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:

  • I changed the template metadata-field-selector.component.html adding the infinite scroll directives
  • I changed the search function to page the query detecting change value on input
  • I changed the observable list to "behaviorsubject" for update the current list
  • I added a function for update the current list options according the query search, only if the user scroll to last item of the list

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 1 APPROVAL pull request only requires a single approval to merge component: Item (Archived) Item display or editing ux User Experience related works port to main This PR needs to be ported to `main` branch for the next major release labels May 31, 2024
this.input.valueChanges.pipe(
debounceTime(this.debounceTime),
startWith(''),
tap( () => this.currentPage$.next(1) )
Copy link
Member

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.

Copy link
Contributor

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) => {
Copy link
Member

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

Copy link
Contributor

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

@pilasou
Copy link
Contributor

pilasou commented Sep 5, 2024

Hi, I tested the PR. It works as described : when adding a metadata field to an archived Item, full list of metadata available is listed in the Field Column with ability to scroll down :
image

When starting to type metadata name (i.e dc.identifier) the metadata list is filtered accordingly and can still be scrolled.

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.

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

# Conflicts:
#	src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts
#	src/app/dso-shared/dso-shared.module.ts
Copy link

github-actions bot commented Sep 8, 2024

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

@VictorHugoDuranS VictorHugoDuranS changed the base branch from dspace-7_x to main September 8, 2024 08:02
Copy link
Member

@artlowel artlowel left a comment

Choose a reason for hiding this comment

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

@tdonohue tdonohue added port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release and removed port to main This PR needs to be ported to `main` branch for the next major release labels Jan 10, 2025
@tdonohue tdonohue added this to the 9.0 milestone Jan 10, 2025
@tdonohue tdonohue merged commit f52aac8 into DSpace:main Jan 10, 2025
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-3096-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-3096-to-dspace-7_x
git switch --create backport-3096-to-dspace-7_x
git cherry-pick -x ee8e915695503debab6875af2d0ce938b0fb98cf ea4076af29dc4a9f5df2284fc0e170da6f9454fd 354675f06b6104868173c62f3d794203aa7a35f1 ad1c954984c39df32d3a4bd87b5fe3e713a05dcd

@dspace-bot
Copy link
Contributor

Backport failed for dspace-8_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-8_x
git worktree add -d .worktree/backport-3096-to-dspace-8_x origin/dspace-8_x
cd .worktree/backport-3096-to-dspace-8_x
git switch --create backport-3096-to-dspace-8_x
git cherry-pick -x ee8e915695503debab6875af2d0ce938b0fb98cf ea4076af29dc4a9f5df2284fc0e170da6f9454fd 354675f06b6104868173c62f3d794203aa7a35f1 ad1c954984c39df32d3a4bd87b5fe3e713a05dcd

tdonohue pushed a commit to tdonohue/dspace-angular that referenced this pull request Jan 10, 2025
…ted (DSpace#3096)

* Change - Metadata field selector add infinite scroll for data paginated

* Update change on new BRANCH

* Fix - LINT ERRORS

* Fix - LINT ERRORS
tdonohue pushed a commit to tdonohue/dspace-angular that referenced this pull request Jan 10, 2025
…ted (DSpace#3096)

* Change - Metadata field selector add infinite scroll for data paginated

* Update change on new BRANCH

* Fix - LINT ERRORS

* Fix - LINT ERRORS
tdonohue pushed a commit to tdonohue/dspace-angular that referenced this pull request Jan 10, 2025
…ted (DSpace#3096)

* Change - Metadata field selector add infinite scroll for data paginated

* Update change on new BRANCH

* Fix - LINT ERRORS

* Fix - LINT ERRORS
@tdonohue tdonohue removed port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Jan 10, 2025
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: Item (Archived) Item display or editing ux User Experience related works
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

List of available metadata fields is truncated when adding new metadata in "Edit Item"
6 participants