Commit 10d2b76d authored by Tristan Read's avatar Tristan Read Committed by Clement Ho

Remove alert_management_detail feature flag

parent a62bea15
# frozen_string_literal: true # frozen_string_literal: true
class Projects::AlertManagementController < Projects::ApplicationController class Projects::AlertManagementController < Projects::ApplicationController
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
push_frontend_feature_flag(:alert_list_status_filtering_enabled) push_frontend_feature_flag(:alert_list_status_filtering_enabled)
...@@ -14,10 +13,4 @@ class Projects::AlertManagementController < Projects::ApplicationController ...@@ -14,10 +13,4 @@ class Projects::AlertManagementController < Projects::ApplicationController
def details def details
@alert_id = params[:id] @alert_id = params[:id]
end end
private
def ensure_detail_feature_enabled
render_404 unless Feature.enabled?(:alert_management_detail, project)
end
end end
---
title: Add Alert Detail view
merge_request: 31877
author:
type: added
...@@ -32,35 +32,17 @@ describe Projects::AlertManagementController do ...@@ -32,35 +32,17 @@ describe Projects::AlertManagementController do
end end
describe 'GET #details' do describe 'GET #details' do
context 'when alert_management_detail is enabled' do it 'shows the page' do
before do get :details, params: { namespace_id: project.namespace, project_id: project, id: id }
stub_feature_flags(alert_management_detail: true)
end
it 'shows the page' do
get :details, params: { namespace_id: project.namespace, project_id: project, id: id }
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) expect(response).to have_gitlab_http_status(:ok)
end
end
end end
context 'when alert_management_detail is disabled' do context 'when user is unauthorized' do
before do let(:role) { :reporter }
stub_feature_flags(alert_management_detail: false)
end
it 'shows 404' do it 'shows 404' do
get :details, params: { namespace_id: project.namespace, project_id: project, id: id } get :index, params: { namespace_id: project.namespace, project_id: project }
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
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