Skip to content

feat(forms): use custom error icon in Feedback Label - #345

Open
mairasalazar wants to merge 1 commit into
masterfrom
override-feedback-label-popup
Open

mairasalazar wants to merge 1 commit into
masterfrom
override-feedback-label-popup

Conversation

@mairasalazar

Copy link
Copy Markdown

Closes zenodo/zenodo-rdm#1435

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@mairasalazar
mairasalazar marked this pull request as ready for review August 28, 2026 09:22
@mairasalazar mairasalazar changed the title feat(components): allow override Feedback Label Popup feat(components): allow custom icons on Feedback Label Popup Sep 8, 2026
};

renderErrors = ({ form: { errors, initialErrors } }) => {
const { fieldPath, pointing } = this.props;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make icon a prop

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a new version in all three PRs linked to the issue, passing the icon str directly in the error and using it here, if it exists.

I preferred it over the props because this change already involves 2 modules and with the prop we'd have to touch at least 2 additional ones, and pass the new prop everywhere FeedbackLabel is used if we want other fields to be able to display other icons.

But I'm open to changing it if you disagree :)

return null;
}
const isError = !hasSeverity || error.severity === "error";
const icon = isError ? "times circle" : "info circle";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to errorIcon

Comment thread src/lib/forms/FeedbackLabel.js Outdated
popupId={`invenio-form-feedback-error-${fieldPath}`}
ariaLabel="Form field feedback error"
trigger={<Icon name={icon} />}
trigger={<Icon name={ORIGIN_ICONS[error.origin] || icon} />}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then icon || errorIcon

@mairasalazar
mairasalazar force-pushed the override-feedback-label-popup branch from 0754c8b to a1d4f33 Compare September 18, 2026 08:20
Use icon passed in the error, if any. Otherwise, display
error/warning icons.
@mairasalazar
mairasalazar force-pushed the override-feedback-label-popup branch from a1d4f33 to 9e9558c Compare September 18, 2026 09:10
@mairasalazar mairasalazar changed the title feat(components): allow custom icons on Feedback Label Popup feat(forms): use custom error icon in Feedback Label Sep 18, 2026
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.

Display AI workflow icon in validation messages in the deposit form

2 participants