Skip to content

Lab Lab: Project Loading refactor#52523

Merged
molly-moen merged 9 commits into
stagingfrom
molly/refactor-standalone-level-data
Jun 29, 2023
Merged

Lab Lab: Project Loading refactor#52523
molly-moen merged 9 commits into
stagingfrom
molly/refactor-standalone-level-data

Conversation

@molly-moen

@molly-moen molly-moen commented Jun 29, 2023

Copy link
Copy Markdown
Contributor

To prep for share/remix, we needed to load some level data for standalone levels. Previously we did not load any level data for standalone levels, and just loaded projects based on the channel id passed through app options. We still want to load the project based on that channel id, but also want to get level properties for the standalone level, as the level configuration contains information about share and remix headers. There is still one case where we load a project and never care about level data, which is /projectbeats.

In this PR I updated the thunks for setting up a lab a bit. What was previously setUpForLevel is now setUpWithLevel, and takes an optional channel id. We will load level properties as before, but then create our project manager either based on the channel id if it exists, or based on the level and script if it does not.

What was previously loadProject is now setUpWithoutLevel (to make things clearer). Previously we set up the project manager outside of this method, to make the methods more unified I moved that logic into this thunk, and then loaded the project as before. I also added the logic to cleanup any existing project manager, so if we want to use this in a page that switches projects without reloading from the server we can.

I also added a couple useful level properties to lab redux, hideShareAndRemix and isProjectLevel, which will be used in the upcoming share and remix work.

Links

Testing story

Tested locally that an allthethings level, a standalone project, and /projectbeats still work.

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 review from a team, breville and sanchitmalhotra126 June 29, 2023 00:17

@sanchitmalhotra126 sanchitmalhotra126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! A few minor questions

Comment thread apps/src/labs/labRedux.ts Outdated
Comment thread apps/src/labs/labRedux.ts
Comment thread apps/src/labs/labRedux.ts Outdated
Comment thread apps/src/labs/labRedux.ts Outdated
Comment thread apps/src/labs/projects/ProjectContainer.tsx Outdated
Comment thread apps/src/labs/projects/utils.ts
@molly-moen molly-moen merged commit 039259d into staging Jun 29, 2023
@molly-moen molly-moen deleted the molly/refactor-standalone-level-data branch June 29, 2023 22:35
@breville breville mentioned this pull request Mar 17, 2025
8 tasks
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.

3 participants