Skip to content

Add a generic ItemPageLicenseFieldComponent#3338

Open
abelgomez wants to merge 24 commits intoDSpace:mainfrom
sistedes:issue-3170
Open

Add a generic ItemPageLicenseFieldComponent#3338
abelgomez wants to merge 24 commits intoDSpace:mainfrom
sistedes:issue-3170

Conversation

@abelgomez
Copy link
Contributor

@abelgomez abelgomez commented Sep 20, 2024

References

Description

This PR adds a new ItemPageLicenseFieldComponent, which allows showing generic rights information. If the component detects that the rights information points to a Creative Commons license, it delegates the rendering to the existing ItemPageCcLicenseFieldComponent.

If the item contains the same numbers of URIs than license names/descriptions, the links will be associated to the names/descriptions in the order they appear. If not, all fields will be explicitly listed (see example below).

Instructions for Reviewers

Create an item with the following properties:

License should be rendered as a license text with a link:

imagen

Create an item with the following properties:

Licenses should be rendered as list of licenses with links:

imagen

Create an item with the following properties:

Licenses should render all fields explicitly (and URIs will be rendered as links), since no matching can be established between the license names and the links:

imagen

Create an item with the following properties:

License will be rendered as in DSpace 9 using ItemPageCcLicenseFieldComponent:

imagen

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • 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 npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run 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.

@github-actions
Copy link

Hi @abelgomez,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@abelgomez abelgomez changed the base branch from dspace-8_x to main September 20, 2024 15:22
@abelgomez abelgomez marked this pull request as ready for review October 21, 2024 20:16
@abelgomez
Copy link
Contributor Author

This PR should be ready for review.

Sorry for the long list of commits: when changing from the dspace-8_x branch to main I rebased rather than merging, and GitHub shows the commits inbetween.

Since this PR delegates the rendering of CC licenses to the ItemPageCcLicenseFieldComponent, this PR is affected by DSpace/DSpace#9882 and #3165.

I opted to keep ItemPageCcLicenseFieldComponent almost as is to avoid breaking any existing installation that relies on it.

@tdonohue
Copy link
Member

@abelgomez : Could you rebase your changes directly on main? This long list of commits is problematic, as GitHub seems to think they are all part of this PR. It's likely a problem on the branch that you created this PR from. You may need to rebase that branch on latest main to solve the issue.

@abelgomez
Copy link
Contributor Author

As far as I remember, that was exactly the problem that caused the long list of commits: I rebased main onto my branch but GitHub does not detect that those commits were already on "main". I'll try to fix it, and if I fail, I'll close the PR and open a clean one.

@abelgomez
Copy link
Contributor Author

I started from scratch, and cherry-picked the interesting commits. Let me know if you want me to also combine several commits into one for a cleaner history.

@github-actions
Copy link

github-actions bot commented Feb 6, 2025

Hi @abelgomez,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue
Copy link
Member

tdonohue commented Mar 6, 2025

@abelgomez : If you wish this to be considered for 9.0, we'll need you to resolve the merge conflicts in this PR. Our merger deadline for new feature PRs is March 28. So, any new feature PR not review, approved and merged by then will not be in 9.0.

@abelgomez
Copy link
Contributor Author

Hi @tdonohue,

sure, I can resolve the conflicts. I was waiting to see what happens with other closely related open PRs (DSpace/DSpace#9882 and #3165).

I think that DSpace/DSpace#9882 (which is kind of a pre-requisite) can be easily merged as a starting point.

Regarding this PR I can handle it today, since it's a trivial fix that only affects the English language file.

Once I check why #3165 is failing for you, would it be possible to include both PRs in the same release?

@abelgomez
Copy link
Contributor Author

Hi @alexandrevryghem ,

I have incorporated the changes you proposed.

This PR should be ready for review and merge. Keep in mind that, since I refactored the code to parse/validate CC URIs to a separate utility file as you suggested, this PR has conflicts with #3165.

Thus, if the plan is to include both, I'll need a small margin to reconcile both PRs when the first one is merged (whichever it will be).

@alexandrevryghem
Copy link
Member

@abelgomez: I think it will be easier to merge #3165 first since it's smaller. Now that I have properly compared both PRs it does look like the ItemPageLicenseFieldComponent from this PR is simply a combination of the ItemPageCcLicenseFieldComponent from #3165 & a custom implementation of ItemPageUriFieldComponent. So I'm not sure if there are additional benefits of merging both PRs, since institutions that use the CC licences will probably use the ItemPageCcLicenseFieldComponent component on their item page, and if they don't use CC licences they can use the ItemPageUriFieldComponent if they want to display links

@abelgomez
Copy link
Contributor Author

abelgomez commented Mar 28, 2025

Ho @alexandrevryghem ,

as you wish. The point of this PR is to directly show the rights information in the simple page without requiring to modify the templates.

For me, seems weird that, by default, DSpaces show a badge and the license information if dc.rights and dc.rights.uri is set to a CC license, but does not show anything if a digital library simply sets a "All rights reserved to the corresponding authors" (or whatever) in the dc.rights field. I don't see the point of treating CC licenses as a special case. Why other types of licenses are not relevant enough to be shown?

Of course, institutions can customize what is shown or hidden by customizing templates, but this PR aims at showing relevant information for those who don't want to customize the templates.

Based on my experience, making big customizations to the Angular code makes upgrades difficult and time-consuming, since every major version typically includes several breaking changes, and institutions need to reconcile their templates with the "base" code. Thus, I think that some institutions would like to avoid as many customizations as possible.

Cheers!

@github-actions
Copy link

Hi @abelgomez,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@github-actions
Copy link

github-actions bot commented Apr 1, 2025

Hi @abelgomez,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@github-actions
Copy link

Hi @abelgomez,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@pilasou
Copy link
Contributor

pilasou commented Oct 2, 2025

Hi @abelgomez, the new feature you developped will be of interest for us as it also corrrects a problems when using entities in DSpace (the CC icon and text not displayed on Publication type Item).

@abelgomez
Copy link
Contributor Author

Hi @pilasou ,

Thanks for letting me know. This PR is not "abandoned", I plan to resolve the current conflicts and keep this PR in sync with the master branch and let the DSpace team decide whether it should be merged or not.

I simply haven't had the time to do it yet.

Cheers,

Abel

@pilasou
Copy link
Contributor

pilasou commented Oct 2, 2025

Thanks @abelgomez, no worries, i am not a developper so I cannot make code review, but once you resolve conflit, I will certainly test it!

@tdonohue
Copy link
Member

@abelgomez : We are just beginning a more detailed review process for 10.0 for all new feature PRs. If you can rebase this on latest main (to resolve the merge conflicts) that would allow us to consider this for 10.0. Thanks!

@abelgomez
Copy link
Contributor Author

@tdonohue , done!

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

Projects

Status: 👀 Under Review

Development

Successfully merging this pull request may close these issues.

ItemPageCcLicenseFieldComponent wrongly assumes that any license in dc.rights is a CC license View CC license in DSpace 8.0 Publication EntityType

4 participants