mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* [ML] Use data view name in anomaly detection job wizards
* adding to data recognizer
(cherry picked from commit 1bcd865363
)
Co-authored-by: James Gowdy <jgowdy@elastic.co>
This commit is contained in:
parent
c332f5bbb3
commit
62ed40b0aa
4 changed files with 13 additions and 4 deletions
|
@ -51,6 +51,7 @@ export class JobCreator {
|
|||
protected _indexPattern: DataView;
|
||||
protected _savedSearch: SavedSearchSavedObject | null;
|
||||
protected _indexPatternTitle: IndexPatternTitle = '';
|
||||
protected _indexPatternDisplayName: string = '';
|
||||
protected _job_config: Job;
|
||||
protected _calendars: Calendar[];
|
||||
protected _datafeed_config: Datafeed;
|
||||
|
@ -79,7 +80,11 @@ export class JobCreator {
|
|||
constructor(indexPattern: DataView, savedSearch: SavedSearchSavedObject | null, query: object) {
|
||||
this._indexPattern = indexPattern;
|
||||
this._savedSearch = savedSearch;
|
||||
this._indexPatternTitle = indexPattern.title;
|
||||
|
||||
const title = this._indexPattern.title;
|
||||
const name = this._indexPattern.getName();
|
||||
this._indexPatternDisplayName = name === title ? name : `${name} (${title})`;
|
||||
this._indexPatternTitle = title;
|
||||
|
||||
this._job_config = createEmptyJob();
|
||||
this._calendars = [];
|
||||
|
@ -104,6 +109,10 @@ export class JobCreator {
|
|||
return this._indexPatternTitle;
|
||||
}
|
||||
|
||||
public get indexPatternDisplayName(): string {
|
||||
return this._indexPatternDisplayName;
|
||||
}
|
||||
|
||||
protected _addDetector(detector: Detector, agg: Aggregation, field: Field) {
|
||||
this._detectors.push(detector);
|
||||
this._aggs.push(agg);
|
||||
|
|
|
@ -72,7 +72,7 @@ export const Page: FC = () => {
|
|||
})
|
||||
: i18n.translate('xpack.ml.newJob.wizard.jobType.dataViewPageTitleLabel', {
|
||||
defaultMessage: 'data view {dataViewName}',
|
||||
values: { dataViewName: currentDataView.title },
|
||||
values: { dataViewName: currentDataView.getName() },
|
||||
});
|
||||
|
||||
const recognizerResults = {
|
||||
|
|
|
@ -216,7 +216,7 @@ export const Page: FC<PageProps> = ({ existingJobsAndGroups, jobType }) => {
|
|||
<FormattedMessage
|
||||
id="xpack.ml.newJob.page.createJob.dataViewName"
|
||||
defaultMessage="Using data view {dataViewName}"
|
||||
values={{ dataViewName: jobCreator.indexPatternTitle }}
|
||||
values={{ dataViewName: jobCreator.indexPatternDisplayName }}
|
||||
/>
|
||||
</EuiPageContentHeaderSection>
|
||||
</EuiPageContentHeader>
|
||||
|
|
|
@ -101,7 +101,7 @@ export const Page: FC<PageProps> = ({ moduleId, existingGroupIds }) => {
|
|||
})
|
||||
: i18n.translate('xpack.ml.newJob.recognize.dataViewPageTitle', {
|
||||
defaultMessage: 'data view {dataViewName}',
|
||||
values: { dataViewName: dataView.title },
|
||||
values: { dataViewName: dataView.getName() },
|
||||
});
|
||||
const displayQueryWarning = savedSearch !== null;
|
||||
const tempQuery = savedSearch === null ? undefined : combinedQuery;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue