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

topic card count fixes for #7965 #8249

Merged
merged 2 commits into from
Aug 4, 2020
Merged

Conversation

jywarren
Copy link
Member

@jywarren jywarren commented Aug 4, 2020

Fixes #7965, supercedes #8048

@gitpod-io
Copy link

gitpod-io bot commented Aug 4, 2020

@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

Merging #8249 into main will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8249      +/-   ##
==========================================
- Coverage   81.69%   81.68%   -0.02%     
==========================================
  Files         100      100              
  Lines        5846     5842       -4     
==========================================
- Hits         4776     4772       -4     
  Misses       1070     1070              
Impacted Files Coverage Δ
app/models/tag.rb 97.47% <ø> (-0.03%) ⬇️
app/models/node_tag.rb 100.00% <100.00%> (ø)

@@ -8,13 +8,11 @@ class NodeTag < ApplicationRecord
has_many :tag_selections, foreign_key: 'tid'
accepts_nested_attributes_for :tag

after_create :increment_count
after_create :update_count
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding better updaters for tag counting

@jywarren jywarren mentioned this pull request Aug 4, 2020
@jywarren
Copy link
Member Author

jywarren commented Aug 4, 2020

Also testing this out at http://unstable.publiclab.org/tags, where I just pushed it!

@jywarren jywarren merged commit 5c35b05 into publiclab:main Aug 4, 2020
jywarren added a commit to jywarren/plots2 that referenced this pull request Aug 4, 2020
@@ -32,7 +32,7 @@
</div>
<div class="card-footer" style="background-color: inherit; border:none;">
<a style="padding-top:15px;text-decoration:underline;color:#808080;display:inline-block;" href="/tag/<%= tag.name %>"><%= Tag.counter(tag.name)-shown_nids.count - Tag.find_nodes_by_type(tag.name, type = 'note', limit = 3).where.not(nid: shown_nids).count %> <%= translation('tag.index.more_posts') %> &raquo;</a>
<a style="padding-top:15px;text-decoration:underline;color:#808080;display:inline-block;" href="/tag/<%= tag.name %>"><%= Tag.count %> <%= translation('tag.index.posts') %> &raquo;</a>
Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, it should've been tag.count not Tag.count -- fixing in follow-up!!!

@jywarren
Copy link
Member Author

jywarren commented Aug 4, 2020

MISTAKE! See last comment, follow-up in af6083a

@jywarren
Copy link
Member Author

jywarren commented Aug 4, 2020

Let's confirm in https://stable.publiclab.org/tags -- 😅

cypherean pushed a commit to cypherean/plots2 that referenced this pull request Aug 5, 2020
dms-yondy pushed a commit to dms-yondy/plots2 that referenced this pull request Aug 7, 2020
jywarren added a commit that referenced this pull request Aug 12, 2020
* paginate tag page listings (#8243)

* Update _graph.html.erb

* Update show.html.erb

* topic card count fixes for #7965 (#8249)

* fixes for #7965

* count fixes

* Update _topicCard.html.erb

* Delete _related_tags.html.erb (#8247)

* Fixes to tag counting logic (#8245)

* Update tag_test.rb

* Update tag_test.rb

* Update tag_test.rb

* Update tag.rb

* Spam2: Moderator's Queue  feature (#8196)

* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue

* Don't let newcomers edit wiki pages (controller-level) (#8250)

* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Bump rubocop from 0.88.0 to 0.89.0

Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.88.0 to 0.89.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v0.88.0...v0.89.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump codecov from 0.2.3 to 0.2.5

Bumps [codecov](https://github.com/codecov/codecov-ruby) from 0.2.3 to 0.2.5.
- [Release notes](https://github.com/codecov/codecov-ruby/releases)
- [Changelog](https://github.com/codecov/codecov-ruby/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-ruby@v0.2.3...v0.2.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump rdiscount from 2.2.0.1 to 2.2.0.2

Bumps [rdiscount](https://github.com/davidfstr/rdiscount) from 2.2.0.1 to 2.2.0.2.
- [Release notes](https://github.com/davidfstr/rdiscount/releases)
- [Changelog](https://github.com/davidfstr/rdiscount/blob/master/CHANGELOG.md)
- [Commits](davidfstr/rdiscount@2.2.0.1...2.2.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Adding tags to Modals of Nodes (#8238)

* adding tags in modals of Nodes #8230

* refactored #8230

* fixed tag path in the modal #8230
also fixed extra spacing when no tags on the modal

* update _flags.html.erb (#8237)

Changed "btn btn-xs" to "btn btn-sm"

* adjust opengraph tag

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
Co-authored-by: Keshav Sethi <36025262+keshavsethi@users.noreply.github.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: renugasaraswathy <renugasaraswathy@gmail.com>
Co-authored-by: siddhama <54734665+siddhama@users.noreply.github.com>
nadimakhtar97 pushed a commit to nadimakhtar97/plots2 that referenced this pull request Sep 21, 2020
shubhangikori pushed a commit to shubhangikori/plots2 that referenced this pull request Oct 12, 2020
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this pull request Oct 14, 2020
piyushswain pushed a commit to piyushswain/plots2 that referenced this pull request Oct 22, 2020
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
ampwang pushed a commit to ampwang/plots2 that referenced this pull request Oct 26, 2021
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
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.

Remove "-" before count of posts on Topic Cards when sorting by "# of People"
1 participant