From 5235e2556ef8bd0b8edef5e3e6b97c79d5fa972c Mon Sep 17 00:00:00 2001 From: Saleem Latif Date: Tue, 10 Sep 2024 17:39:44 +0500 Subject: [PATCH] feat: Moved enrollments charts to new API endpoint. --- .../AdvanceAnalyticsV2/AnalyticsV2Page.jsx | 17 +- .../AdvanceAnalyticsV2/DownloadCSVButton.jsx | 101 +++++++++ .../DownloadCSVButton.test.jsx | 68 ++++++ src/components/AdvanceAnalyticsV2/Header.jsx | 28 +-- .../charts/ChartWrapper.jsx | 2 +- .../AdvanceAnalyticsV2/data/constants.js | 16 +- .../data/{hooks.js => hooks/index.js} | 9 +- .../hooks/useEnterpriseEnrollmentsData.js | 91 ++++++++ .../AdvanceAnalyticsV2/data/utils.js | 128 ++++++++++- .../AdvanceAnalyticsV2/data/utils.test.js | 203 ++++++++++++++++++ .../tabs/AnalyticsTable.jsx | 41 ++-- .../AdvanceAnalyticsV2/tabs/Completions.jsx | 58 ++--- .../tabs/Completions.test.jsx | 49 +++-- .../AdvanceAnalyticsV2/tabs/Engagements.jsx | 52 +++-- .../tabs/Engagements.test.jsx | 49 +++-- .../AdvanceAnalyticsV2/tabs/Enrollments.jsx | 99 ++++++--- .../tabs/Enrollments.test.jsx | 49 +++-- .../tabs/Leaderboard.test.jsx | 41 ++-- .../AdvanceAnalyticsV2/tabs/Skills.jsx | 16 +- .../tests/AnalyticsV2Page.test.jsx | 17 +- src/data/services/EnterpriseDataApiService.js | 12 ++ 21 files changed, 923 insertions(+), 223 deletions(-) create mode 100644 src/components/AdvanceAnalyticsV2/DownloadCSVButton.jsx create mode 100644 src/components/AdvanceAnalyticsV2/DownloadCSVButton.test.jsx rename src/components/AdvanceAnalyticsV2/data/{hooks.js => hooks/index.js} (87%) create mode 100644 src/components/AdvanceAnalyticsV2/data/hooks/useEnterpriseEnrollmentsData.js create mode 100644 src/components/AdvanceAnalyticsV2/data/utils.test.js diff --git a/src/components/AdvanceAnalyticsV2/AnalyticsV2Page.jsx b/src/components/AdvanceAnalyticsV2/AnalyticsV2Page.jsx index 4348b020c1..8ff1df8bd0 100644 --- a/src/components/AdvanceAnalyticsV2/AnalyticsV2Page.jsx +++ b/src/components/AdvanceAnalyticsV2/AnalyticsV2Page.jsx @@ -14,6 +14,7 @@ import Completions from './tabs/Completions'; import Leaderboard from './tabs/Leaderboard'; import Skills from './tabs/Skills'; import { useEnterpriseAnalyticsAggregatesData } from './data/hooks'; +import { GRANULARITY, CALCULATION } from './data/constants'; const PAGE_TITLE = 'AnalyticsV2'; @@ -96,28 +97,28 @@ const AnalyticsV2Page = ({ enterpriseId }) => { value={granularity} onChange={(e) => setGranularity(e.target.value)} > - - - - - - -