Commit a5fd43b8 authored by Ryan Cobb's avatar Ryan Cobb Committed by Michael Kozono

Backend changes to allow setting dashboard timezone

parent 3e69408e
......@@ -9,4 +9,8 @@ class ProjectMetricsSetting < ApplicationRecord
addressable_url: { enforce_sanitization: true, ascii_only: true }
enum dashboard_timezone: { local: 0, utc: 1 }
def dashboard_timezone=(val)
super(val&.downcase)
end
end
.js-operation-settings{ data: { operations_settings_endpoint: project_settings_operations_path(@project),
help_page: help_page_path('user/project/integrations/prometheus'),
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
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
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