diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/environments_helper.rb | 3 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 4 | ||||
-rw-r--r-- | app/models/project.rb | 1 | ||||
-rw-r--r-- | app/views/projects/settings/operations/_external_dashboard.html.haml | 2 |
4 files changed, 8 insertions, 2 deletions
diff --git a/app/helpers/environments_helper.rb b/app/helpers/environments_helper.rb index 365b94f5a3e..8002eb08ada 100644 --- a/app/helpers/environments_helper.rb +++ b/app/helpers/environments_helper.rb @@ -30,7 +30,8 @@ module EnvironmentsHelper "environments-endpoint": project_environments_path(project, format: :json), "project-path" => project_path(project), "tags-path" => project_tags_path(project), - "has-metrics" => "#{environment.has_metrics?}" + "has-metrics" => "#{environment.has_metrics?}", + "external-dashboard-url" => project.metrics_setting_external_dashboard_url } end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 4cf1d6e93a5..e587cf4045d 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -343,6 +343,10 @@ module ProjectsHelper description.html_safe % { project_name: project.name } end + def metrics_external_dashboard_url + @project.metrics_setting_external_dashboard_url + end + private def get_project_nav_tabs(project, current_user) diff --git a/app/models/project.rb b/app/models/project.rb index ab4da61dcf8..20895923d3b 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -309,6 +309,7 @@ class Project < ApplicationRecord delegate :group_clusters_enabled?, to: :group, allow_nil: true delegate :root_ancestor, to: :namespace, allow_nil: true delegate :last_pipeline, to: :commit, allow_nil: true + delegate :external_dashboard_url, to: :metrics_setting, allow_nil: true, prefix: true # Validations validates :creator, presence: true, on: :create diff --git a/app/views/projects/settings/operations/_external_dashboard.html.haml b/app/views/projects/settings/operations/_external_dashboard.html.haml index 2fbb9195a04..f049c35b38d 100644 --- a/app/views/projects/settings/operations/_external_dashboard.html.haml +++ b/app/views/projects/settings/operations/_external_dashboard.html.haml @@ -1,2 +1,2 @@ -.js-operation-settings{ data: { external_dashboard: { path: '', +.js-operation-settings{ data: { external_dashboard: { path: metrics_external_dashboard_url, help_page_path: help_page_path('user/project/operations/link_to_external_dashboard') } } } |