Feature #32116

Add configured theme to Redmine::Info

Added by Aleksandar Pavic almost 3 years ago. Updated 7 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Administration
Target version:5.0.0
Resolution:Fixed

Description

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.

32116-20191006@2x.png (62.7 KB) Go MAEDA, 2019-10-06 06:03

32116.patch Magnifier (578 Bytes) Go MAEDA, 2019-10-06 06:04

331.patch Magnifier (562 Bytes) Aleksandar Pavic, 2019-10-07 22:23

2021-08-05_01-36-12.png (15 KB) Mischa The Evil, 2021-08-06 22:31

0001-Add-current-theme-and-whether-it-includes-JavaScript.patch Magnifier - Patch against trunk @ r21131 (1.28 KB) Mischa The Evil, 2021-08-06 22:31


Related issues

Related to Redmine - Defect #36932: Handle nil return of Redmine::Themes.theme(Setting.ui_the... Closed
Duplicated by Redmine - Feature #35686: Add configured theme and whether it includes JavaScript t... Closed

Associated revisions

Revision 21308
Added by Go MAEDA 7 months ago

Add current theme and whether it includes JavaScript to Redmine::Info (#32116).

Contributed by Mischa The Evil.

History

#1 Updated by Go MAEDA over 2 years ago

+1
The theme is important information to investigate UI issues. Here is a patch to add Setting.ui_theme to admin/info page.

#2 Updated by Aleksandar Pavic over 2 years ago

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...

#3 Updated by Marius BALTEANU over 2 years ago

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?

#4 Updated by Aleksandar Pavic over 2 years ago

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.

#5 Updated by Go MAEDA 11 months ago

  • Related to Feature #35686: Add configured theme and whether it includes JavaScript to Redmine::Info. added

#6 Updated by Marius BALTEANU 11 months ago

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.

#7 Updated by Marius BALTEANU 11 months ago

  • Target version set to Candidate for next major release

#8 Updated by Mischa The Evil 11 months ago

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:

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).

#9 Updated by Mischa The Evil 11 months ago

  • Related to deleted (Feature #35686: Add configured theme and whether it includes JavaScript to Redmine::Info.)

#10 Updated by Mischa The Evil 11 months ago

  • Duplicated by Feature #35686: Add configured theme and whether it includes JavaScript to Redmine::Info. added

#11 Updated by Go MAEDA 11 months ago

  • Target version changed from Candidate for next major release to 5.0.0

Setting the target version to 5.0.0.

#12 Updated by Go MAEDA 7 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch after fixing RuboCop offenses by running "rubocop -a". Thank you.

$ 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

#13 Updated by Mischa The Evil 3 months ago

  • Related to Defect #36932: Handle nil return of Redmine::Themes.theme(Setting.ui_theme) in Redmine::Info.environment added

Also available in: Atom PDF