Skip to content

Refine admin navigation and user group list#9

Merged
coding-hui merged 3 commits into
mainfrom
dev/admin-exam-user-iteration
May 16, 2026
Merged

Refine admin navigation and user group list#9
coding-hui merged 3 commits into
mainfrom
dev/admin-exam-user-iteration

Conversation

@coding-hui
Copy link
Copy Markdown
Owner

Summary

  • Simplify the admin side navigation into dashboard, library, exam, and system sections.
  • Move submissions, judge tasks, and events under the exam area with legacy redirects preserved.
  • Align the user group list table with the rest of the admin pages and update related menu/i18n text.

Validation

@coding-hui coding-hui merged commit 3e697fe into main May 16, 2026
2 checks passed
@coding-hui coding-hui deleted the dev/admin-exam-user-iteration branch May 16, 2026 14:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48c4c92b3c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +363 to +367
for _, userID := range uniqueIDs(userIDs) {
session, ok := sessionByUser[userID]
if ok {
if err := s.store.DeleteExamSession(ctx, session.ID); err != nil {
return err
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve sessions still covered by other assignments

When removing a single assignment, this loop deletes every matching exam_sessions row without checking whether the same user is still assigned through another direct assignment or another user group. In that case, removing one assignment silently revokes access for users who should remain eligible, because their pre-created session is removed even though another assignment still exists for the same exam.

Useful? React with 👍 / 👎.

Comment on lines +36 to +39
if err := tx.Where("user_group_id = ?", id).Delete(&database.UserGroupMemberModel{}).Error; err != nil {
return err
}
return tx.Delete(&database.UserGroupModel{}, id).Error
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Delete group-linked exam assignments with user group cleanup

Deleting a user group only removes memberships and the group row, but leaves exam_assignments entries that target that group. Because those rows keep referencing a now-missing group, later assignment operations can break (for example, removing that assignment resolves target users via ListUserGroupStudentIDs and will fail with user-group-not-found), leaving dangling assignment data in production.

Useful? React with 👍 / 👎.

Comment thread internal/api/users.go
Comment on lines +64 to +67
if roleFilter != "" || hasExcludeGroup {
queryPage = 1
querySize = 10000
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid truncating filtered user lists at 10,000 rows

For role or exclude_user_group_id filters, the handler forces a single fetch capped at 10,000 users and then applies filtering/pagination in memory. Any matching users beyond that cap are never returned and total becomes incorrect, so admins in larger deployments cannot page to or assign users outside the first 10,000 records.

Useful? React with 👍 / 👎.

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.

1 participant