mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] Fixing management app docs links (#130776)
* [ML] Fixing management app docs links * changing translation id
This commit is contained in:
parent
e3d221ed39
commit
5fe9437caf
6 changed files with 37 additions and 31 deletions
|
@ -387,6 +387,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
|
|||
regressionEvaluation: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-regression.html#ml-dfanalytics-regression-evaluation`,
|
||||
classificationAucRoc: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-dfa-classification.html#ml-dfanalytics-class-aucroc`,
|
||||
setUpgradeMode: `${ELASTICSEARCH_DOCS}ml-set-upgrade-mode.html`,
|
||||
trainedModels: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/ml-trained-models.html`,
|
||||
},
|
||||
transforms: {
|
||||
guide: `${ELASTICSEARCH_DOCS}transforms.html`,
|
||||
|
|
|
@ -11,8 +11,8 @@ import { JOBS_LIST_PATH } from './management_urls';
|
|||
export function getJobsListBreadcrumbs() {
|
||||
return [
|
||||
{
|
||||
text: i18n.translate('xpack.ml.jobsList.breadcrumb', {
|
||||
defaultMessage: 'Jobs',
|
||||
text: i18n.translate('xpack.ml.management.breadcrumb', {
|
||||
defaultMessage: 'Machine Learning',
|
||||
}),
|
||||
href: `#${JOBS_LIST_PATH}`,
|
||||
},
|
||||
|
|
|
@ -37,7 +37,6 @@ import { PLUGIN_ID } from '../../../../../../common/constants/app';
|
|||
|
||||
import { checkGetManagementMlJobsResolver } from '../../../../capabilities/check_capabilities';
|
||||
|
||||
import { getDocLinks } from '../../../../util/dependency_cache';
|
||||
// @ts-ignore undeclared module
|
||||
import { JobsListView } from '../../../../jobs/jobs_list/components/jobs_list_view';
|
||||
import { DataFrameAnalyticsList } from '../../../../data_frame_analytics/pages/analytics_management/components/analytics_list';
|
||||
|
@ -54,6 +53,7 @@ import { ListingPageUrlState } from '../../../../../../common/types/common';
|
|||
import { getDefaultDFAListState } from '../../../../data_frame_analytics/pages/analytics_management/page';
|
||||
import { ExportJobsFlyout, ImportJobsFlyout } from '../../../../components/import_export_jobs';
|
||||
import type { JobType, MlSavedObjectType } from '../../../../../../common/types/saved_objects';
|
||||
import { useMlKibana } from '../../../../contexts/kibana';
|
||||
|
||||
interface Tab extends EuiTabbedContentTab {
|
||||
'data-test-subj': string;
|
||||
|
@ -201,30 +201,6 @@ export const JobsListPage: FC<{
|
|||
return null;
|
||||
}
|
||||
|
||||
const anomalyDetectionJobsUrl = getDocLinks().links.ml.anomalyDetectionJobs;
|
||||
const dataFrameAnalyticsUrl = getDocLinks().links.ml.dataFrameAnalytics;
|
||||
|
||||
const anomalyDetectionDocsLabel = i18n.translate(
|
||||
'xpack.ml.management.jobsList.anomalyDetectionDocsLabel',
|
||||
{
|
||||
defaultMessage: 'Anomaly detection jobs docs',
|
||||
}
|
||||
);
|
||||
const analyticsDocsLabel = i18n.translate('xpack.ml.management.jobsList.analyticsDocsLabel', {
|
||||
defaultMessage: 'Analytics jobs docs',
|
||||
});
|
||||
|
||||
const docsLink = (
|
||||
<EuiButtonEmpty
|
||||
href={currentTabId === 'anomaly-detector' ? anomalyDetectionJobsUrl : dataFrameAnalyticsUrl}
|
||||
target="_blank"
|
||||
iconType="help"
|
||||
data-test-subj="documentationLink"
|
||||
>
|
||||
{currentTabId === 'anomaly-detector' ? anomalyDetectionDocsLabel : analyticsDocsLabel}
|
||||
</EuiButtonEmpty>
|
||||
);
|
||||
|
||||
function renderTabs() {
|
||||
return (
|
||||
<EuiTabbedContent
|
||||
|
@ -280,7 +256,7 @@ export const JobsListPage: FC<{
|
|||
defaultMessage="View, export, and import machine learning analytics and anomaly detection items."
|
||||
/>
|
||||
}
|
||||
rightSideItems={[docsLink]}
|
||||
rightSideItems={[<DocsLink currentTabId={currentTabId} />]}
|
||||
bottomBorder
|
||||
/>
|
||||
|
||||
|
@ -329,3 +305,35 @@ export const JobsListPage: FC<{
|
|||
</RedirectAppLinks>
|
||||
);
|
||||
};
|
||||
|
||||
const DocsLink: FC<{ currentTabId: MlSavedObjectType }> = ({ currentTabId }) => {
|
||||
const {
|
||||
services: {
|
||||
docLinks: {
|
||||
links: { ml },
|
||||
},
|
||||
},
|
||||
} = useMlKibana();
|
||||
|
||||
let href = ml.anomalyDetectionJobs;
|
||||
let linkLabel = i18n.translate('xpack.ml.management.jobsList.anomalyDetectionDocsLabel', {
|
||||
defaultMessage: 'Anomaly detection jobs docs',
|
||||
});
|
||||
|
||||
if (currentTabId === 'data-frame-analytics') {
|
||||
href = ml.dataFrameAnalytics;
|
||||
linkLabel = i18n.translate('xpack.ml.management.jobsList.analyticsDocsLabel', {
|
||||
defaultMessage: 'Analytics jobs docs',
|
||||
});
|
||||
} else if (currentTabId === 'trained-model') {
|
||||
href = ml.trainedModels;
|
||||
linkLabel = i18n.translate('xpack.ml.management.jobsList.trainedModelsDocsLabel', {
|
||||
defaultMessage: 'Trained models docs',
|
||||
});
|
||||
}
|
||||
return (
|
||||
<EuiButtonEmpty href={href} target="_blank" iconType="help" data-test-subj="documentationLink">
|
||||
{linkLabel}
|
||||
</EuiButtonEmpty>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -18504,7 +18504,6 @@
|
|||
"xpack.ml.jobsList.alertingRules.tooltipContent": "La tâche a {rulesCount} {rulesCount, plural, one { règle d'alerte associée} other { règles d'alerte associées}}",
|
||||
"xpack.ml.jobsList.analyticsSpacesLabel": "Espaces",
|
||||
"xpack.ml.jobsList.auditMessageColumn.screenReaderDescription": "Cette colonne affiche des icônes lorsque des erreurs ou des avertissements pour la tâche ont été signalé(e)s au cours des dernières 24 heures",
|
||||
"xpack.ml.jobsList.breadcrumb": "Tâches",
|
||||
"xpack.ml.jobsList.cannotSelectRowForJobMessage": "Impossible de sélectionner l'ID de tâche {jobId}",
|
||||
"xpack.ml.jobsList.cloneJobErrorMessage": "Impossible de cloner {jobId}. La tâche est introuvable",
|
||||
"xpack.ml.jobsList.closeActionStatusText": "fermer",
|
||||
|
|
|
@ -18652,7 +18652,6 @@
|
|||
"xpack.ml.jobsList.alertingRules.tooltipContent": "ジョブ{rulesCount}はアラート{rulesCount, plural, other { ルール}}に関連付けられています",
|
||||
"xpack.ml.jobsList.analyticsSpacesLabel": "スペース",
|
||||
"xpack.ml.jobsList.auditMessageColumn.screenReaderDescription": "この列は、過去24時間にエラーまたは警告があった場合にアイコンを表示します",
|
||||
"xpack.ml.jobsList.breadcrumb": "ジョブ",
|
||||
"xpack.ml.jobsList.cannotSelectRowForJobMessage": "ジョブID {jobId}を選択できません",
|
||||
"xpack.ml.jobsList.cloneJobErrorMessage": "{jobId} のクローンを作成できませんでした。ジョブが見つかりませんでした",
|
||||
"xpack.ml.jobsList.closeActionStatusText": "閉じる",
|
||||
|
|
|
@ -18679,7 +18679,6 @@
|
|||
"xpack.ml.jobsList.alertingRules.tooltipContent": "作业具有 {rulesCount} 个关联的告警{rulesCount, plural, other {规则}}",
|
||||
"xpack.ml.jobsList.analyticsSpacesLabel": "工作区",
|
||||
"xpack.ml.jobsList.auditMessageColumn.screenReaderDescription": "过去 24 小时里该作业有错误或警告时,此列显示图标",
|
||||
"xpack.ml.jobsList.breadcrumb": "作业",
|
||||
"xpack.ml.jobsList.cannotSelectRowForJobMessage": "无法选择作业 ID {jobId}",
|
||||
"xpack.ml.jobsList.cloneJobErrorMessage": "无法克隆 {jobId}。找不到作业",
|
||||
"xpack.ml.jobsList.closeActionStatusText": "关闭",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue