-
Notifications
You must be signed in to change notification settings - Fork 10
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
LabeledField: Make sure custom required message is shown #2425
LabeledField: Make sure custom required message is shown #2425
Conversation
… the required value. This was preventing custom required messages from rendering
…om required messages passed into `LabeledField` or the `field` prop are displayed
🦋 Changeset detectedLatest commit: f09dcda The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Size Change: +5 B (+0.01%) Total Size: 98.8 kB
ℹ️ View Unchanged
|
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-fnsnwmxvwb.chromatic.com/ Chromatic results:
|
@@ -250,7 +250,7 @@ export default function LabeledField(props: Props) { | |||
] | |||
.filter(Boolean) | |||
.join(" "), | |||
required: isRequired, |
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.
Since we were passing in a boolean, the default required error message was always used 😅
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (2595ef0) and published all packages with changesets to npm. You can install the packages in webapp by running: ./services/static/dev/tools/deploy_wonder_blocks.js --tag="PR2425" Packages can also be installed manually by running: yarn add @khanacademy/wonder-blocks-<package-name>@PR2425 |
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.
LGTM! nice fix 🚀
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/labeled-field #2425 +/- ##
=============================================
=============================================
Continue to review full report in Codecov by Sentry.
|
… `main` (#2429) ## Summary: This PR includes the following commits: - LabeledField (part 1): Initial set up for LabeledField component based on FieldHeading (#2322) - LabeledField(part2): refactor to a function component (#2338) - LabeledField(part3): Wire up attributes (#2339) - LabeledField(part4): styling and error icon (#2344) - LabeledField: integrate with field components and fixes (#2399) - Use LabeledField in other component stories (#2400) - Add more docs around different browser + screen reader behaviours for LabeledField (#2403) - LabeledField: Make sure custom required message is shown (#2425) - LabeledField: Add a story for custom jsx for props (#2426) - LabeledField: fix import (#2427) Issue: WB-1499 ## Test plan: - Confirm LabeledField is working as expected `?path=/docs/packages-labeledfield--docs` - Review docs for LabeledField: `?path=/docs/packages-labeledfield--docs` Author: beaesguerra Reviewers: beaesguerra, jandrade Required Reviewers: Approved By: jandrade Checks: ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ⏭️ Publish npm snapshot, ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ⏭️ Publish npm snapshot, ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ gerald, ⌛ undefined Pull Request URL: #2429
Summary:
Makes sure custom required messages passed into
LabeledField
or thefield
prop are displayedIssue: WB-1848
Test plan:
Confirm in
?path=/story/packages-labeledfield--required
that the error message shows the custom required message