-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into alerting/refresh-on-deletion
* master: [ML] DF Analytics creation wizard: show link to results (#74025)
- Loading branch information
Showing
10 changed files
with
201 additions
and
86 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
x-pack/plugins/ml/public/application/data_frame_analytics/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@import 'pages/analytics_exploration/components/regression_exploration/index'; | ||
@import 'pages/analytics_management/components/analytics_list/index'; | ||
@import 'pages/analytics_management/components/create_analytics_button/index'; | ||
@import 'pages/analytics_creation/components/index'; |
3 changes: 3 additions & 0 deletions
3
...l/public/application/data_frame_analytics/pages/analytics_creation/components/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dfAnalyticsCreationWizard__card { | ||
width: 300px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...tion/data_frame_analytics/pages/analytics_creation/components/create_step_footer/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { CreateStepFooter } from './create_step_footer'; |
83 changes: 83 additions & 0 deletions
83
...frame_analytics/pages/analytics_creation/components/create_step_footer/progress_stats.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { FC } from 'react'; | ||
import { | ||
EuiCallOut, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiProgress, | ||
EuiSpacer, | ||
EuiText, | ||
} from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { AnalyticsProgressStats } from './create_step_footer'; | ||
|
||
interface Props { | ||
currentProgress?: AnalyticsProgressStats; | ||
failedJobMessage: string | undefined; | ||
} | ||
|
||
export const ProgressStats: FC<Props> = ({ currentProgress, failedJobMessage }) => { | ||
if (currentProgress === undefined) return null; | ||
|
||
return ( | ||
<> | ||
<EuiSpacer /> | ||
{failedJobMessage !== undefined && ( | ||
<> | ||
<EuiCallOut | ||
data-test-subj="analyticsWizardProgressCallout" | ||
title={i18n.translate( | ||
'xpack.ml.dataframe.analytics.create.analyticsProgressCalloutTitle', | ||
{ | ||
defaultMessage: 'Job failed', | ||
} | ||
)} | ||
color={'danger'} | ||
iconType={'alert'} | ||
size="s" | ||
> | ||
<p>{failedJobMessage}</p> | ||
</EuiCallOut> | ||
<EuiSpacer size="s" /> | ||
</> | ||
)} | ||
<EuiText size="m"> | ||
<strong> | ||
{i18n.translate('xpack.ml.dataframe.analytics.create.analyticsProgressTitle', { | ||
defaultMessage: 'Progress', | ||
})} | ||
</strong> | ||
</EuiText> | ||
<EuiSpacer size="s" /> | ||
<EuiFlexGroup alignItems="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiText size="s"> | ||
<strong> | ||
{i18n.translate('xpack.ml.dataframe.analytics.create.analyticsProgressPhaseTitle', { | ||
defaultMessage: 'Phase', | ||
})}{' '} | ||
{currentProgress.currentPhase}/{currentProgress.totalPhases} | ||
</strong> | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem style={{ width: '400px' }} grow={false}> | ||
<EuiProgress | ||
value={currentProgress.progress} | ||
max={100} | ||
color="primary" | ||
size="l" | ||
data-test-subj="mlAnalyticsCreationWizardProgress" | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiText size="s">{`${currentProgress.progress}%`}</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</> | ||
); | ||
}; |
7 changes: 7 additions & 0 deletions
7
...tion/data_frame_analytics/pages/analytics_creation/components/view_results_panel/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { ViewResultsPanel } from './view_results_panel'; |
46 changes: 46 additions & 0 deletions
46
...e_analytics/pages/analytics_creation/components/view_results_panel/view_results_panel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { FC, Fragment } from 'react'; | ||
import { EuiCard, EuiIcon } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { useNavigateToPath } from '../../../../../contexts/kibana'; | ||
import { getResultsUrl } from '../../../analytics_management/components/analytics_list/common'; | ||
import { ANALYSIS_CONFIG_TYPE } from '../../../../common/analytics'; | ||
|
||
interface Props { | ||
jobId: string; | ||
analysisType: ANALYSIS_CONFIG_TYPE; | ||
} | ||
|
||
export const ViewResultsPanel: FC<Props> = ({ jobId, analysisType }) => { | ||
const navigateToPath = useNavigateToPath(); | ||
|
||
const redirectToAnalyticsManagementPage = async () => { | ||
const path = getResultsUrl(jobId, analysisType); | ||
await navigateToPath(path); | ||
}; | ||
|
||
return ( | ||
<Fragment> | ||
<EuiCard | ||
className="dfAnalyticsCreationWizard__card" | ||
icon={<EuiIcon size="xxl" type="tableDensityNormal" />} | ||
title={i18n.translate('xpack.ml.dataframe.analytics.create.viewResultsCardTitle', { | ||
defaultMessage: 'View Results', | ||
})} | ||
description={i18n.translate( | ||
'xpack.ml.dataframe.analytics.create.viewResultsCardDescription', | ||
{ | ||
defaultMessage: 'View results for the analytics job.', | ||
} | ||
)} | ||
onClick={redirectToAnalyticsManagementPage} | ||
data-test-subj="analyticsWizardViewResultsCard" | ||
/> | ||
</Fragment> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters