Skip to content

Remove the default date range limit from analytics dashboards

What does this MR do and why?

This MR removes the default date range limit of 31 days from the analytics customizable dashboards. Instead, it makes the limit a configurable option that defaults to no limit.

Screenshots or screen recordings

Before After with no date range After with date range
Screen_Recording_2023-03-10_at_09.15.09 Screen_Recording_2023-03-10_at_09.07.38 Screen_Recording_2023-03-10_at_09.08.52

How to set up and validate locally

You will need to follow the instructions at https://gitlab.com/gitlab-org/gitlab/-/snippets/2474959 to enable Product Analytics on your GDK

  1. Visit a dashboard on a project e.g.http://gdk.test:3000/gitlab-org/gitlab-test/-/analytics/dashboards/dashboard_audience
  2. Check that you can select the different predefined date ranges
  3. Check that you can select a custom date range, and that the dates are not limited, and that there isn't a tooltip.
  4. Apply the below patch and select a custom date range, check that the dates are limited to that range, and that there is a tooltip:
Index: ee/app/assets/javascripts/analytics/analytics_dashboards/components/analytics_dashboard.vue
<+>UTF-8
===================================================================
diff --git a/ee/app/assets/javascripts/analytics/analytics_dashboards/components/analytics_dashboard.vue b/ee/app/assets/javascripts/analytics/analytics_dashboards/components/analytics_dashboard.vue
--- a/ee/app/assets/javascripts/analytics/analytics_dashboards/components/analytics_dashboard.vue	(revision Staged)
+++ b/ee/app/assets/javascripts/analytics/analytics_dashboards/components/analytics_dashboard.vue	(date 1678436098312)
@@ -122,7 +122,7 @@
         :get-visualization="importVisualization"
         :available-visualizations="availableVisualizations"
         :default-filters="defaultFilters"
-        :date-range-limit="0"
+        :date-range-limit="31"
         show-date-range-filter
         sync-url-filters
       />

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #392467 (closed)

Edited by Robert Hunt

Merge request reports

Loading