Disabling project features should hide their respective analytics options
Summary
When the repository features are disabled under a project, the Analytics area on its sidebar continues to show Merge Request Analytics.
Likewise, when the issue features are disabled, the Issue Analytics link continues to appear.
Steps to reproduce
- Create a project
- Under Project > Settings > General > Project features section, disable the
Repository
andIssues
features entirely - Check the Project > Analytics sidebar and
Merge Request
andIssues
options continue to exist when they should not
Example Project
What is the current bug behavior?
Disabling project features does not hide its corresponding analytics links
What is the expected correct behavior?
Disabling project features must hide its corresponding analytics links
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
A security-related fix recently addressed this (perhaps indirectly) for the Repository
analytics link via c0ae3f6a that implicitly now checks if rule repository_disabled
is applied through the check of policy download_code
.
A similar feature-checking fix to the policies in https://gitlab.com/gitlab-org/gitlab/blob/14c1e9e9d5468ace4bf050c9a54904336f8c6c5c/ee/lib/ee/sidebars/projects/menus/analytics_menu.rb#L67-75 can be made to ensure they respond to the Project feature setting changes.
Related to #345001