diff options
Diffstat (limited to 'app/helpers/projects')
-rw-r--r-- | app/helpers/projects/alert_management_helper.rb | 5 | ||||
-rw-r--r-- | app/helpers/projects/pipeline_helper.rb | 16 | ||||
-rw-r--r-- | app/helpers/projects/project_members_helper.rb | 6 | ||||
-rw-r--r-- | app/helpers/projects/security/configuration_helper.rb | 4 |
4 files changed, 26 insertions, 5 deletions
diff --git a/app/helpers/projects/alert_management_helper.rb b/app/helpers/projects/alert_management_helper.rb index e03f2ae78bf..f21538fd3fb 100644 --- a/app/helpers/projects/alert_management_helper.rb +++ b/app/helpers/projects/alert_management_helper.rb @@ -15,13 +15,14 @@ module Projects::AlertManagementHelper } end - def alert_management_detail_data(project, alert_id) + def alert_management_detail_data(current_user, project, alert_id) { 'alert-id' => alert_id, 'project-path' => project.full_path, 'project-id' => project.id, 'project-issues-path' => project_issues_path(project), - 'page' => 'OPERATIONS' + 'page' => 'OPERATIONS', + 'can-update' => can?(current_user, :update_alert_management_alert, project).to_s } end diff --git a/app/helpers/projects/pipeline_helper.rb b/app/helpers/projects/pipeline_helper.rb new file mode 100644 index 00000000000..185632a49b5 --- /dev/null +++ b/app/helpers/projects/pipeline_helper.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Projects + module PipelineHelper + def js_pipeline_tabs_data(project, pipeline) + { + can_generate_codequality_reports: pipeline.can_generate_codequality_reports?.to_json, + graphql_resource_etag: graphql_etag_pipeline_path(pipeline), + metrics_path: namespace_project_ci_prometheus_metrics_histograms_path(namespace_id: project.namespace, project_id: project, format: :json), + pipeline_project_path: project.full_path + } + end + end +end + +Projects::PipelineHelper.prepend_mod diff --git a/app/helpers/projects/project_members_helper.rb b/app/helpers/projects/project_members_helper.rb index 514737b1417..980c8ca6b80 100644 --- a/app/helpers/projects/project_members_helper.rb +++ b/app/helpers/projects/project_members_helper.rb @@ -18,8 +18,8 @@ module Projects::ProjectMembersHelper MemberSerializer.new.represent(members, { current_user: current_user, group: project.group, source: project }) end - def project_group_links_serialized(group_links) - GroupLink::ProjectGroupLinkSerializer.new.represent(group_links, { current_user: current_user }) + def project_group_links_serialized(project, group_links) + GroupLink::ProjectGroupLinkSerializer.new.represent(group_links, { current_user: current_user, source: project }) end def project_members_list_data(project, members, pagination = {}) @@ -32,7 +32,7 @@ module Projects::ProjectMembersHelper def project_group_links_list_data(project, group_links) { - members: project_group_links_serialized(group_links), + members: project_group_links_serialized(project, group_links), pagination: members_pagination_data(group_links), member_path: project_group_link_path(project, ':id') } diff --git a/app/helpers/projects/security/configuration_helper.rb b/app/helpers/projects/security/configuration_helper.rb index 8281b1f8522..efc77550c90 100644 --- a/app/helpers/projects/security/configuration_helper.rb +++ b/app/helpers/projects/security/configuration_helper.rb @@ -6,6 +6,10 @@ module Projects def security_upgrade_path "https://#{ApplicationHelper.promo_host}/pricing/" end + + def vulnerability_training_docs_path + help_page_path('user/application_security/vulnerabilities/index', anchor: 'enable-security-training-for-vulnerabilities') + end end end end |