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

This commit is contained in:
Jen Huang 2019-07-10 15:56:21 -07:00 committed by GitHub
parent 842132614d
commit 057cc75980
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 9 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

@ -180,7 +180,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;
docTitle.change($scope.indexPattern.title);

View file

@ -140,7 +140,7 @@ uiModules.get('apps/management')
url: kbnUrl.eval('#/management/kibana/index_patterns/{{id}}', { id: id }),
active: $scope.editingId === id,
default: isDefault,
tag: tags && tags.length ? tags[0] : null,
tags,
//the prepending of 0 at the default pattern takes care of prioritization
//so the sorting will but the default index on top
//or on bottom of a the table

View file

@ -39,10 +39,24 @@ const columns = [
{
field: 'title',
name: 'Pattern',
render: (name: string, index: { id: string; default: boolean }) => (
render: (
name: string,
index: {
id: string;
tags?: Array<{
key: string;
name: string;
}>;
}
) => (
<EuiButtonEmpty size="xs" href={`#/management/kibana/index_patterns/${index.id}`}>
{name}
{index.default && <EuiBadge className="indexPatternList__badge">Default</EuiBadge>}
{index.tags &&
index.tags.map(({ key: tagKey, name: tagName }) => (
<EuiBadge className="indexPatternList__badge" key={tagKey}>
{tagName}
</EuiBadge>
))}
</EuiButtonEmpty>
),
dataType: 'string',

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 = () => {