Feature #30207
closedHide menu item in the cross-project menu if the module is not enabled in any project
0%
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
Related issues
Updated by Go MAEDA about 6 years ago
- Related to Feature #5920: Unify and improve cross-project views layout added
Updated by Yuichi HARADA about 6 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.
Updated by Go MAEDA almost 6 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.
Updated by Marius BĂLTEANU almost 6 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?
Updated by Marius BĂLTEANU almost 6 years ago
- Status changed from Closed to Reopened
Updated by Jean-Philippe Lang over 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.
Updated by Aleksandar Pavic over 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