Feature #30207

Hide menu item in the cross-project menu if the module is not enabled in any project

Added by Go MAEDA 12 months ago. Updated 6 months ago.

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

0%

Category:UI
Target version:4.1.0
Resolution:Fixed

Description

A tab in the cross-project menu is always displayed regardless of the enabled modules in projects. For example, gantt tab in the cross-project menu is always shown even if the gantt module is disabled in all projects.

I think a tab in the cross-project menu should not be displayed if no projects in the application use the module. Users disable the module because they don't want to see the tab or have any interest in the tab.

30207-cross-project-menu.patch Magnifier (3.48 KB) Yuichi HARADA, 2018-12-19 02:51


Related issues

Related to Redmine - Feature #5920: Unify and improve cross-project views layout Closed 2010-07-21

Associated revisions

Revision 17794
Added by Go MAEDA 11 months ago

Hide menu item in the cross-project menu if the module is not enabled in any project (#30207).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA 12 months ago

  • Related to Feature #5920: Unify and improve cross-project views layout added

#2 Updated by Yuichi HARADA 12 months ago

If you disable each modules (e.g. 'Issue tracking', 'Time tracking', 'Gantt', 'Calendar', 'News') in all projects available to logged in users, the each tabs (e.g. 'Issues', 'Spent time', 'Gantt', 'Calendar', 'News') of the cross-project menu is not displayed.

I made a patch, and attach it.

#3 Updated by Go MAEDA 12 months ago

  • Target version set to 4.1.0

#4 Updated by Go MAEDA 11 months ago

  • Tracker changed from Defect to Feature
  • Subject changed from Tab in the cross-project menu is displayed even if the module is disabled in all projects to Hide menu item in the cross-project menu if the module is not enabled in any project
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed. Thank you for your contribution.

#5 Updated by Marius BALTEANU 11 months ago

The current implementation generates one query per each module checked, please see the above log:

D, [2019-01-15T05:45:00.920205 #12] DEBUG -- :   EnabledModule Exists (0.9ms)  SELECT  1 AS one FROM `enabled_modules` WHERE `enabled_modules`.`project_id` IN (SELECT `projects`.`id` FROM `projects` WHERE (projects.status <> 9)) AND `enabled_modules`.`name` = 'issue_tracking' LIMIT 1
D, [2019-01-15T05:45:00.922439 #12] DEBUG -- :   EnabledModule Exists (0.6ms)  SELECT  1 AS one FROM `enabled_modules` WHERE `enabled_modules`.`project_id` IN (SELECT `projects`.`id` FROM `projects` WHERE (projects.status <> 9)) AND `enabled_modules`.`name` = 'time_tracking' LIMIT 1
D, [2019-01-15T05:45:00.927233 #12] DEBUG -- :   EnabledModule Exists (0.9ms)  SELECT  1 AS one FROM `enabled_modules` WHERE `enabled_modules`.`project_id` IN (SELECT `projects`.`id` FROM `projects` WHERE (projects.status <> 9)) AND `enabled_modules`.`name` = 'gantt' LIMIT 1
D, [2019-01-15T05:45:00.930691 #12] DEBUG -- :   EnabledModule Exists (0.6ms)  SELECT  1 AS one FROM `enabled_modules` WHERE `enabled_modules`.`project_id` IN (SELECT `projects`.`id` FROM `projects` WHERE (projects.status <> 9)) AND `enabled_modules`.`name` = 'calendar' LIMIT 1
D, [2019-01-15T05:45:00.932697 #12] DEBUG -- :   EnabledModule Exists (0.6ms)  SELECT  1 AS one FROM `enabled_modules` WHERE `enabled_modules`.`project_id` IN (SELECT `projects`.`id` FROM `projects` WHERE (projects.status <> 9)) AND `enabled_modules`.`name` = 'news' LIMIT 1

Is this ok from a performance point of view?

#6 Updated by Marius BALTEANU 11 months ago

  • Status changed from Closed to Reopened

#7 Updated by Jean-Philippe Lang 6 months ago

  • Status changed from Reopened to Closed

I also had a concern about these queries but as long as they are fast it should not be a problem.

Also available in: Atom PDF