Fix Rollup tag not showing on rollup index patterns in list (#40297) (#40821)

This commit is contained in:
Jen Huang 2019-07-10 18:31:52 -07:00 committed by GitHub
parent 575428ed86
commit 10665e0ffc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 7 deletions

View file

@ -28,7 +28,6 @@
</span>
</span>
</span>
&nbsp;
</span>
<span ng-repeat="tag in indexPattern.tags">
<span class="euiBadge euiBadge--hollow">

View file

@ -181,7 +181,10 @@ uiModules.get('apps/management')
$scope.kbnUrl = Private(KbnUrlProvider);
$scope.indexPattern = $route.current.locals.indexPattern;
$scope.indexPatternListProvider = indexPatternListProvider;
$scope.indexPattern.tags = indexPatternListProvider.getIndexPatternTags($scope.indexPattern);
$scope.indexPattern.tags = indexPatternListProvider.getIndexPatternTags(
$scope.indexPattern,
$scope.indexPattern.id === config.get('defaultIndex')
);
$scope.getFieldInfo = indexPatternListProvider.getFieldInfo;
const docTitle = Private(DocTitleProvider);
docTitle.change($scope.indexPattern.title);

View file

@ -132,7 +132,11 @@ uiModules.get('apps/management')
id: id,
title:
<span>
{pattern.get('title')}{$scope.defaultIndex === id && (<EuiBadge className="indexPatternList__badge">Default</EuiBadge>)}
{pattern.get('title')} {tags && tags.length ? tags.map(({ key: tagKey, name: tagName }) => (
<EuiBadge className="indexPatternList__badge" key={tagKey}>
{tagName}
</EuiBadge>
)) : null}
</span>,
url: kbnUrl.eval('#/management/kibana/index_patterns/{{id}}', { id: id }),
active: $scope.editingId === id,

View file

@ -24,9 +24,9 @@ class IndexPatternList {
this._plugins = registry.inOrder.map(Plugin => new Plugin());
}
getIndexPatternTags = (indexPattern) => {
getIndexPatternTags = (indexPattern, isDefault) => {
return this._plugins.reduce((tags, plugin) => {
return plugin.getIndexPatternTags ? tags.concat(plugin.getIndexPatternTags(indexPattern)) : tags;
return plugin.getIndexPatternTags ? tags.concat(plugin.getIndexPatternTags(indexPattern, isDefault)) : tags;
}, []);
}

View file

@ -20,8 +20,11 @@
export class IndexPatternListConfig {
static key = 'default';
getIndexPatternTags = () => {
return [];
getIndexPatternTags = (indexPattern, isDefault) => {
return isDefault ? [{
key: 'default',
name: 'Default',
}] : [];
}
getFieldInfo = () => {