From 607802f5d7328ba1349474a72e21ecb2a79b92ec Mon Sep 17 00:00:00 2001 From: Frank Hassanabad Date: Thu, 2 May 2019 14:57:31 -0600 Subject: [PATCH] Remove extra types we added to infra project over time (#35963) * Our proposed merge back into master should no longer impact this team/project * During merges from master back into feature-secops we were getting constant conflicts and typing issues where these types would influence other people's types. * Removed horiztonal bar chart as it is not needed and used anymore and we are replacing it --- x-pack/plugins/infra/types/eui.d.ts | 16 ------ .../plugins/infra/types/eui_experimental.d.ts | 6 +- .../flow_controls/flow_target_select.tsx | 5 +- .../components/horizontal_bar_chart/index.tsx | 57 ------------------- .../horizontal_bar_chart/translations.ts | 11 ---- .../timeline/body/column_headers/index.tsx | 7 ++- 6 files changed, 11 insertions(+), 91 deletions(-) delete mode 100644 x-pack/plugins/siem/public/components/horizontal_bar_chart/index.tsx delete mode 100644 x-pack/plugins/siem/public/components/horizontal_bar_chart/translations.ts diff --git a/x-pack/plugins/infra/types/eui.d.ts b/x-pack/plugins/infra/types/eui.d.ts index 16f13f206dc8..d8272455d2c2 100644 --- a/x-pack/plugins/infra/types/eui.d.ts +++ b/x-pack/plugins/infra/types/eui.d.ts @@ -118,20 +118,4 @@ declare module '@elastic/eui' { message?: any; }; export const EuiInMemoryTable: React.SFC; - - type EuiSuperSelectProps = CommonProps & { - style?: any; - options?: any; - valueOfSelected?: any; - onChange?: (value: any) => void; - disabled?: boolean; - isLoading?: boolean; - itemClassName?: any; - hasDividers?: boolean; - itemLayoutAlign?: any; - compressed?: boolean; - fullWidth?: any; - }; - - export const EuiSuperSelect: React.SFC; } diff --git a/x-pack/plugins/infra/types/eui_experimental.d.ts b/x-pack/plugins/infra/types/eui_experimental.d.ts index 14179ab91e10..8d5086eaa4d9 100644 --- a/x-pack/plugins/infra/types/eui_experimental.d.ts +++ b/x-pack/plugins/infra/types/eui_experimental.d.ts @@ -7,11 +7,7 @@ declare module '@elastic/eui/lib/experimental' { import { CommonProps } from '@elastic/eui/src/components/common'; export type EuiSeriesChartProps = CommonProps & { - width?: number | string; - height?: number | string; - orientation?: string; xType?: string; - yType?: string; stackBy?: string; statusText?: string; yDomain?: number[]; @@ -25,7 +21,7 @@ declare module '@elastic/eui/lib/experimental' { export const EuiSeriesChart: React.SFC; type EuiSeriesProps = CommonProps & { - data: Array<{ x: number; y: number | string; y0?: number }>; + data: Array<{ x: number; y: number; y0?: number }>; lineSize?: number; name: string; color?: string; diff --git a/x-pack/plugins/siem/public/components/flow_controls/flow_target_select.tsx b/x-pack/plugins/siem/public/components/flow_controls/flow_target_select.tsx index 59da4c57f25f..344e8b254b5d 100644 --- a/x-pack/plugins/siem/public/components/flow_controls/flow_target_select.tsx +++ b/x-pack/plugins/siem/public/components/flow_controls/flow_target_select.tsx @@ -4,7 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiSuperSelect } from '@elastic/eui'; +import { + // @ts-ignore + EuiSuperSelect, +} from '@elastic/eui'; import React from 'react'; import { pure } from 'recompose'; import { ActionCreator } from 'typescript-fsa'; diff --git a/x-pack/plugins/siem/public/components/horizontal_bar_chart/index.tsx b/x-pack/plugins/siem/public/components/horizontal_bar_chart/index.tsx deleted file mode 100644 index f4f7b7ff835c..000000000000 --- a/x-pack/plugins/siem/public/components/horizontal_bar_chart/index.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { EuiTitle } from '@elastic/eui'; -import { EuiBarSeries, EuiSeriesChart } from '@elastic/eui/lib/experimental'; -import React from 'react'; -import { pure } from 'recompose'; -import styled from 'styled-components'; - -import { LoadingPanel } from '../loading'; - -import * as i18n from './translations'; - -export interface HorizontalBarChartData { - x: number; - y: string; -} - -interface HorizontalBarChartProps { - barChartdata: HorizontalBarChartData[]; - width?: number; - height?: number; - title: string; - loading: boolean; -} - -export const HorizontalBarChart = pure( - ({ barChartdata, width, height, title, loading }) => { - return loading ? ( - - ) : ( - - -

{title}

-
- - - -
- ); - } -); - -const Container = styled.div<{ height?: number }>` - display: flex; - flex-direction: row; - flex-wrap: wrap; - height: auto; - & > div { - .rv-xy-plot { - height: ${({ height }) => (height ? `${height}px !important` : 'auto')}; - } - } -`; diff --git a/x-pack/plugins/siem/public/components/horizontal_bar_chart/translations.ts b/x-pack/plugins/siem/public/components/horizontal_bar_chart/translations.ts deleted file mode 100644 index f949174c7deb..000000000000 --- a/x-pack/plugins/siem/public/components/horizontal_bar_chart/translations.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { i18n } from '@kbn/i18n'; - -export const LOADING_DATA = i18n.translate('xpack.siem.horizontalBarChart.loadingData', { - defaultMessage: 'Loading data', -}); diff --git a/x-pack/plugins/siem/public/components/timeline/body/column_headers/index.tsx b/x-pack/plugins/siem/public/components/timeline/body/column_headers/index.tsx index b49cc58b1c56..353ce55c92b1 100644 --- a/x-pack/plugins/siem/public/components/timeline/body/column_headers/index.tsx +++ b/x-pack/plugins/siem/public/components/timeline/body/column_headers/index.tsx @@ -4,7 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiFlexGroup, EuiFlexItem, EuiSuperSelect } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + // @ts-ignore + EuiSuperSelect, +} from '@elastic/eui'; import { noop } from 'lodash/fp'; import * as React from 'react'; import { pure } from 'recompose';