Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] "View job" link from latency charts leads to a malfunctioning page #86788

Merged
merged 2 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export function MLManageJobsLink({ children, external }: Props) {
rangeFrom = 'now-1h',
rangeTo = 'now',
refreshInterval = timePickerRefreshIntervalDefaults.value,
refreshPaused = timePickerRefreshIntervalDefaults.pause,
// defaults it to true to avoid infinite loop when refreshInterval is "0"
refreshPaused = true,
cauemarcondes marked this conversation as resolved.
Show resolved Hide resolved
} = urlParams;

const mlADLink = useMlHref(ml, core.http.basePath.get(), {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export function useSingleMetricHref({
rangeFrom = 'now-1h',
rangeTo = 'now',
refreshInterval = timePickerRefreshIntervalDefaults.value,
refreshPaused = timePickerRefreshIntervalDefaults.pause,
// defaults it to true to avoid infinite loop when refreshInterval is "0"
refreshPaused = true,
} = urlParams;

const entities =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { isEmpty } from 'lodash';
import React from 'react';
import { useParams } from 'react-router-dom';
import styled from 'styled-components';
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
import { MLSingleMetricLink } from '../../Links/MachineLearningLinks/MLSingleMetricLink';

Expand All @@ -33,12 +34,13 @@ const ShiftedEuiText = styled(EuiText)`
export function MLHeader({ hasValidMlLicense, mlJobId }: Props) {
const { serviceName } = useParams<{ serviceName?: string }>();
const { urlParams } = useUrlParams();
const { transactionType } = useApmServiceContext();

if (!hasValidMlLicense || !mlJobId) {
return null;
}

const { kuery, transactionType } = urlParams;
const { kuery } = urlParams;

const hasKuery = !isEmpty(kuery);
const icon = hasKuery ? (
Expand Down