Commit c5fa7c4e authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'move-ff-menu-doc-to-core' into 'master'

Finish Moving Feature Flags to Core RUN AS-IF-FOSS

See merge request gitlab-org/gitlab!44642
parents c0fdd5f9 5d550618
...@@ -471,7 +471,8 @@ module ProjectsHelper ...@@ -471,7 +471,8 @@ module ProjectsHelper
labels: :read_label, labels: :read_label,
issues: :read_issue, issues: :read_issue,
project_members: :read_project_member, project_members: :read_project_member,
wiki: :read_wiki wiki: :read_wiki,
feature_flags: :read_feature_flag
} }
end end
...@@ -482,7 +483,8 @@ module ProjectsHelper ...@@ -482,7 +483,8 @@ module ProjectsHelper
:read_environment, :read_environment,
:read_issue, :read_issue,
:read_sentry_issue, :read_sentry_issue,
:read_cluster :read_cluster,
:read_feature_flag
].any? do |ability| ].any? do |ability|
can?(current_user, ability, project) can?(current_user, ability, project)
end end
...@@ -561,7 +563,11 @@ module ProjectsHelper ...@@ -561,7 +563,11 @@ module ProjectsHelper
end end
def sidebar_operations_link_path(project = @project) def sidebar_operations_link_path(project = @project)
metrics_project_environments_path(project) if can?(current_user, :read_environment, project) if can?(current_user, :read_environment, project)
metrics_project_environments_path(project)
else
project_feature_flags_path(project)
end
end end
def project_last_activity(project) def project_last_activity(project)
...@@ -754,6 +760,7 @@ module ProjectsHelper ...@@ -754,6 +760,7 @@ module ProjectsHelper
logs logs
product_analytics product_analytics
metrics_dashboard metrics_dashboard
feature_flags
tracings tracings
] ]
end end
......
...@@ -297,7 +297,11 @@ ...@@ -297,7 +297,11 @@
%span %span
= _('Environments') = _('Environments')
= render_if_exists 'layouts/nav/sidebar/project_feature_flags_link' - if project_nav_tab? :feature_flags
= nav_link(controller: :feature_flags) do
= link_to project_feature_flags_path(@project), title: _('Feature Flags'), class: 'shortcuts-feature-flags' do
%span
= _('Feature Flags')
- if project_nav_tab?(:product_analytics) - if project_nav_tab?(:product_analytics)
= nav_link(controller: :product_analytics) do = nav_link(controller: :product_analytics) do
......
---
title: Move feature flags to core
merge_request: 44642
author:
type: changed
...@@ -4,9 +4,11 @@ group: Progressive Delivery ...@@ -4,9 +4,11 @@ group: Progressive Delivery
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
--- ---
# Feature Flags API **(PREMIUM)** # Feature Flags API **(CORE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9566) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9566) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212318) to [GitLab Starter](https://about.gitlab.com/pricing/) in 13.4.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212318) to [GitLab Core](https://about.gitlab.com/pricing/) in 13.5.
NOTE: **Note:** NOTE: **Note:**
This API is behind a [feature flag](../operations/feature_flags.md#enable-or-disable-feature-flag-strategies). This API is behind a [feature flag](../operations/feature_flags.md#enable-or-disable-feature-flag-strategies).
......
...@@ -4,9 +4,11 @@ group: Progressive Delivery ...@@ -4,9 +4,11 @@ group: Progressive Delivery
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
--- ---
# Legacy Feature Flags API **(PREMIUM)** # Legacy Feature Flags API **(CORE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9566) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9566) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212318) to [GitLab Starter](https://about.gitlab.com/pricing/) in 13.4.
> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212318) to [GitLab Core](https://about.gitlab.com/pricing/) in 13.5.
CAUTION: **Deprecation:** CAUTION: **Deprecation:**
This API is deprecated and [scheduled for removal in GitLab 14.0](https://gitlab.com/gitlab-org/gitlab/-/issues/213369). Use [this API](feature_flags.md) instead. This API is deprecated and [scheduled for removal in GitLab 14.0](https://gitlab.com/gitlab-org/gitlab/-/issues/213369). Use [this API](feature_flags.md) instead.
......
...@@ -17,13 +17,6 @@ module EE ...@@ -17,13 +17,6 @@ module EE
super + %w(path_locks) super + %w(path_locks)
end end
override :sidebar_operations_paths
def sidebar_operations_paths
super + %w[
feature_flags
]
end
override :get_project_nav_tabs override :get_project_nav_tabs
def get_project_nav_tabs(project, current_user) def get_project_nav_tabs(project, current_user)
nav_tabs = super nav_tabs = super
...@@ -38,10 +31,6 @@ module EE ...@@ -38,10 +31,6 @@ module EE
nav_tabs << :merge_request_analytics nav_tabs << :merge_request_analytics
end end
if can?(current_user, :read_feature_flag, project) && !nav_tabs.include?(:operations)
nav_tabs << :operations
end
if project.feature_available?(:issues_analytics) && can?(current_user, :read_project, project) if project.feature_available?(:issues_analytics) && can?(current_user, :read_project, project)
nav_tabs << :issues_analytics nav_tabs << :issues_analytics
end end
...@@ -53,13 +42,6 @@ module EE ...@@ -53,13 +42,6 @@ module EE
nav_tabs nav_tabs
end end
override :tab_ability_map
def tab_ability_map
tab_ability_map = super
tab_ability_map[:feature_flags] = :read_feature_flag
tab_ability_map
end
override :default_url_to_repo override :default_url_to_repo
def default_url_to_repo(project = @project) def default_url_to_repo(project = @project)
case default_clone_protocol case default_clone_protocol
...@@ -79,11 +61,6 @@ module EE ...@@ -79,11 +61,6 @@ module EE
end end
end end
override :sidebar_operations_link_path
def sidebar_operations_link_path(project = @project)
super || project_feature_flags_path(project)
end
override :remove_project_message override :remove_project_message
def remove_project_message(project) def remove_project_message(project)
return super unless project.adjourned_deletion? return super unless project.adjourned_deletion?
......
- if project_nav_tab? :feature_flags
= nav_link(controller: :feature_flags) do
= link_to project_feature_flags_path(@project), title: _('Feature Flags'), class: 'shortcuts-feature-flags' do
%span
= _('Feature Flags')
...@@ -14,11 +14,6 @@ RSpec.describe 'Project navbar' do ...@@ -14,11 +14,6 @@ RSpec.describe 'Project navbar' do
stub_feature_flags(project_iterations: false) stub_feature_flags(project_iterations: false)
insert_package_nav(_('Operations')) insert_package_nav(_('Operations'))
insert_after_sub_nav_item(
_('Environments'),
within: _('Operations'),
new_sub_nav_item_name: _('Feature Flags')
)
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
......
...@@ -18,14 +18,6 @@ RSpec.describe 'Project navbar' do ...@@ -18,14 +18,6 @@ RSpec.describe 'Project navbar' do
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
if Gitlab.ee?
insert_after_sub_nav_item(
_('Environments'),
within: _('Operations'),
new_sub_nav_item_name: _('Feature Flags')
)
end
end end
it_behaves_like 'verified navigation bar' do it_behaves_like 'verified navigation bar' do
......
...@@ -72,6 +72,7 @@ RSpec.shared_context 'project navbar structure' do ...@@ -72,6 +72,7 @@ RSpec.shared_context 'project navbar structure' do
_('Serverless'), _('Serverless'),
_('Kubernetes'), _('Kubernetes'),
_('Environments'), _('Environments'),
_('Feature Flags'),
_('Product Analytics') _('Product Analytics')
] ]
}, },
......
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