Skip to content

[Port dspace-7_x] Show restricted thumbnails to users with access rights#4250

Merged
tdonohue merged 6 commits intoDSpace:dspace-7_xfrom
atmire:fix-embargoed-thumbnails_contribute-7.6
May 8, 2025
Merged

[Port dspace-7_x] Show restricted thumbnails to users with access rights#4250
tdonohue merged 6 commits intoDSpace:dspace-7_xfrom
atmire:fix-embargoed-thumbnails_contribute-7.6

Conversation

@artlowel
Copy link
Member

References

Description

There was already a call to get a shortlivedtoken in the thumbnail component. The issue was that in prod mode, angular didn't detect that the image src had changed afterwards so it didn't rerender the image.

The solution was to use a BehaviorSubject for the src and the isLoading boolean

Instructions for Reviewers

  • Create a bitstream in the ORIGINAL bundle of an item
  • Configure an embargo for that bitstream, with a date in the future
  • Run filter-media -f -i ${the item's handle} on the item containing the bitstream
  • Go to the item page as an admin, and verify that you can see that bitstream's thumbnail
  • Go to the item page as an anonymous user, and verify that you see a placeholder instead

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.

@artlowel artlowel added bug authorization related to authorization, permissions or groups testathon Reported by a tester during Community Testathon labels Apr 25, 2025
@artlowel artlowel self-assigned this Apr 25, 2025
@artlowel artlowel changed the title Fix embargoed thumbnails contribute 7.6 [Port dspace-7_x] Show restricted thumbnails to users with access rights Apr 25, 2025
@artlowel artlowel moved this to 🙋 Needs Reviewers Assigned in DSpace Maintenance (9.x, 8.x, 7.6.x) Apr 25, 2025
@artlowel artlowel force-pushed the fix-embargoed-thumbnails_contribute-7.6 branch from 0554caf to cfc7df5 Compare May 8, 2025 09:05
…iewer, and switch to themed version of thumbnail component
@artlowel artlowel force-pushed the fix-embargoed-thumbnails_contribute-7.6 branch from cfc7df5 to 283b345 Compare May 8, 2025 09:26
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 @artlowel ! Verified this is the same code as #4251. Tested via #4251

@github-project-automation github-project-automation bot moved this from 🙋 Needs Reviewers Assigned to 👍 Reviewer Approved in DSpace Maintenance (9.x, 8.x, 7.6.x) May 8, 2025
@tdonohue tdonohue merged commit fbbf16f into DSpace:dspace-7_x May 8, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from 👍 Reviewer Approved to ✅ Done in DSpace Maintenance (9.x, 8.x, 7.6.x) May 8, 2025
@tdonohue tdonohue added this to the 7.6.4 milestone May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

authorization related to authorization, permissions or groups bug testathon Reported by a tester during Community Testathon

Projects

Development

Successfully merging this pull request may close these issues.

3 participants