Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Updated leaderboard data table to use new API endpoint. #1319

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 0 additions & 119 deletions src/components/AdvanceAnalyticsV2/DownloadCSV.jsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/AdvanceAnalyticsV2/data/hooks.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ const mockAnalyticsCompletionsChartsData = {
const mockAnalyticsLeaderboardTableData = [
{
email: 'user@example.com',
dailySessions: 243,
sessionCount: 243,
learningTimeSeconds: 1111,
learningTimeHours: 3.4,
averageSessionLength: 1.6,
courseCompletions: 4,
courseCompletionCount: 4,
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/components/AdvanceAnalyticsV2/tabs/AnalyticsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const AnalyticsTable = ({
}) => {
const intl = useIntl();
const [currentPage, setCurrentPage] = useState(0);
const pageSize = 50;
const pageSize = 20;

const {
isFetching, data,
Expand Down
4 changes: 2 additions & 2 deletions src/components/AdvanceAnalyticsV2/tabs/Leaderboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Leaderboard = ({ startDate, endDate, enterpriseId }) => {
description: 'Label for the daily sessions column in the leaderboard table',

}),
accessor: 'dailySessions',
accessor: 'sessionCount',
},
{
Header: intl.formatMessage({
Expand All @@ -67,7 +67,7 @@ const Leaderboard = ({ startDate, endDate, enterpriseId }) => {
defaultMessage: 'Course Completions',
description: 'Label for the course completions column in the leaderboard table',
}),
accessor: 'courseCompletions',
accessor: 'courseCompletionCount',
},
]}
/>
Expand Down
16 changes: 8 additions & 8 deletions src/components/AdvanceAnalyticsV2/tabs/Leaderboard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ const mockLeaderboardData = {
results: [
{
email: 'user100@example.com',
daily_sessions: 74,
session_count: 74,
learning_time_hours: 13.1,
average_session_length: 1.8,
course_completions: 3,
course_completion_count: 3,
},
{
email: 'user200@example.com',
daily_sessions: 48,
session_count: 48,
learning_time_hours: 131.9,
average_session_length: 2.7,
course_completions: 1,
course_completion_count: 1,
},
{
email: 'user300@example.com',
daily_sessions: 92,
session_count: 92,
learning_time_hours: 130,
average_session_length: 1.4,
course_completions: 3,
course_completion_count: 3,
},
],
};
Expand Down Expand Up @@ -134,9 +134,9 @@ describe('Leaderboard Component', () => {
const rowCells = within(rows[index + 1]).getAllByRole('cell'); // Skip header row
expect(rowCells[0]).toHaveTextContent(user.email);
expect(rowCells[1]).toHaveTextContent(user.learning_time_hours);
expect(rowCells[2]).toHaveTextContent(user.daily_sessions);
expect(rowCells[2]).toHaveTextContent(user.session_count);
expect(rowCells[3]).toHaveTextContent(user.average_session_length);
expect(rowCells[4]).toHaveTextContent(user.course_completions);
expect(rowCells[4]).toHaveTextContent(user.course_completion_count);
});
});
});
Expand Down
89 changes: 0 additions & 89 deletions src/components/AdvanceAnalyticsV2/tests/DownloadCSV.test.jsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/data/services/tests/EnterpriseDataApiService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ const mockAnalyticsSkillsData = {
const mockAnalyticsLeaderboardTableData = [
{
email: 'user@example.com',
dailySessions: 243,
sessionCount: 243,
learningTimeSeconds: 1111,
learningTimeHours: 3.4,
averageSessionLength: 1.6,
courseCompletions: 4,
courseCompletionCount: 4,
},
];

Expand Down