Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/metrics/dashboard/stages/custom_metrics_details_inserter.rb')
-rw-r--r--lib/gitlab/metrics/dashboard/stages/custom_metrics_details_inserter.rb40
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/gitlab/metrics/dashboard/stages/custom_metrics_details_inserter.rb b/lib/gitlab/metrics/dashboard/stages/custom_metrics_details_inserter.rb
deleted file mode 100644
index 06cfa5cc58e..00000000000
--- a/lib/gitlab/metrics/dashboard/stages/custom_metrics_details_inserter.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module Metrics
- module Dashboard
- module Stages
- class CustomMetricsDetailsInserter < BaseStage
- def transform!
- dashboard[:panel_groups].each do |panel_group|
- next unless panel_group
-
- has_custom_metrics = custom_group_titles.include?(panel_group[:group])
- panel_group[:has_custom_metrics] = has_custom_metrics
-
- panel_group[:panels].each do |panel|
- next unless panel
-
- panel[:metrics].each do |metric|
- next unless metric
-
- metric[:edit_path] = has_custom_metrics ? edit_path(metric) : nil
- end
- end
- end
- end
-
- private
-
- def custom_group_titles
- @custom_group_titles ||= Enums::PrometheusMetric.custom_group_details.values.map { |group_details| group_details[:group_title] }
- end
-
- def edit_path(metric)
- Gitlab::Routing.url_helpers.edit_project_prometheus_metric_path(project, metric[:metric_id])
- end
- end
- end
- end
- end
-end