Skip to content

Commit

Permalink
[ML] Update redirect for dfa wizard to use constants
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Aug 21, 2020
1 parent c1f8cde commit 98dd2e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import React, { FC, Fragment } from 'react';
import { EuiCard, EuiIcon } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useMlKibana, useMlUrlGenerator } from '../../../../../contexts/kibana';
import { ML_TABS } from '../../../../../../url_generator';

export const BackToListPanel: FC = () => {
const urlGenerator = useMlUrlGenerator();
Expand All @@ -18,7 +19,7 @@ export const BackToListPanel: FC = () => {
} = useMlKibana();

const redirectToAnalyticsManagementPage = async () => {
const url = await urlGenerator.createUrl({ page: 'data_frame_analytics' });
const url = await urlGenerator.createUrl({ page: ML_TABS.DATA_FRAME_ANALYTICS });
await navigateToUrl(url);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { i18n } from '@kbn/i18n';
import { useMlUrlGenerator } from '../../../../../contexts/kibana';
import { ANALYSIS_CONFIG_TYPE } from '../../../../common/analytics';
import { useNavigateToPath } from '../../../../../contexts/kibana';
import { ML_TABS } from '../../../../../../url_generator';

interface Props {
jobId: string;
Expand All @@ -20,9 +21,9 @@ export const ViewResultsPanel: FC<Props> = ({ jobId, analysisType }) => {
const urlGenerator = useMlUrlGenerator();
const navigateToPath = useNavigateToPath();

const redirectToAnalyticsManagementPage = async () => {
const redirectToAnalyticsJobPage = async () => {
const path = await urlGenerator.createUrl({
page: 'data_frame_analytics/exploration',
page: ML_TABS.DATA_FRAME_ANALYTICS_EXPLORATION,
jobId,
analysisType,
});
Expand All @@ -43,7 +44,7 @@ export const ViewResultsPanel: FC<Props> = ({ jobId, analysisType }) => {
defaultMessage: 'View results for the analytics job.',
}
)}
onClick={redirectToAnalyticsManagementPage}
onClick={redirectToAnalyticsJobPage}
data-test-subj="analyticsWizardViewResultsCard"
/>
</Fragment>
Expand Down

0 comments on commit 98dd2e5

Please sign in to comment.