-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT: Added field warning component to all fields #2698
Conversation
🦋 Changeset detectedLatest commit: 11fb79e The changes in this PR will be included in the next version bump. This PR includes changesets to release 94 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I had to replace all select fields' hasWarning prop to only be true if and only if the field is touched and the newly added warnings object prop has at least one warning. Please let me know if this will affect any team that might have been using the hasWarning prop as a simple truthy or falsy prop. |
packages/components/fields/async-creatable-select-field/README.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Carlos Cortizas <97907068+CarlosCortizasCT@users.noreply.github.com>
@CarlosCortizasCT Fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for your work in this PR, Chisom 🙇
Please, wait for Filip and another Shield engineer approval 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I'm leaving the comment to get a better understanding of the changes
hasWarning={this.props.hasWarning} | ||
hasWarning={hasWarning} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused about one aspect in general. Based on my understanding, the original requirements were outlined here.
I read this comment but I'm not sure if this was addressed.
Previously, the hasWarning
prop alone triggered the border display, but it's no longer considered. Is the hasWarning
prop deprecated? Shouldn't this be mentioned in the changeset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good catch, Kacper.
I think the hasWarning
prop we currently have should be deprecated, but that means keeping it so consumers have time to transition from one prop (hasWarning
) to the other (warnings
).
We probably need the hasWarning
constant calculation to be adjusted:
const hasWarning =
this.props.hasWarnings ||
(AsyncCreatableSelectInput.isTouched(this.props.touched) &&
hasWarnings(this.props.warnings));
And also update the jsdoc of that property to mention about it.
@kark what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool stuff. @CarlosCortizasCT So the jsdoc should mention that the field is already deprecated or is their a specific copy you would like to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also does this mean we keep the hasWarning boolean prop in the story?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @obulaworld
@CarlosCortizasCT So the jsdoc should mention that the field is already deprecated or is their a specific copy you would like to use?
I mean both.
For example:
/**
* Indicates the input field has a warning.
* @deprecated Please use the `warnings` prop instead so users know the reason why the field is in warning state.
*/
hasWarning?: boolean;
Also does this mean we keep the hasWarning boolean prop in the story?
We should remove it as we don't want consumers to use it anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Co-authored-by: Kacper Krzywiec <49066275+kark@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution 🎉 looks good to me
Summary
Update all Field component to handle warning texts.
It seeks to fully fix this UI-KIT issue
Description
This PR seeks to update all Field component to handle warning texts by:
FieldWarnings
component to all FieldsScreenshots