Commit 0269c9cd authored by James Fargher's avatar James Fargher

Merge branch 'tr-alert-mgmt-detail-minimal' into 'master'

Skeleton route and view for alert management details page

See merge request gitlab-org/gitlab!30020
parents 349bcc1c 4d753e0f
......@@ -6,6 +6,9 @@ class Projects::AlertManagementController < Projects::ApplicationController
def index
end
def details
end
private
def ensure_feature_enabled
......
......@@ -277,7 +277,9 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
resources :alert_management, only: [:index], controller: :alert_management
resources :alert_management, only: [:index] do
get 'details', on: :member
end
namespace :error_tracking do
resources :projects, only: :index
......
......@@ -1689,6 +1689,9 @@ msgid_plural "Alerts"
msgstr[0] ""
msgstr[1] ""
msgid "Alert Details"
msgstr ""
msgid "AlertManagement|Alert"
msgstr ""
......
......@@ -6,6 +6,7 @@ describe Projects::AlertManagementController do
let_it_be(:project) { create(:project) }
let_it_be(:role) { :reporter }
let_it_be(:user) { create(:user) }
let_it_be(:id) { 1 }
before do
project.add_role(user, role)
......@@ -37,4 +38,30 @@ describe Projects::AlertManagementController do
end
end
end
describe 'GET #details' do
context 'when alert_management_minimal is enabled' do
before do
stub_feature_flags(alert_management_minimal: 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
end
context 'when alert_management_minimal is disabled' do
before do
stub_feature_flags(alert_management_minimal: false)
end
it 'shows 404' do
get :details, params: { namespace_id: project.namespace, project_id: project, id: id }
expect(response).to have_gitlab_http_status(:not_found)
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