Fix individually approved/rejected statuses/links showing as pending review (#17787)

This commit is contained in:
Eugen Rochko 2022-03-15 07:51:55 +01:00 committed by GitHub
parent 40a4dad4c8
commit a794117679
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

View file

@ -80,6 +80,10 @@ class PreviewCard < ApplicationRecord
end end
end end
def requires_review?
attributes['trendable'].nil? && (provider.nil? || provider.requires_review?)
end
def requires_review_notification? def requires_review_notification?
attributes['trendable'].nil? && (provider.nil? || provider.requires_review_notification?) attributes['trendable'].nil? && (provider.nil? || provider.requires_review_notification?)
end end

View file

@ -294,6 +294,10 @@ class Status < ApplicationRecord
end end
end end
def requires_review?
attributes['trendable'].nil? && account.requires_review?
end
def requires_review_notification? def requires_review_notification?
attributes['trendable'].nil? && account.requires_review_notification? attributes['trendable'].nil? && account.requires_review_notification?
end end

View file

@ -1,4 +1,4 @@
.batch-table__row{ class: [preview_card.provider&.requires_review? && 'batch-table__row--attention', !preview_card.provider&.requires_review? && !preview_card.trendable? && 'batch-table__row--muted'] } .batch-table__row{ class: [preview_card.requires_review? && 'batch-table__row--attention', !preview_card.requires_review? && !preview_card.trendable? && 'batch-table__row--muted'] }
%label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox %label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
= f.check_box :preview_card_ids, { multiple: true, include_hidden: false }, preview_card.id = f.check_box :preview_card_ids, { multiple: true, include_hidden: false }, preview_card.id
@ -25,6 +25,6 @@
- if preview_card.decaying? - if preview_card.decaying?
= t('admin.trends.tags.peaked_on_and_decaying', date: l(preview_card.max_score_at.to_date, format: :short)) = t('admin.trends.tags.peaked_on_and_decaying', date: l(preview_card.max_score_at.to_date, format: :short))
- elsif preview_card.provider&.requires_review? - elsif preview_card.requires_review?
= t('admin.trends.pending_review') = t('admin.trends.pending_review')

View file

@ -1,4 +1,4 @@
.batch-table__row{ class: [status.account.requires_review? && 'batch-table__row--attention', !status.account.requires_review? && !status.trendable? && 'batch-table__row--muted'] } .batch-table__row{ class: [status.requires_review? && 'batch-table__row--attention', !status.requires_review? && !status.trendable? && 'batch-table__row--muted'] }
%label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox %label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
= f.check_box :status_ids, { multiple: true, include_hidden: false }, status.id = f.check_box :status_ids, { multiple: true, include_hidden: false }, status.id
@ -28,6 +28,6 @@
- if status.trendable? && (rank = Trends.statuses.rank(status.id)) - if status.trendable? && (rank = Trends.statuses.rank(status.id))
%abbr{ title: t('admin.trends.tags.current_score', score: Trends.statuses.score(status.id)) }= t('admin.trends.tags.trending_rank', rank: rank + 1) %abbr{ title: t('admin.trends.tags.current_score', score: Trends.statuses.score(status.id)) }= t('admin.trends.tags.trending_rank', rank: rank + 1)
- elsif status.account.requires_review? - elsif status.requires_review?
= t('admin.trends.pending_review') = t('admin.trends.pending_review')