-
Notifications
You must be signed in to change notification settings - Fork 480
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
Add share and remix option to Python Lab #58820
Conversation
@@ -6,6 +6,6 @@ | |||
= render partial: 'levels/editors/fields/checkboxes', locals: {f: f, field_name: :disable_sharing, description: "Disable sharing"} | |||
%p If set, this level cannot be shared or saved to galleries even if it's free play. | |||
|
|||
= render partial: 'levels/editors/fields/checkboxes', locals: {f: f, field_name: :hide_share_and_remix, description: "Hide Share and Remix buttons in header"} if (@level.uses_droplet?) || @level.is_a?(Blockly) || @level.is_a?(Weblab) ||@level.is_a?(Javalab) | |||
= render partial: 'levels/editors/fields/checkboxes', locals: {f: f, field_name: :hide_share_and_remix, description: "Hide Share and Remix buttons in header"} if (@level.uses_droplet?) || @level.is_a?(Blockly) || @level.is_a?(Weblab) ||@level.is_a?(Javalab) ||@level.uses_lab2? |
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.
ultra nit: space after the ||
in a couple places?
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 really didn't take much code, which is great!
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!
@@ -51,7 +51,7 @@ const Lab2ShareDialogWrapper: React.FunctionComponent< | |||
return null; | |||
} | |||
|
|||
if (appType === 'music') { | |||
if (appType === 'music' || appType === 'pythonlab') { |
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.
minor/later: would it be worth storing a list of lab2 labs that support the new share dialog in lab2's constants.ts
instead of needing to update this condition whenever we enable this for a new lab?
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.
good call, will update
Add the option to add share and remix buttons to Python Lab. Thanks to lab2 this was a pretty straightforward change of plugging in some puzzle pieces.
Now level 2 in Python Lab all the things has share and remix buttons, and you can create a new project with
/projects/pythonlab/new
.I used the Music Lab share modal for this, it's easy to swap if we want to use the old one.
Links
Testing story
Tested locally. You can share and remix from the level, and create new projects and share/remix them.
Follow-up work
I found a bug where if you remix from a level and then open the projects page, your new project doesn't have a type. This is due to a quirk of how we populate that page. I filed a bug here
PR Checklist: