Skip to content

Commit

Permalink
Fix ts issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Nov 19, 2020
1 parent 9c53d17 commit 59553d5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { first } from 'lodash';
import React from 'react';
import { useHistory } from 'react-router-dom';
import styled from 'styled-components';
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
import { APMError } from '../../../../../typings/es_schemas/ui/apm_error';
import { IUrlParams } from '../../../../context/UrlParamsContext/types';
import { px, unit, units } from '../../../../style/variables';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { i18n } from '@kbn/i18n';
import React, { useMemo } from 'react';
import styled from 'styled-components';
import { EuiIconTip } from '@elastic/eui';
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n';
import {
fontFamilyCode,
Expand All @@ -24,7 +25,6 @@ import { ErrorDetailLink } from '../../../shared/Links/apm/ErrorDetailLink';
import { TimestampTooltip } from '../../../shared/TimestampTooltip';
import { ErrorOverviewLink } from '../../../shared/Links/apm/ErrorOverviewLink';
import { APMQueryParams } from '../../../shared/Links/url_helpers';
import { APIReturnType } from '../../../services/rest/createCallApmApi';

const GroupIdLink = styled(ErrorDetailLink)`
font-family: ${fontFamilyCode};
Expand All @@ -48,8 +48,12 @@ const Culprit = styled.div`
font-family: ${fontFamilyCode};
`;

type ErrorGroupListAPIResponse = APIReturnType<
'GET /api/apm/services/{serviceName}/errors'
>;

interface Props {
items: APIReturnType<'GET /api/apm/services/{serviceName}/errors'>;
items: ErrorGroupListAPIResponse;
serviceName: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

import React, { ComponentType } from 'react';
import { MemoryRouter } from 'react-router-dom';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { TransactionGroup } from '../../../../../server/lib/transaction_groups/fetcher';
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
import { MockApmPluginContextWrapper } from '../../../../context/ApmPluginContext/MockApmPluginContext';
import { TransactionList } from './';

type TransactionGroup = APIReturnType<
'GET /api/apm/services/{serviceName}/transaction_groups'
>['items'][0];

export default {
title: 'app/TransactionOverview/TransactionList',
component: TransactionList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import { AgentIcon } from '../../../shared/AgentIcon';
import { HealthBadge } from './HealthBadge';
import { ServiceListMetric } from './ServiceListMetric';

type Items = APIReturnType<'GET /api/apm/services'>['items'];
type ServiceListAPIResponse = APIReturnType<'GET /api/apm/services'>;
type Items = ServiceListAPIResponse['items'];

interface Props {
items: Items;
noItemsMessage?: React.ReactNode;
}

type ServiceListItem = ValuesType<Items>;

function formatNumber(value: number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import React, { ReactNode } from 'react';
import { MemoryRouter } from 'react-router-dom';
import { ServiceHealthStatus } from '../../../../../common/service_health_status';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ServiceListAPIResponse } from '../../../../../server/lib/services/get_services';
import { MockApmPluginContextWrapper } from '../../../../context/ApmPluginContext/MockApmPluginContext';
import { mockMoment, renderWithTheme } from '../../../../utils/testHelpers';
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
import { ServiceList, SERVICE_COLUMNS } from './';
import props from './__fixtures__/props.json';

type ServiceListAPIResponse = APIReturnType<'GET /api/apm/services'>;

function Wrapper({ children }: { children?: ReactNode }) {
return (
<MockApmPluginContextWrapper>
Expand Down

0 comments on commit 59553d5

Please sign in to comment.