Skip to content

Commit

Permalink
Merge branch 'main' into security/siem-migrations/11283-install-rules
Browse files Browse the repository at this point in the history
  • Loading branch information
e40pud authored Nov 29, 2024
2 parents c3be96d + 06b7993 commit b29bbd9
Show file tree
Hide file tree
Showing 61 changed files with 2,355 additions and 721 deletions.
95 changes: 58 additions & 37 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7560,42 +7560,6 @@ paths:
tags:
- Security Entity Analytics API
x-beta: true
/api/entity_store/engines/{entityType}/stats:
post:
operationId: GetEntityEngineStats
parameters:
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
schema:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EntityType'
responses:
'200':
content:
application/json; Elastic-Api-Version=2023-10-31:
schema:
type: object
properties:
indexPattern:
$ref: '#/components/schemas/Security_Entity_Analytics_API_IndexPattern'
indices:
items:
type: object
type: array
status:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EngineStatus'
transforms:
items:
type: object
type: array
type:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EntityType'
description: Successful response
summary: Get Entity Engine stats
tags:
- Security Entity Analytics API
x-beta: true
/api/entity_store/engines/{entityType}/stop:
post:
operationId: StopEntityEngine
Expand Down Expand Up @@ -7749,6 +7713,12 @@ paths:
/api/entity_store/status:
get:
operationId: GetEntityStoreStatus
parameters:
- description: If true returns a detailed status of the engine including all it's components
in: query
name: include_components
schema:
type: boolean
responses:
'200':
content:
Expand All @@ -7758,10 +7728,20 @@ paths:
properties:
engines:
items:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EngineDescriptor'
allOf:
- $ref: '#/components/schemas/Security_Entity_Analytics_API_EngineDescriptor'
- type: object
properties:
components:
items:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EngineComponentStatus'
type: array
type: array
status:
$ref: '#/components/schemas/Security_Entity_Analytics_API_StoreStatus'
required:
- status
- engines
description: Successful response
summary: Get the status of the Entity Store
tags:
Expand Down Expand Up @@ -45755,6 +45735,47 @@ components:
$ref: '#/components/schemas/Security_Entity_Analytics_API_AssetCriticalityLevel'
required:
- criticality_level
Security_Entity_Analytics_API_EngineComponentResource:
enum:
- entity_engine
- entity_definition
- index
- component_template
- index_template
- ingest_pipeline
- enrich_policy
- task
- transform
type: string
Security_Entity_Analytics_API_EngineComponentStatus:
type: object
properties:
errors:
items:
type: object
properties:
message:
type: string
title:
type: string
type: array
health:
enum:
- green
- yellow
- red
- unknown
type: string
id:
type: string
installed:
type: boolean
resource:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EngineComponentResource'
required:
- id
- installed
- resource
Security_Entity_Analytics_API_EngineDataviewUpdateResult:
type: object
properties:
Expand Down
94 changes: 58 additions & 36 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10445,41 +10445,6 @@ paths:
summary: Start an Entity Engine
tags:
- Security Entity Analytics API
/api/entity_store/engines/{entityType}/stats:
post:
operationId: GetEntityEngineStats
parameters:
- description: The entity type of the engine (either 'user' or 'host').
in: path
name: entityType
required: true
schema:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EntityType'
responses:
'200':
content:
application/json; Elastic-Api-Version=2023-10-31:
schema:
type: object
properties:
indexPattern:
$ref: '#/components/schemas/Security_Entity_Analytics_API_IndexPattern'
indices:
items:
type: object
type: array
status:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EngineStatus'
transforms:
items:
type: object
type: array
type:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EntityType'
description: Successful response
summary: Get Entity Engine stats
tags:
- Security Entity Analytics API
/api/entity_store/engines/{entityType}/stop:
post:
operationId: StopEntityEngine
Expand Down Expand Up @@ -10630,6 +10595,12 @@ paths:
/api/entity_store/status:
get:
operationId: GetEntityStoreStatus
parameters:
- description: If true returns a detailed status of the engine including all it's components
in: query
name: include_components
schema:
type: boolean
responses:
'200':
content:
Expand All @@ -10639,10 +10610,20 @@ paths:
properties:
engines:
items:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EngineDescriptor'
allOf:
- $ref: '#/components/schemas/Security_Entity_Analytics_API_EngineDescriptor'
- type: object
properties:
components:
items:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EngineComponentStatus'
type: array
type: array
status:
$ref: '#/components/schemas/Security_Entity_Analytics_API_StoreStatus'
required:
- status
- engines
description: Successful response
summary: Get the status of the Entity Store
tags:
Expand Down Expand Up @@ -53478,6 +53459,47 @@ components:
$ref: '#/components/schemas/Security_Entity_Analytics_API_AssetCriticalityLevel'
required:
- criticality_level
Security_Entity_Analytics_API_EngineComponentResource:
enum:
- entity_engine
- entity_definition
- index
- component_template
- index_template
- ingest_pipeline
- enrich_policy
- task
- transform
type: string
Security_Entity_Analytics_API_EngineComponentStatus:
type: object
properties:
errors:
items:
type: object
properties:
message:
type: string
title:
type: string
type: array
health:
enum:
- green
- yellow
- red
- unknown
type: string
id:
type: string
installed:
type: boolean
resource:
$ref: '#/components/schemas/Security_Entity_Analytics_API_EngineComponentResource'
required:
- id
- installed
- resource
Security_Entity_Analytics_API_EngineDataviewUpdateResult:
type: object
properties:
Expand Down
2 changes: 1 addition & 1 deletion oas_docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion oas_docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"bump-cli": "^2.8.4",
"@redocly/cli": "^1.25.12"
"@redocly/cli": "^1.25.13"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@
"@octokit/rest": "^17.11.2",
"@parcel/watcher": "^2.1.0",
"@playwright/test": "=1.46.0",
"@redocly/cli": "^1.25.12",
"@redocly/cli": "^1.25.13",
"@statoscope/webpack-plugin": "^5.28.2",
"@storybook/addon-a11y": "^6.5.16",
"@storybook/addon-actions": "^6.5.16",
Expand Down
60 changes: 60 additions & 0 deletions packages/kbn-unified-data-table/src/components/data_table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1399,4 +1399,64 @@ describe('UnifiedDataTable', () => {
EXTENDED_JEST_TIMEOUT
);
});

describe('pagination', () => {
const onChangePageMock = jest.fn();
beforeEach(() => {
jest.clearAllMocks();
});
test('should effect pageIndex change', async () => {
const component = await getComponent({
...getProps(),
onUpdatePageIndex: onChangePageMock,
rowsPerPageState: 1,
rowsPerPageOptions: [1, 5],
});

expect(findTestSubject(component, 'pagination-button-1').exists()).toBeTruthy();
onChangePageMock.mockClear();
findTestSubject(component, 'pagination-button-1').simulate('click');
expect(onChangePageMock).toHaveBeenNthCalledWith(1, 1);
});

test('should effect pageIndex change when itemsPerPage has been changed', async () => {
/*
* Use Case:
*
* Let's say we have 4 pages and we are on page 1 with 1 item per page.
* Now if we change items per page to 4, it should automatically change the pageIndex to 0.
*
* */
const component = await getComponent({
...getProps(),
onUpdatePageIndex: onChangePageMock,
rowsPerPageState: 1,
rowsPerPageOptions: [1, 4],
});

expect(findTestSubject(component, 'pagination-button-4').exists()).toBeTruthy();
onChangePageMock.mockClear();
// go to last page
findTestSubject(component, 'pagination-button-4').simulate('click');
expect(onChangePageMock).toHaveBeenNthCalledWith(1, 4);
onChangePageMock.mockClear();

// Change items per Page so that pageIndex autoamtically changes.
expect(findTestSubject(component, 'tablePaginationPopoverButton').text()).toBe(
'Rows per page: 1'
);
findTestSubject(component, 'tablePaginationPopoverButton').simulate('click');
component.setProps({
rowsPerPageState: 5,
});

await waitFor(() => {
expect(findTestSubject(component, 'tablePaginationPopoverButton').text()).toBe(
'Rows per page: 5'
);
});

expect(onChangePageMock).toHaveBeenNthCalledWith(1, 0);
});
});
});
Loading

0 comments on commit b29bbd9

Please sign in to comment.