iloveeyjafjalla opened a new pull request, #6348:
URL: https://github.com/apache/rocketmq-dashboard/pull/6348
Fixes #6347
### What
`web/src/pages/ops/alerts.tsx` (the alert-rule dialog's instance picker) and
`web/src/pages/studio/BrokerCluster.tsx` (the page's instance selector)
answered a failed `GET /api/instances` with an empty list plus a transient
toast. Once the toast faded the picker looked like a deployment without
instances, and neither page offered a retry. The broker-cluster page also
called `clearData()` in its `catch`, discarding the broker / NameServer / proxy
tables already on screen although the failure says nothing about the topology.
Both now keep the previous options, mark the `Select` as errored and render
the failure next to it with a retry that re-runs the load - the shape #6078
uses on its four pages and #6144 folded for the session details
(`instance.listLoadFailed` / `alerts.instanceLoadFailed` + `common.retry`, all
already translated).
Scope: #6078 covers dashboard, data sources, producer and lite topic; #4700
covered the notification-deliveries filter and #4953 the instance pages through
`InstanceSelect`. These were the two remaining call sites of that shape (`grep
-rn "listInstances" web/src` - the rest go through `useInstanceFilter` or
already carry an error state).
### How did you test this change?
- `npx vitest run src/pages/ops/__tests__/AlertsPage.test.tsx
src/pages/studio/__tests__/BrokerCluster.test.tsx`: 50/50 green.
- Mutation check: with the two source files reverted to `6c9f74a7`, the new
cases fail - `AlertsPage` on the retry ("Unable to find an accessible element
with the role \"button\" and name \"重试\"") and `BrokerCluster` on the missing
text ("Unable to find an element with the text: 实例列表加载失败,请稍后重试").
- `npx eslint` on the four changed files: 0 errors (the reported warnings
are pre-existing lines); `npx prettier --check`: clean; `npx tsc -b`: clean.
### Checklist
- [x] One coherent fix and its tests
- [x] Conventional Commit subject
- [x] Test names end in `Test`
- [x] New UI text: N/A - reuses `instance.listLoadFailed`,
`alerts.instanceLoadFailed` and `common.retry`
- [x] Java architecture/integration tests: not run, no backend change
- [x] Existing ASF headers retained; no new source file
AI assistance: prepared with AI assistance (OpenAI Codex / ZCode); the diff
was read and every claim above was verified before it was written down.
--
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]