Skip to content

Metrics dashboard fetches UTC configuration from HTML to display it

Miguel Rincon requested to merge 214370-add-timezone-dashboard-store into master

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

Availability and Testing

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 🤖

Merge request reports

Loading