-
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.
Add Terms, Histogram, Metrics, and Review steps to Rollup Job Wizard (#…
…22984) * Move steps into a single steps directory. * Update deserializeJob method for symmetry with serializeJob method. * Return dateFields, keywordFields, and numericFields from index_pattern_validity API endpoint. * Block forward progress from first step if: - we're waiting for async validation - index pattern is invalid * Add FieldList, FieldChooser, and JobDetails components.
- Loading branch information
Showing
38 changed files
with
1,651 additions
and
352 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
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/rollup/public/crud_app/sections/components/job_details/index.js
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,14 @@ | ||
/* | ||
* 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, | ||
JOB_DETAILS_TAB_SUMMARY, | ||
JOB_DETAILS_TAB_TERMS, | ||
JOB_DETAILS_TAB_HISTOGRAM, | ||
JOB_DETAILS_TAB_METRICS, | ||
JOB_DETAILS_TAB_JSON, | ||
} from './job_details'; |
72 changes: 72 additions & 0 deletions
72
x-pack/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js
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,72 @@ | ||
/* | ||
* 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 from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { | ||
TabSummary, | ||
TabTerms, | ||
TabMetrics, | ||
TabJson, | ||
TabHistogram, | ||
} from './tabs'; | ||
|
||
export const JOB_DETAILS_TAB_SUMMARY = 'Summary'; | ||
export const JOB_DETAILS_TAB_TERMS = 'Terms'; | ||
export const JOB_DETAILS_TAB_HISTOGRAM = 'Histogram'; | ||
export const JOB_DETAILS_TAB_METRICS = 'Metrics'; | ||
export const JOB_DETAILS_TAB_JSON = 'JSON'; | ||
|
||
const JOB_DETAILS_TABS = [ | ||
JOB_DETAILS_TAB_SUMMARY, | ||
JOB_DETAILS_TAB_TERMS, | ||
JOB_DETAILS_TAB_HISTOGRAM, | ||
JOB_DETAILS_TAB_METRICS, | ||
JOB_DETAILS_TAB_JSON, | ||
]; | ||
|
||
export const JobDetails = ({ | ||
tab, | ||
job, | ||
stats, | ||
json, | ||
}) => { | ||
const { | ||
metrics, | ||
terms, | ||
histogram, | ||
histogramInterval, | ||
} = job; | ||
|
||
const tabToContentMap = { | ||
Summary: ( | ||
<TabSummary | ||
job={job} | ||
stats={stats} | ||
/> | ||
), | ||
Terms: ( | ||
<TabTerms terms={terms} /> | ||
), | ||
Histogram: ( | ||
<TabHistogram histogram={histogram} histogramInterval={histogramInterval} /> | ||
), | ||
Metrics: ( | ||
<TabMetrics metrics={metrics} /> | ||
), | ||
JSON: ( | ||
<TabJson json={json} /> | ||
), | ||
}; | ||
|
||
return tabToContentMap[tab]; | ||
}; | ||
|
||
JobDetails.propTypes = { | ||
tab: PropTypes.oneOf(JOB_DETAILS_TABS), | ||
job: PropTypes.object, | ||
}; |
File renamed without changes.
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
File renamed without changes.
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
198 changes: 198 additions & 0 deletions
198
x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js
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,198 @@ | ||
/* | ||
* 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, { Component, Fragment } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { | ||
EuiDescriptionList, | ||
EuiDescriptionListTitle, | ||
EuiDescriptionListDescription, | ||
EuiTitle, | ||
EuiSpacer, | ||
EuiIconTip, | ||
} from '@elastic/eui'; | ||
|
||
import { JobStatus } from '../../job_status'; | ||
|
||
export class TabSummary extends Component { | ||
static propTypes = { | ||
job: PropTypes.object.isRequired, | ||
stats: PropTypes.object, | ||
}; | ||
|
||
renderStats() { | ||
const { stats } = this.props; | ||
|
||
if (!stats) { | ||
return null; | ||
} | ||
|
||
const { | ||
documentsProcessed, | ||
pagesProcessed, | ||
rollupsIndexed, | ||
triggerCount, | ||
status, | ||
} = stats; | ||
|
||
return ( | ||
<Fragment> | ||
<EuiSpacer size="s" /> | ||
|
||
<EuiTitle size="s"> | ||
<h3>Stats</h3> | ||
</EuiTitle> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiDescriptionList type="column" align="center"> | ||
<Fragment> | ||
<EuiDescriptionListTitle> | ||
<strong>Status</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
<JobStatus status={status} /> | ||
</EuiDescriptionListDescription> | ||
</Fragment> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Documents processed</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
{documentsProcessed} | ||
</EuiDescriptionListDescription> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Pages processed</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
{pagesProcessed} | ||
</EuiDescriptionListDescription> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Rollups indexed</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
{rollupsIndexed} | ||
</EuiDescriptionListDescription> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Trigger count</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
{triggerCount} | ||
</EuiDescriptionListDescription> | ||
</EuiDescriptionList> | ||
</Fragment> | ||
); | ||
} | ||
|
||
render() { | ||
const { job } = this.props; | ||
|
||
const { | ||
indexPattern, | ||
rollupIndex, | ||
rollupCron, | ||
dateHistogramInterval, | ||
dateHistogramDelay, | ||
dateHistogramTimeZone, | ||
dateHistogramField, | ||
} = job; | ||
|
||
return ( | ||
<Fragment> | ||
<EuiTitle size="s"> | ||
<h3>Logistics</h3> | ||
</EuiTitle> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiDescriptionList type="column" align="center"> | ||
<EuiDescriptionListTitle> | ||
<strong>Index pattern</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription className="eui-textBreakWord"> | ||
{indexPattern} | ||
</EuiDescriptionListDescription> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Rollup index</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription className="eui-textBreakWord"> | ||
{rollupIndex} | ||
</EuiDescriptionListDescription> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Cron</strong>{' '} | ||
<EuiIconTip | ||
content="Interval at which data is rolled up" | ||
/> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
{rollupCron} | ||
</EuiDescriptionListDescription> | ||
</EuiDescriptionList> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiTitle size="s"> | ||
<h3>Date histogram</h3> | ||
</EuiTitle> | ||
|
||
<EuiSpacer size="s" /> | ||
|
||
<EuiDescriptionList type="column" align="center"> | ||
<EuiDescriptionListTitle> | ||
<strong>Time field</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription className="eui-textBreakWord"> | ||
{dateHistogramField} | ||
</EuiDescriptionListDescription> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Timezone</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
{dateHistogramTimeZone} | ||
</EuiDescriptionListDescription> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Delay</strong> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
{dateHistogramDelay || 'None'} | ||
</EuiDescriptionListDescription> | ||
|
||
<EuiDescriptionListTitle> | ||
<strong>Interval</strong>{' '} | ||
<EuiIconTip | ||
content="Time bucket interval generated at roll-up time" | ||
/> | ||
</EuiDescriptionListTitle> | ||
|
||
<EuiDescriptionListDescription> | ||
{dateHistogramInterval} | ||
</EuiDescriptionListDescription> | ||
</EuiDescriptionList> | ||
|
||
{this.renderStats()} | ||
</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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.