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 UI to clone lessons to another script #40599
Conversation
LGTM - agreed we can wait for feedback on the autocomplete. Thank you for all of your hard work on this! |
return fetch(`/lessons/${this.props.lessonId}/clone`, { | ||
method: 'POST', | ||
body: JSON.stringify({ | ||
destinationScriptName: this.state.destinationScript |
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.
I have renaming on the brain and it reminded me that we are trying to move from Script to Unit. Should we try to use Unit here?
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.
Sounds good! Is the script to unit change a known move? Wondering if/how I should update the text on this dialog -- maybe something like "Which script/unit do you want to clone this lesson to?"
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's part of our Q2 plan - https://codedotorg.atlassian.net/browse/PLAT-791. I don't know how deep of a dive we were planning to try to do to move away from script
I pulled this locally to test how it worked to move things from aiml-2021 to csd7-2021. I ran into an issue when a unit has no lesson groups. This line in
Ends up not finding a lesson group if the script hasn't had one added to it. It might be worth adding something to create a lesson group that is not user-facing if one does not exist? Or giving a warning that lets the user know they should go make one. The error I got was |
Also looks like you can't go to a unit and save a lesson group with nothing in it. https://codedotorg.atlassian.net/browse/PLAT-1065 Worked great once I added a lesson so it forced it to have a lesson group |
Love how simple the UI for this ending up being! |
oh good call. I noticed this when adding unit tests but that was before the empty script discussion. Should be easy to add a level group if one doesn't exist. If it's not, I'll do it in a follow-up PR |
I managed to break seeding on my local environment trying to test adding a lesson group, so I'm just going to throw an error and then have a better fix in a follow-up |
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.
Nice improvements! Excited to see this go live!
Finishes PLAT-963. Adds a button to the lesson tokens to clone the level to another script.
Successful clone:
Screen.Recording.2021-05-14.at.11.24.00.AM.mov
Clone with errors:
Screen.Recording.2021-05-14.at.11.19.18.AM.mov
We had talked about adding script name autocomplete. I didn't add that right now as they would've complicated this already sizeable PR, it's usable as is, and there is a decent error message if the user misspells the script name. Definitely possible as a future improvement if people think it's worth it.
Testing story
lot of manual testing, unit tests
Security
Caching
PR Checklist: