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 ...@@ -10,7 +10,7 @@ module GroupsHelper
] ]
end end
def group_nav_link_paths def group_settings_nav_link_paths
%w[ %w[
groups#projects groups#projects
groups#edit groups#edit
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
= _('Members') = _('Members')
- if group_sidebar_link?(:settings) - 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 = link_to edit_group_path(@group) do
.nav-icon-container .nav-icon-container
= sprite_icon('settings') = sprite_icon('settings')
......
...@@ -11,10 +11,22 @@ module EE ...@@ -11,10 +11,22 @@ module EE
.count .count
end end
def group_administration_nav_link_paths def group_nav_link_paths
%w[saml_providers#show usage_quotas#index billings#index] %w[saml_providers#show usage_quotas#index billings#index]
end 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) def size_limit_message_for_group(group)
show_lfs = group.lfs_enabled? ? 'and their respective LFS files' : '' show_lfs = group.lfs_enabled? ? 'and their respective LFS files' : ''
...@@ -91,7 +103,9 @@ module EE ...@@ -91,7 +103,9 @@ module EE
end end
def show_administration_nav?(group) 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 end
def administration_nav_path(group) 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) - if Gitlab::Auth::Ldap::Config.group_sync_enabled? && can?(current_user, :admin_ldap_group_links, @group)
= nav_link(path: 'ldap_group_links#index') do = 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 = link_to group_ldap_group_links_path(@group), title: 'LDAP Group', class: 'qa-ldap-synchronization-link' do
%span %span
LDAP Synchronization 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? - if @group.feature_available?(:group_webhooks) || show_promotions?
= nav_link(path: 'hooks#index') do = nav_link(path: 'hooks#index') do
= link_to group_hooks_path(@group), title: 'Webhooks' do = link_to group_hooks_path(@group), title: 'Webhooks' do
...@@ -15,3 +23,15 @@ ...@@ -15,3 +23,15 @@
= link_to group_audit_events_path(@group), title: 'Audit Events', data: { qa_selector: 'audit_events_settings_link' } do = link_to group_audit_events_path(@group), title: 'Audit Events', data: { qa_selector: 'audit_events_settings_link' } do
%span %span
Audit Events 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 ...@@ -233,6 +233,16 @@ describe GroupsHelper do
expect(helper.show_administration_nav?(subgroup)).to be false expect(helper.show_administration_nav?(subgroup)).to be false
end 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
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