chstercc opened a new pull request, #5778:
URL: https://github.com/apache/rocketmq-dashboard/pull/5778
<!-- Make sure the base branch is `rocketmq-studio`: that is the RocketMQ
Studio trunk. -->
### Which Issue(s) This PR Fixes
<!-- Link the issue with a keyword so it closes on merge. Trivial fixes need
no issue.
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->
- Fixes #5298
### Brief Description
<!-- What changes and why. Keep it short — the diff already shows how. -->
Preserve the broker’s original `maxMessageSize` bytes when its rounded MiB
field is untouched. Previously, an untouched preview or save converted
`5000000` bytes into `5242880` bytes.
Use the field’s touched state instead of value equality, so explicitly
entering the displayed `5` MiB applies `5242880` bytes, while entering `6` MiB
applies `6291456` bytes. Reset edit tracking whenever the dialog opens. Preview
and save share the same request builder.
Add five page regression cases covering untouched preview/save, an unrelated
field edit, explicit edits to `6` and `5` MiB, and cancel/reopen. Only the
cluster page and its test file change.
AI assistance was used for investigation, implementation, and validation.
### How Did You Test This Change?
<!-- Paste the commands you ran and what they printed. Typical verification:
backend `cd server && mvn -B -ntp test` (integration tests need
MySQL 8, see CONTRIBUTING.md)
frontend `cd web && npm test && npm run lint && npm run build`
A pull request with no verification will not be merged. -->
From `web`, using Linux Node.js 22.20.0:
```bash
node node_modules/vitest/vitest.mjs run
src/pages/cluster/__tests__/ClusterPage.test.tsx src/api/cluster.test.ts
src/services/clusterService.test.ts
```
Result: **3 test files passed, 54 tests passed**.
```bash
npm run lint
```
Result: exit code 0; zero errors and 10 warnings in unchanged files.
```bash
node node_modules/eslint/bin/eslint.js src/pages/cluster/index.tsx
src/pages/cluster/__tests__/ClusterPage.test.tsx
node node_modules/prettier/bin/prettier.cjs --check
src/pages/cluster/index.tsx src/pages/cluster/__tests__/ClusterPage.test.tsx
node node_modules/typescript/bin/tsc -b
```
Result: all passed.
```bash
npm run build
```
TypeScript compilation and Vite bundling passed. The final license check
failed with `build artifact verification failed: assets/index-*.js`. The
unchanged upstream baseline at `c99b9ad5` fails with the same error, tracked by
#5547 / PR #5019. No check was bypassed.
At the repository root:
```bash
git diff --check
```
Result: passed.
Regression verification: three preservation cases fail against the unchanged
page because `5000000` becomes `5242880`. Replacing touched-state detection
with value comparison also fails the explicit `5` MiB case. Restoring the
implementation makes the tests pass.
The full frontend suite, browser/server integration, and backend tests were
not run.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [ ] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
No new UI text or source files are introduced. Backend code and the API
contract are unchanged; architecture tests were not run. No documentation
changes are included.
--
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]