FIX: do not looks for plugin test js in production (#16962)

Previous to this fix, in production we were getting 500 errors from
bootstrap.json cause script_asset_path can not find plugin-tests

Opted for the simplest fix that is omitting the files in production
This commit is contained in:
Sam 2022-06-01 10:49:53 +10:00 committed by GitHub
parent 9ac85d6163
commit bc8f651501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -61,6 +61,13 @@ class BootstrapController < ApplicationController
request: assets_fake_request
).map { |f| script_asset_path(f) }
plugin_test_js =
if Rails.env != "production"
script_asset_path("plugin-tests")
else
[]
end
bootstrap = {
theme_id: theme_id,
theme_color: "##{ColorScheme.hex_for_name('header_background', scheme_id)}",
@ -69,7 +76,7 @@ class BootstrapController < ApplicationController
locale_script: locale,
stylesheets: @stylesheets,
plugin_js: plugin_js,
plugin_test_js: [script_asset_path("plugin-tests")],
plugin_test_js: plugin_test_js,
setup_data: client_side_setup_data,
preloaded: @preloaded,
html: create_html,