tju-yxq opened a new pull request, #5568:
URL: https://github.com/apache/rocketmq-dashboard/pull/5568
### Which Issue(s) This PR Fixes
- Fixes #5567
### Brief Description
Converts the ACL risk diagnostics utility to the key-returning contract that
`messageTraceDiagnostics` established (and #5564/#5566 applied to the consumer
and route diagnostics), so the ACL risk panel follows the display language:
- **`aclRiskDiagnostics.ts`**: `statusText` → `statusKey`; issues carry
`titleKey` / `descriptionKey` / `recommendationKey` instead of `title` /
`description` / `recommendation`; `recommendations` → `recommendationKeys`. All
texts are static, so no params are needed; `evidence` stays raw data. Codes,
severities, scoring, and the dedup/6-cap recommendation builder are untouched.
- **`acl.tsx`** (risk panel): the status banner, the issue table's item and
recommendation columns, and the recommendations list resolve through `t()`.
- **`translations.ts`**: 47 new `aclRisk.*` entries; the zh text is
byte-identical to what the utility returned before.
- **`aclRiskDiagnostics.test.ts`**: the recommendation assertions now check
keys.
### How Did You Test This Change?
```
cd web && npx vitest run src/utils/aclRiskDiagnostics.test.ts
Test Files 1 passed (1)
Tests 7 passed (7) # recommendation assertions now check keys
cd web && npx vitest run src/pages/instance/__tests__/AclPage.test.tsx
Test Files 1 passed (1)
Tests 26 passed (26) # including 'renders ACL risk diagnostics for
the examined cluster config'
cd web && npx eslint src/utils/aclRiskDiagnostics.ts
src/pages/instance/acl.tsx src/i18n/translations.ts
(no output — 0 errors, 0 warnings)
cd web && npx tsc --noEmit
(no output — exit 0)
```
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in (one
diagnostics util + its page render sites + its test, per the key-returning
theme)
- [x] Commit subject follows Conventional Commits
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test` (util test updated to the new return shape; the page suite passes
unchanged because the zh render is byte-identical)
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
(47 new `aclRisk.*` keys)
- [x] Architecture constraints stay green (no Java changes)
- [x] New source files carry the ASF license header (no new source files)
- [ ] Documentation touched where behaviour changed (internal contract +
display strings only)
--
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]