mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* chore: rename useUrlParams to useLegacyUrlParams * fix: revert uptime & fleet changes Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Lucca Miranda <42002892+luckened@users.noreply.github.com>
This commit is contained in:
parent
e6f52d9467
commit
181b042a82
61 changed files with 120 additions and 120 deletions
|
@ -52,7 +52,7 @@ const {
|
|||
|
||||
`useApmParams` will strip query parameters for which there is no validation. The route path should match exactly, but you can also use wildcards: `useApmParams('/*)`. In that case, the return type will be a union type of all possible matching routes.
|
||||
|
||||
Previously we used `useUrlParams` for path and query parameters, which we are trying to get away from. When possible, any usage of `useUrlParams` should be replaced by `useApmParams` or other custom hooks that use `useApmParams` internally.
|
||||
Previously we used `useLegacyUrlParams` for path and query parameters, which we are trying to get away from. When possible, any usage of `useLegacyUrlParams` should be replaced by `useApmParams` or other custom hooks that use `useApmParams` internally.
|
||||
|
||||
## Linking
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
createExploratoryViewUrl,
|
||||
HeaderMenuPortal,
|
||||
} from '../../../../../../observability/public';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public';
|
||||
import { AppMountParameters } from '../../../../../../../../src/core/public';
|
||||
import { InspectorHeaderLink } from '../../../shared/apm_header_action_menu/inspector_header_link';
|
||||
|
@ -38,7 +38,7 @@ export function UXActionMenu({
|
|||
const {
|
||||
services: { http },
|
||||
} = useKibana();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { rangeTo, rangeFrom, serviceName } = urlParams;
|
||||
|
||||
const uxExploratoryViewLink = createExploratoryViewUrl(
|
||||
|
|
|
@ -28,7 +28,7 @@ import moment from 'moment';
|
|||
import React from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useUiSetting$ } from '../../../../../../../../src/plugins/kibana_react/public';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { fromQuery, toQuery } from '../../../shared/Links/url_helpers';
|
||||
import { ChartWrapper } from '../ChartWrapper';
|
||||
import { I18LABELS } from '../translations';
|
||||
|
@ -43,7 +43,7 @@ interface Props {
|
|||
|
||||
export function PageViewsChart({ data, loading }: Props) {
|
||||
const history = useHistory();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const { start, end } = urlParams;
|
||||
const diffInDays = moment(new Date(end as string)).diff(
|
||||
|
|
|
@ -15,13 +15,13 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { I18LABELS } from '../translations';
|
||||
import { getPercentileLabel } from '../UXMetrics/translations';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { Metrics } from './Metrics';
|
||||
|
||||
export function ClientMetrics() {
|
||||
const {
|
||||
urlParams: { percentile },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
return (
|
||||
<EuiPanel hasBorder={true}>
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
import numeral from '@elastic/numeral';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { I18LABELS } from '../translations';
|
||||
import { CsmSharedContext } from '../CsmSharedContext';
|
||||
|
@ -31,7 +31,7 @@ interface JSErrorItem {
|
|||
}
|
||||
|
||||
export function JSErrors() {
|
||||
const { urlParams, uxUiFilters } = useUrlParams();
|
||||
const { urlParams, uxUiFilters } = useLegacyUrlParams();
|
||||
|
||||
const { start, end, serviceName, searchTerm } = urlParams;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, { Fragment } from 'react';
|
|||
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import styled from 'styled-components';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { FilterValueLabel } from '../../../../../../observability/public';
|
||||
import { FiltersUIHook } from '../hooks/useLocalUIFilters';
|
||||
import { UxLocalUIFilterName } from '../../../../../common/ux_ui_filter';
|
||||
|
@ -38,7 +38,7 @@ export function SelectedFilters({
|
|||
const {
|
||||
uxUiFilters,
|
||||
urlParams: { searchTerm },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
const { transactionUrl } = uxUiFilters;
|
||||
|
||||
const urlValues = transactionUrl ?? [];
|
||||
|
|
|
@ -9,7 +9,7 @@ import * as React from 'react';
|
|||
import { useCallback } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { FilterValueLabel } from '../../../../../../observability/public';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { fromQuery, toQuery } from '../../../shared/Links/url_helpers';
|
||||
import { TRANSACTION_URL } from '../../../../../common/elasticsearch_fieldnames';
|
||||
import { IndexPattern } from '../../../../../../../../src/plugins/data_views/common';
|
||||
|
@ -22,7 +22,7 @@ export function SelectedWildcards({ indexPattern }: Props) {
|
|||
|
||||
const {
|
||||
urlParams: { searchTerm },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const updateSearchTerm = useCallback(
|
||||
(searchTermN: string) => {
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
EuiTitle,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { I18LABELS } from '../translations';
|
||||
import { BreakdownFilter } from '../Breakdowns/BreakdownFilter';
|
||||
|
@ -34,7 +34,7 @@ export function PageLoadDistribution() {
|
|||
services: { http },
|
||||
} = useKibana();
|
||||
|
||||
const { urlParams, uxUiFilters } = useUrlParams();
|
||||
const { urlParams, uxUiFilters } = useLegacyUrlParams();
|
||||
|
||||
const { start, end, rangeFrom, rangeTo, searchTerm } = urlParams;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { PercentileRange } from './index';
|
||||
|
||||
interface Props {
|
||||
|
@ -16,7 +16,7 @@ interface Props {
|
|||
}
|
||||
|
||||
export const useBreakdowns = ({ percentileRange, field, value }: Props) => {
|
||||
const { urlParams, uxUiFilters } = useUrlParams();
|
||||
const { urlParams, uxUiFilters } = useLegacyUrlParams();
|
||||
const { start, end, searchTerm } = urlParams;
|
||||
const { min: minP, max: maxP } = percentileRange ?? {};
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
EuiTitle,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { I18LABELS } from '../translations';
|
||||
import { BreakdownFilter } from '../Breakdowns/BreakdownFilter';
|
||||
|
@ -28,7 +28,7 @@ export function PageViewsTrend() {
|
|||
services: { http },
|
||||
} = useKibana();
|
||||
|
||||
const { urlParams, uxUiFilters } = useUrlParams();
|
||||
const { urlParams, uxUiFilters } = useLegacyUrlParams();
|
||||
const { serviceName } = uxUiFilters;
|
||||
|
||||
const { start, end, searchTerm, rangeTo, rangeFrom } = urlParams;
|
||||
|
|
|
@ -9,12 +9,12 @@ import React from 'react';
|
|||
import { ServiceNameFilter } from '../URLFilter/ServiceNameFilter';
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { RUM_AGENT_NAMES } from '../../../../../common/agent_name';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
|
||||
export function WebApplicationSelect() {
|
||||
const {
|
||||
urlParams: { start, end },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const { data, status } = useFetcher(
|
||||
(callApmApi) => {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { EuiSelect } from '@elastic/eui';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import React, { useEffect, useCallback } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useUrlParams } from '../../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../../context/url_params_context/use_url_params';
|
||||
import { fromQuery, toQuery } from '../../../../shared/Links/url_helpers';
|
||||
|
||||
interface Props {
|
||||
|
@ -21,7 +21,7 @@ function ServiceNameFilter({ loading, serviceNames }: Props) {
|
|||
const history = useHistory();
|
||||
const {
|
||||
urlParams: { serviceName: selectedServiceName },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const options = serviceNames.map((type) => ({
|
||||
text: type,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { isEqual, map } from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useUrlParams } from '../../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../../context/url_params_context/use_url_params';
|
||||
import { I18LABELS } from '../../translations';
|
||||
import { formatToSec } from '../../UXMetrics/KeyUXMetrics';
|
||||
import { getPercentileLabel } from '../../UXMetrics/translations';
|
||||
|
@ -93,7 +93,7 @@ export function URLSearch({
|
|||
const {
|
||||
uxUiFilters: { transactionUrl, transactionUrlExcluded },
|
||||
urlParams,
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const { searchTerm, percentile } = urlParams;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import useDebounce from 'react-use/lib/useDebounce';
|
|||
import { useState } from 'react';
|
||||
import { useFetcher } from '../../../../../hooks/use_fetcher';
|
||||
import { useUxQuery } from '../../hooks/useUxQuery';
|
||||
import { useUrlParams } from '../../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../../context/url_params_context/use_url_params';
|
||||
|
||||
interface Props {
|
||||
popoverIsOpen: boolean;
|
||||
|
@ -19,7 +19,7 @@ interface Props {
|
|||
export const useUrlSearch = ({ popoverIsOpen, query }: Props) => {
|
||||
const uxQuery = useUxQuery();
|
||||
|
||||
const { uxUiFilters } = useUrlParams();
|
||||
const { uxUiFilters } = useLegacyUrlParams();
|
||||
|
||||
const { transactionUrl, transactionUrlExcluded, ...restFilters } =
|
||||
uxUiFilters;
|
||||
|
|
|
@ -20,13 +20,13 @@ import { useFetcher } from '../../../../hooks/use_fetcher';
|
|||
import { useUxQuery } from '../hooks/useUxQuery';
|
||||
import { getCoreVitalsComponent } from '../../../../../../observability/public';
|
||||
import { CsmSharedContext } from '../CsmSharedContext';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { getPercentileLabel } from './translations';
|
||||
|
||||
export function UXMetrics() {
|
||||
const {
|
||||
urlParams: { percentile },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const uxQuery = useUxQuery();
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, { useCallback, useEffect } from 'react';
|
|||
|
||||
import { EuiSelect } from '@elastic/eui';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { fromQuery, toQuery } from '../../../shared/Links/url_helpers';
|
||||
import { I18LABELS } from '../translations';
|
||||
|
||||
|
@ -20,7 +20,7 @@ export function UserPercentile() {
|
|||
|
||||
const {
|
||||
urlParams: { percentile },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const updatePercentile = useCallback(
|
||||
(percentileN?: number, replaceHistory?: boolean) => {
|
||||
|
|
|
@ -10,10 +10,10 @@ import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer } from '@elastic/eui';
|
|||
import { VisitorBreakdownChart } from '../Charts/VisitorBreakdownChart';
|
||||
import { I18LABELS, VisitorBreakdownLabel } from '../translations';
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
|
||||
export function VisitorBreakdown() {
|
||||
const { urlParams, uxUiFilters } = useUrlParams();
|
||||
const { urlParams, uxUiFilters } = useLegacyUrlParams();
|
||||
|
||||
const { start, end, searchTerm } = urlParams;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
isErrorEmbeddable,
|
||||
} from '../../../../../../../../src/plugins/embeddable/public';
|
||||
import { useLayerList } from './useLayerList';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import type { RenderTooltipContentParams } from '../../../../../../maps/public';
|
||||
import { MapToolTip } from './MapToolTip';
|
||||
|
@ -50,7 +50,7 @@ interface KibanaDeps {
|
|||
embeddable: EmbeddableStart;
|
||||
}
|
||||
export function EmbeddedMapComponent() {
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const apmPluginContext = useApmPluginContext();
|
||||
|
||||
const { start, end, serviceName } = urlParams;
|
||||
|
|
|
@ -22,7 +22,7 @@ import {
|
|||
} from '../../../../../../maps/common';
|
||||
|
||||
import { APM_STATIC_INDEX_PATTERN_ID } from '../../../../../common/index_pattern_constants';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import {
|
||||
SERVICE_NAME,
|
||||
TRANSACTION_TYPE,
|
||||
|
@ -84,7 +84,7 @@ interface VectorLayerDescriptor extends BaseVectorLayerDescriptor {
|
|||
}
|
||||
|
||||
export function useLayerList() {
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const { serviceName } = urlParams;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { useMemo } from 'react';
|
||||
import { FieldFilter as Filter } from '@kbn/es-query';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import {
|
||||
CLIENT_GEO_COUNTRY_ISO_CODE,
|
||||
SERVICE_NAME,
|
||||
|
@ -92,7 +92,7 @@ const existFilter: Filter = {
|
|||
};
|
||||
|
||||
export const useMapFilters = (): Filter[] => {
|
||||
const { urlParams, uxUiFilters } = useUrlParams();
|
||||
const { urlParams, uxUiFilters } = useLegacyUrlParams();
|
||||
|
||||
const { serviceName, searchTerm } = urlParams;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
toQuery,
|
||||
} from '../../../../components/shared/Links/url_helpers';
|
||||
import { removeUndefinedProps } from '../../../../context/url_params_context/helpers';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { getExcludedName } from '../LocalUIFilters';
|
||||
|
||||
export type FiltersUIHook = ReturnType<typeof useLocalUIFilters>;
|
||||
|
@ -28,7 +28,7 @@ export function useLocalUIFilters({
|
|||
filterNames: UxLocalUIFilterName[];
|
||||
}) {
|
||||
const history = useHistory();
|
||||
const { uxUiFilters } = useUrlParams();
|
||||
const { uxUiFilters } = useLegacyUrlParams();
|
||||
|
||||
const setFilterValue = (name: UxLocalUIFilterName, value: string[]) => {
|
||||
const search = omit(toQuery(history.location.search), name);
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
*/
|
||||
|
||||
import { useMemo } from 'react';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
|
||||
export function useUxQuery() {
|
||||
const { urlParams, uxUiFilters } = useUrlParams();
|
||||
const { urlParams, uxUiFilters } = useLegacyUrlParams();
|
||||
|
||||
const { start, end, searchTerm, percentile } = urlParams;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import React from 'react';
|
||||
import { getNodeName, NodeType } from '../../../../common/connections';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useFetcher } from '../../../hooks/use_fetcher';
|
||||
import { getTimeRangeComparison } from '../../shared/time_comparison/get_time_range_comparison';
|
||||
import { DependenciesTable } from '../../shared/dependencies_table';
|
||||
|
@ -19,7 +19,7 @@ import { useTimeRange } from '../../../hooks/use_time_range';
|
|||
export function BackendDetailDependenciesTable() {
|
||||
const {
|
||||
urlParams: { comparisonEnabled, comparisonType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { backendName, rangeFrom, rangeTo, kuery, environment },
|
||||
|
|
|
@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import React from 'react';
|
||||
import { useUiTracker } from '../../../../../../observability/public';
|
||||
import { getNodeName, NodeType } from '../../../../../common/connections';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../../hooks/use_apm_params';
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { useTimeRange } from '../../../../hooks/use_time_range';
|
||||
|
@ -21,7 +21,7 @@ import { getTimeRangeComparison } from '../../../shared/time_comparison/get_time
|
|||
export function BackendInventoryDependenciesTable() {
|
||||
const {
|
||||
urlParams: { comparisonEnabled, comparisonType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { rangeFrom, rangeTo, environment, kuery },
|
||||
|
|
|
@ -29,7 +29,7 @@ import { getAlertAnnotations } from '../../../shared/charts/helper/get_alert_ann
|
|||
import { ChartContainer } from '../../../shared/charts/chart_container';
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { LazyAlertsFlyout } from '../../../../../../observability/public';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { getTimeZone } from '../../../shared/charts/helper/timezone';
|
||||
|
||||
const ALERT_RULE_TYPE_ID: typeof ALERT_RULE_TYPE_ID_TYPED =
|
||||
|
@ -48,7 +48,7 @@ export function ErrorDistribution({ distribution, title, fetchStatus }: Props) {
|
|||
const { core } = useApmPluginContext();
|
||||
const theme = useTheme();
|
||||
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { comparisonEnabled } = urlParams;
|
||||
|
||||
const timeseries = [
|
||||
|
|
|
@ -20,7 +20,7 @@ import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'
|
|||
import { NOT_AVAILABLE_LABEL } from '../../../../common/i18n';
|
||||
import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context';
|
||||
import { useBreadcrumb } from '../../../context/breadcrumbs/use_breadcrumb';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { useApmRouter } from '../../../hooks/use_apm_router';
|
||||
import { useErrorGroupDistributionFetcher } from '../../../hooks/use_error_group_distribution_fetcher';
|
||||
|
@ -94,7 +94,7 @@ function ErrorGroupHeader({
|
|||
}
|
||||
|
||||
export function ErrorGroupDetails() {
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const { serviceName } = useApmServiceContext();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import React, { useMemo } from 'react';
|
||||
import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common';
|
||||
import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
|
||||
import { truncate, unit } from '../../../../utils/style';
|
||||
import { ErrorDetailLink } from '../../../shared/Links/apm/ErrorDetailLink';
|
||||
|
@ -56,7 +56,7 @@ interface Props {
|
|||
}
|
||||
|
||||
function ErrorGroupList({ items, serviceName }: Props) {
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
|
|
|
@ -17,7 +17,7 @@ import uuid from 'uuid';
|
|||
import { toMountPoint } from '../../../../../../../src/plugins/kibana_react/public';
|
||||
import { useAnomalyDetectionJobsContext } from '../../../context/anomaly_detection_jobs/use_anomaly_detection_jobs_context';
|
||||
import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLocalStorage } from '../../../hooks/useLocalStorage';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher';
|
||||
|
@ -42,7 +42,7 @@ let hasDisplayedToast = false;
|
|||
function useServicesFetcher() {
|
||||
const {
|
||||
urlParams: { comparisonEnabled, comparisonType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { rangeFrom, rangeTo, environment, kuery },
|
||||
|
|
|
@ -11,8 +11,8 @@ import React, { useContext, useEffect, useState } from 'react';
|
|||
import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common';
|
||||
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 { getLegacyApmHref } from '../../shared/Links/apm/APMLink';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { APMQueryParams } from '../../shared/Links/url_helpers';
|
||||
import { CytoscapeContext } from './Cytoscape';
|
||||
import { getAnimationOptions, getNodeHeight } from './cytoscape_options';
|
||||
|
@ -103,7 +103,7 @@ export function Controls() {
|
|||
const { basePath } = core.http;
|
||||
const theme = useTheme();
|
||||
const cy = useContext(CytoscapeContext);
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { kuery },
|
||||
|
|
|
@ -11,7 +11,7 @@ import React, { ReactNode } from 'react';
|
|||
import { useUiTracker } from '../../../../../../observability/public';
|
||||
import { getNodeName, NodeType } from '../../../../../common/connections';
|
||||
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../../hooks/use_apm_params';
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { useTimeRange } from '../../../../hooks/use_time_range';
|
||||
|
@ -33,7 +33,7 @@ export function ServiceOverviewDependenciesTable({
|
|||
}: ServiceOverviewDependenciesTableProps) {
|
||||
const {
|
||||
urlParams: { comparisonEnabled, comparisonType, latencyAggregationType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { environment, kuery, rangeFrom, rangeTo },
|
||||
|
|
|
@ -16,7 +16,7 @@ import { orderBy } from 'lodash';
|
|||
import React, { useState } from 'react';
|
||||
import uuid from 'uuid';
|
||||
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
|
||||
import { ErrorOverviewLink } from '../../../shared/Links/apm/ErrorOverviewLink';
|
||||
|
@ -61,7 +61,7 @@ const INITIAL_STATE_DETAILED_STATISTICS: ErrorGroupDetailedStatistics = {
|
|||
export function ServiceOverviewErrorsTable({ serviceName }: Props) {
|
||||
const {
|
||||
urlParams: { comparisonType, comparisonEnabled },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
const { transactionType } = useApmServiceContext();
|
||||
const [tableOptions, setTableOptions] = useState<{
|
||||
pageIndex: number;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { orderBy } from 'lodash';
|
|||
import React, { useState } from 'react';
|
||||
import uuid from 'uuid';
|
||||
import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher';
|
||||
import { useTimeRange } from '../../../hooks/use_time_range';
|
||||
|
@ -78,7 +78,7 @@ export function ServiceOverviewInstancesChartAndTable({
|
|||
|
||||
const {
|
||||
urlParams: { latencyAggregationType, comparisonType, comparisonEnabled },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const { start, end } = useTimeRange({ rangeFrom, rangeTo });
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import React, { ReactNode, useEffect, useState } from 'react';
|
||||
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { FETCH_STATUS } from '../../../../hooks/use_fetcher';
|
||||
import { APIReturnType } from '../../../../services/rest/createCallApmApi';
|
||||
import {
|
||||
|
@ -76,7 +76,7 @@ export function ServiceOverviewInstancesTable({
|
|||
|
||||
const {
|
||||
urlParams: { latencyAggregationType, comparisonEnabled },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const [itemIdToOpenActionMenuRowMap, setItemIdToOpenActionMenuRowMap] =
|
||||
useState<Record<string, boolean>>({});
|
||||
|
|
|
@ -16,7 +16,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import React from 'react';
|
||||
import { asExactTransactionRate } from '../../../../common/utils/formatters';
|
||||
import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { useFetcher } from '../../../hooks/use_fetcher';
|
||||
import { useTheme } from '../../../hooks/use_theme';
|
||||
|
@ -48,7 +48,7 @@ export function ServiceOverviewThroughputChart({
|
|||
|
||||
const {
|
||||
urlParams: { comparisonEnabled, comparisonType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { rangeFrom, rangeTo },
|
||||
|
|
|
@ -25,7 +25,7 @@ import { useUiTracker } from '../../../../../../observability/public';
|
|||
import { getDurationFormatter } from '../../../../../common/utils/formatters';
|
||||
import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../../common/search_strategies/constants';
|
||||
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { FETCH_STATUS } from '../../../../hooks/use_fetcher';
|
||||
|
||||
import { TransactionDistributionChart } from '../../../shared/charts/transaction_distribution_chart';
|
||||
|
@ -69,7 +69,7 @@ export function TransactionDistribution({
|
|||
traceSamples,
|
||||
}: TransactionDistributionProps) {
|
||||
const transactionColors = useTransactionColors();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { waterfall, status: waterfallStatus } = useWaterfallFetcher();
|
||||
|
||||
const markerCurrentTransaction =
|
||||
|
|
|
@ -16,7 +16,7 @@ import { EventOutcome } from '../../../../../common/event_outcome';
|
|||
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../../hooks/use_apm_params';
|
||||
import { useFetcher, FETCH_STATUS } from '../../../../hooks/use_fetcher';
|
||||
import { useTimeRange } from '../../../../hooks/use_time_range';
|
||||
|
@ -37,7 +37,7 @@ export const useTransactionDistributionChartData = () => {
|
|||
core: { notifications },
|
||||
} = useApmPluginContext();
|
||||
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { transactionName } = urlParams;
|
||||
|
||||
const {
|
||||
|
|
|
@ -13,7 +13,7 @@ import { useHistory } from 'react-router-dom';
|
|||
import { XYBrushEvent } from '@elastic/charts';
|
||||
import { EuiPanel, EuiSpacer, EuiTabs, EuiTab } from '@elastic/eui';
|
||||
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { useTransactionTraceSamplesFetcher } from '../../../hooks/use_transaction_trace_samples_fetcher';
|
||||
|
||||
|
@ -34,7 +34,7 @@ const tabs = [
|
|||
export function TransactionDetailsTabs() {
|
||||
const { query } = useApmParams('/services/{serviceName}/transactions/view');
|
||||
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const history = useHistory();
|
||||
|
||||
const [currentTab, setCurrentTab] = useState(traceSamplesTab.key);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useMemo } from 'react';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { useFetcher } from '../../../hooks/use_fetcher';
|
||||
import { useTimeRange } from '../../../hooks/use_time_range';
|
||||
|
@ -19,7 +19,7 @@ const INITIAL_DATA = {
|
|||
};
|
||||
|
||||
export function useWaterfallFetcher() {
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { traceId, transactionId } = urlParams;
|
||||
|
||||
const {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { EuiButton, EuiFlexItem, EuiToolTip } from '@elastic/eui';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import React from 'react';
|
||||
import { getNextEnvironmentUrlParam } from '../../../../../common/environment_filter_values';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { Transaction as ITransaction } from '../../../../../typings/es_schemas/ui/transaction';
|
||||
import { TransactionDetailLink } from '../../../shared/Links/apm/transaction_detail_link';
|
||||
import { IWaterfall } from './waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers';
|
||||
|
@ -26,7 +26,7 @@ export function MaybeViewTraceLink({
|
|||
}) {
|
||||
const {
|
||||
urlParams: { latencyAggregationType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const viewFullTraceButtonLabel = i18n.translate(
|
||||
'xpack.apm.transactionDetails.viewFullTraceButtonLabel',
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
} from '../../../../../../../common/elasticsearch_fieldnames';
|
||||
import { getNextEnvironmentUrlParam } from '../../../../../../../common/environment_filter_values';
|
||||
import { Transaction } from '../../../../../../../typings/es_schemas/ui/transaction';
|
||||
import { useUrlParams } from '../../../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../../../../hooks/use_apm_params';
|
||||
import { TransactionDetailLink } from '../../../../../shared/Links/apm/transaction_detail_link';
|
||||
import { ServiceLink } from '../../../../../shared/service_link';
|
||||
|
@ -26,7 +26,7 @@ interface Props {
|
|||
export function FlyoutTopLevelProperties({ transaction }: Props) {
|
||||
const {
|
||||
urlParams: { latencyAggregationType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
const { query } = useApmParams('/services/{serviceName}/transactions/view');
|
||||
|
||||
if (!transaction) {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { EuiLink } from '@elastic/eui';
|
|||
import { UI_SETTINGS } from '../../../../../../../../src/plugins/data/common';
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { useMlHref, ML_PAGES } from '../../../../../../ml/public';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { TimePickerRefreshInterval } from '../../DatePicker/typings';
|
||||
|
||||
interface Props {
|
||||
|
@ -37,7 +37,7 @@ export function useExplorerHref({ jobId }: { jobId: string }) {
|
|||
core,
|
||||
plugins: { ml },
|
||||
} = useApmPluginContext();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const timePickerRefreshIntervalDefaults =
|
||||
core.uiSettings.get<TimePickerRefreshInterval>(
|
||||
|
|
|
@ -10,7 +10,7 @@ import React from 'react';
|
|||
import { UI_SETTINGS } from '../../../../../../../../src/plugins/data/common';
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { useMlHref, ML_PAGES } from '../../../../../../ml/public';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { TimePickerRefreshInterval } from '../../DatePicker/typings';
|
||||
|
||||
interface Props {
|
||||
|
@ -24,7 +24,7 @@ export function MLManageJobsLink({ children, external }: Props) {
|
|||
plugins: { ml },
|
||||
} = useApmPluginContext();
|
||||
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const timePickerRefreshIntervalDefaults =
|
||||
core.uiSettings.get<TimePickerRefreshInterval>(
|
||||
|
|
|
@ -10,7 +10,7 @@ import { EuiLink } from '@elastic/eui';
|
|||
import { UI_SETTINGS } from '../../../../../../../../src/plugins/data/common';
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { useMlHref, ML_PAGES } from '../../../../../../ml/public';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { TimePickerRefreshInterval } from '../../DatePicker/typings';
|
||||
|
||||
interface Props {
|
||||
|
@ -53,7 +53,7 @@ export function useSingleMetricHref({
|
|||
core,
|
||||
plugins: { ml },
|
||||
} = useApmPluginContext();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const timePickerRefreshIntervalDefaults =
|
||||
core.uiSettings.get<TimePickerRefreshInterval>(
|
||||
|
|
|
@ -13,7 +13,7 @@ import { useLocation } from 'react-router-dom';
|
|||
import url from 'url';
|
||||
import { pickKeys } from '../../../../../common/utils/pick_keys';
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { APMQueryParams, fromQuery, toQuery } from '../url_helpers';
|
||||
|
||||
interface Props extends EuiLinkAnchorProps {
|
||||
|
@ -46,7 +46,7 @@ export function useAPMHref({
|
|||
persistedFilters?: Array<keyof APMQueryParams>;
|
||||
query?: APMQueryParams;
|
||||
}) {
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { basePath } = useApmPluginContext().core.http;
|
||||
const { search } = useLocation();
|
||||
const nextQuery = {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { pickKeys } from '../../../../../common/utils/pick_keys';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { APMQueryParams } from '../url_helpers';
|
||||
import { APMLink, APMLinkExtendProps } from './APMLink';
|
||||
|
||||
|
@ -24,7 +24,7 @@ interface Props extends APMLinkExtendProps {
|
|||
}
|
||||
|
||||
export function ErrorOverviewLink({ serviceName, query, ...rest }: Props) {
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
return (
|
||||
<APMLink
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useLocation } from 'react-router-dom';
|
|||
import { EuiLink } from '@elastic/eui';
|
||||
import { pickBy, identity } from 'lodash';
|
||||
import { getLegacyApmHref, APMLinkExtendProps } from './APMLink';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { pickKeys } from '../../../../../common/utils/pick_keys';
|
||||
import { APMQueryParams } from '../url_helpers';
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
|
@ -40,7 +40,7 @@ export function TransactionDetailLink({
|
|||
environment,
|
||||
...rest
|
||||
}: Props) {
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { core } = useApmPluginContext();
|
||||
const location = useLocation();
|
||||
const href = getLegacyApmHref({
|
||||
|
|
|
@ -20,7 +20,7 @@ import { isEmpty } from 'lodash';
|
|||
import React, { useCallback } from 'react';
|
||||
import { useHistory, useLocation } from 'react-router-dom';
|
||||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { HeightRetainer } from '../HeightRetainer';
|
||||
import { fromQuery, toQuery } from '../Links/url_helpers';
|
||||
import { filterSectionsByTerm } from './helper';
|
||||
|
@ -36,7 +36,7 @@ interface Props {
|
|||
export function MetadataTable({ sections, isLoading }: Props) {
|
||||
const history = useHistory();
|
||||
const location = useLocation();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { searchTerm = '' } = urlParams;
|
||||
const { docLinks } = useApmPluginContext().core;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
TRANSACTION_ID,
|
||||
} from '../../../../../../common/elasticsearch_fieldnames';
|
||||
import { asDuration } from '../../../../../../common/utils/formatters';
|
||||
import { useUrlParams } from '../../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../../context/url_params_context/use_url_params';
|
||||
import { useTheme } from '../../../../../hooks/use_theme';
|
||||
import { ErrorMark } from '../../../../app/transaction_details/waterfall_with_summary/waterfall_container/Marks/get_error_marks';
|
||||
import { ErrorDetailLink } from '../../../Links/apm/ErrorDetailLink';
|
||||
|
@ -55,7 +55,7 @@ function truncateMessage(errorMessage?: string) {
|
|||
|
||||
export function ErrorMarker({ mark }: Props) {
|
||||
const theme = useTheme();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const [isPopoverOpen, showPopover] = useState(false);
|
||||
|
||||
const togglePopover = () => showPopover(!isPopoverOpen);
|
||||
|
|
|
@ -14,7 +14,7 @@ import { APIReturnType } from '../../../../services/rest/createCallApmApi';
|
|||
import { asPercent } from '../../../../../common/utils/formatters';
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { useTheme } from '../../../../hooks/use_theme';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { TimeseriesChart } from '../timeseries_chart';
|
||||
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
|
||||
import {
|
||||
|
@ -58,7 +58,7 @@ export function FailedTransactionRateChart({
|
|||
const theme = useTheme();
|
||||
const {
|
||||
urlParams: { transactionName, comparisonEnabled, comparisonType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { rangeFrom, rangeTo },
|
||||
|
|
|
@ -17,7 +17,7 @@ import { useApmServiceContext } from '../../../../context/apm_service/use_apm_se
|
|||
import { LatencyAggregationType } from '../../../../../common/latency_aggregation_types';
|
||||
import { getDurationFormatter } from '../../../../../common/utils/formatters';
|
||||
import { useLicenseContext } from '../../../../context/license/use_license_context';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useTheme } from '../../../../hooks/use_theme';
|
||||
import { useTransactionLatencyChartsFetcher } from '../../../../hooks/use_transaction_latency_chart_fetcher';
|
||||
import { TimeseriesChart } from '../../../shared/charts/timeseries_chart';
|
||||
|
@ -52,7 +52,7 @@ export function LatencyChart({ height, kuery, environment }: Props) {
|
|||
const history = useHistory();
|
||||
const theme = useTheme();
|
||||
const comparisonChartTheme = getComparisonChartTheme(theme);
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { latencyAggregationType, comparisonEnabled } = urlParams;
|
||||
const license = useLicenseContext();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useFetcher } from '../../../../hooks/use_fetcher';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
|
||||
import { useApmParams } from '../../../../hooks/use_apm_params';
|
||||
import { useTimeRange } from '../../../../hooks/use_time_range';
|
||||
|
@ -20,7 +20,7 @@ export function useTransactionBreakdown({
|
|||
}) {
|
||||
const {
|
||||
urlParams: { transactionName },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { rangeFrom, rangeTo },
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
QuerySuggestion,
|
||||
} from '../../../../../../../src/plugins/data/public';
|
||||
import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { useDynamicDataViewFetcher } from '../../../hooks/use_dynamic_data_view';
|
||||
import { fromQuery, toQuery } from '../Links/url_helpers';
|
||||
|
@ -52,7 +52,7 @@ export function KueryBar(props: {
|
|||
suggestions: [],
|
||||
isLoadingSuggestions: false,
|
||||
});
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const location = useLocation();
|
||||
const { data } = useApmPluginContext().plugins;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { EuiBasicTable, EuiBasicTableColumn } from '@elastic/eui';
|
|||
import { orderBy } from 'lodash';
|
||||
import React, { ReactNode, useCallback, useMemo } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { fromQuery, toQuery } from '../Links/url_helpers';
|
||||
|
||||
// TODO: this should really be imported from EUI
|
||||
|
@ -79,7 +79,7 @@ function UnoptimizedManagedTable<T>(props: Props<T>) {
|
|||
sortField = initialSortField,
|
||||
sortDirection = initialSortDirection,
|
||||
},
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const renderedItems = useMemo(() => {
|
||||
const sortedItems = sortItems
|
||||
|
|
|
@ -13,7 +13,7 @@ import { useHistory } from 'react-router-dom';
|
|||
import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common';
|
||||
import { useUiTracker } from '../../../../../observability/public';
|
||||
import { TimeRangeComparisonEnum } from '../../../../common/runtime_types/comparison_type_rt';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from '../../../hooks/use_apm_params';
|
||||
import { useBreakpoints } from '../../../hooks/use_breakpoints';
|
||||
import { useTimeRange } from '../../../hooks/use_time_range';
|
||||
|
@ -127,7 +127,7 @@ export function TimeComparison() {
|
|||
|
||||
const {
|
||||
urlParams: { comparisonEnabled, comparisonType },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const comparisonTypes = getComparisonTypes({
|
||||
start: exactStart,
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
import { Transaction } from '../../../../typings/es_schemas/ui/transaction';
|
||||
import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { useLicenseContext } from '../../../context/license/use_license_context';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { CustomLinkMenuSection } from './custom_link_menu_section';
|
||||
import { getSections } from './sections';
|
||||
|
||||
|
@ -45,7 +45,7 @@ export function TransactionActionMenu({ transaction }: Props) {
|
|||
|
||||
const { core } = useApmPluginContext();
|
||||
const location = useLocation();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
|
||||
const [isActionPopoverOpen, setIsActionPopoverOpen] = useState(false);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
|||
import { EuiCode } from '@elastic/eui';
|
||||
import { APIReturnType } from '../../../services/rest/createCallApmApi';
|
||||
import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context';
|
||||
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params';
|
||||
import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher';
|
||||
import { TransactionOverviewLink } from '../Links/apm/transaction_overview_link';
|
||||
import { getTimeRangeComparison } from '../time_comparison/get_time_range_comparison';
|
||||
|
@ -100,7 +100,7 @@ export function TransactionsTable({
|
|||
const { transactionType, serviceName } = useApmServiceContext();
|
||||
const {
|
||||
urlParams: { latencyAggregationType, comparisonType, comparisonEnabled },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const { comparisonStart, comparisonEnd } = getTimeRangeComparison({
|
||||
start,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useMemo, useContext } from 'react';
|
|||
import type { ApmUrlParams } from './types';
|
||||
import { UrlParamsContext } from './url_params_context';
|
||||
|
||||
export function useUrlParams(): Assign<
|
||||
export function useLegacyUrlParams(): Assign<
|
||||
React.ContextType<typeof UrlParamsContext>,
|
||||
{ urlParams: ApmUrlParams }
|
||||
> {
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
getComparisonChartTheme,
|
||||
getTimeRangeComparison,
|
||||
} from '../components/shared/time_comparison/get_time_range_comparison';
|
||||
import { useUrlParams } from '../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../context/url_params_context/use_url_params';
|
||||
import { useApmParams } from './use_apm_params';
|
||||
import { useTheme } from './use_theme';
|
||||
import { useTimeRange } from './use_time_range';
|
||||
|
@ -31,7 +31,7 @@ export function useComparison() {
|
|||
|
||||
const {
|
||||
urlParams: { comparisonType, comparisonEnabled },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const { offset } = getTimeRangeComparison({
|
||||
start,
|
||||
|
|
|
@ -31,7 +31,7 @@ import {
|
|||
APM_SEARCH_STRATEGIES,
|
||||
} from '../../common/search_strategies/constants';
|
||||
import { useApmServiceContext } from '../context/apm_service/use_apm_service_context';
|
||||
import { useUrlParams } from '../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../context/url_params_context/use_url_params';
|
||||
|
||||
import { ApmPluginStartDeps } from '../plugin';
|
||||
|
||||
|
@ -103,7 +103,7 @@ export function useSearchStrategy<
|
|||
query: { kuery, environment, rangeFrom, rangeTo },
|
||||
} = useApmParams('/services/{serviceName}/transactions/view');
|
||||
const { start, end } = useTimeRange({ rangeFrom, rangeTo });
|
||||
const { urlParams } = useUrlParams();
|
||||
const { urlParams } = useLegacyUrlParams();
|
||||
const { transactionName } = urlParams;
|
||||
|
||||
const [rawResponse, setRawResponse] = useReducer(
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { useMemo } from 'react';
|
||||
import { useFetcher } from './use_fetcher';
|
||||
import { useUrlParams } from '../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../context/url_params_context/use_url_params';
|
||||
import { useApmServiceContext } from '../context/apm_service/use_apm_service_context';
|
||||
import { getLatencyChartSelector } from '../selectors/latency_chart_selectors';
|
||||
import { useTheme } from './use_theme';
|
||||
|
@ -31,7 +31,7 @@ export function useTransactionLatencyChartsFetcher({
|
|||
comparisonType,
|
||||
comparisonEnabled,
|
||||
},
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
query: { rangeFrom, rangeTo },
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useFetcher } from './use_fetcher';
|
||||
import { useUrlParams } from '../context/url_params_context/use_url_params';
|
||||
import { useLegacyUrlParams } from '../context/url_params_context/use_url_params';
|
||||
import { useApmServiceContext } from '../context/apm_service/use_apm_service_context';
|
||||
import { useApmParams } from './use_apm_params';
|
||||
import { useTimeRange } from './use_time_range';
|
||||
|
@ -39,7 +39,7 @@ export function useTransactionTraceSamplesFetcher({
|
|||
|
||||
const {
|
||||
urlParams: { transactionId, traceId, sampleRangeFrom, sampleRangeTo },
|
||||
} = useUrlParams();
|
||||
} = useLegacyUrlParams();
|
||||
|
||||
const {
|
||||
data = INITIAL_DATA,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue