Skip to content

Commit

Permalink
Clean up redundant common imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Apr 24, 2020
1 parent 484c3ed commit 8794013
Show file tree
Hide file tree
Showing 111 changed files with 123 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import DateMath from '@elastic/datemath';
import { DurationChartComponent } from '../duration_chart';
import { MonitorDurationResult } from '../../../../../common/types';
import { MonitorDurationResult } from '../../../../../common';
import { shallowWithRouter } from '../../../../lib';

describe('MonitorCharts component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { MonitorBarSeries, MonitorBarSeriesProps } from '../monitor_bar_series';
import { renderWithRouter, shallowWithRouter } from '../../../../lib';
import { HistogramPoint } from '../../../../../common/runtime_types';
import { HistogramPoint } from '../../../../../common';

describe('MonitorBarSeries component', () => {
let props: MonitorBarSeriesProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import moment from 'moment';
import { FormattedMessage } from '@kbn/i18n/react';
import { Axis, Chart, Position, timeFormatter, Settings, SeriesIdentifier } from '@elastic/charts';
import { getChartDateLabel } from '../../../lib/helper';
import { LocationDurationLine } from '../../../../common/types';
import { LocationDurationLine } from '../../../../common';
import { DurationLineSeriesList } from './duration_line_series_list';
import { ChartWrapper } from './chart_wrapper';
import { useUrlParams } from '../../../hooks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react';
import { LineSeries, CurveType } from '@elastic/charts';
import { LocationDurationLine } from '../../../../common/types';
import { LocationDurationLine } from '../../../../common';
import { convertMicrosecondsToMilliseconds as microsToMillis } from '../../../lib/helper';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React, { useContext } from 'react';
import moment from 'moment';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiText, EuiToolTip } from '@elastic/eui';
import { HistogramPoint } from '../../../../common/runtime_types';
import { HistogramPoint } from '../../../../common';
import { getChartDateLabel, seriesHasDownValues } from '../../../lib/helper';
import { useUrlParams } from '../../../hooks';
import { UptimeThemeContext } from '../../../contexts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import moment from 'moment';
import { getChartDateLabel } from '../../../lib/helper';
import { ChartWrapper } from './chart_wrapper';
import { UptimeThemeContext } from '../../../contexts';
import { HistogramResult } from '../../../../common/runtime_types';
import { HistogramResult } from '../../../../common';
import { useUrlParams } from '../../../hooks';
import { ChartEmptyState } from './chart_empty_state';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React, { useContext } from 'react';
import { EuiSuperDatePicker } from '@elastic/eui';
import { useUrlParams } from '../../hooks';
import { CLIENT_DEFAULTS } from '../../../common/constants';
import { CLIENT_DEFAULTS } from '../../../common';
import { UptimeRefreshContext, UptimeSettingsContext } from '../../contexts';

// TODO: when EUI exports types for this, this should be replaced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { LocationMap } from '../location_map';
import { MonitorLocations } from '../../../../../common/runtime_types';
import { MonitorLocations } from '../../../../../common';
import { LocationMissingWarning } from '../location_missing';

// Note For shallow test, we need absolute time strings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import moment from 'moment';
import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
import { MonitorLocation } from '../../../../../common/runtime_types/monitor';
import { MonitorLocation } from '../../../../../common';
import { LocationStatusTags } from '../index';

describe('LocationStatusTags component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import uuid from 'uuid';
import styled from 'styled-components';
import { MapEmbeddable, MapEmbeddableInput } from '../../../../../../../legacy/plugins/maps/public';
import * as i18n from './translations';
import { Location } from '../../../../../common/runtime_types';
import { Location } from '../../../../../common';
import { getLayerList } from './map_config';
import { UptimeThemeContext, UptimeStartupPluginsContext } from '../../../../contexts';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import styled from 'styled-components';
import { EuiFlexGroup, EuiFlexItem, EuiErrorBoundary, EuiHideFor } from '@elastic/eui';
import { LocationStatusTags } from './location_status_tags';
import { EmbeddedMap, LocationPoint } from './embeddables/embedded_map';
import { MonitorLocations, MonitorLocation } from '../../../../common/runtime_types';
import { UNNAMED_LOCATION } from '../../../../common/constants';
import { UNNAMED_LOCATION, MonitorLocations, MonitorLocation } from '../../../../common';
import { LocationMissingWarning } from './location_missing';

// These height/width values are used to make sure map is in center of panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import styled from 'styled-components';
import { EuiBadge, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { UptimeThemeContext } from '../../../contexts';
import { MonitorLocation } from '../../../../common/runtime_types';
import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE } from '../../../../common/constants';
import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE, MonitorLocation } from '../../../../common';

const TimeStampSpan = styled.span`
display: inline-block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react';
import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
import { MLFlyoutView } from '../ml_flyout';
import { UptimeSettingsContext } from '../../../../contexts';
import { CLIENT_DEFAULTS } from '../../../../../common/constants';
import { CLIENT_DEFAULTS } from '../../../../../common';
import { License } from '../../../../../../../plugins/licensing/common/license';

const expiredLicense = new License({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
KibanaReactNotifications,
} from '../../../../../../../src/plugins/kibana_react/public';
import { MLFlyoutView } from './ml_flyout';
import { ML_JOB_ID } from '../../../../common/constants';
import { ML_JOB_ID } from '../../../../common';
import { UptimeRefreshContext, UptimeSettingsContext } from '../../../contexts';
import { useGetUrlParams } from '../../../hooks';
import { getDynamicSettings } from '../../../state/actions/dynamic_settings';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiTitle } from '@elastic/eui';
import { LocationDurationLine } from '../../../../common/types';
import { LocationDurationLine } from '../../../../common';
import { MLIntegrationComponent } from '../ml/ml_integeration';
import { AnomalyRecords } from '../../../state/actions';
import { DurationChartComponent } from '../../common/charts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { UptimeRefreshContext } from '../../../contexts';
import { getMLJobId } from '../../../state/api/ml_anomaly';
import { JobStat } from '../../../../../ml/common/types/data_recognizer';
import { MonitorDurationComponent } from './monitor_duration';
import { MonitorIdParam } from '../../../../common/types';
import { MonitorIdParam } from '../../../../common';

export const MonitorDuration: React.FC<MonitorIdParam> = ({ monitorId }) => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import moment from 'moment';
import { mountWithIntl } from 'test_utils/enzyme_helpers';
import { EuiBadge } from '@elastic/eui';
import { renderWithIntl } from 'test_utils/enzyme_helpers';
import { Tls } from '../../../../../common/runtime_types';
import { Tls } from '../../../../../common';
import { MonitorSSLCertificate } from '../monitor_status_bar';

describe('MonitorStatusBar component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import moment from 'moment';
import React from 'react';
import { renderWithIntl } from 'test_utils/enzyme_helpers';
import { MonitorStatusBarComponent } from '../monitor_status_bar';
import { Ping } from '../../../../../common/runtime_types';
import { Ping } from '../../../../../common';

describe('MonitorStatusBar component', () => {
let monitorStatus: Ping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react';
import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
import { MonitorLocation } from '../../../../../common/runtime_types';
import { MonitorLocation } from '../../../../../common';
import { StatusByLocations } from '../index';

describe('StatusByLocation component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import moment from 'moment';
import { EuiSpacer, EuiText, EuiBadge } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { Tls } from '../../../../../common/runtime_types';
import { Tls } from '../../../../../common';

interface Props {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import {
import { MonitorSSLCertificate } from './ssl_certificate';
import * as labels from './translations';
import { StatusByLocations } from './status_by_location';
import { Ping } from '../../../../../common/runtime_types';
import { MonitorLocations } from '../../../../../common/runtime_types';
import { MonitorLocations, Ping } from '../../../../../common';

interface MonitorStatusBarProps {
monitorId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MonitorStatusBarComponent } from './index';
import { getMonitorStatusAction } from '../../../../state/actions';
import { useGetUrlParams } from '../../../../hooks';
import { UptimeRefreshContext } from '../../../../contexts';
import { MonitorIdParam } from '../../../../../common/types';
import { MonitorIdParam } from '../../../../../common';
import { AppState } from '../../../../state';

export const MonitorStatusBar: React.FC<MonitorIdParam> = ({ monitorId }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { MonitorLocation } from '../../../../../common/runtime_types';
import { MonitorLocation } from '../../../../../common';

interface StatusByLocationsProps {
locations: MonitorLocation[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui';
import styled from 'styled-components';
import { LocationMap } from '../location_map';
import { UptimeRefreshContext } from '../../../contexts';
import { MonitorLocations } from '../../../../common/runtime_types';
import { MonitorLocations } from '../../../../common';
import { MonitorStatusBar } from './monitor_status_bar';

interface MonitorStatusDetailsProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { getMonitorLocationsAction } from '../../../state/actions/monitor';
import { MonitorStatusDetailsComponent } from './index';
import { UptimeRefreshContext } from '../../../contexts';
import { AppState } from '../../../state';
import { MonitorIdParam } from '../../../../common/types';
import { MonitorIdParam } from '../../../../common';

export const MonitorStatusDetails: React.FC<MonitorIdParam> = ({ monitorId }) => {
const { lastRefresh } = useContext(UptimeRefreshContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { mountWithIntl, renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
import React from 'react';
import { PingListExpandedRowComponent } from '../expanded_row';
import { Ping } from '../../../../../common/runtime_types';
import { Ping } from '../../../../../common';
import { DocLinkForBody } from '../doc_link_body';

describe('PingListExpandedRow', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { PingListComponent, toggleDetails } from '../ping_list';
import { Ping, PingsResponse } from '../../../../../common/runtime_types';
import { Ping, PingsResponse } from '../../../../../common';
import { ExpandedRowMap } from '../../../overview/monitor_list/types';

describe('PingList component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@elastic/eui';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { Ping, HttpResponseBody } from '../../../../common/runtime_types';
import { Ping, HttpResponseBody } from '../../../../common';
import { DocLinkForBody } from './doc_link_body';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import moment from 'moment';
import React, { useState, useEffect } from 'react';
import styled from 'styled-components';
import { Ping, GetPingsParams, DateRange } from '../../../../common/runtime_types';
import { Ping, GetPingsParams, DateRange } from '../../../../common';
import { convertMicrosecondsToMilliseconds as microsToMillis } from '../../../lib/helper';
import { LocationName } from './location_name';
import { Pagination } from '../../overview/monitor_list';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useSelector, useDispatch } from 'react-redux';
import React, { useContext, useCallback } from 'react';
import { selectPingList } from '../../../state/selectors';
import { getPings } from '../../../state/actions';
import { GetPingsParams } from '../../../../common/runtime_types';
import { GetPingsParams } from '../../../../common';
import { UptimeSettingsContext } from '../../../contexts';
import { PingListComponent } from './index';

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

import React from 'react';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { Snapshot } from '../../../../common/runtime_types';
import { Snapshot } from '../../../../common';
import { SnapshotComponent } from '../snapshot/snapshot';

describe('Snapshot component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React from 'react';
import { EmptyStateComponent } from '../empty_state';
import { StatesIndexStatus } from '../../../../../common/runtime_types';
import { StatesIndexStatus } from '../../../../../common';
import { HttpFetchError, IHttpFetchError } from 'src/core/public';
import { mountWithRouter, shallowWithRouter } from '../../../../lib';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { FormattedMessage } from '@kbn/i18n/react';
import React, { useContext } from 'react';
import { UptimeSettingsContext } from '../../../contexts';
import { DynamicSettings } from '../../../../common/runtime_types';
import { DynamicSettings } from '../../../../common';

interface DataMissingProps {
headingMessage: JSX.Element;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { EmptyStateError } from './empty_state_error';
import { EmptyStateLoading } from './empty_state_loading';
import { DataOrIndexMissing } from './data_or_index_missing';
import { DynamicSettings, StatesIndexStatus } from '../../../../common/runtime_types';
import { DynamicSettings, StatesIndexStatus } from '../../../../common';
import { IHttpFetchError } from '../../../../../../../target/types/core/public/http';

interface EmptyStateProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { EuiFilterGroup } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FilterPopoverProps, FilterPopover } from './filter_popover';
import { FilterStatusButton } from './filter_status_button';
import { OverviewFilters } from '../../../../common/runtime_types/overview_filters';
import { OverviewFilters } from '../../../../common';

interface PresentationalComponentProps {
loading: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { parseFiltersMap } from './parse_filter_map';
import { AppState } from '../../../state';
import { fetchOverviewFilters, GetOverviewFiltersPayload } from '../../../state/actions';
import { FilterGroupComponent } from './index';
import { OverviewFilters } from '../../../../common/runtime_types/overview_filters';
import { OverviewFilters } from '../../../../common';
import { UptimeRefreshContext } from '../../../contexts';

interface OwnProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
*/

import React from 'react';
import {
MonitorSummaryResult,
CursorDirection,
SortOrder,
} from '../../../../../common/runtime_types';
import { MonitorSummaryResult, CursorDirection, SortOrder } from '../../../../../common';
import { MonitorListComponent } from '../monitor_list';
import { renderWithRouter, shallowWithRouter } from '../../../../lib';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import React from 'react';
import moment from 'moment';
import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
import { getLocationStatus, MonitorListStatusColumn } from '../monitor_list_status_column';
import { Check } from '../../../../../common/runtime_types';
import { STATUS } from '../../../../../common/constants';
import { STATUS, Check } from '../../../../../common';

describe('MonitorListStatusColumn', () => {
beforeAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
import { FormattedMessage } from '@kbn/i18n/react';
import React, { useState, useEffect } from 'react';
import styled from 'styled-components';
import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types';
import { MonitorSummary } from '../../../../common/runtime_types';
import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common';
import { MonitorSummary } from '../../../../common';
import { MonitorListStatusColumn } from './monitor_list_status_column';
import { ExpandedRowMap } from './types';
import { MonitorBarSeries } from '../../common/charts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React, { useCallback } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { getMonitorList } from '../../../state/actions';
import { FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types';
import { FetchMonitorStatesQueryArgs } from '../../../../common';
import { monitorListSelector } from '../../../state/selectors';
import { MonitorListComponent } from './monitor_list';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react';
import { MonitorSummary } from '../../../../../../common/runtime_types';
import { MonitorSummary } from '../../../../../../common';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { IntegrationGroup } from '../actions_popover/integration_group';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import 'jest';
import React from 'react';
import { MonitorListDrawerComponent } from '../monitor_list_drawer';
import { Check, MonitorDetails, MonitorSummary } from '../../../../../../common/runtime_types';
import { Check, MonitorDetails, MonitorSummary } from '../../../../../../common';
import { shallowWithRouter } from '../../../../../lib';

describe('MonitorListDrawer component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import React from 'react';
import moment from 'moment';
import { MonitorStatusList } from '../monitor_status_list';
import { Check } from '../../../../../../common/runtime_types';
import { Check } from '../../../../../../common';

describe('MonitorStatusList component', () => {
let checks: Check[];
Expand Down
Loading

0 comments on commit 8794013

Please sign in to comment.