プロジェクト

全般

プロフィール

Vote #79705

完了

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

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
127
issue_org_id:
30207
author_id:
332
assigned_to_id:
332
comments:
8
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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.


journals

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

--------------------------------------------------------------------------------
Committed. Thank you for your contribution.
--------------------------------------------------------------------------------
The current implementation generates one query per each module checked, please see the above log:
<pre>
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
</pre>

Is this ok from a performance point of view?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I also had a concern about these queries but as long as they are fast it should not be a problem.
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------


related_issues

relates,Closed,5920,Unify and improve cross-project views layout

Admin Redmine さんが3年以上前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン4.1.0_127 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0