Add indicies and type information for conflict field

Fixes #7661

Added indicies and type information when hover over field with conflict type in
index patterns page.
This commit is contained in:
Martin Hickey 2016-08-12 13:35:01 +01:00
parent ab5f6cbd31
commit f842f65faf
3 changed files with 9 additions and 3 deletions

View file

@ -1,7 +1,7 @@
<span>{{field.type}}</span>
<i
aria-label="The type of this field changes across indices. It is unavailable for many analysis functions."
aria-label="The type of this field changes across indices. It is unavailable for many analysis functions. The types per index are as follows: {{field.indicesTypes}}"
ng-if="field.type == 'conflict'"
tooltip="The type of this field changes across indices. It is unavailable for many analysis functions."
tooltip="The type of this field changes across indices. It is unavailable for many analysis functions. The types per index are as follows: {{field.indicesTypes}}"
class="fa fa-warning text-color-warning">
</i>

View file

@ -71,6 +71,9 @@ export default function FieldObjectProvider(Private, shortDotsFilter, $rootScope
obj.comp('displayName', shortDotsFilter(spec.name));
obj.comp('$$spec', spec);
// conflict info
obj.writ('indicesTypes');
return obj.create();
}

View file

@ -23,15 +23,18 @@ export default function transformMappingIntoFields(Private, kbnIndex, config) {
if (keys.length === 0 || (name[0] === '_') && !_.contains(config.get('metaFields'), name)) return;
let mapping = mapField(field, name);
const indexType = 'Index: ' + indexName + ', Type: ' + mapping.type + ';';
mapping.indicesTypes = indexType;
if (fields[name]) {
mapping.indicesTypes = fields[name].indicesTypes + mapping.indicesTypes;
if (fields[name].type !== mapping.type) {
// conflict fields are not available for much except showing in the discover table
mapping.type = 'conflict';
mapping.indexed = false;
}
}
fields[name] = _.pick(mapping, 'type', 'indexed', 'analyzed', 'doc_values');
fields[name] = _.pick(mapping, 'type', 'indexed', 'analyzed', 'doc_values', 'indicesTypes');
});
});
});