Skip to content

feat: add user activity report page - #878

Merged
LordofAvernus merged 8 commits into
mainfrom
dms-ui/feat-user-activity
Aug 13, 2026
Merged

feat: add user activity report page#878
LordofAvernus merged 8 commits into
mainfrom
dms-ui/feat-user-activity

Conversation

@LordofAvernus

Copy link
Copy Markdown
Collaborator

Summary

用户活跃度报表前端页面,与后端 actiontech/dms#664(CE 契约)、actiontech/dms-ee#960(EE 实现)配套。

  • packages/base/src/page/UserActivity/:报表页面,含概览卡片、日趋势、模块分布、时段分布四张图与用户排行表;默认查询当天,图表面板高度受约束,不会随数据量把页面撑开。
  • 路由、菜单入口、权限与 locale 接线:router.base.tsxQuickActionspermissions.ts / permissionManifest.ts、中英文文案。
  • packages/shared/lib/api/base/service/UserActivity/:接口客户端与类型定义;配套 mock 数据供测试使用。

页面与菜单入口都用 // #if [ee] 做了构建期门禁,社区版构建里不会出现入口,也不会打进路由。

Problem

该页面此前只存在于 CSVW 定制分支(dms-ui-eecsvw-4.2505.x),未进入主干。按前端 CE/EE 规范,含条件编译的共用源文件仍走 CE 仓库交付,合入 main 后经 Sync 进入 dms-ui-eemain-ee,因此不再单独提 dms-ui-ee 功能 PR。

Test plan

  • pnpm checker(ts-check / eslint / stylelint / prettier)全部通过
  • sh ./scripts/jest/run-ci.sh <shard> 4 四个分片全部通过,快照无漂移
  • 页面测试固定了系统时间,避免默认查询当天导致快照随日期漂移
  • 完整链路已在本地部署环境验证:真实操作产生访问记录后,页面各图表与排行表数据与流量一致

Add EE-only user activity dashboard with KPI cards, trend charts, module and
hourly distribution, user ranking table, API client, routes, and QuickActions entry.
Default stat date to today, pad chart axes, fill 24-hour slots, and show
uid fallback in user ranking when name is missing.
Restrict page to global admins, improve chart layout and 24-hour axis,
hide pagination when ranking fits on a single page.
Align the table label with backend logic that excludes session and
bootstrap modules when picking each user's primary module.
Import ResponseCode, table helpers and utils from @actiontech/dms-kit after
they moved out of @actiontech/shared, update QuickActions assertions for the
added shortcut, and pin the system time in the page test so the default
"today" stat date no longer drifts the snapshot.
The new quick action shortcut renders in both CE and EE side menus, so the
affected snapshots gain the entry markup.
The report route already lives inside an ee conditional block, so without the
same guard the CE build renders a shortcut that navigates to a missing route.
@github-actions

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 80.91% 30104/37207
🟡 Branches 63.14% 11338/17956
🟢 Functions 84.33% 10133/12016
🟢 Lines 84.81% 28769/33922

Test suite run success

3750 tests passing in 821 suites.

Report generated by 🧪jest coverage report action from 32d13bf

@LordofAvernus
LordofAvernus merged commit c69670b into main Aug 13, 2026
8 checks passed
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