mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 01:41:08 +00:00
Limit count to pending&trending on admin/trends/tags page (#35120)
This commit is contained in:
parent
ebc6897afb
commit
c023ebc87a
|
@ -4,7 +4,7 @@ class Admin::Trends::TagsController < Admin::BaseController
|
||||||
def index
|
def index
|
||||||
authorize :tag, :review?
|
authorize :tag, :review?
|
||||||
|
|
||||||
@pending_tags_count = Tag.pending_review.async_count
|
@pending_tags_count = pending_tags.async_count
|
||||||
@tags = filtered_tags.page(params[:page])
|
@tags = filtered_tags.page(params[:page])
|
||||||
@form = Trends::TagBatch.new
|
@form = Trends::TagBatch.new
|
||||||
end
|
end
|
||||||
|
@ -22,6 +22,10 @@ class Admin::Trends::TagsController < Admin::BaseController
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def pending_tags
|
||||||
|
Trends::TagFilter.new(status: :pending_review).results
|
||||||
|
end
|
||||||
|
|
||||||
def filtered_tags
|
def filtered_tags
|
||||||
Trends::TagFilter.new(filter_params).results
|
Trends::TagFilter.new(filter_params).results
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,6 +7,21 @@ RSpec.describe 'Admin::Trends::Tags' do
|
||||||
|
|
||||||
before { sign_in current_user }
|
before { sign_in current_user }
|
||||||
|
|
||||||
|
describe 'Viewing tags lists' do
|
||||||
|
context 'with a tag that needs review but is not trending' do
|
||||||
|
before { Fabricate :tag, requested_review_at: 5.minutes.ago }
|
||||||
|
|
||||||
|
it 'includes a correct pending tag count in navigation' do
|
||||||
|
visit admin_trends_tags_path
|
||||||
|
|
||||||
|
within('.filter-subset') do
|
||||||
|
expect(page)
|
||||||
|
.to have_content("#{I18n.t('admin.accounts.moderation.pending')} (0)")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe 'Performing batch updates' do
|
describe 'Performing batch updates' do
|
||||||
context 'without selecting any records' do
|
context 'without selecting any records' do
|
||||||
it 'displays a notice about selection' do
|
it 'displays a notice about selection' do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user