DEV: Convert approve_unless_trust_level to groups (#24357)

This change converts the `approve_unless_trust_level` site setting to
`approve_unless_allowed_groups`.

See: https://meta.discourse.org/t/283408

- Adds the new site setting
- Adds a deprecation warning
- Updates core to use the new settings.
- Adds a migration to fill in the new setting of the old setting was
  changed
- Adds an entry to the site_setting.keywords section
- Updates many tests to account for the new change

After a couple of months we will remove the `approve_unless_trust_level`
setting entirely.

Internal ref: /t/115696
This commit is contained in:
Blake Erickson
2023-11-21 11:31:42 -07:00
committed by GitHub
parent b19b4b4215
commit 447d9b2105
15 changed files with 80 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true
describe "Composer Form Templates", type: :system do
fab!(:user)
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
fab!(:form_template_1) do
Fabricate(
:form_template,

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true
describe "Composer using review_media", type: :system do
fab!(:user)
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
fab!(:topic) { Fabricate(:topic, category: Category.find(SiteSetting.uncategorized_category_id)) }
fab!(:post) { Fabricate(:post, topic: topic) }
let(:topic_page) { PageObjects::Pages::Topic.new }

View File

@@ -100,6 +100,7 @@ describe "Using #hashtag autocompletion to search for and lookup categories and
end
it "cooks the hashtags for tag and category correctly serverside when the post is saved to the database" do
Group.refresh_automatic_groups!
topic_page.visit_topic_and_open_composer(topic)
expect(topic_page).to have_expanded_composer