feat(forms): use custom error icon in Feedback Label - #345
Open
mairasalazar wants to merge 1 commit into
Open
mairasalazar wants to merge 1 commit into
mairasalazar wants to merge 1 commit into
Conversation
mairasalazar
marked this pull request as ready for review
August 28, 2026 09:22
| }; | ||
|
|
||
| renderErrors = ({ form: { errors, initialErrors } }) => { | ||
| const { fieldPath, pointing } = this.props; |
Contributor
There was a problem hiding this comment.
I would make icon a prop
Author
There was a problem hiding this comment.
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"; |
| popupId={`invenio-form-feedback-error-${fieldPath}`} | ||
| ariaLabel="Form field feedback error" | ||
| trigger={<Icon name={icon} />} | ||
| trigger={<Icon name={ORIGIN_ICONS[error.origin] || icon} />} |
Contributor
There was a problem hiding this comment.
then icon || errorIcon
mairasalazar
force-pushed
the
override-feedback-label-popup
branch
from
September 18, 2026 08:20
0754c8b to
a1d4f33
Compare
Use icon passed in the error, if any. Otherwise, display error/warning icons.
mairasalazar
force-pushed
the
override-feedback-label-popup
branch
from
September 18, 2026 09:10
a1d4f33 to
9e9558c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: