Skip to content

fix: add deleted user status filter - #5464

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
seefs001:feature/user-list-deleted
Jun 12, 2026
Merged

fix: add deleted user status filter#5464
seefs001 merged 1 commit into
QuantumNous:mainfrom
seefs001:feature/user-list-deleted

Conversation

@seefs001

@seefs001 seefs001 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

用户列表增加已注销过滤条件

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

  • New Features
    • Added "Deleted" as a filterable status option in the users management interface, allowing administrators to view and manage deleted user records separately.
    • Enhanced status filters to support the new deletion status with appropriate visual indicators.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR extends the user management system to support a new "Deleted" status. A -1 status value is introduced to represent soft-deleted users, enabling the query layer to filter and display deleted records separately from active users with distinct status values.

Changes

Deleted User Status Support

Layer / File(s) Summary
Status constant and mapping definitions
web/default/src/features/users/constants.ts
USER_STATUS adds DELETED: -1. USER_STATUSES and getUserStatusOptions extend to include a "Deleted" entry using the new constant and danger styling.
Query validation and database filtering
web/default/src/routes/_authenticated/users/index.tsx, model/user.go
Zod schema accepts '-1' as a valid status value. SearchUsers branches: when status is -1, filters for soft-deleted rows; otherwise filters for non-deleted rows and applies the status filter.
Frontend table and status badge rendering
web/default/src/features/users/components/users-columns.tsx, web/default/src/features/users/components/users-table.tsx
Import USER_STATUS constant. Enable manualFiltering: true in table config. Update status badge to use USER_STATUSES[USER_STATUS.DELETED] for deleted users.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A -1 status hops into view,
Deleted users now sorted anew,
Constants defined, queries refined,
The table displays what was "gone" before—
Soft-deleted users shine once more!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a filter for deleted user status to the user list interface.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seefs001
seefs001 merged commit 1507229 into QuantumNous:main Jun 12, 2026
1 of 2 checks passed
jjcc123312 added a commit to SolveaCX/new-api that referenced this pull request Jun 17, 2026
sync: cherry-pick low-risk upstream fixes (kimi temp QuantumNous#5390, deleted-user filter QuantumNous#5464)
ruanhangjian pushed a commit to ruanhangjian/new-api that referenced this pull request Jul 11, 2026
noah-wung pushed a commit to noah-wung/new-api that referenced this pull request Jul 17, 2026
zhaodechao2008 pushed a commit to zhaodechao2008/new-api that referenced this pull request Jul 27, 2026
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
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