Skip to content

Render the item-page thumbnail only once#5824

Open
bram-atmire wants to merge 1 commit into
DSpace:mainfrom
bram-atmire:fix/5821-duplicate-thumbnail
Open

Render the item-page thumbnail only once#5824
bram-atmire wants to merge 1 commit into
DSpace:mainfrom
bram-atmire:fix/5821-duplicate-thumbnail

Conversation

@bram-atmire

Copy link
Copy Markdown
Member

References

Fixes #5821

Description

Removes the duplicate thumbnail on the item page: the advanced attachment cards rendered their own thumbnail in addition to the item thumbnail already shown in the item-page sidebar.

Instructions for Reviewers

This affects the advanced attachment rendering used on the item page when layout.showDownloadLinkAsAttachment: true (the ds-bitstream-attachment cards). Each card rendered a thumbnail (or the "no thumbnail" placeholder) for its bitstream, which duplicated the item-level thumbnail already rendered in the left sidebar (col-md-4), spending prime above-the-fold space on a second copy.

List of changes in this PR:

  • Removed the per-attachment thumbnail block from BitstreamAttachmentComponent's template.
  • Removed the now-unused thumbnail$ subject, its ngOnInit subscription, the ThemedThumbnailComponent import, and the dead .thumbnail-wrapper style.
  • Updated the unit test setup accordingly.

The single item thumbnail rendered in the sidebar is retained; the attachment cards keep their file metadata and download button.

How to test:

  1. Set layout.showDownloadLinkAsAttachment: true in your config.*.yml.
  2. Open an item that has an attached file: only one thumbnail (the sidebar one) is shown; the attachment card no longer renders its own thumbnail/placeholder.
  3. Confirm with a multi-file item and with an item that has no thumbnail (the placeholder also appears only once).

Checklist

  • My PR is created against the main branch of code.
  • My PR is small in size.
  • My PR passes lint validation.
  • My PR passes all tests (existing Unit Tests updated).
  • My PR includes details on how to test it.
  • If my PR includes new libraries/dependencies: n/a.
  • If my PR modifies REST API endpoints: n/a.
  • If my PR includes new configurations: n/a.
  • If my PR fixes an issue ticket, I've linked them together.

The advanced attachment rendering (showDownloadLinkAsAttachment) showed a
thumbnail (or 'no thumbnail' placeholder) per attachment card, duplicating the
item thumbnail already rendered in the item-page sidebar. Remove the
per-attachment thumbnail from BitstreamAttachmentComponent so the page renders
a single thumbnail; the attachment cards keep their file metadata and download
button.

Fixes DSpace#5821
@tdonohue

tdonohue commented Jun 9, 2026

Copy link
Copy Markdown
Member

@bram-atmire : I'm not sure I agree with this PR as it removes the thumbnail entirely from the ds-bitstream-attachment.

My understanding is that this came over from DSpace-CRIS because it's a part of the Configurable Layout of Entity/Item pages coming in DSpace 11, see DSpace/DSpace#11779

I believe the thumbnail appears in this component because it does NOT always appear in the other location, based on how the layout is configured.

So, I think it'd be a better solution to make this configurable... or wait until DSpace/DSpace#11779 is fixed before we move this forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Item page should render thumbnail only once

2 participants