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

Part 1: Shows Relevant #help Posts in Homepage Sidebar #12670

Conversation

juliannatetreault
Copy link
Contributor

@juliannatetreault juliannatetreault commented Feb 11, 2021

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

The "Definition of Done" for this RFC is:

This feature is deployed to all Forems, and we can assert that every size Forem, regardless of Forem size, can render articles on the sidebar. We should be able to see that every Forem (even if those that have few posts or old posts) can always display posts for a tag, regardless of an article's published_at date or score.

This PR is part one of a two-part solution to ensure that posts show beneath the tags in the homepage's righthand sidebar, regardless of the Forem's size and the article's published_at date, score, and comment_count. The first part of this two-part solution focuses specifically on the #help tag in the homepage's righthand sidebar. To accomplish this, I've updated the active_help scope the Article model. This scope is responsible for determining which posts to show under the #help tag found in the homepage's righthand sidebar. In addition to this, I've added a test for this work to spec/models/article_spec.rb.

Related Tickets & Documents

Relates to RFC 20

QA Instructions, Screenshots, Recordings

  • To QA this PR, please first ensure that you have admin-status and then navigate to /admin/config and scroll to the /tags section:

Screen Shot 2021-02-12 at 3 36 49 PM

  • In order to have tags display in the sidebar and to test this PR, you need to first set some tags, like "help" (⚠️ in order to test this, you will need to set the "help" tag!):

Screen Shot 2021-02-12 at 3 39 42 PM

  • After setting the tags, navigate to the homepage and observe that there are no articles beneath the "help" tag:

Screen Shot 2021-02-12 at 3 41 20 PM

  • In order to see articles displayed beneath the "help" tag, create a post that uses the "help" tag:

Screen Shot 2021-02-12 at 3 44 14 PM

Screen Shot 2021-02-12 at 3 44 31 PM

  • After creating an article with the "help" tag, navigate back to the homepage. Observe that your article tagged with "help" displays in the sidebar:

Screen Shot 2021-02-12 at 3 46 20 PM

  • To test that the article tagged with "help" displays in the sidebar as expected if it meets the #active_help requirements, first drop into the console and update the article to match where(published_at: 12.hours.ago.., comments_count: ..5, score: -3..):
article = Article.last
article.update(comments_count: 5, published_at: 13.hours.ago, score: -3)
  • After updating the article, navigate back to the homepage. Observe that your article shows in the sidebar as expected:

Screen Shot 2021-02-12 at 3 53 06 PM

  • Try to break things! ⚒️

UI accessibility concerns?

I don't believe so!

Added tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

[Forem core team only] How will this change be communicated?

Will this PR introduce a change that impacts Forem members or creators, the
development process, or any of our internal teams? If so, please note how you
will share this change with the people who need to know about it.

  • I've updated the Admin Guide
    👀 I've added documentation to the Admin Guide. The draft can be found here. Any and all feedback welcome!
  • I've updated the README or added inline documentation
  • I will share this change in a Changelog
    or in a forem.dev post
  • I will share this change internally with the appropriate teams
  • I'm not sure how best to communicate this change and need help
  • This change does not need to be communicated, and this is why not: please
    replace this line with details on why this change doesn't need to be
    shared

[optional] Are there any post-deployment tasks we need to perform?

This will need to be deployed to all Forems.

[optional] What gif best describes this PR or how it makes you feel?

Cat Rescuing Cat Stuck in Tree

@pr-triage pr-triage bot added the PR: draft bot applied label for PR's that are a work in progress label Feb 11, 2021
@juliannatetreault juliannatetreault changed the title Part 1: Shows Relevant #help Posts in Sidebar Part 1: Shows Relevant #help Posts in Homepage Sidebar Feb 11, 2021
app/models/article.rb Outdated Show resolved Hide resolved
app/models/article.rb Outdated Show resolved Hide resolved
app/models/article.rb Outdated Show resolved Hide resolved
@juliannatetreault juliannatetreault force-pushed the juliannatetreault/sidebar-help-tag-shows-relevant-posts-20 branch from b4610c9 to 57b8007 Compare February 25, 2021 19:26
@juliannatetreault juliannatetreault marked this pull request as ready for review February 25, 2021 19:41
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: draft bot applied label for PR's that are a work in progress labels Feb 25, 2021
Copy link
Contributor

@citizen428 citizen428 left a comment

Choose a reason for hiding this comment

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

Nice!

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Feb 26, 2021
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

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

QA'ed it! Let's do this!

@juliannatetreault juliannatetreault merged commit 27f27ca into master Mar 1, 2021
@juliannatetreault juliannatetreault deleted the juliannatetreault/sidebar-help-tag-shows-relevant-posts-20 branch March 1, 2021 17:24
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Mar 1, 2021
@juliannatetreault juliannatetreault added this to DONE 🎉 in Current Cycle Work Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants