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

CB to LB: Add UI display of Lesson Group Description and Big Questions #36298

Merged
merged 26 commits into from
Sep 1, 2020

Conversation

dmcavoy
Copy link
Contributor

@dmcavoy dmcavoy commented Aug 15, 2020

This is part of the work to move Chapter over from CB to LB. This is a follow up to #36299 which set up the new dsl syntax for adding big questions and descriptions to lesson groups.

This adds an info icon next to the lesson group name on the script overview page if a Lesson Group has a description or big questions. This icon also shows up in the MiniView.
Screen Shot 2020-08-16 at 7 54 55 PM

Clicking on the info icon pops open a dialog with the description and/or big questions.
Screen Shot 2020-08-16 at 8 01 09 PM

Links

Testing story

  • Added tests for new components
  • Updated tests for existing components
  • Manually tested pulling in example information for csd3-2020

Reviewer Checklist:

  • Tests provide adequate coverage
  • 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

@dmcavoy dmcavoy requested a review from a team as a code owner August 15, 2020 03:47
@dmcavoy dmcavoy changed the title Question description display CB to LB: Add UI display of Lesson Group Description and Big Questions Aug 16, 2020
@@ -660,6 +664,19 @@ export const groupedLessons = (state, includeBonusLevels = false) => {

const allLevels = levelsByLesson(state);

state.lessonGroups.forEach(lessonGroup => {
byGroup[lessonGroup.display_name] = {
Copy link
Member

Choose a reason for hiding this comment

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

in case two lesson groups had the same display name, I think it would make more sense to group by key rather than display name, assuming that information is available here.

Comment on lines +5 to +7
import DetailProgressTable from '@cdo/apps/templates/progress/DetailProgressTable';
import SummaryProgressTable from '@cdo/apps/templates/progress/SummaryProgressTable';
import FontAwesome from '@cdo/apps/templates/FontAwesome';
Copy link
Member

Choose a reason for hiding this comment

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

any particular reason these have changed? Just checking if I'm missing a new best practice since I don't remember any conclusion to the debate of which method of importing things is preferred.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ummm I don't know if anyone else has a rule. I like it better when they are written this way because then if you want to use them somewhere else or move the file it doesn't cause problems.

};

describe('LessonGroup', () => {
it('renders clickable lesson group info button when there is a description or big questions', () => {
Copy link
Member

Choose a reason for hiding this comment

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

nice tests!

@dmcavoy
Copy link
Contributor Author

dmcavoy commented Sep 1, 2020

@davidsbailey any idea why I needed to do the work in d67fbc2 to get db_query_test.rb 'test_script_level_show' to pass but it was not an issue before. I can't see where my changes would impact this.

@davidsbailey
Copy link
Member

@davidsbailey any idea why I needed to do the work in d67fbc2 to get db_query_test.rb 'test_script_level_show' to pass but it was not an issue before. I can't see where my changes would impact this.

hard to say without more context. what is the name of the level that this was failing for without d67fbc2, and what operation was it failing during?

@uponthesun
Copy link

@davidsbailey any idea why I needed to do the work in d67fbc2 to get db_query_test.rb 'test_script_level_show' to pass but it was not an issue before. I can't see where my changes would impact this.

If this seems odd, it's probably worth digging into to figure out what's going on, since there's some chance some bug was introduced.

@dmcavoy
Copy link
Contributor Author

dmcavoy commented Sep 1, 2020

@uponthesun @davidsbailey Tracked it down. This change is because of my summarize lesson groups which also summarizes lessons.

@dmcavoy dmcavoy merged commit da19b44 into staging Sep 1, 2020
@dmcavoy dmcavoy deleted the question-description-display branch September 1, 2020 20:31
Comment on lines +77 to +81
levels_and_texts&.reject {|l| l.is_a?(External)}
end

def texts
levels_and_texts.select {|l| l.is_a?(External)}
levels_and_texts&.select {|l| l.is_a?(External)}
Copy link
Member

Choose a reason for hiding this comment

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

merging this makes me a little uncomfortable -- we have caught a number of issues where levels_and_texts is nil because it exposes that there is someplace we haven't updated our system to use the new level group format. @dmcavoy can you describe in more detail what was failing, maybe by pointing to a stack trace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created PR to fix: #36559

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