Frun1na opened a new pull request, #6131:
URL: https://github.com/apache/rocketmq-dashboard/pull/6131
### Which Issue(s) This PR Fixes
- Fixes #6130
### Brief Description
The audit risk panel's "Repeated Failed Targets" table truncated a target's
failing operation types to the
first three without saying so
(`web/src/pages/ops/AuditRiskInsights.tsx:156`). The row's severity is derived
from the full list — `buildHotTargets` marks a target as a warning when any
of its operation types is high
risk (`auditRiskInsightModel.ts:240-244`) — so a target flagged because of a
high-risk operation could be
listed without that operation, leaving the warning unexplained.
The cell now renders every failing operation type of the target (the tags
already wrap inside a `Space`).
User-visible change: the row shows the complete set of failing operations,
including the high-risk one that
explains its level. No user-facing copy changes; the model's five-row cap on
the card itself is left as it is.
### How Did You Test This Change?
```
$ cd web && npx eslint src/pages/ops/AuditRiskInsights.tsx
# clean
$ cd web && npx prettier --check src/pages/ops/AuditRiskInsights.tsx
# clean
$ cd web && npx vitest related --run src/pages/ops/AuditRiskInsights.tsx
--maxWorkers=1 --fileParallelism=false
✓ src/pages/ops/__tests__/AuditPage.test.tsx (11 tests) 10057ms
✓ src/App.test.tsx (10 tests) 458ms
✓ src/pages/ops/__tests__/AuditRiskInsights.test.tsx (5 tests) 776ms
Test Files 3 passed (3)
Tests 26 passed (26)
$ cd web && npx tsc -b
# clean
```
The new test fails without the fix:
```
$ cd web && npx vitest run src/pages/ops/__tests__/AuditRiskInsights.test.tsx
FAIL src/pages/ops/__tests__/AuditRiskInsights.test.tsx > AuditRiskInsights
> lists every failing operation of a repeated target, not only the first three
TestingLibraryElementError: Unable to find an element with the text:
清除已确认告警.
Test Files 1 failed (1)
Tests 1 failed | 4 passed (5)
```
(That run is `pages/ops/AuditRiskInsights.tsx` reverted and the test kept,
which is also the mutation check;
the case is green again once the fix is restored. On the unfixed build the
first three labels are found and
the fourth, high-risk one is not.)
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [ ] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]