messere1 opened a new pull request, #1576:
URL: https://github.com/apache/rocketmq-dashboard/pull/1576
## What changed
- lock alert-rule submission synchronously before form validation begins
- ignore duplicate create/edit confirmations while a submission is pending
- keep the existing confirmation loading state active from validation
through API completion
- prevent cancel, close, keyboard, and mask-close actions during submission
- release the guard after validation failure, API success, or API failure
- add a regression test that double-clicks edit confirmation and asserts one
update request
## Why
AlertsPage previously set submitting only after validateFields completed. A
rapid double click could enter handleSubmit twice and start duplicate create or
update requests before React disabled the confirmation button. The modal also
remained closable while the request continued.
## Impact
The change is limited to the Alert Rules modal and its test. Form
validation, API contracts, successful list updates, and bulk actions are
unchanged.
Fixes #1575
## Validation
- npx vitest run src/pages/ops/__tests__/AlertsPage.test.tsx
- 5 tests passed
- npx eslint src/pages/ops/alerts.tsx
src/pages/ops/__tests__/AlertsPage.test.tsx
- npm run build
- TypeScript and Vite production build passed
- Husky pre-commit ESLint and Prettier checks passed
--
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]