-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Inventory][ECO] Entity type Remove Control groups filter #202177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cauemarcondes
merged 8 commits into
elastic:main
from
cauemarcondes:inventory-remove-control-groups
Dec 2, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
38cba01
[Inventory] Removing control groups from search bar
cauemarcondes 32984fb
filter by entity type on grid
cauemarcondes 5aa1994
e2e
cauemarcondes b6cbf16
telemetry
cauemarcondes 07cab76
Update x-pack/plugins/observability_solution/inventory/public/compone…
cauemarcondes 731899a
pr comments
cauemarcondes 5dffc4a
Merge branch 'inventory-remove-control-groups' of github.com:cauemarc…
cauemarcondes 061845a
Merge branch 'main' into inventory-remove-control-groups
cauemarcondes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
60 changes: 60 additions & 0 deletions
60
x-pack/plugins/observability_solution/inventory/common/rt_types.ts
This file contains hidden or 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,60 @@ | ||
| /* | ||
| * 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 { decode, encode } from '@kbn/rison'; | ||
| import { isRight } from 'fp-ts/lib/Either'; | ||
| import * as t from 'io-ts'; | ||
|
|
||
| const validate = (validationRt: t.Any) => (input: unknown, context: t.Context) => { | ||
| switch (typeof input) { | ||
| case 'string': { | ||
| try { | ||
| const decoded = decode(input); | ||
| const validation = validationRt.decode(decoded); | ||
| if (isRight(validation)) { | ||
| return t.success(validation.right); | ||
| } | ||
|
|
||
| return t.failure(input, context); | ||
| } catch (e) { | ||
| return t.failure(input, context); | ||
| } | ||
| } | ||
|
|
||
| case 'undefined': | ||
| return t.success(input); | ||
|
|
||
| default: { | ||
| const validation = validationRt.decode(input); | ||
|
|
||
| if (isRight(validation)) { | ||
| return t.success(validation.right); | ||
| } | ||
|
|
||
| return t.failure(input, context); | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| const entityTypeCheckOptions = t.union([t.literal('on'), t.literal('off'), t.literal('mixed')]); | ||
| export type EntityTypeCheckOptions = t.TypeOf<typeof entityTypeCheckOptions>; | ||
|
|
||
| const entityTypeRt = t.record(t.string, entityTypeCheckOptions); | ||
| export type EntityType = t.TypeOf<typeof entityTypeRt>; | ||
| export const entityTypesRt = new t.Type< | ||
| Record<string, 'on' | 'off' | 'mixed'> | undefined, | ||
| string, | ||
| unknown | ||
| >('entityTypesRt', entityTypeRt.is, validate(entityTypeRt), (o) => encode(o)); | ||
|
|
||
| const paginationRt = t.record(t.string, t.number); | ||
| export type EntityPagination = t.TypeOf<typeof entityPaginationRt>; | ||
| export const entityPaginationRt = new t.Type<Record<string, number> | undefined, string, unknown>( | ||
| 'entityPaginationRt', | ||
| paginationRt.is, | ||
| validate(paginationRt), | ||
| (o) => encode(o) | ||
| ); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.