tju-yxq opened a new pull request, #5566:
URL: https://github.com/apache/rocketmq-dashboard/pull/5566
### Which Issue(s) This PR Fixes
- Fixes #5565
### Brief Description
Converts the topic route diagnostics utility to the key-returning contract
that `messageTraceDiagnostics` established (and #5564 applied to the consumer
group health diagnostics), so the route section follows the display language:
- **`topicRouteDiagnostics.ts`**: `statusText` → `statusKey`; issues carry
`titleKey` / `descriptionKey` instead of `title` / `description` (all texts are
static, so no params are needed); `recommendations` → `recommendationKeys`.
Codes, severities, thresholds, and summary math are untouched.
- **`topic.tsx`** (route section): the diagnostics alert renders
`t('topic.routeDiagnostics', { status: t(diagnostics.statusKey) })`; the
per-broker issue list, the route table's issue tags, and the recommendations
banner resolve through `t()`.
- **`translations.ts`**: 39 new `routeDiag.*` entries (3 status + 14
title/description pairs + 8 recommendations) plus the `topic.routeDiagnostics`
page key; the zh text is byte-identical to what the utility returned before.
- **`topicRouteDiagnostics.test.ts`**: the recommendation assertions now
check keys.
Note: the status-alert line overlaps #5533 (the topic page localization);
whichever lands second needs a one-line rebase.
### How Did You Test This Change?
```
cd web && npx vitest run src/utils/topicRouteDiagnostics.test.ts
Test Files 1 passed (1)
Tests 5 passed (5) # recommendation assertions now check keys
cd web && npx vitest run src/pages/instance/__tests__/TopicPage.test.tsx
Tests 32 passed | 2 failed (34)
```
`renders topic route health diagnostics in the detail modal` — the test of
the changed behavior — **passes in the full run** (and standalone), confirming
the key-resolved zh render is byte-identical to the previous hardcoded text.
The two failures are the documented machine-load flakes, unrelated to this
change: `clears selected topics when the search scope changes` is a 20s timeout
that passed standalone in 6.7s on the sibling branch (#5533's verification
records the same), and `moves back from an emptied last topic page after batch
deletion` passes standalone in 8.6s on this branch.
```
cd web && npx eslint src/utils/topicRouteDiagnostics.ts
src/pages/instance/topic.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/`
(40 new 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]