Skip to content

Commit

Permalink
Merge branch 'master' into 2803
Browse files Browse the repository at this point in the history
  • Loading branch information
stormpython committed Feb 4, 2015
2 parents 8b3d6e9 + 2cd85bc commit f82f97d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/kibana/components/vis/_agg_config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
return function AggConfigFactory(Private) {
return function AggConfigFactory(Private, fieldTypeFilter) {
var _ = require('lodash');
var fieldFormats = Private(require('components/index_patterns/_field_formats'));

Expand Down Expand Up @@ -110,8 +110,16 @@ define(function (require) {
* @return {object} the new params object
*/
AggConfig.prototype.resetParams = function () {
// We need to ensure that row and field don't get overriden.
return this.fillDefaults(_.pick(this.params, 'row', 'field'));
var fieldParam = this.type && this.type.params.byName.field;
var field;

if (fieldParam) {
var prevField = this.params.field;
var fieldOpts = fieldTypeFilter(this.vis.indexPattern.fields, fieldParam.filterFieldTypes);
field = _.contains(fieldOpts, prevField) ? prevField : null;
}

return this.fillDefaults({ row: this.params.row, field: field });
};

AggConfig.prototype.write = function () {
Expand Down
2 changes: 1 addition & 1 deletion src/kibana/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ define(function (require) {
.constant('kbnVersion', window.KIBANA_VERSION)
// The build number is placed by grunt, represents a sequence to provide nothing really but order.
// If NaN, use the max value of a JS number, that way we always have a number here, even in dev
.constant('buildNum', _.parseInt(window.KIBANA_BUILD_NUM) || Number.MAX_VALUE)
.constant('buildNum', _.parseInt(window.KIBANA_BUILD_NUM) || Number.MAX_SAFE_INTEGER)
// This stores the build number, @REV@ is replaced by grunt.
.constant('commitSha', window.KIBANA_COMMIT_SHA)
// Use this for cache busting partials
Expand Down

0 comments on commit f82f97d

Please sign in to comment.