-
Notifications
You must be signed in to change notification settings - Fork 352
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
Numeric Input: Treat unrecognized simplify
values as "required"
#2308
base: main
Are you sure you want to change the base?
Conversation
… simplify = accepted
…zed `simplify` values as "required"
default: | ||
return "required"; | ||
} | ||
} |
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 still need to add tests for this.
Size Change: +235 B (+0.03%) Total Size: 735 kB
ℹ️ View Unchanged
|
pipeParsers(boolean).then( | ||
convert((value) => { | ||
if (typeof value === "boolean") { | ||
return value ? "required" : "optional"; |
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.
@SonicScrewdriver I changed the behavior here to match what the code was doing in production before this parser existed. It seems like the scoring logic treats both true
and false
as "required"
, so I removed the conditional that converts false
into "optional"
. Please let me know if I'm missing something here!
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (4c784d8) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2308 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2308 |
Context: I'm seeing errors in Sentry because the perseus JSON parser doesn't
understand some of the values of
simplify
that exist in production data. ThisPR ensures we accept and handle those values.
Summary:
the values of
simplify
that are in production.simplify
valuesto equivalent ones.
Issue: none
Test plan:
yarn test