Vote #80342
完了Add configured theme to Redmine::Info
0%
説明
Administration | Information
Displays various info about system, but doesn't display which theme is currently being used.
Environment: Redmine version 3.4.10.stable Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux] Rails version 4.2.11.1 Environment production Database adapter Mysql2 SCM: Subversion 1.9.3 Git 2.7.4 Filesystem Redmine plugins:
It is important to know which theme is used, because there is many themes available on internet,
and some themes don't show everything, or have bugs.
journals
+1
The theme is important information to investigate UI issues. Here is a patch to add Setting.ui_theme to admin/info page.
!{width: 518px; border: 1px solid #ccc;}.32116-20191006@2x.png!
--------------------------------------------------------------------------------
Thanks @Go MAEDA, I've followed your code, and delivered patch for 3.3.1 I guess it will work on other 3.x versions as well...
--------------------------------------------------------------------------------
I'm not sure if it's a good idea to show the configured "Theme" in the information page because the setting is already available in "settings?tab=display". For me, Information page is more about the system, environment, framework and tools which are not configurable in the admin. Also, why display only "Theme" and no other settings as well?
--------------------------------------------------------------------------------
Theme is important to investigate UI issues, there are also some commercially available themes, which use white text on white background for example, and people are posting "info" data on sites like stackoverflow, or forums, IRC chats, asking for help, and we can't reproduce their issues, since issues are theme related.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Indeed, there were a lot of cases when this information would help us investigate more quickly the issues reported by the users. I think we should add this info.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
A slightly alternative, more extensive, approach was posted by me as an up-to-date patch in another, duplicating issue:
Mischa The Evil wrote in #35686:
> Given that a fair amount of (UI) issues are caused by a third-party theme (see e.g. recently closed #35258 and #35534), it would be really helpful if information about the configured theme and whether it includes JavaScript is added to @Redmine::Info@.
>
> Example:
>
> !2021-08-05_01-36-12.png!
>
> I'll leave a patch against current trunk.
I'll modify the subject of this issue because @Redmine::Info.enviroment@ is also (supposed to be?) displayed as the output of the 'rake/rails about' command (see source:/trunk/bin/about@21131#L6).
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Setting the target version to 5.0.0.
--------------------------------------------------------------------------------
Committed the patch after fixing RuboCop offenses by running "rubocop -a". Thank you.
<pre>
$ bundle exec rubocop -a lib/redmine/info.rb
Inspecting 1 file
W
Offenses:
lib/redmine/info.rb:24:9: C: [Corrected] Style/MultilineIfModifier: Favor a normal unless-statement over a modifier clause in a multiline statement.
theme_js = (Redmine::Themes.theme(Setting.ui_theme).javascripts.include?('theme') ? ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/redmine/info.rb:24:22: C: [Corrected] Style/MultilineTernaryOperator: Avoid multi-line ternary operators, use if or unless instead.
theme_js = (Redmine::Themes.theme(Setting.ui_theme).javascripts.include?('theme') ? ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/redmine/info.rb:25:24: C: [Corrected] Style/MultilineTernaryOperator: Avoid multi-line ternary operators, use if or unless instead.
theme_js = (Redmine::Themes.theme(Setting.ui_theme).javascripts.include?('theme') ? ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/redmine/info.rb:26:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -21) spaces for indentation.
' (includes JavaScript)'
^^^^^^^^^^^^^^^^^^^^^
lib/redmine/info.rb:27:1: C: [Corrected] Layout/ElseAlignment: Align else with if.
else
^^^^
lib/redmine/info.rb:28:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -21) spaces for indentation.
'' ...
^^
lib/redmine/info.rb:28:24: C: [Corrected] Style/RedundantInterpolation: Prefer to_s over string interpolation.
theme_string = "#{theme + theme_js.to_s}"
^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/redmine/info.rb:29:1: W: [Corrected] Layout/EndAlignment: end at 29, 0 is not aligned with if at 25, 23.
end
^^^
1 file inspected, 8 offenses detected, 8 offenses corrected
</pre>
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,Closed,36932,Handle nil return of Redmine::Themes.theme(Setting.ui_theme) in Redmine::Info.environment
duplicates,Closed,35686,Add configured theme and whether it includes JavaScript to Redmine::Info.