Commit 6ba086fa authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'sy-rename-project-dashboard' into 'master'

Renames the ProjectDashboards to name the team uses CustomDashboards

See merge request gitlab-org/gitlab!27431
parents 57957ee8 82f2c6a0
...@@ -6,7 +6,7 @@ module Metrics ...@@ -6,7 +6,7 @@ module Metrics
module Dashboard module Dashboard
class CloneDashboardService < ::BaseService class CloneDashboardService < ::BaseService
ALLOWED_FILE_TYPE = '.yml' ALLOWED_FILE_TYPE = '.yml'
USER_DASHBOARDS_DIR = ::Metrics::Dashboard::ProjectDashboardService::DASHBOARD_ROOT USER_DASHBOARDS_DIR = ::Metrics::Dashboard::CustomDashboardService::DASHBOARD_ROOT
class << self class << self
def allowed_dashboard_templates def allowed_dashboard_templates
...@@ -52,7 +52,7 @@ module Metrics ...@@ -52,7 +52,7 @@ module Metrics
def dashboard_details def dashboard_details
{ {
path: new_dashboard_path, path: new_dashboard_path,
display_name: ::Metrics::Dashboard::ProjectDashboardService.name_for_path(new_dashboard_path), display_name: ::Metrics::Dashboard::CustomDashboardService.name_for_path(new_dashboard_path),
default: false, default: false,
system_dashboard: false system_dashboard: false
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Use Gitlab::Metrics::Dashboard::Finder to retrive dashboards. # Use Gitlab::Metrics::Dashboard::Finder to retrive dashboards.
module Metrics module Metrics
module Dashboard module Dashboard
class ProjectDashboardService < ::Metrics::Dashboard::BaseService class CustomDashboardService < ::Metrics::Dashboard::BaseService
DASHBOARD_ROOT = ".gitlab/dashboards" DASHBOARD_ROOT = ".gitlab/dashboards"
class << self class << self
......
...@@ -7,7 +7,7 @@ module Metrics ...@@ -7,7 +7,7 @@ module Metrics
include Stepable include Stepable
ALLOWED_FILE_TYPE = '.yml' ALLOWED_FILE_TYPE = '.yml'
USER_DASHBOARDS_DIR = ::Metrics::Dashboard::ProjectDashboardService::DASHBOARD_ROOT USER_DASHBOARDS_DIR = ::Metrics::Dashboard::CustomDashboardService::DASHBOARD_ROOT
steps :check_push_authorized, steps :check_push_authorized,
:check_branch_name, :check_branch_name,
...@@ -117,7 +117,7 @@ module Metrics ...@@ -117,7 +117,7 @@ module Metrics
def dashboard_details def dashboard_details
{ {
path: update_dashboard_path, path: update_dashboard_path,
display_name: ::Metrics::Dashboard::ProjectDashboardService.name_for_path(update_dashboard_path), display_name: ::Metrics::Dashboard::CustomDashboardService.name_for_path(update_dashboard_path),
default: false, default: false,
system_dashboard: false system_dashboard: false
} }
......
...@@ -78,7 +78,7 @@ module Gitlab ...@@ -78,7 +78,7 @@ module Gitlab
end end
def project_service def project_service
::Metrics::Dashboard::ProjectDashboardService ::Metrics::Dashboard::CustomDashboardService
end end
def self_monitoring_service def self_monitoring_service
......
...@@ -20,7 +20,7 @@ module Gitlab ...@@ -20,7 +20,7 @@ module Gitlab
::Metrics::Dashboard::SystemDashboardService, ::Metrics::Dashboard::SystemDashboardService,
::Metrics::Dashboard::PodDashboardService, ::Metrics::Dashboard::PodDashboardService,
::Metrics::Dashboard::SelfMonitoringDashboardService, ::Metrics::Dashboard::SelfMonitoringDashboardService,
::Metrics::Dashboard::ProjectDashboardService ::Metrics::Dashboard::CustomDashboardService
].freeze ].freeze
# Returns a class which inherits from the BaseService # Returns a class which inherits from the BaseService
......
...@@ -15,7 +15,7 @@ describe Gitlab::Metrics::Dashboard::ServiceSelector do ...@@ -15,7 +15,7 @@ describe Gitlab::Metrics::Dashboard::ServiceSelector do
context 'when just the dashboard path is provided' do context 'when just the dashboard path is provided' do
let(:arguments) { { dashboard_path: '.gitlab/dashboards/test.yml' } } let(:arguments) { { dashboard_path: '.gitlab/dashboards/test.yml' } }
it { is_expected.to be Metrics::Dashboard::ProjectDashboardService } it { is_expected.to be Metrics::Dashboard::CustomDashboardService }
context 'when the path is for the system dashboard' do context 'when the path is for the system dashboard' do
let(:arguments) { { dashboard_path: system_dashboard_path } } let(:arguments) { { dashboard_path: system_dashboard_path } }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Metrics::Dashboard::ProjectDashboardService, :use_clean_rails_memory_store_caching do describe Metrics::Dashboard::CustomDashboardService, :use_clean_rails_memory_store_caching do
include MetricsDashboardHelpers include MetricsDashboardHelpers
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment