4Science / dspace-angular

Angular UI for DSpace and DSpace-CRIS. In the dspace-cris-7 branch you can find the extension to support DSpace-CRIS
BSD 3-Clause "New" or "Revised" License
14 stars 28 forks source link

FileDownloadLinkComponent does not consider current value of configuration key request.item.type #48

Open saschaszott opened 1 year ago

saschaszott commented 1 year ago

DS and DS CRIS allow to disable the request-a-copy feature by setting request.item.type to an empty value (see https://github.com/4Science/DSpace/blob/0c4ee1a65dca7b0bc3382c1a6a642ac94a0a4fba/dspace/config/dspace.cfg#L1674 for details).

Currently, this configuration setting is not propagated from the backend to the frontend.

The current implementation in FileDownloadButtonComponent does not consider the status of request.item.type. The template (src/app/shared/file-download-button/file-download-button.component.html)renders a Request a copy button if the user cannot access the bitstream at hand.

image

To fix this bug a conditional check is required in https://github.com/4Science/dspace-angular/blob/99eeea926c5b6398c9b7d68c9d090a618269ce0c/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metadata/rendering-types/advanced-attachment/bitstream-attachment/attachment-render/types/file-download-button/file-download-button.component.html#L10.