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

Rename lesson summarize methods #37121

Merged
merged 12 commits into from
Oct 10, 2020
Merged

Rename lesson summarize methods #37121

merged 12 commits into from
Oct 10, 2020

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented Oct 7, 2020

Follow-up from #36935 (comment)

  • renames existing summarize methods in Script, LessonGroup, Lesson
  • removes editableData wrapper from lesson edit response (see discussion linked above)
  • extracts new summarize methods for LessonActivity and ActivitySection

Testing story

I confirmed that existing test coverage is hitting these summarize codepaths. I also manually verified that the lesson edit page still works for editing activities and activity sections.

Reviewer 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

@davidsbailey davidsbailey changed the base branch from staging to edit-activity-data October 7, 2020 22:04
Base automatically changed from edit-activity-data to staging October 8, 2020 17:06
@davidsbailey davidsbailey marked this pull request as ready for review October 8, 2020 21:09
@@ -329,6 +329,7 @@ class ActivitySectionCard extends Component {
targetActivitySectionPos,
activityPosition
} = this.props;
const activitySectionText = activitySection.text || '';
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixes a misc bug I ran across while trying to test this manually. the split fails later if the text field is null, which is what happens if you create a new activity section without entering any text/description.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think in some of the other cases that I ran into this I fixed it in the script/edit.js or lesson/edit.js file. Seeing this I'm wondering it those changes should be moved? Probably would be good to standardize. Do you have thoughts on which one to use?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call Dani! Trying to keep these sanitation steps all together makes sense. In general I'm in favor of doing it early, before putting it into redux, so that we don't have to remember to do it every time we read from redux. If you move this to the edit.js file, then one bonus is you can mark this prop as required, which will help highlight if we somehow miss a case, e.g. we might replace null with '' when loading from the server, but if the user took an action that led us into a bad state then we'd get a handy js warning.

I'll go ahead and move this to edit.js.

Copy link
Contributor

@dmcavoy dmcavoy left a comment

Choose a reason for hiding this comment

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

Thanks for following up on this

@davidsbailey davidsbailey merged commit 94aeb1a into staging Oct 10, 2020
@davidsbailey davidsbailey deleted the rename-lesson-summarize branch October 10, 2020 00:12
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

2 participants