mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Improve theme error handling UX
- Update UI to improve contrast - Make it clear that the message is only shown to administrators - Add theme name and id to the console output - Parse the error backtrace to identify the theme-id for post-decoration errors - Improve console output to include the theme name / URL - Add `?safe_mode=no_custom` to the admin panel link, so that it will work even if the theme is causing the site to break
This commit is contained in:
@@ -142,7 +142,7 @@ class ThemeField < ActiveRecord::Base
|
||||
javascript_cache.content = js_compiler.content
|
||||
javascript_cache.save!
|
||||
|
||||
doc.add_child("<script src='#{javascript_cache.url}'></script>") if javascript_cache.content.present?
|
||||
doc.add_child("<script src='#{javascript_cache.url}' data-theme-id='#{theme_id}'></script>") if javascript_cache.content.present?
|
||||
[doc.to_s, errors&.join("\n")]
|
||||
end
|
||||
|
||||
@@ -258,7 +258,7 @@ class ThemeField < ActiveRecord::Base
|
||||
javascript_cache.content = js_compiler.content
|
||||
javascript_cache.save!
|
||||
doc = ""
|
||||
doc = "<script src='#{javascript_cache.url}'></script>" if javascript_cache.content.present?
|
||||
doc = "<script src='#{javascript_cache.url}' data-theme-id='#{theme_id}'></script>" if javascript_cache.content.present?
|
||||
[doc, errors&.join("\n")]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user