Commit 0534e35b authored by Robert Speicher's avatar Robert Speicher

Merge branch 'move-group-administation-menu-behind-feature-flag' into 'master'

Move group "Administration" nav behind feature flag

See merge request gitlab-org/gitlab!29084
parents ab8144f0 f9b9b99c
...@@ -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')
......
...@@ -173,7 +173,7 @@ To see the status of your GitLab.com subscription, log into GitLab.com and go to ...@@ -173,7 +173,7 @@ To see the status of your GitLab.com subscription, log into GitLab.com and go to
1. Go to **User Avatar > Settings**. 1. Go to **User Avatar > Settings**.
1. Click **Billing**. 1. Click **Billing**.
- For groups: - For groups:
1. From the group page (*not* from a project within the group), go to **Administration > Billing**. 1. From the group page (*not* from a project within the group), go to **Settings > Billing**.
The following table describes details of your subscription for groups: The following table describes details of your subscription for groups:
...@@ -430,7 +430,7 @@ CI pipeline minutes are the execution time for your [pipelines](../ci/pipelines/ ...@@ -430,7 +430,7 @@ CI pipeline minutes are the execution time for your [pipelines](../ci/pipelines/
Quotas apply to: Quotas apply to:
- Groups, where the minutes are shared across all members of the group, its subgroups, and nested projects. To view the group's usage, navigate to the group, then **{settings}** **Administration > Usage Quotas**. - Groups, where the minutes are shared across all members of the group, its subgroups, and nested projects. To view the group's usage, navigate to the group, then **{settings}** **Settings > Usage Quotas**.
- Your personal account, where the minutes are available for your personal projects. To view and buy personal minutes, click your avatar, then **{settings}** **Settings > Pipeline quota**. - Your personal account, where the minutes are available for your personal projects. To view and buy personal minutes, click your avatar, then **{settings}** **Settings > Pipeline quota**.
Only pipeline minutes for GitLab shared runners are restricted. If you have a specific runner set up for your projects, there is no limit to your build time on GitLab.com. Only pipeline minutes for GitLab shared runners are restricted. If you have a specific runner set up for your projects, there is no limit to your build time on GitLab.com.
...@@ -451,10 +451,10 @@ main quota. Additional minutes: ...@@ -451,10 +451,10 @@ main quota. Additional minutes:
To purchase additional minutes for your group on GitLab.com: To purchase additional minutes for your group on GitLab.com:
1. From your group, go to **{settings}** **Administration > Usage Quotas**. 1. From your group, go to **{settings}** **Settings > Usage Quotas**.
1. Locate the subscription card that's linked to your group on GitLab.com, click **Buy more CI minutes**, and complete the details about the transaction. 1. Locate the subscription card that's linked to your group on GitLab.com, click **Buy more CI minutes**, and complete the details about the transaction.
1. Once we have processed your payment, the extra CI minutes will be synced to your group. 1. Once we have processed your payment, the extra CI minutes will be synced to your group.
1. To confirm the available CI minutes, go to your group, then **{settings}** **Administration > Usage Quotas**. 1. To confirm the available CI minutes, go to your group, then **{settings}** **Settings > Usage Quotas**.
The **Additional minutes** displayed now includes the purchased additional CI minutes, plus any minutes rolled over from last month. The **Additional minutes** displayed now includes the purchased additional CI minutes, plus any minutes rolled over from last month.
To purchase additional minutes for your personal namespace: To purchase additional minutes for your personal namespace:
......
...@@ -24,7 +24,7 @@ Note the following: ...@@ -24,7 +24,7 @@ Note the following:
## Configuring your Identity Provider ## Configuring your Identity Provider
1. Navigate to the group and click **Administration > SAML SSO**. 1. Navigate to the group and click **Settings > SAML SSO**.
1. Configure your SAML server using the **Assertion consumer service URL** and **Identifier**. Alternatively GitLab provides [metadata XML configuration](#metadata-configuration). See [your identity provider's documentation](#providers) for more details. 1. Configure your SAML server using the **Assertion consumer service URL** and **Identifier**. Alternatively GitLab provides [metadata XML configuration](#metadata-configuration). See [your identity provider's documentation](#providers) for more details.
1. Configure the SAML response to include a NameID that uniquely identifies each user. 1. Configure the SAML response to include a NameID that uniquely identifies each user.
1. Configure required assertions using the [table below](#assertions). 1. Configure required assertions using the [table below](#assertions).
...@@ -116,7 +116,7 @@ This feature is similar to the [Credentials inventory for self-managed instances ...@@ -116,7 +116,7 @@ This feature is similar to the [Credentials inventory for self-managed instances
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/34648) in GitLab 12.9. > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/34648) in GitLab 12.9.
Groups with group-managed accounts can disallow forking of projects to destinations outside the group. Groups with group-managed accounts can disallow forking of projects to destinations outside the group.
To do so, enable the "Prohibit outer forks" option in **Administration > SAML SSO**. To do so, enable the "Prohibit outer forks" option in **Settings > SAML SSO**.
When enabled, projects within the group can only be forked to other destinations within the group (including its subgroups). When enabled, projects within the group can only be forked to other destinations within the group (including its subgroups).
##### Other restrictions for Group-managed accounts ##### Other restrictions for Group-managed accounts
...@@ -146,7 +146,7 @@ assertions to be able to create a user. ...@@ -146,7 +146,7 @@ assertions to be able to create a user.
GitLab provides metadata XML that can be used to configure your Identity Provider. GitLab provides metadata XML that can be used to configure your Identity Provider.
1. Navigate to the group and click **Administration > SAML SSO**. 1. Navigate to the group and click **Settings > SAML SSO**.
1. Copy the provided **GitLab metadata URL**. 1. Copy the provided **GitLab metadata URL**.
1. Follow your Identity Provider's documentation and paste the metadata URL when it is requested. 1. Follow your Identity Provider's documentation and paste the metadata URL when it is requested.
...@@ -154,7 +154,7 @@ GitLab provides metadata XML that can be used to configure your Identity Provide ...@@ -154,7 +154,7 @@ GitLab provides metadata XML that can be used to configure your Identity Provide
Once you've set up your identity provider to work with GitLab, you'll need to configure GitLab to use it for authentication: Once you've set up your identity provider to work with GitLab, you'll need to configure GitLab to use it for authentication:
1. Navigate to the group's **Administration > SAML SSO**. 1. Navigate to the group's **Settings > SAML SSO**.
1. Find the SSO URL from your Identity Provider and enter it the **Identity provider single sign on URL** field. 1. Find the SSO URL from your Identity Provider and enter it the **Identity provider single sign on URL** field.
1. Find and enter the fingerprint for the SAML token signing certificate in the **Certificate** field. 1. Find and enter the fingerprint for the SAML token signing certificate in the **Certificate** field.
1. Click the **Enable SAML authentication for this group** toggle switch. 1. Click the **Enable SAML authentication for this group** toggle switch.
...@@ -288,14 +288,14 @@ If the information you need isn't listed above you may wish to check our [troubl ...@@ -288,14 +288,14 @@ If the information you need isn't listed above you may wish to check our [troubl
To link SAML to your existing GitLab.com account: To link SAML to your existing GitLab.com account:
1. Sign in to your GitLab.com account. 1. Sign in to your GitLab.com account.
1. Locate the SSO URL for the group you are signing in to. A group Admin can find this on the group's **Administration > SAML SSO** page. 1. Locate the SSO URL for the group you are signing in to. A group Admin can find this on the group's **Settings > SAML SSO** page.
1. Visit the SSO URL and click **Authorize**. 1. Visit the SSO URL and click **Authorize**.
1. Enter your credentials on the Identity Provider if prompted. 1. Enter your credentials on the Identity Provider if prompted.
1. You will be redirected back to GitLab.com and should now have access to the group. In the future, you can use SAML to sign in to GitLab.com. 1. You will be redirected back to GitLab.com and should now have access to the group. In the future, you can use SAML to sign in to GitLab.com.
## Signing in to GitLab.com with SAML ## Signing in to GitLab.com with SAML
1. Locate the SSO URL for the group you are signing in to. A group Admin can find this on a group's **Administration > SAML SSO** page. If configured, it might also be possible to sign in to GitLab starting from your Identity Provider. 1. Locate the SSO URL for the group you are signing in to. A group Admin can find this on a group's **Settings > SAML SSO** page. If configured, it might also be possible to sign in to GitLab starting from your Identity Provider.
1. Visit the SSO URL and click the **Sign in with Single Sign-On** button. 1. Visit the SSO URL and click the **Sign in with Single Sign-On** button.
1. Enter your credentials on the Identity Provider if prompted. 1. Enter your credentials on the Identity Provider if prompted.
1. You will be signed in to GitLab.com and redirected to the group. 1. You will be signed in to GitLab.com and redirected to the group.
......
...@@ -30,7 +30,7 @@ The following identity providers are supported: ...@@ -30,7 +30,7 @@ The following identity providers are supported:
Once [Single sign-on](index.md) has been configured, we can: Once [Single sign-on](index.md) has been configured, we can:
1. Navigate to the group and click **Administration > SAML SSO**. 1. Navigate to the group and click **Settings > SAML SSO**.
1. Click on the **Generate a SCIM token** button. 1. Click on the **Generate a SCIM token** button.
1. Save the token and URL so they can be used in the next step. 1. Save the token and URL so they can be used in the next step.
......
...@@ -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')
---
title: Move settings only relevant to the parent group into an "Administration" menu
merge_request: 28057
author:
type: changed
...@@ -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