From eafa15bba6de05ac4d8071c9bf3c939f3833800b Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Mon, 6 Jan 2025 18:24:20 +0200 Subject: [PATCH] fix: [Security:Rules:Detection Rules]Notify Bell button on installed rules table on Detection rules(siem) page is missing accessible discernible text (#205336) Closes: #204483 Related to: https://github.com/elastic/kibana/pull/188075 ## Description A similar issue was already fixed in https://github.com/elastic/kibana/pull/188075. To address #204483, we just need to restore the name from the fetchRulesSnoozeSettings request. ## Screen image --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../detection_engine/rule_management/api/api.test.ts | 6 +++--- .../public/detection_engine/rule_management/api/api.ts | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts index bc7c288906e8e..d3de6cf7aaa0f 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts @@ -854,7 +854,7 @@ describe('Detections Rules API', () => { expect(fetchMock).toHaveBeenCalledWith( expect.any(String), expect.objectContaining({ - body: '{"filter":"alert.id:\\"alert:id1\\" or alert.id:\\"alert:id2\\"","fields":"[\\"muteAll\\",\\"activeSnoozes\\",\\"isSnoozedUntil\\",\\"snoozeSchedule\\"]","per_page":2}', + body: '{"filter":"alert.id:\\"alert:id1\\" or alert.id:\\"alert:id2\\"","fields":"[\\"name\\",\\"muteAll\\",\\"activeSnoozes\\",\\"isSnoozedUntil\\",\\"snoozeSchedule\\"]","per_page":2}', }) ); }); @@ -865,7 +865,7 @@ describe('Detections Rules API', () => { expect(fetchMock).toHaveBeenCalledWith( expect.any(String), expect.objectContaining({ - body: '{"filter":"alert.id:\\"alert:id1\\" or alert.id:\\"alert:id2\\"","fields":"[\\"muteAll\\",\\"activeSnoozes\\",\\"isSnoozedUntil\\",\\"snoozeSchedule\\"]","per_page":2}', + body: '{"filter":"alert.id:\\"alert:id1\\" or alert.id:\\"alert:id2\\"","fields":"[\\"name\\",\\"muteAll\\",\\"activeSnoozes\\",\\"isSnoozedUntil\\",\\"snoozeSchedule\\"]","per_page":2}', }) ); }); @@ -876,7 +876,7 @@ describe('Detections Rules API', () => { expect(fetchMock).toHaveBeenCalledWith( expect.any(String), expect.objectContaining({ - body: '{"filter":"alert.id:\\"alert:id1\\" or alert.id:\\"alert:id2\\"","fields":"[\\"muteAll\\",\\"activeSnoozes\\",\\"isSnoozedUntil\\",\\"snoozeSchedule\\"]","per_page":2}', + body: '{"filter":"alert.id:\\"alert:id1\\" or alert.id:\\"alert:id2\\"","fields":"[\\"name\\",\\"muteAll\\",\\"activeSnoozes\\",\\"isSnoozedUntil\\",\\"snoozeSchedule\\"]","per_page":2}', }) ); }); diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.ts index 4bde24e9f4573..0ccf26d822d56 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.ts @@ -245,7 +245,13 @@ export const fetchRulesSnoozeSettings = async ({ method: 'POST', body: JSON.stringify({ filter: ids.map((x) => `alert.id:"alert:${x}"`).join(' or '), - fields: JSON.stringify(['muteAll', 'activeSnoozes', 'isSnoozedUntil', 'snoozeSchedule']), + fields: JSON.stringify([ + 'name', + 'muteAll', + 'activeSnoozes', + 'isSnoozedUntil', + 'snoozeSchedule', + ]), per_page: ids.length, }), signal,