Metrics dashboard fetches UTC configuration from HTML to display it
What does this MR do?
Metrics dashboard fetches UTC configuration from HTML to display it
When the dashboard is configured to use UTC, the dashboard time picker and the panels will use the dashboard timezone.
Integrate this change
The frontend expects the configuration to come from the backend in the HTML attributes, locally I could force this config, like this:
diff --git a/app/helpers/environments_helper.rb b/app/helpers/environments_helper.rb
index e7b561af3da..04dd33a08ac 100644
--- a/app/helpers/environments_helper.rb
+++ b/app/helpers/environments_helper.rb
@@ -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' => 'UTC'
}
end
Values are: LOCAL
and UTC
in uppercase.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #214370 (closed)
Edited by 🤖 GitLab Bot 🤖