Skip to content

feat(admin): add statistics#40

Merged
CoderOJ merged 3 commits into
mainfrom
statistics
May 25, 2025
Merged

feat(admin): add statistics#40
CoderOJ merged 3 commits into
mainfrom
statistics

Conversation

@Early0v0
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 25, 2025 14:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds per-user practice statistics to the admin user management table by fetching both users and their assigned spares, computing total practice time, absences, and late/early leaves, and rendering these new metrics in a “Statistics” column.

  • Compute sum_time, absence_count, and late_count for each user from the spares data
  • Updated ResourceLoader to load both users and spares in one call
  • Added new column in UserListManage to display computed statistics

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/pages/Home.tsx Changed week format token from "RRRR-'W'ww" to "RRRR-'W'II"
src/pages/Admin.tsx Fetched spares alongside users, computed statistics, and added a stats column
api Bumped submodule commit reference
Comments suppressed due to low confidence (3)

src/pages/Admin.tsx:45

  • Property names sum_time, absence_count, and late_count use snake_case; align with the project's camelCase style (e.g. sumTime, absenceCount, lateCount).
statistics: {

src/pages/Admin.tsx:60

  • This new statistics computation logic isn’t covered by tests. Add unit tests for cases with on-time, late, and absent spares to prevent regressions.
statistics: (spares => {

src/pages/Home.tsx:147

  • Verify that the "II" token produces the intended week number (ISO week) per date-fns; if the goal was local week-of-year, you may need to revert to "ww".
content: format(week(), "RRRR-'W'II"),

Comment thread src/pages/Admin.tsx
Comment thread src/pages/Admin.tsx
Comment thread src/pages/Admin.tsx
@Early0v0 Early0v0 requested a review from CoderOJ May 25, 2025 14:14
@sonarqubecloud
Copy link
Copy Markdown

@CoderOJ CoderOJ merged commit 487d16a into main May 25, 2025
2 checks passed
@CoderOJ CoderOJ deleted the statistics branch May 25, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants