diff options
Diffstat (limited to 'lib/sidebars/projects/menus/monitor_menu.rb')
-rw-r--r-- | lib/sidebars/projects/menus/monitor_menu.rb | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/sidebars/projects/menus/monitor_menu.rb b/lib/sidebars/projects/menus/monitor_menu.rb index 7d1fa8b8fa7..f1fc9f70ef8 100644 --- a/lib/sidebars/projects/menus/monitor_menu.rb +++ b/lib/sidebars/projects/menus/monitor_menu.rb @@ -12,7 +12,6 @@ module Sidebars add_item(error_tracking_menu_item) add_item(alert_management_menu_item) add_item(incidents_menu_item) - add_item(airflow_dashboard_menu_item) true end @@ -39,6 +38,11 @@ module Sidebars { controller: [:user, :gcp] } end + override :serialize_as_menu_item_args + def serialize_as_menu_item_args + nil + end + private def feature_enabled? @@ -46,6 +50,8 @@ module Sidebars end def metrics_dashboard_menu_item + return ::Sidebars::NilMenuItem.new(item_id: :metrics) if Feature.enabled?(:remove_monitor_metrics) + unless can?(context.current_user, :metrics_dashboard, context.project) return ::Sidebars::NilMenuItem.new(item_id: :metrics) end @@ -53,6 +59,7 @@ module Sidebars ::Sidebars::MenuItem.new( title: _('Metrics'), link: project_metrics_dashboard_path(context.project), + super_sidebar_parent: ::Sidebars::Projects::SuperSidebarMenus::MonitorMenu, active_routes: { path: 'metrics_dashboard#show' }, container_html_options: { class: 'shortcuts-metrics' }, item_id: :metrics @@ -67,6 +74,7 @@ module Sidebars ::Sidebars::MenuItem.new( title: _('Error Tracking'), link: project_error_tracking_index_path(context.project), + super_sidebar_parent: ::Sidebars::Projects::SuperSidebarMenus::MonitorMenu, active_routes: { controller: :error_tracking }, item_id: :error_tracking ) @@ -80,6 +88,7 @@ module Sidebars ::Sidebars::MenuItem.new( title: _('Alerts'), link: project_alert_management_index_path(context.project), + super_sidebar_parent: ::Sidebars::Projects::SuperSidebarMenus::MonitorMenu, active_routes: { controller: :alert_management }, item_id: :alert_management ) @@ -93,24 +102,11 @@ module Sidebars ::Sidebars::MenuItem.new( title: _('Incidents'), link: project_incidents_path(context.project), + super_sidebar_parent: ::Sidebars::Projects::SuperSidebarMenus::MonitorMenu, active_routes: { controller: [:incidents, :incident_management] }, item_id: :incidents ) end - - def airflow_dashboard_menu_item - unless can?(context.current_user, :read_airflow_dags, context.project) && - Feature.enabled?(:airflow_dags, context.project) - return ::Sidebars::NilMenuItem.new(item_id: :airflow) - end - - ::Sidebars::MenuItem.new( - title: _('Airflow'), - link: project_airflow_dags_path(context.project), - active_routes: { path: 'airflow/dags#show' }, - item_id: :airflow_dags - ) - end end end end |