A platform for community discussion. Free, open, simple.
DEV: Move image auto-grid back to experimental (#31296)
Ted Johanssonb3a686ca4e6b
diff --git a/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js b/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.jsindex a56ed7a5bee..346f722c12c 100644--- a/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js+++ b/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js@@ -344,7 +344,10 @@ export default class UppyComposerUpload {});const MIN_IMAGES_TO_AUTO_GRID = 3;- if (this.#consecutiveImages?.length >= MIN_IMAGES_TO_AUTO_GRID) {+ if (+ this.siteSettings.experimental_auto_grid_images &&+ this.#consecutiveImages?.length >= MIN_IMAGES_TO_AUTO_GRID+ ) {this.#autoGridImages();}});diff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex a5491b2046a..48a6f8851d7 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -2755,7 +2755,7 @@ en:experimental_form_templates: "Enable the form templates feature. Manage the templates at <a href='%{base_path}/admin/customize/form-templates'>Customize / Templates</a>."admin_sidebar_enabled_groups: "Enable sidebar navigation for the admin UI for the specified groups, which replaces the top-level admin navigation buttons."lazy_load_categories_groups: "Lazy load category information only for users of these groups. This improves performance on sites with many categories."-+ experimental_auto_grid_images: "Automatically wraps images in [grid] tags when 3 or more images are uploaded in the composer."page_loading_indicator: "Configure the loading indicator which appears during page navigations within Discourse. 'Spinner' is a full page indicator. 'Slider' shows a narrow bar at the top of the screen."show_user_menu_avatars: "Show user avatars in the user menu"about_page_hidden_groups: "Do not show members of specific groups on the /about page."diff --git a/config/site_settings.yml b/config/site_settings.ymlindex b9a8e9537d4..42c1c52db72 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -3514,6 +3514,9 @@ dashboard:client: trueexperimental:+ experimental_auto_grid_images:+ default: false+ client: trueexperimental_rename_faq_to_guidelines:default: falsehidden: truediff --git a/spec/system/composer_uploads_spec.rb b/spec/system/composer_uploads_spec.rbindex deaf75a47a1..bbee973b819 100644--- a/spec/system/composer_uploads_spec.rb+++ b/spec/system/composer_uploads_spec.rb@@ -160,6 +160,8 @@ describe "Uploading files in the composer", type: :system doendcontext "when multiple images are uploaded" do+ before { SiteSetting.experimental_auto_grid_images = true }+it "automatically wraps images in [grid] tags on 3 or more images" dovisit "/new-topic"expect(composer).to be_opened@@ -225,6 +227,8 @@ describe "Uploading files in the composer", type: :system doendit "does not automatically wrap images in [grid] tags when setting is disabled" do+ SiteSetting.experimental_auto_grid_images = false+visit "/new-topic"expect(composer).to be_opened