Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
nexedi
gitlab-ce
Commits
a5fd43b8
Commit
a5fd43b8
authored
4 years ago
by
Ryan Cobb
Committed by
Michael Kozono
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Backend changes to allow setting dashboard timezone
parent
3e69408e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
app/models/project_metrics_setting.rb
app/models/project_metrics_setting.rb
+4
-0
app/views/projects/settings/operations/_metrics_dashboard.html.haml
...projects/settings/operations/_metrics_dashboard.html.haml
+2
-2
spec/models/project_metrics_setting_spec.rb
spec/models/project_metrics_setting_spec.rb
+8
-0
No files found.
app/models/project_metrics_setting.rb
View file @
a5fd43b8
...
...
@@ -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
This diff is collapsed.
Click to expand it.
app/views/projects/settings/operations/_metrics_dashboard.html.haml
View file @
a5fd43b8
.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
}
}
}
This diff is collapsed.
Click to expand it.
spec/models/project_metrics_setting_spec.rb
View file @
a5fd43b8
...
...
@@ -52,4 +52,12 @@
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
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment