Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Dec 2, 2020
1 parent cabd189 commit 7251eb0
Show file tree
Hide file tree
Showing 97 changed files with 129 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {
getEnvironmentLabel,
} from '../../../common/environment_filter_values';
import { getAPMHref } from '../../components/shared/Links/apm/APMLink';
import { useApmPluginContext } from '../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../context/apm_plugin/use_apm_plugin_context';
import { FETCH_STATUS, useFetcher } from '../../hooks/use_fetcher';
import { useLicense } from '../../context/license_context/use_license';
import { useLicenseContext } from '../../context/license/use_license_context';
import { useUrlParams } from '../../context/url_params_context/use_url_params';
import { APIReturnType } from '../../services/rest/createCallApmApi';
import { units } from '../../style/variables';
Expand All @@ -32,7 +32,7 @@ export function AnomalyDetectionSetupLink() {
const environment = uiFilters.environment;
const { core } = useApmPluginContext();
const canGetJobs = !!core.application.capabilities.ml?.canGetJobs;
const license = useLicense();
const license = useLicenseContext();
const hasValidLicense = license?.isActive && license?.hasAtLeast('platinum');
const { basePath } = core.http;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { useParams } from 'react-router-dom';
import { getAlertingCapabilities } from '../../components/alerting/get_alert_capabilities';
import { getAPMHref } from '../../components/shared/Links/apm/APMLink';
import { useApmPluginContext } from '../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../context/apm_plugin/use_apm_plugin_context';
import { AlertingPopoverAndFlyout } from './alerting_popover_flyout';
import { AnomalyDetectionSetupLink } from './anomaly_detection_setup_link';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/public/application/application.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { act } from '@testing-library/react';
import { createMemoryHistory } from 'history';
import { Observable } from 'rxjs';
import { AppMountParameters, CoreStart, HttpSetup } from 'src/core/public';
import { mockApmPluginContextValue } from '../context/apm_plugin_context/mock_apm_plugin_context';
import { mockApmPluginContextValue } from '../context/apm_plugin/mock_apm_plugin_context';
import { ApmPluginSetupDeps } from '../plugin';
import { createCallApmApi } from '../services/rest/createCallApmApi';
import { renderApp } from './';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/public/application/csmApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { APMRouteDefinition } from '../application/routes';
import { renderAsRedirectTo } from '../components/app/Main/route_config';
import { ScrollToTopOnPathChange } from '../components/app/Main/ScrollToTopOnPathChange';
import { RumHome, UX_LABEL } from '../components/app/RumDashboard/RumHome';
import { ApmPluginContext } from '../context/apm_plugin_context/apm_plugin_context';
import { ApmPluginContext } from '../context/apm_plugin/apm_plugin_context';
import { UrlParamsProvider } from '../context/url_params_context/url_params_context';
import { useBreadcrumbs } from '../hooks/use_breadcrumbs';
import { ConfigSchema } from '../index';
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/public/application/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import { ScrollToTopOnPathChange } from '../components/app/Main/ScrollToTopOnPat
import {
ApmPluginContext,
ApmPluginContextValue,
} from '../context/apm_plugin_context/apm_plugin_context';
import { LicenseProvider } from '../context/license_context/license_context';
} from '../context/apm_plugin/apm_plugin_context';
import { LicenseProvider } from '../context/license/license_context';
import { UrlParamsProvider } from '../context/url_params_context/url_params_context';
import { useBreadcrumbs } from '../hooks/use_breadcrumbs';
import { ApmPluginSetupDeps } from '../plugin';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { ErrorCountAlertTrigger } from '.';
import { ApmPluginContextValue } from '../../../context/apm_plugin_context/apm_plugin_context';
import { ApmPluginContextValue } from '../../../context/apm_plugin/apm_plugin_context';
import {
mockApmPluginContextValue,
MockApmPluginContextWrapper,
} from '../../../context/apm_plugin_context/mock_apm_plugin_context';
} from '../../../context/apm_plugin/mock_apm_plugin_context';

export default {
title: 'app/ErrorCountAlertTrigger',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { cloneDeep, merge } from 'lodash';
import React, { ComponentType } from 'react';
import { MemoryRouter, Route } from 'react-router-dom';
import { TransactionDurationAlertTrigger } from '.';
import { ApmPluginContextValue } from '../../../context/apm_plugin_context/apm_plugin_context';
import { ApmPluginContextValue } from '../../../context/apm_plugin/apm_plugin_context';
import {
mockApmPluginContextValue,
MockApmPluginContextWrapper,
} from '../../../context/apm_plugin_context/mock_apm_plugin_context';
} from '../../../context/apm_plugin/mock_apm_plugin_context';
import { MockUrlParamsContextProvider } from '../../../context/url_params_context/mock_url_params_context_provider';

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
TransactionTypeField,
IsAboveField,
} from '../fields';
import { useApmService } from '../../../context/apm_service/use_apm_service';
import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context';

interface AlertParams {
windowSize: number;
Expand Down Expand Up @@ -63,7 +63,7 @@ interface Props {
export function TransactionDurationAlertTrigger(props: Props) {
const { setAlertParams, alertParams, setAlertProperty } = props;
const { urlParams } = useUrlParams();
const { transactionTypes } = useApmService();
const { transactionTypes } = useApmServiceContext();
const { serviceName } = useParams<{ serviceName?: string }>();
const { start, end, transactionType } = urlParams;
const { environmentOptions } = useEnvironmentsFetcher({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
ServiceField,
TransactionTypeField,
} from '../fields';
import { useApmService } from '../../../context/apm_service/use_apm_service';
import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context';

interface Params {
windowSize: number;
Expand All @@ -47,7 +47,7 @@ interface Props {
export function TransactionDurationAnomalyAlertTrigger(props: Props) {
const { setAlertParams, alertParams, setAlertProperty } = props;
const { urlParams } = useUrlParams();
const { transactionTypes } = useApmService();
const { transactionTypes } = useApmServiceContext();
const { serviceName } = useParams<{ serviceName?: string }>();
const { start, end, transactionType } = urlParams;
const { environmentOptions } = useEnvironmentsFetcher({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
EnvironmentField,
IsAboveField,
} from '../fields';
import { useApmService } from '../../../context/apm_service/use_apm_service';
import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context';

interface AlertParams {
windowSize: number;
Expand All @@ -38,7 +38,7 @@ interface Props {
export function TransactionErrorRateAlertTrigger(props: Props) {
const { setAlertParams, alertParams, setAlertProperty } = props;
const { urlParams } = useUrlParams();
const { transactionTypes } = useApmService();
const { transactionTypes } = useApmServiceContext();
const { serviceName } = useParams<{ serviceName?: string }>();
const { start, end, transactionType } = urlParams;
const { environmentOptions } = useEnvironmentsFetcher({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '@elastic/eui';
import { useHistory } from 'react-router-dom';
import { enableCorrelations } from '../../../../common/ui_settings_keys';
import { useApmPluginContext } from '../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context';
import { LatencyCorrelations } from './LatencyCorrelations';
import { ErrorCorrelations } from './ErrorCorrelations';
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { mount } from 'enzyme';
import React from 'react';
import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin_context/mock_apm_plugin_context';
import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context';
import { MockUrlParamsContextProvider } from '../../../../../context/url_params_context/mock_url_params_context_provider';
import { mockMoment, toJson } from '../../../../../utils/testHelpers';
import { ErrorGroupList } from '../index';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { shallow } from 'enzyme';
import React from 'react';
import { Home } from '../Home';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin_context/mock_apm_plugin_context';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context';

describe('Home component', () => {
it('should render services', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { render } from '@testing-library/react';
import cytoscape from 'cytoscape';
import React, { ReactNode } from 'react';
import { ThemeContext } from 'styled-components';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin_context/mock_apm_plugin_context';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context';
import { Controls } from './Controls';
import { CytoscapeContext } from './Cytoscape';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { EuiButtonIcon, EuiPanel, EuiToolTip } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useContext, useEffect, useState } from 'react';
import styled from 'styled-components';
import { useApmPluginContext } from '../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context';
import { useTheme } from '../../../hooks/use_theme';
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
import { getAPMHref } from '../../shared/Links/apm/APMLink';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React, { ReactNode } from 'react';
import { Buttons } from './Buttons';
import { render } from '@testing-library/react';
import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin_context/mock_apm_plugin_context';
import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context';

function Wrapper({ children }: { children?: ReactNode }) {
return <MockApmPluginContextWrapper>{children}</MockApmPluginContextWrapper>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { EuiButton, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { MouseEvent } from 'react';
import { useApmPluginContext } from '../../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
import { getAPMHref } from '../../../shared/Links/apm/APMLink';
import { APMQueryParams } from '../../../shared/Links/url_helpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import cytoscape from 'cytoscape';
import { HttpSetup } from 'kibana/public';
import React, { ComponentType } from 'react';
import { EuiThemeProvider } from '../../../../../../observability/public';
import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin_context/mock_apm_plugin_context';
import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context';
import { MockUrlParamsContextProvider } from '../../../../context/url_params_context/mock_url_params_context_provider';
import { createCallApmApi } from '../../../../services/rest/createCallApmApi';
import { CytoscapeContext } from '../Cytoscape';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { act, waitFor } from '@testing-library/react';
import cytoscape from 'cytoscape';
import React, { ReactNode } from 'react';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin_context/mock_apm_plugin_context';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context';
import { renderWithTheme } from '../../../utils/testHelpers';
import { CytoscapeContext } from './Cytoscape';
import { EmptyBanner } from './EmptyBanner';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { createKibanaReactContext } from 'src/plugins/kibana_react/public';
import { License } from '../../../../../licensing/common/license';
import { EuiThemeProvider } from '../../../../../observability/public';
import { FETCH_STATUS } from '../../../../../observability/public/hooks/use_fetcher';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin_context/mock_apm_plugin_context';
import { LicenseContext } from '../../../context/license_context/license_context';
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context';
import { LicenseContext } from '../../../context/license/license_context';
import * as useFetcherModule from '../../../hooks/use_fetcher';
import { ServiceMap } from './';

Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/public/components/app/ServiceMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
SERVICE_MAP_TIMEOUT_ERROR,
} from '../../../../common/service_map';
import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher';
import { useLicense } from '../../../context/license_context/use_license';
import { useLicenseContext } from '../../../context/license/use_license_context';
import { useTheme } from '../../../hooks/use_theme';
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
import { callApmApi } from '../../../services/rest/createCallApmApi';
Expand Down Expand Up @@ -70,7 +70,7 @@ export function ServiceMap({
serviceName,
}: PropsWithChildren<ServiceMapProps>) {
const theme = useTheme();
const license = useLicense();
const license = useLicenseContext();
const { urlParams } = useUrlParams();

const { data = { elements: [] }, status, error } = useFetcher(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
validateSetting,
} from '../../../../../../../common/agent_configuration/setting_definitions';
import { AgentName } from '../../../../../../../typings/es_schemas/ui/fields/agent';
import { useApmPluginContext } from '../../../../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../../../../context/apm_plugin/use_apm_plugin_context';
import { FETCH_STATUS } from '../../../../../../hooks/use_fetcher';
import { saveConfig } from './saveConfig';
import { SettingFormRow } from './SettingFormRow';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { AgentConfigurationCreateEdit } from './index';
import {
ApmPluginContext,
ApmPluginContextValue,
} from '../../../../../context/apm_plugin_context/apm_plugin_context';
} from '../../../../../context/apm_plugin/apm_plugin_context';
import { EuiThemeProvider } from '../../../../../../../observability/public';

storiesOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
APIReturnType,
callApmApi,
} from '../../../../../services/rest/createCallApmApi';
import { useApmPluginContext } from '../../../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../../../context/apm_plugin/use_apm_plugin_context';

type Config = APIReturnType<'GET /api/apm/settings/agent-configuration'>[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React, { useState } from 'react';
import { useLocation } from 'react-router-dom';
import { APIReturnType } from '../../../../../services/rest/createCallApmApi';
import { getOptionLabel } from '../../../../../../common/agent_configuration/all_option';
import { useApmPluginContext } from '../../../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../../../context/apm_plugin/use_apm_plugin_context';
import { FETCH_STATUS } from '../../../../../hooks/use_fetcher';
import { useTheme } from '../../../../../hooks/use_theme';
import { px, units } from '../../../../../style/variables';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { isEmpty } from 'lodash';
import React from 'react';
import { useLocation } from 'react-router-dom';
import { useTrackPageview } from '../../../../../../observability/public';
import { useApmPluginContext } from '../../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
import { useFetcher } from '../../../../hooks/use_fetcher';
import { createAgentConfigurationHref } from '../../../shared/Links/apm/agentConfigurationLinks';
import { AgentConfigurationList } from './List';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { render } from '@testing-library/react';
import React from 'react';
import { ApmIndices } from '.';
import * as hooks from '../../../../hooks/use_fetcher';
import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin_context/mock_apm_plugin_context';
import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context';

describe('ApmIndices', () => {
it('should not get stuck in infinite loop', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { useFetcher } from '../../../../hooks/use_fetcher';
import { callApmApi } from '../../../../services/rest/createCallApmApi';
import { clearCache } from '../../../../services/rest/callApi';
import { useApmPluginContext } from '../../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';

const APM_INDEX_LABELS = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { NotificationsStart } from 'kibana/public';
import React, { useState } from 'react';
import { px, unit } from '../../../../../../style/variables';
import { callApmApi } from '../../../../../../services/rest/createCallApmApi';
import { useApmPluginContext } from '../../../../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../../../../context/apm_plugin/use_apm_plugin_context';

interface Props {
onDelete: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { i18n } from '@kbn/i18n';
import React, { useState } from 'react';
import { Filter } from '../../../../../../../common/custom_link/custom_link_types';
import { useApmPluginContext } from '../../../../../../context/apm_plugin_context/use_apm_plugin_context';
import { useApmPluginContext } from '../../../../../../context/apm_plugin/use_apm_plugin_context';
import { FiltersSection } from './FiltersSection';
import { FlyoutFooter } from './FlyoutFooter';
import { LinkSection } from './LinkSection';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import { act } from 'react-dom/test-utils';
import * as apmApi from '../../../../../services/rest/createCallApmApi';
import { License } from '../../../../../../../licensing/common/license';
import * as hooks from '../../../../../hooks/use_fetcher';
import { LicenseContext } from '../../../../../context/license_context/license_context';
import { LicenseContext } from '../../../../../context/license/license_context';
import { CustomLinkOverview } from '.';
import {
expectTextsInDocument,
expectTextsNotInDocument,
} from '../../../../../utils/testHelpers';
import * as saveCustomLink from './CreateEditCustomLinkFlyout/saveCustomLink';
import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin_context/mock_apm_plugin_context';
import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context';

const data = [
{
Expand Down
Loading

0 comments on commit 7251eb0

Please sign in to comment.