feat(admin): add statistics#40
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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, andlate_countfor each user from the spares data - Updated
ResourceLoaderto load both users and spares in one call - Added new column in
UserListManageto 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, andlate_countuse 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"),
|
CoderOJ
approved these changes
May 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.