-
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.
Browse files
Browse the repository at this point in the history
* [ML] Fixing missing advanced job summary items * updating translations
- Loading branch information
1 parent
b06d553
commit 1d6dcdb
Showing
21 changed files
with
276 additions
and
58 deletions.
There are no files selected for viewing
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
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
13 changes: 13 additions & 0 deletions
13
...w/pages/components/pick_fields_step/components/advanced_view/metric_selection_summary.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,13 @@ | ||
/* | ||
* 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 { DetectorList } from './detector_list'; | ||
|
||
export const AdvancedDetectorsSummary: FC = () => ( | ||
<DetectorList isActive={false} onEditJob={() => {}} onDeleteJob={() => {}} /> | ||
); |
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
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
51 changes: 51 additions & 0 deletions
51
...cy/plugins/ml/public/jobs/new_job_new/pages/components/summary_step/components/common.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,51 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { EuiTitle } from '@elastic/eui'; | ||
|
||
export interface ListItems { | ||
title: string; | ||
description: string | JSX.Element; | ||
} | ||
|
||
export const trueLabel = i18n.translate('xpack.ml.newJob.wizard.summaryStep.trueLabel', { | ||
defaultMessage: 'True', | ||
}); | ||
|
||
export const falseLabel = i18n.translate('xpack.ml.newJob.wizard.summaryStep.falseLabel', { | ||
defaultMessage: 'False', | ||
}); | ||
|
||
export const defaultLabel = i18n.translate('xpack.ml.newJob.wizard.summaryStep.defaultString', { | ||
defaultMessage: 'default', | ||
}); | ||
|
||
export const JobSectionTitle: FC = () => ( | ||
<EuiTitle size="s"> | ||
<h3> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.summaryStep.jobConfig.title" | ||
defaultMessage="Job configuration" | ||
/> | ||
</h3> | ||
</EuiTitle> | ||
); | ||
|
||
export const DatafeedSectionTitle: FC = () => ( | ||
<EuiTitle size="s"> | ||
<h3> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.summaryStep.datafeedConfig.title" | ||
defaultMessage="Datafeed configuration" | ||
/> | ||
</h3> | ||
</EuiTitle> | ||
); | ||
|
||
export const Italic: FC = ({ children }) => <span style={{ fontStyle: 'italic' }}>{children}</span>; |
88 changes: 88 additions & 0 deletions
88
...ew_job_new/pages/components/summary_step/components/datafeed_details/datafeed_details.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,88 @@ | ||
/* | ||
* 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, useContext } from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { EuiFlexGroup, EuiFlexItem, EuiDescriptionList, EuiFormRow } from '@elastic/eui'; | ||
import { JobCreatorContext } from '../../../job_creator_context'; | ||
import { MLJobEditor } from '../../../../../../jobs_list/components/ml_job_editor'; | ||
import { calculateDatafeedFrequencyDefaultSeconds } from '../../../../../../../../common/util/job_utils'; | ||
import { DEFAULT_QUERY_DELAY } from '../../../../../common/job_creator/util/constants'; | ||
import { newJobDefaults } from '../../../../../utils/new_job_defaults'; | ||
import { ListItems, defaultLabel, Italic } from '../common'; | ||
|
||
const EDITOR_HEIGHT = '200px'; | ||
|
||
export const DatafeedDetails: FC = () => { | ||
const { jobCreator } = useContext(JobCreatorContext); | ||
const { datafeeds } = newJobDefaults(); | ||
|
||
const queryString = JSON.stringify(jobCreator.query, null, 2); | ||
const defaultFrequency = calculateDatafeedFrequencyDefaultSeconds(jobCreator.bucketSpanMs / 1000); | ||
const scrollSizeDefault = datafeeds.scroll_size || ''; | ||
|
||
const queryDelay = jobCreator.queryDelay || ( | ||
<Italic>{`${DEFAULT_QUERY_DELAY} (${defaultLabel})`}</Italic> | ||
); | ||
const frequency = jobCreator.frequency || ( | ||
<Italic>{`${defaultFrequency} (${defaultLabel})`}</Italic> | ||
); | ||
const scrollSize = | ||
jobCreator.scrollSize !== null ? ( | ||
`${jobCreator.scrollSize}` | ||
) : ( | ||
<Italic>{`${scrollSizeDefault} (${defaultLabel})`}</Italic> | ||
); | ||
|
||
const datafeedDetails: ListItems[] = [ | ||
{ | ||
title: i18n.translate('xpack.ml.newJob.wizard.summaryStep.datafeedDetails.timeField.title', { | ||
defaultMessage: 'Time field', | ||
}), | ||
description: jobCreator.timeFieldName, | ||
}, | ||
{ | ||
title: i18n.translate('xpack.ml.newJob.wizard.summaryStep.datafeedDetails.queryDelay.title', { | ||
defaultMessage: 'Query delay', | ||
}), | ||
description: queryDelay, | ||
}, | ||
|
||
{ | ||
title: i18n.translate('xpack.ml.newJob.wizard.summaryStep.datafeedDetails.frequency.title', { | ||
defaultMessage: 'Frequency', | ||
}), | ||
description: frequency, | ||
}, | ||
|
||
{ | ||
title: i18n.translate('xpack.ml.newJob.wizard.summaryStep.datafeedDetails.scrollSize.title', { | ||
defaultMessage: 'Scroll size', | ||
}), | ||
description: scrollSize, | ||
}, | ||
]; | ||
|
||
const queryTitle = i18n.translate( | ||
'xpack.ml.newJob.wizard.summaryStep.datafeedDetails.query.title', | ||
{ | ||
defaultMessage: 'Scroll size', | ||
} | ||
); | ||
|
||
return ( | ||
<EuiFlexGroup> | ||
<EuiFlexItem> | ||
<EuiFormRow label={queryTitle} fullWidth={true}> | ||
<MLJobEditor value={queryString} height={EDITOR_HEIGHT} readOnly={true} /> | ||
</EuiFormRow> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiDescriptionList compressed listItems={datafeedDetails} /> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}; |
6 changes: 6 additions & 0 deletions
6
...ublic/jobs/new_job_new/pages/components/summary_step/components/datafeed_details/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,6 @@ | ||
/* | ||
* 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 { DatafeedDetails } from './datafeed_details'; |
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
.../public/jobs/new_job_new/pages/components/summary_step/components/detector_chart/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 { DetectorChart } from './detector_chart'; |
6 changes: 6 additions & 0 deletions
6
.../ml/public/jobs/new_job_new/pages/components/summary_step/components/job_details/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,6 @@ | ||
/* | ||
* 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 { JobDetails } from './job_details'; |
Oops, something went wrong.