Commit 3e4aaaac authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'rc/integrate_dashboard_timezone' into 'master'

Rc/integrate dashboard timezone

See merge request gitlab-org/gitlab!33660
parents 0dcc35a9 35980e13
......@@ -60,7 +60,8 @@ module EnvironmentsHelper
'custom-metrics-path' => project_prometheus_metrics_path(project),
'validate-query-path' => validate_query_project_prometheus_metrics_path(project),
'custom-metrics-available' => "#{custom_metrics_available?(project)}",
'prometheus-alerts-available' => "#{can?(current_user, :read_prometheus_alerts, project)}"
'prometheus-alerts-available' => "#{can?(current_user, :read_prometheus_alerts, project)}",
'dashboard-timezone' => project.metrics_setting_dashboard_timezone.to_s.upcase
}
end
......
......@@ -2410,6 +2410,10 @@ class Project < ApplicationRecord
touch(:last_activity_at, :last_repository_updated_at)
end
def metrics_setting
super || build_metrics_setting
end
private
def find_service(services, name)
......
......@@ -6064,6 +6064,14 @@ describe Project do
it { is_expected.not_to include(user) }
end
describe "#metrics_setting" do
let(:project) { build(:project) }
it 'creates setting if it does not exist' do
expect(project.metrics_setting).to be_an_instance_of(ProjectMetricsSetting)
end
end
def finish_job(export_job)
export_job.start
export_job.finish
......
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