mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Fix time field not being recognized due to ordering of aggs * Clean up UI whitespace * Update snapshot
This commit is contained in:
parent
758f158d4d
commit
fef9624357
4 changed files with 38 additions and 25 deletions
|
@ -2,9 +2,6 @@
|
|||
|
||||
exports[`Header should render normally 1`] = `
|
||||
<div>
|
||||
<EuiSpacer
|
||||
size="m"
|
||||
/>
|
||||
<EuiTitle
|
||||
size="m"
|
||||
>
|
||||
|
@ -59,9 +56,6 @@ exports[`Header should render normally 1`] = `
|
|||
|
||||
exports[`Header should render without including system indices 1`] = `
|
||||
<div>
|
||||
<EuiSpacer
|
||||
size="m"
|
||||
/>
|
||||
<EuiTitle
|
||||
size="m"
|
||||
>
|
||||
|
|
|
@ -39,7 +39,6 @@ export const Header = ({
|
|||
onChangeIncludingSystemIndices,
|
||||
}) => (
|
||||
<div>
|
||||
<EuiSpacer size="m"/>
|
||||
<EuiTitle>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<div
|
||||
ng-controller="managementIndicesEdit"
|
||||
data-test-subj="editIndexPattern"
|
||||
class="kuiViewContent"
|
||||
role="region"
|
||||
aria-label="{{::'kbn.management.editIndexPattern.detailsAria' | i18n: { defaultMessage: 'Index pattern details' } }}"
|
||||
>
|
||||
|
|
|
@ -69,23 +69,44 @@ export function registerFieldsForWildcardRoute(server) {
|
|||
readFromDocValues: true,
|
||||
};
|
||||
|
||||
rollupFields.push(
|
||||
...fields
|
||||
// For each field of the aggregation, filter out ones that have already been added
|
||||
// to the field list bcause the same field can be part of multiple aggregations, but
|
||||
// end consumption doesn't differentiate fields based on their aggregation abilities.
|
||||
.filter(field => !rollupFieldNames.includes(field))
|
||||
// Then expand each field into object format that end consumption expects.
|
||||
.map(field => {
|
||||
const fieldCapsKey = `${field}.${agg}.${agg === 'date_histogram' ? 'timestamp' : 'value'}`;
|
||||
rollupFieldNames.push(field);
|
||||
return {
|
||||
...fieldsFromFieldCapsApi[fieldCapsKey],
|
||||
...defaultField,
|
||||
name: field,
|
||||
};
|
||||
})
|
||||
);
|
||||
// Date histogram agg only ever has one field defined, let date type overwrite a
|
||||
// previous type if defined (such as number from max and min aggs).
|
||||
if(agg === 'date_histogram') {
|
||||
const timeFieldName = fields[0];
|
||||
const fieldCapsKey = `${timeFieldName}.${agg}.timestamp`;
|
||||
const newField = {
|
||||
...fieldsFromFieldCapsApi[fieldCapsKey],
|
||||
...defaultField,
|
||||
name: timeFieldName,
|
||||
};
|
||||
const existingField = rollupFields.find(field => field.name === timeFieldName);
|
||||
|
||||
if(existingField) {
|
||||
Object.assign(existingField, newField);
|
||||
} else {
|
||||
rollupFieldNames.push(timeFieldName);
|
||||
rollupFields.push(newField);
|
||||
}
|
||||
}
|
||||
// For all other aggs, filter out ones that have already been added to the field list
|
||||
// because the same field can be part of multiple aggregations, but end consumption
|
||||
// doesn't differentiate fields based on their aggregation abilities.
|
||||
else {
|
||||
rollupFields.push(
|
||||
...fields
|
||||
.filter(field => !rollupFieldNames.includes(field))
|
||||
.map(field => {
|
||||
// Expand each field into object format that end consumption expects.
|
||||
const fieldCapsKey = `${field}.${agg}.value`;
|
||||
rollupFieldNames.push(field);
|
||||
return {
|
||||
...fieldsFromFieldCapsApi[fieldCapsKey],
|
||||
...defaultField,
|
||||
name: field,
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue