Skip to content
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

Replace a number of any-ed styled(eui*) with accurate types #64555

Merged
merged 2 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ function getSpanTypes(span: Span) {
};
}

const SpanBadge = styled(EuiBadge)`
const SpanBadge = (styled(EuiBadge)`
display: inline-block;
margin-right: ${px(units.quarter)};
` as any;
` as unknown) as typeof EuiBadge;

const HttpInfoContainer = styled('div')`
margin-right: ${px(units.quarter)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import React from 'react';
import styled from 'styled-components';
import { px, units } from '../../../../../../style/variables';

const SpanBadge = styled(EuiBadge)`
const SpanBadge = (styled(EuiBadge)`
display: inline-block;
margin-right: ${px(units.quarter)};
` as any;
` as unknown) as typeof EuiBadge;

interface SyncBadgeProps {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Props {

const Badge = (styled(EuiBadge)`
margin-top: ${px(units.eighth)};
` as any) as any;
` as unknown) as typeof EuiBadge;

export const ErrorCountSummaryItemBadge = ({ count }: Props) => (
<Badge color={euiThemeLight.euiColorDanger}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { HttpStatusBadge } from '../HttpStatusBadge';

const HttpInfoBadge = (styled(EuiBadge)`
margin-right: ${px(units.quarter)};
` as any) as any;
` as unknown) as typeof EuiBadge;

const Url = styled('span')`
display: inline-block;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/siem/public/components/and_or_badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import styled from 'styled-components';

import * as i18n from './translations';

const RoundedBadge = styled(EuiBadge)`
const RoundedBadge = (styled(EuiBadge)`
align-items: center;
border-radius: 100%;
display: inline-flex;
Expand All @@ -30,7 +30,7 @@ const RoundedBadge = styled(EuiBadge)`
.euiBadge__text {
text-overflow: clip;
}
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

RoundedBadge.displayName = 'RoundedBadge';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import {
import { FeatureProperty } from '../types';
import * as i18n from '../translations';

const FlowBadge = styled(EuiBadge)`
const FlowBadge = (styled(EuiBadge)`
height: 45px;
min-width: 85px;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

const EuiFlexGroupStyled = styled(EuiFlexGroup)`
margin: 0 auto;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/siem/public/components/flyout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import { DEFAULT_TIMELINE_WIDTH } from '../timeline/body/constants';
import { StatefulTimeline } from '../timeline';
import { TimelineById } from '../../store/timeline/types';

export const Badge = styled(EuiBadge)`
export const Badge = (styled(EuiBadge)`
position: absolute;
padding-left: 4px;
padding-right: 4px;
right: 0%;
top: 0%;
border-bottom-left-radius: 5px;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

Badge.displayName = 'Badge';

Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/siem/public/components/header_page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const LinkBack = styled.div.attrs({
`;
LinkBack.displayName = 'LinkBack';

const Badge = styled(EuiBadge)`
const Badge = (styled(EuiBadge)`
letter-spacing: 0;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;
Badge.displayName = 'Badge';

interface BackOptions {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/siem/public/components/header_page/title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const StyledEuiBetaBadge = styled(EuiBetaBadge)`

StyledEuiBetaBadge.displayName = 'StyledEuiBetaBadge';

const Badge = styled(EuiBadge)`
const Badge = (styled(EuiBadge)`
letter-spacing: 0;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;
Badge.displayName = 'Badge';

interface Props {
Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/siem/public/components/page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ export const Pane1FlexContent = styled.div`

Pane1FlexContent.displayName = 'Pane1FlexContent';

export const CountBadge = styled(EuiBadge)`
export const CountBadge = (styled(EuiBadge)`
margin-left: 5px;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

CountBadge.displayName = 'CountBadge';

Expand All @@ -177,9 +177,9 @@ export const Spacer = styled.span`

Spacer.displayName = 'Spacer';

export const Badge = styled(EuiBadge)`
export const Badge = (styled(EuiBadge)`
vertical-align: top;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

Badge.displayName = 'Badge';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const SignatureFlexItem = styled(EuiFlexItem)`

SignatureFlexItem.displayName = 'SignatureFlexItem';

const Badge = styled(EuiBadge)`
const Badge = (styled(EuiBadge)`
vertical-align: top;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

Badge.displayName = 'Badge';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { IS_OPERATOR } from '../../../data_providers/data_provider';

import * as i18n from './translations';

const Badge = styled(EuiBadge)`
const Badge = (styled(EuiBadge)`
vertical-align: top;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

Badge.displayName = 'Badge';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const Text = styled(EuiText)`

Text.displayName = 'Text';

const BadgeHighlighted = styled(EuiBadge)`
const BadgeHighlighted = (styled(EuiBadge)`
height: 20px;
margin: 0 5px 0 5px;
maxwidth: 85px;
minwidth: 85px;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

BadgeHighlighted.displayName = 'BadgeHighlighted';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { EXISTS_OPERATOR, QueryOperator } from './data_provider';

import * as i18n from './translations';

const ProviderBadgeStyled = styled(EuiBadge)`
const ProviderBadgeStyled = (styled(EuiBadge)`
.euiToolTipAnchor {
&::after {
font-style: normal;
Expand All @@ -44,7 +44,7 @@ const ProviderBadgeStyled = styled(EuiBadge)`
margin-right: 0;
margin-left: 4px;
}
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

ProviderBadgeStyled.displayName = 'ProviderBadgeStyled';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ const DropAndTargetDataProviders = styled.div<{ hasAndItem: boolean }>`

DropAndTargetDataProviders.displayName = 'DropAndTargetDataProviders';

const NumberProviderAndBadge = styled(EuiBadge)`
const NumberProviderAndBadge = (styled(EuiBadge)`
margin: 0px 5px;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

NumberProviderAndBadge.displayName = 'NumberProviderAndBadge';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const historyToolTip = 'The chronological history of actions related to t
export const streamLiveToolTip = 'Update the Timeline as new data arrives';
export const newTimelineToolTip = 'Create a new timeline';

const NotesCountBadge = styled(EuiBadge)`
const NotesCountBadge = (styled(EuiBadge)`
margin-left: 5px;
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

NotesCountBadge.displayName = 'NotesCountBadge';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ const NoteDescriptionContainer = styled(EuiFlexItem)`

export const isNotEmptyArray = (values: string[]) => !isEmpty(values.join(''));

const EuiBadgeWrap = styled(EuiBadge)`
const EuiBadgeWrap = (styled(EuiBadge)`
.euiBadge__text {
white-space: pre-wrap !important;
}
` as any; // eslint-disable-line @typescript-eslint/no-explicit-any
` as unknown) as typeof EuiBadge;

export const buildQueryBarDescription = ({
field,
Expand Down