tju-yxq opened a new pull request, #5558:
URL: https://github.com/apache/rocketmq-dashboard/pull/5558
### Which Issue(s) This PR Fixes
- Fixes #5557
### Brief Description
Adds the missing confirmation friction to four destructive or high-impact
actions, each following the pattern its own page already uses for sibling
actions:
- **Proxy.tsx**: the per-row config hot-reload button is now wrapped in a
Popconfirm naming the address (`确定要热重载 {addr} 的配置吗?`), matching the sibling
remove-address Popconfirm and the cluster page's named proxy-restart confirm.
The tooltip on the icon button is preserved.
- **systemAlerts.tsx**: "Clear Acknowledged" now opens a `Modal.confirm`
stating that every acknowledged record will be permanently deleted, with a
danger OK button; the toolbar button is danger-styled like other destructive
toolbar actions.
- **Ops.tsx**: the NameServer delete Popconfirm now names the selected
address instead of the generic "Are you sure to delete?".
- **alerts.tsx**: bulk enable/disable now confirms with the selected count
(`确定要启用/禁用选中的 {count} 条告警规则吗?`), mirroring the sibling bulk-delete confirm; the
mutation body moved unchanged into the confirm's `onOk`.
### How Did You Test This Change?
```
cd web && npx vitest run src/pages/studio/__tests__/Proxy.test.tsx
Tests 15 passed (15) # reload test updated to click through the
Popconfirm
cd web && npx vitest run src/pages/ops/__tests__/AlertsPage.test.tsx
Tests 29 passed (29) # four bulk-toggle tests updated to click the
confirm OK
cd web && npx vitest run src/pages/ops/__tests__/SystemAlertsPage.test.tsx
src/pages/studio/__tests__/Ops.test.tsx
Tests 26 passed (26) # Ops delete test already confirmed via
/确\s*认|Confirm/ and is unaffected
cd web && npx eslint src/pages/studio/Proxy.tsx src/pages/studio/Ops.tsx
src/pages/ops/systemAlerts.tsx src/pages/ops/alerts.tsx src/i18n/translations.ts
0 errors (6 pre-existing warnings)
cd web && npx tsc --noEmit
(no output — exit 0)
```
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in (one
concern — missing/unnamed confirmations on destructive actions — four sites
across four pages)
- [x] Commit subject follows Conventional Commits
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test` (existing tests updated to click through the new confirmations;
suites pass)
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
(six 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 (confirmation prompts
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]