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

Sort hour of code tutorials by popularity #32577

Merged
merged 4 commits into from Jan 8, 2020
Merged

Conversation

molly-moen
Copy link
Contributor

Description

Update hourofcode.com/learn, code.org/learn, and csedweek.org/learn to sort tutorials by popularity when in the "post-hoc" mode. Current mode for production is "post-hoc".
Screen Shot 2020-01-08 at 10 57 30 AM

Links

Testing story

Validated all pages sort as expected during "post-hoc" mode. During "pre-hoc" mode only code.org/learn will sort by popularity as was the behavior previously.

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

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

This logic for the sort order is starting to get a little complex! And it's duplicated between the code.org and hourofcode.com helpers. Let's extract it someplace and write tests for it.

I think this is a good candidate for a class method on the Tutorials class in database.rb. There are already some tests for that class. Maybe a signature that looks like this?

def self.sort_by_popularity?(site, hoc_mode)

Let me know if you'd like to chat about this in person.

pegasus/sites.v3/code.org/public/learn/index.haml Outdated Show resolved Hide resolved
Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

🎉 Looks great!

@molly-moen molly-moen merged commit 692930c into staging Jan 8, 2020
@molly-moen molly-moen deleted the molly/default-hoc-view branch January 8, 2020 22:00
Copy link
Member

@breville breville 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 jumping into this code!

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