forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution][Endpoint][Response Actions] Fix table navigation …
…when trays are expanded (elastic#157777) ## Summary Fixes an issue where when an action detail is shown via an expanded tray item and the total number of items goes beyond the first page on the response actions history page/flyout, switching between pages while the tray is open breaks the page. - [x] fix paging with trays expanded on a flyout - [x] fix paging with trays expanded on a page - [x] ensure when the page is loaded with `?withOutputs=` with action ids from different sets of pages, table paging doesn't break when paged, and trays show open for the action ids in `?withOutputs=` URL param - tests: - [x] page navigation flyout/page view - [x] page reload with URL params (cypress) **flyout** ![response-logs-flyout](https://github.com/elastic/kibana/assets/1849116/c7c91d0d-3279-4813-b7dd-1365313b7fe4) **page** ![response-logs-page](https://github.com/elastic/kibana/assets/1849116/b68f6e5d-9d0e-456f-8b07-dea07526571b) *page with URL load* - three actions are open on two different pages - we re-load page 2 with two open trays and then navigate to page 1 to see the third one open - also re-load page 1; we see the tray open, then navigate to page 2 to see the other two trays open. ![response-logs-page-reload](https://github.com/elastic/kibana/assets/1849116/58896b2e-4078-42c0-ac6c-c34d5b1cd42b) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
1 parent
b50c358
commit 9e01dc8
Showing
11 changed files
with
248 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...security_solution/public/management/cypress/e2e/mocked_data/reponse_actions_history.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { ReturnTypeFromChainable } from '../../types'; | ||
import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; | ||
import { login } from '../../tasks/login'; | ||
|
||
describe('Response actions history page', () => { | ||
let endpointData: ReturnTypeFromChainable<typeof indexEndpointHosts>; | ||
// let actionData: ReturnTypeFromChainable<typeof indexActionResponses>; | ||
|
||
before(() => { | ||
indexEndpointHosts({ numResponseActions: 11 }).then((indexEndpoints) => { | ||
endpointData = indexEndpoints; | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
login(); | ||
}); | ||
|
||
after(() => { | ||
if (endpointData) { | ||
endpointData.cleanup(); | ||
// @ts-expect-error ignore setting to undefined | ||
endpointData = undefined; | ||
} | ||
}); | ||
|
||
it('retains expanded action details on page reload', () => { | ||
cy.visit(`/app/security/administration/response_actions_history`); | ||
cy.getByTestSubj('response-actions-list-expand-button').eq(3).click(); // 4th row on 1st page | ||
cy.getByTestSubj('response-actions-list-details-tray').should('exist'); | ||
cy.url().should('include', 'withOutputs'); | ||
|
||
// navigate to page 2 | ||
cy.getByTestSubj('pagination-button-1').click(); | ||
cy.getByTestSubj('response-actions-list-details-tray').should('not.exist'); | ||
|
||
// reload with URL params on page 2 with existing URL | ||
cy.reload(); | ||
cy.getByTestSubj('response-actions-list-details-tray').should('not.exist'); | ||
|
||
// navigate to page 1 | ||
cy.getByTestSubj('pagination-button-0').click(); | ||
cy.getByTestSubj('response-actions-list-details-tray').should('exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.