Use table data for trend line in AI impact dashboard

What does this MR do and why?

This code change simplifies how charts are generated and displayed in an AI analytics dashboard. Previously, the system made separate API calls to fetch chart data and then merged it with table data in a complex process. Now, the chart data is generated directly from the existing table data during the row-building process, eliminating the need for additional API calls and reducing code complexity. The change also moves a utility function to make it reusable across different parts of the codebase. The end result is the same visual output for users, but with cleaner, more efficient code that's easier to maintain. Test snapshots were updated to reflect minor formatting changes in date ranges, but the core functionality remains unchanged.

References

Screenshots or screen recordings

Before After
old current

How to set up and validate locally

  1. Ensure that you are using GitLab Ultimate
  2. Configure your GDK to use ClickHouse
  3. Enable this patch to enable the Duo AddOn
diff --git a/ee/app/models/ee/user.rb b/ee/app/models/ee/user.rb
index e7243a29cc49..5b818ad77df4 100644
--- a/ee/app/models/ee/user.rb
+++ b/ee/app/models/ee/user.rb
@@ -541,7 +541,7 @@ def assigned_to_duo_enterprise?(container)
         .for_duo_enterprise
         .active
         .by_namespace(namespace)
-        .assigned_to_user(self).exists?
+        .assigned_to_user(self).exists? || true
     end
 
     def assigned_to_duo_pro?(container)
  1. Navigate to the Analytics dashboard page for any group (ex. http://gdk.test:3000/groups/flightjs/-/analytics/dashboards)
  2. Select the AI impact analytics dashboard
  3. Verify that the table date ranges match the table date ranges

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #539008 (closed)

Edited by Alex Pennells

Merge request reports

Loading