mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
chore(NA): splits types from code on @kbn/securitysolution-io-ts-utils (#121677)
* chore(NA): splits types from code on @kbn/securitysolution-io-ts-utils * chore(NA): fix package.json * chore(NA): merge and solve conflicts with main * chore(NA): remove any from types Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9ca9fe7577
commit
0a75d426b9
14 changed files with 43 additions and 20 deletions
|
@ -52,8 +52,6 @@ TYPES_DEPS = [
|
|||
"@npm//@types/react",
|
||||
"@npm//@types/testing-library__react-hooks",
|
||||
"@npm//fp-ts",
|
||||
# TODO: Remove once the bug on pkg_npm_types around transitive type deps got solved
|
||||
"@npm//io-ts",
|
||||
"@npm//tslib",
|
||||
]
|
||||
|
||||
|
|
|
@ -74,11 +74,11 @@ export const transformInput = (exceptionItem: ExceptionListItemSchema): Exceptio
|
|||
export const addIdToExceptionItemEntries = (
|
||||
exceptionItem: ExceptionListItemSchema
|
||||
): ExceptionListItemSchema => {
|
||||
const entries = exceptionItem.entries.map((entry: any) => {
|
||||
const entries = exceptionItem.entries.map((entry) => {
|
||||
if (entry.type === 'nested') {
|
||||
return addIdToItem({
|
||||
...entry,
|
||||
entries: entry.entries.map((nestedEntry: any) => addIdToItem(nestedEntry)),
|
||||
entries: entry.entries.map((nestedEntry) => addIdToItem(nestedEntry)),
|
||||
});
|
||||
} else {
|
||||
return addIdToItem(entry);
|
||||
|
@ -100,11 +100,11 @@ export const removeIdFromExceptionItemsEntries = <T extends { entries: EntriesAr
|
|||
exceptionItem: T
|
||||
): T => {
|
||||
const { entries } = exceptionItem;
|
||||
const entriesNoId = entries.map((entry: any) => {
|
||||
const entriesNoId = entries.map((entry) => {
|
||||
if (entry.type === 'nested') {
|
||||
return removeIdFromItem({
|
||||
...entry,
|
||||
entries: entry.entries.map((nestedEntry: any) => removeIdFromItem(nestedEntry)),
|
||||
entries: entry.entries.map((nestedEntry) => removeIdFromItem(nestedEntry)),
|
||||
});
|
||||
} else {
|
||||
return removeIdFromItem<Entry>(entry);
|
||||
|
|
|
@ -203,7 +203,7 @@ export const useApi = (http: HttpStart): ExceptionsApi => {
|
|||
// This data transform is UI specific and useful for UI concerns
|
||||
// to compensate for the differences and preferences of how ReactJS might prefer
|
||||
// data vs. how we want to model data. View `transformInput` for more details
|
||||
exceptions: data.map((item: any) => transformInput(item)),
|
||||
exceptions: data.map((item) => transformInput(item)),
|
||||
pagination: {
|
||||
page,
|
||||
perPage,
|
||||
|
|
|
@ -120,7 +120,7 @@ export const useExceptionListItems = ({
|
|||
|
||||
// Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes
|
||||
// for context around the temporary `id`
|
||||
const transformedData = data.map((item: any) => transformInput(item));
|
||||
const transformedData = data.map((item) => transformInput(item));
|
||||
|
||||
if (isSubscribed) {
|
||||
setPagination({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue