Commit 6871780d authored by mfluharty's avatar mfluharty

Rename to group repository (singular) analytics

Move feature into /analytics subdirectory
Keep "Repositories" link in sidebar, but
use "group repository analytics" internally
to match equivalent project feature and
make it obvious that this is a group-level feature
parent 949ff03b
# frozen_string_literal: true
class Groups::Analytics::RepositoryAnalyticsController < Groups::Analytics::ApplicationController
end
# frozen_string_literal: true
class Groups::RepositoriesAnalyticsController < Groups::ApplicationController
end
......@@ -18,7 +18,7 @@ module EE
override :group_analytics_navbar_links
def group_analytics_navbar_links(group, current_user)
super + [
repositories_analytics_navbar_link(group, current_user),
group_repository_analytics_navbar_link(group, current_user),
contribution_analytics_navbar_link(group, current_user),
group_insights_navbar_link(group, current_user),
issues_analytics_navbar_link(group, current_user),
......@@ -136,13 +136,13 @@ module EE
)
end
def repositories_analytics_navbar_link(group, current_user)
return unless group_sidebar_link?(:repositories_analytics)
def group_repository_analytics_navbar_link(group, current_user)
return unless group_sidebar_link?(:repository_analytics)
navbar_sub_item(
title: _('Repositories'),
path: 'groups/repositories_analytics#show',
link: group_repositories_analytics_path(group)
path: 'groups/analytics/repository_analytics#show',
link: group_analytics_repository_analytics_path(group)
)
end
end
......
......@@ -83,7 +83,7 @@ class License < ApplicationRecord
group_ip_restriction
group_merge_request_analytics
group_project_templates
group_repositories_analytics
group_repository_analytics
group_saml
issues_analytics
jira_issues_integration
......
......@@ -25,8 +25,8 @@ module EE
@subject.feature_available?(:group_merge_request_analytics)
end
condition(:group_repositories_analytics_available) do
@subject.feature_available?(:group_repositories_analytics)
condition(:group_repository_analytics_available) do
@subject.feature_available?(:group_repository_analytics)
end
condition(:group_activity_analytics_available) do
......@@ -135,8 +135,8 @@ module EE
rule { has_access & group_activity_analytics_available }
.enable :read_group_activity_analytics
rule { has_access & group_repositories_analytics_available }
.enable :read_group_repositories_analytics
rule { has_access & group_repository_analytics_available }
.enable :read_group_repository_analytics
rule { reporter & group_merge_request_analytics_available }
.enable :read_group_merge_request_analytics
......
......@@ -21,12 +21,12 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
get '/analytics', to: redirect('groups/%{group_id}/-/contribution_analytics')
resource :contribution_analytics, only: [:show]
resource :repositories_analytics, only: [:show]
namespace :analytics do
resource :productivity_analytics, only: :show, constraints: -> (req) { Gitlab::Analytics.productivity_analytics_enabled? }
resources :coverage_reports, only: :index, constraints: -> (req) { Gitlab::Analytics.group_coverage_reports_enabled? }
resource :merge_request_analytics, only: :show, constraints: -> (req) { Gitlab::Analytics.group_merge_request_analytics_enabled? }
resource :repository_analytics, only: [:show]
feature_default_enabled = Gitlab::Analytics.feature_enabled_by_default?(Gitlab::Analytics::CYCLE_ANALYTICS_FEATURE_FLAG)
constrainer = ::Constraints::FeatureConstrainer.new(Gitlab::Analytics::CYCLE_ANALYTICS_FEATURE_FLAG, default_enabled: feature_default_enabled)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment