Commit 76f3cf3b authored by Michael Kozono's avatar Michael Kozono

Merge branch 'rc/dashboard_timezone_setting_integrations' into 'master'

Backend changes to allow setting dashboard timezone

See merge request gitlab-org/gitlab!34316
parents 4710c3c9 a5fd43b8
...@@ -9,4 +9,8 @@ class ProjectMetricsSetting < ApplicationRecord ...@@ -9,4 +9,8 @@ class ProjectMetricsSetting < ApplicationRecord
addressable_url: { enforce_sanitization: true, ascii_only: true } addressable_url: { enforce_sanitization: true, ascii_only: true }
enum dashboard_timezone: { local: 0, utc: 1 } enum dashboard_timezone: { local: 0, utc: 1 }
def dashboard_timezone=(val)
super(val&.downcase)
end
end end
.js-operation-settings{ data: { operations_settings_endpoint: project_settings_operations_path(@project), .js-operation-settings{ data: { operations_settings_endpoint: project_settings_operations_path(@project),
help_page: help_page_path('user/project/integrations/prometheus'), help_page: help_page_path('user/project/integrations/prometheus'),
external_dashboard: { url: metrics_external_dashboard_url, external_dashboard: { url: metrics_external_dashboard_url,
help_page: help_page_path('user/project/operations/linking_to_an_external_dashboard'), help_page: help_page_path('user/project/operations/linking_to_an_external_dashboard') },
} } } dashboard_timezone: { setting: metrics_dashboard_timezone.upcase } } }
...@@ -52,4 +52,12 @@ describe ProjectMetricsSetting do ...@@ -52,4 +52,12 @@ describe ProjectMetricsSetting do
end end
end end
end end
describe '#dashboard_timezone=' do
it 'downcases string' do
subject.dashboard_timezone = 'UTC'
expect(subject.dashboard_timezone).to eq('utc')
end
end
end end
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