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
Fill in has_lesson_plan value based on lockable and save updates to has_lesson_plan in editor #38502
Conversation
…or has lesosn plan
4662c5a
to
f51a840
Compare
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.
Great work, Dani! The new UI test is a great addition. This seems like just the time when we would need a UI test case, because the editor is doing something substantially different in this case.
@@ -1025,7 +1025,8 @@ def wait_for_jquery | |||
data = JSON.parse(response) | |||
@temp_script_name = data['script_name'] | |||
@temp_lesson_id = data['lesson_id'] | |||
puts "created temp migrated script named '#{@temp_script_name}' and temp lesson with id #{@temp_lesson_id}" | |||
@temp_lesson_without_lesson_plan_id = data['lesson_without_lesson_plan_id'] | |||
puts "created temp migrated script named '#{@temp_script_name}', temp lesson with id #{@temp_lesson_id}, and temp lesson without a lesson plan with id #{@temp_lesson_without_lesson_plan_id}" |
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.
remove debug statement?
@@ -3,6 +3,27 @@ | |||
@no_mobile | |||
|
|||
Feature: Using the Lesson Edit Page | |||
Scenario: Save changes using the lesson edit page for lesson without lesson plan | |||
Given I create a levelbuilder named "Levi" | |||
And I create a temp migrated script and lesson |
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 updates to UI tests! nit: change to "script and lessons" or "script with lessons"?
And I wait until element "#show-container" is visible | ||
And element "h2" contains text "Agenda" | ||
|
||
And I delete the temp script and lesson |
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.
nit: "script and lessons" or "script with lessons"?
Background
Follow up to #38490, and #38614 which :
Current PR
This is a big PR but a lot of that is the script (commit f51a840) and script_json files (commit b80a68f) (updated both in ce47f55 to account for script has_lesson_plan setting) . So hopefully that makes it less scary to review. I have tried to think about how to split it up but I don't think there is a way to not ship all of this as one.
I reviewed all the script and script_json files to make sure there were not any unwanted changes.
Setting has_lesson_plan
Set
has_lesson_plan
in the script and script_json files based on the lockable value and the script has_lesson_plan setting (if the script has_lesson_plan is false than all all lesson has_lesson_plan settings should be false otherwise if lockable true then has_lesson_plan is false and if lockable false has_lesson_plan true. Except in the case of the last lesson in CSP 21-22 scripts which we set has_lesson_plan to true.) We are holding off on updating the CSP 20-21 lessons which have lesson plans because we need to transition those over which will take some extra steps.I generated these by updating my local database using:
Then I updated the script files using:
And the script_json by:
Serializing has_lesson_plan
Adds has_lesson_plan to .script and .script_json files when script or lesson is saved by adding to the DSL and the LessonSerializer.
Saving has_lesson_plan in migrated scripts
#38614 set up the activities editor to respond to hasLessonPlan. This PR updates the reset of the LessonEditor to respond to hasLessonPlan and also adds some indicators on the LessonToken in ScriptEditor to tell if a lesson is lockable or has no lesson plan.
ScriptEditor:
LessonEditor for Lesson Without Lesson Plan:
Links
Testing story
Added and updated tests for react components for the editor experience.
Updated and added tests around the script DSL changes.
Added a basic UI test for editing a lesson without a lesson plan
I manually tested:
has_lesson_plan
on an existing lesson in script DSLhas_lesson_plan
set in DSL. If the levelbuilder does not specify has_lesson_plan will be true.Reviewer Checklist: