mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Update the conflict data to show all index names per type
Fixes #7661 Feedback from review is that it would be better to display a list of indices for each field type as would be easier to distinguish the outliers in this case.
This commit is contained in:
parent
0af13831d5
commit
ee698c4f0b
3 changed files with 14 additions and 14 deletions
|
@ -177,18 +177,16 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div ng-if="editor.field.conflictDescriptions.length > 0" class="alert alert-warning">
|
||||
<!-- {{editor.field.conflictDescriptions}} -->
|
||||
<!-- {{editor.field.indicesTypes}} -->
|
||||
The type of this field changes across indices. It is unavailable for many analysis functions. The types per index are as follows:
|
||||
<div ng-if="editor.conflictDescriptionsLength > 0" class="alert alert-warning">
|
||||
The type of this field changes across indices. It is unavailable for many analysis functions. The indices per type are as follows:
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th> Index Name </th>
|
||||
<th> Field Type </th>
|
||||
<th> Index Names </th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="obj in editor.field.conflictDescriptions">
|
||||
<td>{{obj.index}}</td> <td>{{obj.type}}</td>
|
||||
<tr ng-repeat="(type, indices) in editor.field.conflictDescriptions">
|
||||
<td>{{type}}</td> <td>{{indices}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -46,6 +46,7 @@ uiModules
|
|||
self.indexPattern = $scope.getIndexPattern();
|
||||
self.field = shadowCopy($scope.getField());
|
||||
self.formatParams = self.field.format.params();
|
||||
self.conflictDescriptionsLength = (self.field.conflictDescriptions) ? Object.keys(self.field.conflictDescriptions).length : 0;
|
||||
|
||||
// only init on first create
|
||||
self.creating = !self.indexPattern.fields.byName[self.field.name];
|
||||
|
|
|
@ -25,12 +25,9 @@ export default function transformMappingIntoFields(Private, kbnIndex, config) {
|
|||
|
||||
let mapping = mapField(field, name);
|
||||
|
||||
let conflictDescription = {
|
||||
index: indexName,
|
||||
type: mapping.type
|
||||
};
|
||||
mapping.conflictDescriptions = [];
|
||||
mapping.conflictDescriptions.push(conflictDescription);
|
||||
const origType = mapping.type;
|
||||
mapping.conflictDescriptions = {};
|
||||
mapping.conflictDescriptions[origType] = [indexName];
|
||||
|
||||
if (fields[name]) {
|
||||
if (fields[name].type !== mapping.type) {
|
||||
|
@ -41,7 +38,11 @@ export default function transformMappingIntoFields(Private, kbnIndex, config) {
|
|||
}
|
||||
if (conflictFields[name]) {
|
||||
mapping.conflictDescriptions = conflictFields[name].conflictDescriptions;
|
||||
mapping.conflictDescriptions.push(conflictDescription);
|
||||
if (mapping.conflictDescriptions.hasOwnProperty(origType)) {
|
||||
mapping.conflictDescriptions[origType].push(indexName);
|
||||
} else {
|
||||
mapping.conflictDescriptions[origType] = [indexName];
|
||||
}
|
||||
}
|
||||
fields[name] = _.pick(mapping, 'type', 'indexed', 'analyzed', 'doc_values');
|
||||
conflictFields[name] = _.pick(mapping, 'type', 'indexed', 'analyzed', 'doc_values', 'conflictDescriptions');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue