Module: Projects::AlertManagementHelper

Defined in:
app/helpers/projects/alert_management_helper.rb

Instance Method Summary collapse

Instance Method Details

#alert_management_data(current_user, project) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/projects/alert_management_helper.rb', line 4

def alert_management_data(current_user, project)
  {
    'project-path' => project.full_path,
    'enable-alert-management-path' => project_settings_operations_path(project, anchor: 'js-alert-management-settings'),
    'alerts-help-url' => help_page_url('operations/incident_management/index.md'),
    'populating-alerts-help-url' => help_page_url('operations/incident_management/index.md', anchor: 'enable-alert-management'),
    'empty-alert-svg-path' => image_path('illustrations/alert-management-empty-state.svg'),
    'user-can-enable-alert-management' => can?(current_user, :admin_operations, project).to_s,
    'alert-management-enabled' => alert_management_enabled?(project).to_s
  }
end

#alert_management_detail_data(project, alert_id) ⇒ Object


16
17
18
19
20
21
22
23
# File 'app/helpers/projects/alert_management_helper.rb', line 16

def alert_management_detail_data(project, alert_id)
  {
    'alert-id' => alert_id,
    'project-path' => project.full_path,
    'project-id' => project.id,
    'project-issues-path' => project_issues_path(project)
  }
end