Skip to content

CLARIN-DSpace v9/Keep the license label icon when it is edited without a new file - #1730

Merged
milanmajchrak merged 1 commit into
dtq-dev-9-basefrom
9-base/fix-license-label-keep-icon
Nov 12, 2026
Merged

milanmajchrak merged 1 commit into
dtq-dev-9-basefrom
9-base/fix-license-label-keep-icon

Conversation

@milanmajchrak

Copy link
Copy Markdown
Collaborator

References

Description

Editing a license label without choosing a new icon file removed the label's icon. The form now sends the current icon back, so the icon stays.

Instructions for Reviewers

List of changes in this PR:

  • editLicenseLabel sends selectedLabel.icon when no new file is chosen and "Remove current icon" is not checked. Before, it sent undefined. The backend PUT sets the icon to whatever the request sends, so it stored null.
  • The spec now expects the existing icon in the PUT payload. It fails on the old code.

The REST API returns the icon as a base64 string. On PUT, Jackson decodes the same string back to the same bytes, so sending it back does not change the icon.

How to test:

  1. As an admin, open /licenses/manage-table and pick a license label that has an icon.
  2. Edit it, change only the title, and save.
  3. The icon is still there. Before this fix it was gone.

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.

🤖 Generated with Claude Code

The backend PUT replaces the icon with whatever the request sends,
so leaving the icon out removed it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milanmajchrak
milanmajchrak merged commit 32ac445 into dtq-dev-9-base Nov 12, 2026
4 checks passed
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.

1 participant