-
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
Move enum logic from Webapp to Perseus #1058
Conversation
Size Change: +863 B (0%) Total Size: 811 kB
ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1058 +/- ##
==========================================
+ Coverage 65.12% 67.25% +2.12%
==========================================
Files 432 436 +4
Lines 96215 96445 +230
Branches 6544 10110 +3566
==========================================
+ Hits 62664 64867 +2203
+ Misses 33551 31578 -1973
... and 108 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
explanation: "EXPLANATION", | ||
expression: "EXPRESSION", | ||
"graded-group-set": "GRADED_GROUP", | ||
"graded-group": "GRADED_GROUP_SET", |
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.
Are these reversed?
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.
Oh that's weird. That's copy/pasted from prod webapp which means it's live on the site. 🤔 Not that I think we care all that much about graded-group statistics (compared to more interactive widgets).
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (0a98447) and published it to npm. You Example: yarn add @khanacademy/perseus@PR1058 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR1058 |
|
||
return widgetEnum; | ||
} | ||
|
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.
Oh lovely this can replace that function in the coach report utils! :)
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.
Wonderful, thank you!
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/perseus@20.6.0 ### Minor Changes - [#1090](#1090) [`20a23a39`](20a23a3) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Added new API methods to support our Coach Report Response view. - [#1058](#1058) [`a431883d`](a431883) Thanks [@handeyeco](https://github.com/handeyeco)! - Move widget enum helpers from Webapp to Perseus ### Patch Changes - [#1095](#1095) [`11e04962`](11e0496) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Tooling: Upgrade projects to use TypeScript v5.4.2 - [#1093](#1093) [`0cd66f88`](0cd66f8) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Change APIOptions and APIOptionsWithDefaults comments to JSDoc comments for better tooling support - [#1088](#1088) [`47eade13`](47eade1) Thanks [@benchristel](https://github.com/benchristel)! - Refactor the InteractiveGraph component to avoid mounting the legacy interactive graph when Mafs is enabled. This ensures that state from the legacy graph doesn't interfere with the Mafs graph - Updated dependencies \[[`11e04962`](11e0496)]: - @khanacademy/simple-markdown@0.11.4 - @khanacademy/pure-markdown@0.3.1 ## @khanacademy/perseus-dev-ui@1.3.3 ### Patch Changes - Updated dependencies \[[`11e04962`](11e0496)]: - @khanacademy/simple-markdown@0.11.4 - @khanacademy/pure-markdown@0.3.1 ## @khanacademy/perseus-editor@5.2.1 ### Patch Changes - Updated dependencies \[[`20a23a39`](20a23a3), [`11e04962`](11e0496), [`a431883d`](a431883), [`0cd66f88`](0cd66f8), [`47eade13`](47eade1)]: - @khanacademy/perseus@20.6.0 ## @khanacademy/pure-markdown@0.3.1 ### Patch Changes - Updated dependencies \[[`11e04962`](11e0496)]: - @khanacademy/simple-markdown@0.11.4 ## @khanacademy/simple-markdown@0.11.4 ### Patch Changes - [#1095](#1095) [`11e04962`](11e0496) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Tooling: Upgrade projects to use TypeScript v5.4.2
Summary:
In this PR I added some logic in Webapp knowing I would need to move it to Perseus; now that I'm trying to add the CEDAR event to Mobile, the time has come.
I didn't get any ideas on how to implement the below and I need to move on, so I'm going to move forward with the original plan.
I'm wondering if this could be done in a cleaner way. In each widget we have an export; for example this is Radio's:
We also do something like this in
perseus-types.ts
:Then:
It feels like we're having to maintain a lot of places where there are lists of widgets; now this would add even more. Is there a way to derive this type information from the widgets themselves? For instance:
That way the widgets themselves are responsible for providing their own name and enum values? And we have one master list of widgets that is used to derive other lists?
Issue: MOB-5441