-
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
[LEMS-2868] Answerless ServerItemRendererWithDebugUI #2289
base: main
Are you sure you want to change the base?
Conversation
…ionally render answerless data
Size Change: 0 B Total Size: 875 kB ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (0f0848b) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2289 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2289 |
…ererWithDebugUI to optionally use answerless data for rendering
} from "@khanacademy/perseus-core"; | ||
|
||
const createItemJson = ( | ||
widgetOptions: PerseusExpressionWidgetOptions, | ||
version: Version, |
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.
It seems like changing version to widgetVersion, adding extra keys, and modifying item 3 below is all that was done here. Did you add an item without answers somewhere? I think the big red and green chunks were just moved code, but I might have missed something.
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.
This looks reasonable. One bit of feedback is that I'd suggest you revert the code moves unless there's a good reason as it'll make the PR clearer what's actually being changed.
@@ -122,6 +125,16 @@ export const ExpressionItem3 = (args: StoryArgs): React.ReactElement => { | |||
); | |||
}; | |||
|
|||
export const AnswerlessExpression = (args: StoryArgs): React.ReactElement => { |
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.
Where is this used? I don't see it referenced in this PR at all.
} from "@khanacademy/perseus-core"; | ||
|
||
const createItemJson = ( | ||
widgetOptions: PerseusExpressionWidgetOptions, | ||
version: Version, | ||
widgetVersion: Version = expressionLogic.version as Version, |
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.
Can we use satisfies
instead of as
here? Also, why do we need the cast at all? :)
Summary:
I wanted to be able to render/use widgets in Storybook, but have them rendered using answerless data rather than the full data.
Issue: LEMS-2868