btlqql opened a new pull request, #5335:
URL: https://github.com/apache/rocketmq-dashboard/pull/5335
### Which Issue(s) This PR Fixes
- Fixes #5294
### Brief Description
`web/src/pages/instance/message.tsx` (message result table) and `web/src/pages/instance/dlq.tsx`
(DLQ group table) are both paginated by the server: `pagination.onChange` re-runs the query with
the next `page`/`pageSize`. Five of their columns nevertheless declared antd in-memory sorters —
message `topic` (message.tsx:776) and `storeTime` (message.tsx:820), DLQ `groupName` (dlq.tsx:491),
`messageCount` (dlq.tsx:519) and `lastEnqueueTime` (dlq.tsx:544). Clicking such a header sorted
only the page that happened to be loaded while the header claimed the whole result set was sorted,
so the combined multi-page view was silently mis-ordered.
This removes those in-memory sorters, which is the option the issue asks for when no server-side
sort parameter exists: a server-paginated table must not offer a sort it cannot honour. No column
of either table offers sorting now, and the existing `tableScrollX(columns)` sizing is unaffected
(that helper reads only `width`/`minWidth`).
### How Did You Test This Change?
A new case in each existing page suite pins that the server-paginated table exposes no sorter
affordance (`.ant-table-column-sorters` / `ant-table-column-has-sorters`) on any of those columns
and that clicking the headers does not reorder the rows the server returned. Both cases were run
first on the unmodified tree (red), then again after the fix (green).
```
$ cd web && npx vitest run src/pages/instance/__tests__/MessagePage.test.tsx src/pages/instance/__tests__/DLQPage.test.tsx
# before the fix
FAIL src/pages/instance/__tests__/DLQPage.test.tsx > DLQ page > offers no page-local sort on the server-paginated group table
Error: expect(element).not.toHaveClass("ant-table-column-has-sorters")
Expected the element not to have class:
ant-table-column-has-sorters
Received:
ant-table-cell ant-table-cell-ellipsis ant-table-column-has-sorters
FAIL src/pages/instance/__tests__/MessagePage.test.tsx > Message page query history > offers no page-local sort on the server-paginated result table
Error: expect(element).not.toHaveClass("ant-table-column-has-sorters")
Received:
ant-table-cell ant-table-cell-ellipsis ant-table-column-has-sorters
Test Files 2 failed (2)
Tests 2 failed | 52 passed (54)
# after the fix
✓ src/pages/instance/__tests__/MessagePage.test.tsx (27 tests)
✓ src/pages/instance/__tests__/DLQPage.test.tsx (27 tests)
Test Files 2 passed (2)
Tests 54 passed (54)
$ cd web && npx tsc -b # exit 0, no diagnostics
$ cd web && npx eslint src/pages/instance/message.tsx src/pages/instance/dlq.tsx \
src/pages/instance/__tests__/MessagePage.test.tsx src/pages/instance/__tests__/DLQPage.test.tsx
✖ 1 problem (0 errors, 1 warning) # the warning is the pre-existing react-refresh one on dlq.tsx:62
```
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits
- [x] Tests added or updated for non-trivial changes
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/` — not applicable: this
removes a sorting affordance and adds no user-facing string
- [x] Architecture constraints stay green — no `server/**` file is touched, so the ArchUnit checks
are unaffected; the frontend gates (`npx tsc -b`, `npx eslint`) are green
- [ ] New source files carry the ASF license header — not applicable: no new source file
- [ ] Documentation touched where behaviour changed — not applicable: no document describes
per-column sorting of these tables
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org