Commit 4fc5e7b5 authored by Tristan Read's avatar Tristan Read Committed by Clement Ho

Remove alert_management_minimal feature flag

parent 99d21e45
# frozen_string_literal: true # frozen_string_literal: true
class Projects::AlertManagementController < Projects::ApplicationController class Projects::AlertManagementController < Projects::ApplicationController
before_action :ensure_list_feature_enabled, only: :index
before_action :ensure_detail_feature_enabled, only: :details before_action :ensure_detail_feature_enabled, only: :details
before_action :authorize_read_alert_management_alert! before_action :authorize_read_alert_management_alert!
before_action do before_action do
...@@ -18,10 +17,6 @@ class Projects::AlertManagementController < Projects::ApplicationController ...@@ -18,10 +17,6 @@ class Projects::AlertManagementController < Projects::ApplicationController
private private
def ensure_list_feature_enabled
render_404 unless Feature.enabled?(:alert_management_minimal, project)
end
def ensure_detail_feature_enabled def ensure_detail_feature_enabled
render_404 unless Feature.enabled?(:alert_management_detail, project) render_404 unless Feature.enabled?(:alert_management_detail, project)
end end
......
...@@ -222,12 +222,11 @@ ...@@ -222,12 +222,11 @@
%span %span
= _('Metrics') = _('Metrics')
- if Feature.enabled?(:alert_management_minimal, @project) - if project_nav_tab?(:alert_management)
- if project_nav_tab?(:alert_management) = nav_link(controller: :alert_management) do
= nav_link(controller: :alert_management) do = link_to project_alert_management_index_path(@project), title: _('Alerts'), class: 'shortcuts-tracking qa-operations-tracking-link' do
= link_to project_alert_management_index_path(@project), title: _('Alerts'), class: 'shortcuts-tracking qa-operations-tracking-link' do %span
%span = _('Alerts')
= _('Alerts')
- if project_nav_tab? :environments - if project_nav_tab? :environments
= render_if_exists "layouts/nav/sidebar/tracing_link" = render_if_exists "layouts/nav/sidebar/tracing_link"
......
---
title: Enable Alert Management functionality
merge_request: 31171
author:
type: added
...@@ -14,32 +14,14 @@ describe Projects::AlertManagementController do ...@@ -14,32 +14,14 @@ describe Projects::AlertManagementController do
end end
describe 'GET #index' do describe 'GET #index' do
context 'when alert_management_minimal is enabled' do it 'shows the page' do
before do get :index, params: { namespace_id: project.namespace, project_id: project }
stub_feature_flags(alert_management_minimal: true)
end
it 'shows the page' do
get :index, params: { namespace_id: project.namespace, project_id: project }
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end
context 'when user is unauthorized' do
let(:role) { :reporter }
it 'shows 404' do
get :index, params: { namespace_id: project.namespace, project_id: project }
expect(response).to have_gitlab_http_status(:not_found)
end
end
end end
context 'when alert_management_minimal is disabled' do context 'when user is unauthorized' do
before do let(:role) { :reporter }
stub_feature_flags(alert_management_minimal: false)
end
it 'shows 404' do it 'shows 404' do
get :index, params: { namespace_id: project.namespace, project_id: project } get :index, params: { namespace_id: project.namespace, project_id: project }
......
...@@ -163,28 +163,10 @@ describe 'layouts/nav/sidebar/_project' do ...@@ -163,28 +163,10 @@ describe 'layouts/nav/sidebar/_project' do
end end
describe 'Alert Management' do describe 'Alert Management' do
context 'when alert_management_minimal is enabled' do it 'shows the Alerts sidebar entry' do
before do render
stub_feature_flags(alert_management_minimal: true)
end
it 'shows the Alerts sidebar entry' do
render
expect(rendered).to have_css('a[title="Alerts"]')
end
end
context 'when alert_management_minimal is disabled' do
before do
stub_feature_flags(alert_management_minimal: false)
end
it 'does not show the Alerts sidebar entry' do
render
expect(rendered).to have_no_css('a[title="Alerts"]') expect(rendered).to have_css('a[title="Alerts"]')
end
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