Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default columns configuration #3417

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/kibana/components/config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ define(function (require) {
value: null,
description: 'The index to access if no index is set',
},
'defaultColumns': {
value: ['_source'],
description: 'Columns displayed by default in the Discover tab',
},
'metaFields': {
value: ['_source', '_id', '_type', '_index'],
description: 'Fields that exist outside of _source to merge into our document when displaying it',
Expand Down Expand Up @@ -81,4 +85,4 @@ define(function (require) {
description: 'The maximum height that a cell in a table should occupy. Set to 0 to disable truncation.'
}
};
});
});
4 changes: 2 additions & 2 deletions src/kibana/plugins/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ define(function (require) {
// Make sure there are no columns added that aren't in the displayed field list.
$state.columns = _.intersection($state.columns, fields);

// If no columns remain, use _source
// If no columns remain, use defaultColumns
if (!$state.columns.length) {
$scope.toggleField('_source');
config.get('defaultColumns').forEach($scope.toggleField);
return;
}

Expand Down