Commit 88250e41 authored by peterhegman's avatar peterhegman

Move group "Administration" nav behind feature flag

There has been some negative feedback about how this may be confusing.
Reverting docs and moving behind a feature flag till we can determine
how to move forward.
parent 0f5a5c14
......@@ -10,7 +10,7 @@ module GroupsHelper
]
end
def group_nav_link_paths
def group_settings_nav_link_paths
%w[
groups#projects
groups#edit
......
......@@ -133,7 +133,7 @@
= _('Members')
- if group_sidebar_link?(:settings)
= nav_link(path: group_nav_link_paths) do
= nav_link(path: group_settings_nav_link_paths) do
= link_to edit_group_path(@group) do
.nav-icon-container
= sprite_icon('settings')
......
......@@ -11,10 +11,22 @@ module EE
.count
end
def group_administration_nav_link_paths
def group_nav_link_paths
%w[saml_providers#show usage_quotas#index billings#index]
end
def group_settings_nav_link_paths
if ::Feature.disabled?(:group_administration_nav_item, @group)
super + group_nav_link_paths
else
super
end
end
def group_administration_nav_link_paths
group_nav_link_paths
end
def size_limit_message_for_group(group)
show_lfs = group.lfs_enabled? ? 'and their respective LFS files' : ''
......@@ -91,7 +103,9 @@ module EE
end
def show_administration_nav?(group)
group.parent.nil? && can?(current_user, :admin_group, @group)
::Feature.enabled?(:group_administration_nav_item, group) &&
group.parent.nil? &&
can?(current_user, :admin_group, group)
end
def administration_nav_path(group)
......
- administration_nav_item_disabled = Feature.disabled?(:group_administration_nav_item, @group)
- if Gitlab::Auth::Ldap::Config.group_sync_enabled? && can?(current_user, :admin_ldap_group_links, @group)
= nav_link(path: 'ldap_group_links#index') do
= link_to group_ldap_group_links_path(@group), title: 'LDAP Group', class: 'qa-ldap-synchronization-link' do
%span
LDAP Synchronization
- if show_saml_in_sidebar?(@group) && administration_nav_item_disabled
= nav_link(path: 'saml_providers#show') do
= link_to group_saml_providers_path(@group), title: _('SAML SSO'), data: { qa_selector: 'group_saml_sso_link' } do
%span
= _('SAML SSO')
- if @group.feature_available?(:group_webhooks) || show_promotions?
= nav_link(path: 'hooks#index') do
= link_to group_hooks_path(@group), title: 'Webhooks' do
......@@ -15,3 +23,15 @@
= link_to group_audit_events_path(@group), title: 'Audit Events', data: { qa_selector: 'audit_events_settings_link' } do
%span
Audit Events
- if show_usage_quotas_in_sidebar? && @group.parent.nil? && administration_nav_item_disabled
= nav_link(path: 'usage_quotas#index') do
= link_to group_usage_quotas_path(@group), title: s_('UsageQuota|Usage Quotas') do
%span
= s_('UsageQuota|Usage Quotas')
- if show_billing_in_sidebar? && administration_nav_item_disabled
= nav_link(path: 'billings#index') do
= link_to group_billings_path(@group), title: _('Billing') do
%span
= _('Billing')
......@@ -233,6 +233,16 @@ describe GroupsHelper do
expect(helper.show_administration_nav?(subgroup)).to be false
end
context 'when `group_administration_nav_item` feature flag is disabled for the group' do
before do
stub_feature_flags(group_administration_nav_item: { enabled: false, thing: group })
end
it 'returns false' do
expect(helper.show_administration_nav?(group)).to be false
end
end
end
end
......
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