Project

General

Profile

Actions

Feature #30207

closed

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

Added by Go MAEDA over 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
UI
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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.


Files

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

Related issues

Related to Redmine - Feature #5920: Unify and improve cross-project views layoutClosedJean-Philippe Lang2010-07-21

Actions
Actions #1

Updated by Go MAEDA over 5 years ago

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

Updated by Yuichi HARADA over 5 years 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.

Actions #3

Updated by Go MAEDA over 5 years ago

  • Target version set to 4.1.0
Actions #4

Updated by Go MAEDA over 5 years 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.

Actions #5

Updated by Marius BĂLTEANU over 5 years 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?

Actions #6

Updated by Marius BĂLTEANU over 5 years ago

  • Status changed from Closed to Reopened
Actions #7

Updated by Jean-Philippe Lang almost 5 years 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.

Actions #8

Updated by Aleksandar Pavic almost 4 years ago

It is still displayed for roles that don't have permission to use any of those...

Once they click on projects tab.

My Redmine version is: 4.1.0.stable.19444

Actions

Also available in: Atom PDF