mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 18:05:43 +08:00
FIX: Use a better default for the low_priority_threshold setting. (#13161)
Using 1 as the default value is confusing for some people as low-score flags are hidden unless staff uses the "(any)" priority filter. Let's change it to 0 and let every site adjust the setting to match their needs.
This commit is contained in:
parent
ea61bcaf13
commit
91ee3fb6e3
@ -1714,8 +1714,8 @@ spam:
|
|||||||
default: low
|
default: low
|
||||||
enum: "ReviewablePrioritySetting"
|
enum: "ReviewablePrioritySetting"
|
||||||
reviewable_low_priority_threshold:
|
reviewable_low_priority_threshold:
|
||||||
default: 1
|
default: 0
|
||||||
min: 1
|
min: 0
|
||||||
|
|
||||||
rate_limits:
|
rate_limits:
|
||||||
unique_posts_mins: 5
|
unique_posts_mins: 5
|
||||||
|
@ -40,15 +40,20 @@ describe Jobs::ReviewablePriorities do
|
|||||||
expect(Reviewable.score_required_to_hide_post).to eq(8.33)
|
expect(Reviewable.score_required_to_hide_post).to eq(8.33)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when there are enough reviewables' do
|
||||||
|
let(:medium_threshold) { 8.0 }
|
||||||
|
let(:high_threshold) { 13.0 }
|
||||||
|
let(:score_to_hide_post) { 8.66 }
|
||||||
|
|
||||||
it "will set priorities based on the maximum score" do
|
it "will set priorities based on the maximum score" do
|
||||||
create_reviewables(Jobs::ReviewablePriorities.min_reviewables)
|
create_reviewables(Jobs::ReviewablePriorities.min_reviewables)
|
||||||
|
|
||||||
Jobs::ReviewablePriorities.new.execute({})
|
Jobs::ReviewablePriorities.new.execute({})
|
||||||
|
|
||||||
expect_min_score(:low, SiteSetting.reviewable_low_priority_threshold)
|
expect_min_score(:low, SiteSetting.reviewable_low_priority_threshold)
|
||||||
expect_min_score(:medium, 9.0)
|
expect_min_score(:medium, medium_threshold)
|
||||||
expect_min_score(:high, 14.0)
|
expect_min_score(:high, high_threshold)
|
||||||
expect(Reviewable.score_required_to_hide_post).to eq(9.33)
|
expect(Reviewable.score_required_to_hide_post).to eq(score_to_hide_post)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'ignore negative scores when calculating priorities' do
|
it 'ignore negative scores when calculating priorities' do
|
||||||
@ -59,9 +64,9 @@ describe Jobs::ReviewablePriorities do
|
|||||||
Jobs::ReviewablePriorities.new.execute({})
|
Jobs::ReviewablePriorities.new.execute({})
|
||||||
|
|
||||||
expect_min_score(:low, SiteSetting.reviewable_low_priority_threshold)
|
expect_min_score(:low, SiteSetting.reviewable_low_priority_threshold)
|
||||||
expect_min_score(:medium, 9.0)
|
expect_min_score(:medium, medium_threshold)
|
||||||
expect_min_score(:high, 14.0)
|
expect_min_score(:high, high_threshold)
|
||||||
expect(Reviewable.score_required_to_hide_post).to eq(9.33)
|
expect(Reviewable.score_required_to_hide_post).to eq(score_to_hide_post)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'ignores non-approved reviewables' do
|
it 'ignores non-approved reviewables' do
|
||||||
@ -72,9 +77,10 @@ describe Jobs::ReviewablePriorities do
|
|||||||
Jobs::ReviewablePriorities.new.execute({})
|
Jobs::ReviewablePriorities.new.execute({})
|
||||||
|
|
||||||
expect_min_score(:low, SiteSetting.reviewable_low_priority_threshold)
|
expect_min_score(:low, SiteSetting.reviewable_low_priority_threshold)
|
||||||
expect_min_score(:medium, 9.0)
|
expect_min_score(:medium, medium_threshold)
|
||||||
expect_min_score(:high, 14.0)
|
expect_min_score(:high, high_threshold)
|
||||||
expect(Reviewable.score_required_to_hide_post).to eq(9.33)
|
expect(Reviewable.score_required_to_hide_post).to eq(score_to_hide_post)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def expect_min_score(priority, score)
|
def expect_min_score(priority, score)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user