Skip to content
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

Merged
merged 9 commits into from
May 21, 2024
Merged

Conversation

molly-moen
Copy link
Contributor

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:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@molly-moen molly-moen requested a review from a team as a code owner May 21, 2024 20:05
@@ -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?
Copy link
Member

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?

Copy link
Member

@breville breville left a 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!

Copy link
Contributor

@sanchitmalhotra126 sanchitmalhotra126 left a 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') {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, will update

@molly-moen molly-moen merged commit 13864ff into staging May 21, 2024
2 checks passed
@molly-moen molly-moen deleted the molly/python-lab-share branch May 21, 2024 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants