-
Notifications
You must be signed in to change notification settings - Fork 25
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(NumberField): add belowMin
and aboveMax
error keys to NumberField
#2853
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 5ebceb0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 96 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 |
14d6550
to
d629d53
Compare
d629d53
to
361f9ba
Compare
361f9ba
to
a8ec564
Compare
belowMin
and aboveMax
error keys to NumberField
belowMin
and aboveMax
error keys to NumberField
This PR is missing a Jira ticket reference in the title or description. |
🥷 Code experts: emmenko emmenko has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
a8ec564
to
d403564
Compare
d403564
to
356432f
Compare
@@ -278,7 +280,36 @@ class NumberField extends Component<TNumberFieldProps, TNumberFieldState> { | |||
id={sequentialErrorsId} | |||
errors={this.props.errors} | |||
isVisible={hasError} | |||
renderError={this.props.renderError} | |||
renderError={(key: string, error?: boolean) => { | |||
const element = this.props.renderError?.(key, error); |
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.
@ragafus Do you have a bit of time for us (remeet) to elaborate as to why this change is needed?
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.
@ragafus Do you have a bit of time for us (remeet) to elaborate as to why this change is needed?
Of course! I can explain my point of view as a "consumer" of NumberField
component.
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.
Great! I will set up a meeting for us.
Thanks again
Hey @misama-ct @ddouglasz, I've refactored the code as we agreed in the meeting. Please, let me know your thoughts. |
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 @ragafus
Looks good to me now 🙌🏾
Please note that we would also need a sign off from our designer @FilPob too. |
Thanks! Looks good from my side |
Summary
Adds two new error keys,
belowMin
andaboveMax
, to improveNumberField
DX.Description
NumberField
provides amin
andmax
props which are used as property on input field. Unfortunately, users can introduce numbers above themax
prop and below themin
props. ATM, the developer usingNumberField
has to handle all the logic regardingmin
andmax
errors.With this PR we provide default error messages for
belowMin
andaboveMax
error keys, so, the developer usingNumberField
has to just generate these new keys when validating their forms.