You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2026/08/10 06:45:29 UTC
(rocketmq-dashboard) 05/06: fix(ui): drop misleading selected count on alert export button (#1258)
This is an automated email from the ASF dual-hosted git repository.
lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git
commit 15b98d6558be98dfe4e35a25788224a606edd41e
Author: 0 <19...@qq.com>
AuthorDate: Mon Aug 10 14:22:09 2026 +0800
fix(ui): drop misleading selected count on alert export button (#1258)
* fix(ui): drop misleading selected count on alert export button
* test: drop selected count from alert export button assertions
#1258 removes the count suffix from the export button; update the expectations accordingly.
---------
Co-authored-by: lizhimins <70...@qq.com>
---
web/src/pages/studio/AlertManagement.tsx | 1 -
web/src/pages/studio/__tests__/AlertManagement.test.tsx | 6 +++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/web/src/pages/studio/AlertManagement.tsx b/web/src/pages/studio/AlertManagement.tsx
index aea6b06a..7b14add3 100644
--- a/web/src/pages/studio/AlertManagement.tsx
+++ b/web/src/pages/studio/AlertManagement.tsx
@@ -469,7 +469,6 @@ const AlertManagementPage: React.FC = () => {
</Button>
<Button icon={<DownloadSimple size={16} />} onClick={handleExportYaml} size="small">
{t('alertMgmt.exportYaml')}
- {selectedRules.length > 0 ? ` (${selectedRules.length})` : ''}
</Button>
</Space>
}
diff --git a/web/src/pages/studio/__tests__/AlertManagement.test.tsx b/web/src/pages/studio/__tests__/AlertManagement.test.tsx
index 98a078a2..97992fb3 100644
--- a/web/src/pages/studio/__tests__/AlertManagement.test.tsx
+++ b/web/src/pages/studio/__tests__/AlertManagement.test.tsx
@@ -124,7 +124,7 @@ describe('AlertManagementPage', () => {
const brokerRow = brokerRule.closest('tr');
expect(brokerRow).not.toBeNull();
await user.click(within(brokerRow!).getByRole('checkbox'));
- await user.click(screen.getByRole('button', { name: '导出 YAML (1)' }));
+ await user.click(screen.getByRole('button', { name: '导出 YAML' }));
await waitFor(() => {
expect(queryAlertRules).toHaveBeenCalledTimes(2);
@@ -159,7 +159,7 @@ describe('AlertManagementPage', () => {
expect(brokerRow).not.toBeNull();
await user.click(within(brokerRow!).getByRole('checkbox'));
- expect(screen.getByRole('button', { name: '导出 YAML (1)' })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: '导出 YAML' })).toBeInTheDocument();
await user.click(within(brokerRow!).getByRole('switch'));
@@ -184,7 +184,7 @@ describe('AlertManagementPage', () => {
expect(screen.queryByText('BrokerDown')).not.toBeInTheDocument();
expect(screen.getByText('ConsumerLagHigh')).toBeInTheDocument();
- await user.click(screen.getByRole('button', { name: '导出 YAML (1)' }));
+ await user.click(screen.getByRole('button', { name: '导出 YAML' }));
const blob = createObjectURL.mock.calls[0][0] as Blob;
const yaml = await blob.text();