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

Removed unnecessary *ngVars from ThumbnailComponent #3221

Conversation

alexandrevryghem
Copy link
Member

References

Description

This PR removes the unnecessary *ngVars in the ThumbnailComponent. When you disable caching and you run dspace in prod mode you will still be able to see that the content is retrieved twice, but this can't be avoided. The first time it is triggered by the SSR and the second time by CSR. We can't change that, but we should still remove the *ngVars since they are actually not necessary and *ngVars also trigger fixture.detectChanges() every time there is interaction with the template so that's not really good for performance.

Instructions for Reviewers

We actually don't need those BehaviourSubjects because we don't subscribe to them except in the template, so I just converted them back to regular string/boolean fields. Everything should still work like they did before.

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • 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.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • 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.

…nto w2p-116728_removed-unnecessary-ngvars_contribute-main

# Conflicts:
#	src/app/thumbnail/thumbnail.component.ts
@alexandrevryghem alexandrevryghem added bug component: Item (Archived) Item display or editing claimed: Atmire Atmire team is working on this issue & will contribute back affects: 8.x Issue impacts 8.x releases affects: 7.x Issue impacts 7.x releases labels Jul 26, 2024
@alexandrevryghem alexandrevryghem self-assigned this Jul 26, 2024
@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 1 APPROVAL pull request only requires a single approval to merge labels Jul 26, 2024
@tdonohue tdonohue added this to the 9.0 milestone Jul 26, 2024
@tdonohue tdonohue self-requested a review July 26, 2024 15:20
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 @alexandrevryghem ! Finally got around to testing/reviewing this today. It all looks good and works well.

@tdonohue tdonohue merged commit b9c712c into DSpace:main Oct 8, 2024
13 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

@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-3221-to-dspace-8_x origin/dspace-8_x
cd .worktree/backport-3221-to-dspace-8_x
git switch --create backport-3221-to-dspace-8_x
git cherry-pick -x d31e17894ce3f8f6be82f426de879816d76acd97

@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 Oct 8, 2024
@alexandrevryghem alexandrevryghem deleted the w2p-116728_removed-unnecessary-ngvars_contribute-main branch October 9, 2024 14:28
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 affects: 7.x Issue impacts 7.x releases affects: 8.x Issue impacts 8.x releases bug claimed: Atmire Atmire team is working on this issue & will contribute back component: Item (Archived) Item display or editing
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

ngVars cause duplicate thumbnail bitstream requests
3 participants