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

   Closes #5615
   
   ## Problem
   
   `showTotal={(total) => t('alerts.totalRules', { count: total })}` passed 
`count` as a `t()` param, but the `totalRules` template has **no `{count}` 
placeholder** (`{ zh: '规则总数', en: 'Total Rules' }` — it doubles as the plain 
header-card label at line 918, where the count is a separate element). The i18n 
helper only substitutes `{key}` occurrences, so the count was silently dropped 
and the pagination showed "Total Rules" with no number — unlike every other 
paginated page (e.g. deliveries: `` showTotal: (count) => `${t('common.total')} 
${count}` ``).
   
   ## Fix
   
   Append the count explicitly, keeping the domain label:
   
   ```tsx
   showTotal={(total) => `${t('alerts.totalRules')} ${total}`}
   ```
   
   ## Verification
   
   - New `AlertsPaginationTotal.test.tsx` (deterministic): renders the page 
with one rule and asserts the `.ant-pagination-total-text` contains a digit and 
the total — **FAILS on master** (label only, no number), **PASSES with this 
change** ("规则总数 1")
   - Regression: the existing `AlertsPage.test.tsx` suite 28/28 in isolation
   - Mutation check: reverting the one-line change makes the new test fail 
again; restoring it passes
   
   ## Collision note
   
   `alerts.tsx` is touched by several open PRs but none modifies this 
pagination line; the change is a single expression at ~1048 with a comment.


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