Skip to content

Commit

Permalink
[indexPattern] copy excluded field property when refreshing fields
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger authored and scampi committed Jun 2, 2016
1 parent 0d06220 commit c3c1d48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ui/public/index_patterns/_index_pattern.js
Expand Up @@ -310,8 +310,18 @@ export default function IndexPatternFactory(Private, timefilter, Notifier, confi
};

self._fetchFields = function () {
const existingFieldsByName = self.fields.byName;

return mapper.getFieldsForIndexPattern(self, true)
.then(function (fields) {
// copy over kibana-added properties from existing fields
fields.forEach(function (field) {
var existingField = existingFieldsByName[field.name];
if (existingField) {
field.exclude = existingField.exclude;
}
});

// append existing scripted fields
fields = fields.concat(self.getScriptedFields());

Expand Down

0 comments on commit c3c1d48

Please sign in to comment.