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

   <!-- Base branch: `rocketmq-studio`, the RocketMQ Studio trunk. -->
   
   ### Which Issue(s) This PR Fixes
   
   - No open issue tracks this defect; see `### Related issue` below.
   
   ### Brief Description
   
   `web/src/pages/settings/DataSourceTab.tsx:298` joined the bound instance 
list with a hardcoded
   ideographic comma:
   
   ```ts
   .join('、');
   ```
   
   That string is both the 适用实例 table column and the `Instances` column of the 
exported CSV, and the
   settings page renders in English as well, so an English reader saw 
`instance-a、instance-b` in the
   table and downloaded a CSV carrying Chinese punctuation. The separator now 
follows the viewer
   language, the way `pages/instance/index.tsx:408,491,507` and the traffic 
insights panel already pick
   their separators.
   
   ### How Did You Test This Change?
   
   New case in `web/src/pages/settings/__tests__/DataSourceTab.test.tsx`: it 
stores `en` as the language
   preference, serves one data source bound to `['instance-a', 'instance-b']`, 
and asserts the rendered
   cell is `instance-a, instance-b` and that no ideographic comma is rendered 
at all.
   
   Both runs below use the project's own test runner through the 
workspace-local binary
   (`web/node_modules/.bin/vitest.cmd`, vitest 4.1.10 as pinned by 
`web/package.json`), not a
   downloaded one.
   
   Red - on the unmodified base (new test copied in, `DataSourceTab.tsx` 
untouched):
   
   ```
   $ cd web && .\node_modules\.bin\vitest.cmd run 
src/pages/settings/__tests__/DataSourceTab.test.tsx
    ❯ src/pages/settings/__tests__/DataSourceTab.test.tsx (13 tests | 1 failed) 
245ms
        × joins the applied instance list with the viewer language separator 
245ms
   
    FAIL  src/pages/settings/__tests__/DataSourceTab.test.tsx > DataSourceTab > 
joins the applied instance list with the viewer language separator
   AssertionError: expected 'instance-a、instance-b' to be 'instance-a, 
instance-b' // Object.is equality
   Expected: "instance-a, instance-b"
   Received: "instance-a、instance-b"
   
    Test Files  1 failed (1)
         Tests  1 failed | 12 passed (13)
   ```
   
   Green - with the fix:
   
   ```
   $ cd web && .\node_modules\.bin\vitest.cmd run 
src/pages/settings/__tests__/DataSourceTab.test.tsx
    Test Files  1 passed (1)
         Tests  13 passed (13)
      Duration  58.07s
   ```
   
   ```
   $ cd web && npx tsc -b            # exit 0, no output
   $ cd web && .\node_modules\.bin\eslint.cmd 
src/pages/settings/DataSourceTab.tsx 
src/pages/settings/__tests__/DataSourceTab.test.tsx
                                     # exit 0, no output
   ```
   
   Clean-tree baseline for the whole frontend area on this base, for 
comparison: `Test Files 2 failed |
   132 passed (134)`, `Tests 3 failed | 1232 passed (1235)`; all three 
pre-existing failures are
   `TopicPage` cases timing out at the 20 000 ms limit, unrelated to this 
change. The 12 other cases of
   this file (including the export, credential and modal-test cases) are 
unchanged and still pass.
   
   ### Related issue
   
   - #4630 tracks hardcoded Chinese text in the English UI for three other 
pages (Ops runtime-config
     alert, Broker Cluster instance selector, alert-rule template subtitle) and 
does not cover the
     applied-instance column; the sibling punctuation defect in the home 
traffic insights panel is
     #4706, which is open and touches a different file.
   
   ### 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`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no UI text is added; only the separator between already-localized values 
changes)
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks); no server file is touched, so the Java suite is not affected
   - [x] New source files carry the ASF license header (no new source file)
   - [x] Documentation touched where behaviour changed (no README / `docs/` 
page documents this column)


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