Frun1na opened a new pull request, #6104:
URL: https://github.com/apache/rocketmq-dashboard/pull/6104

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6103
   
   ### Brief Description
   
   The clients table tags a connection whose broker-reported language has no 
known counterpart as "unknown"
   (`renderLanguageTag`, `web/src/pages/cluster/clients.tsx:390`) and counts it 
in the language/version
   distribution's unknown bucket (`:310`), but the language column's filter 
only offered the eight languages of
   `languageConfig` (`:495-498`) and matched `record.language === value`, so 
those rows could not be selected.
   The CSV export had the same gap (`matches('language', connection.language ?? 
'')`, `:374`).
   
   The protocol column received exactly this treatment when its own null case 
appeared: the merge for #5453 added
   an unknown option and switched the export to the same sentinel "so the rows 
behind the `-: N` statistic can
   actually be filtered". This mirrors it for the language column.
   
   User-visible change: the language column gains an "unknown" filter option 
that selects the rows whose language
   the API could not confirm, and the export honours it. The option's label 
reuses the existing
   `common.unknown` copy (Chinese and English already exist), so no new UI text 
is introduced.
   
   Not addressed here: the version column has no filter at all, so the 
per-version split inside the unknown
   bucket stays unselectable.
   
   ### How Did You Test This Change?
   
   ```
   $ cd web && npx eslint src/pages/cluster/clients.tsx
   # clean
   
   $ cd web && npx prettier --check src/pages/cluster/clients.tsx
   # clean
   
   $ cd web && npx vitest related --run src/pages/cluster/clients.tsx 
--maxWorkers=1 --fileParallelism=false
    ✓ src/pages/cluster/__tests__/ClientsPage.test.tsx (25 tests) 20087ms
    ✓ src/App.test.tsx (10 tests) 453ms
    Test Files  2 passed (2)
         Tests  35 passed (35)
   
   $ cd web && npx tsc -b
   # clean
   ```
   
   The new test fails without the fix:
   
   ```
   $ cd web && npx vitest run src/pages/cluster/__tests__/ClientsPage.test.tsx
    FAIL src/pages/cluster/__tests__/ClientsPage.test.tsx > Clients page > 
filters rows with an unconfirmed language through the language filter
    TestingLibraryElementError: Unable to find an element with the text: 未知.
    Test Files  1 failed (1)
         Tests  1 failed | 24 passed (25)
   ```
   
   (That run is `pages/cluster/clients.tsx` reverted and the test kept, which 
is also the mutation check; the case
   is green again once the fix is restored. The test also pins the export: with 
the unknown filter active the CSV
   carries the unconfirmed row and not the other one.)
   
   ### 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)
   


-- 
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]

Reply via email to