dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Item page cc license field

Open autavares-dev opened this issue 9 months ago • 0 comments

References

Fixes #3002

Description

Component to show an item's Creative Commons license image on the simple item page.

Displays the image and name (optional) of the CC license, with a link to the license deed on the Creative Commons website.

There are two variants: 'small' variant for the sidebar of the item page and 'full' variant for the main content area.

Example with both variants of the component:

image

Instructions for Reviewers

On the back-end, in the dpsace.cfg file, the cc.license.uri and cc.license.name properties will define in which metadata field the CC license information is stored. By default, they are set to dc.rights.uri and dc.rights respectively.

In this component, the same default fields are used, but can be configured using the ccLicenseUriField and ccLicenseNameField component inputs if needed.

When both metadata values are available on an item, the CC license component is rendered, extracting the license code (e.g.: by, by-sa, zero) from the dc.rights.uri metadata value to select the CC license image stored in src/assets/images/cc-licenses.

List of changes in this PR:

  • Added folder with CC license images, src/assets/images/cc-licenses
  • Added component ds-item-page-cc-license-field
  • Added two keys to the i18n/en.json5 file:
    • item.page.cc.license.title: title for the component field in the simple item page
    • item.page.cc.license.disclaimer: disclaimer text shown in the 'full' variant (optional)
  • Refactored the simple item page template, adding the 'full' variant of this component

Checklist

  • [x] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests)
  • [x] My PR passes ESLint validation using yarn lint
  • [x] My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • [x] My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • [x] My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • [x] My PR doesn't includes new libraries/dependencies (in package.json)
  • [x] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • [x] If my PR fixes an issue ticket, I've linked them together.

autavares-dev avatar May 04 '24 16:05 autavares-dev