Update default to string, remove check for getFormat in aggConfig

This commit is contained in:
Rashid Khan 2015-05-06 15:58:04 -07:00
parent a5449701c3
commit 37e561c5a2
3 changed files with 3 additions and 3 deletions

View file

@ -133,7 +133,7 @@ define(function (require) {
*/
AggType.prototype.getFormat = function (agg) {
var field = agg.field();
return field ? field.format : fieldFormats.getDefaultInstance('number');
return field ? field.format : fieldFormats.getDefaultInstance('string');
};
return AggType;

View file

@ -272,7 +272,7 @@ define(function (require) {
var format = field && field.format;
var strFormat = fieldFormats.getDefaultInstance('string');
if (this.type && this.type.getFormat) {
if (this.type) {
format = this.type.getFormat(this) || format;
}

View file

@ -102,7 +102,7 @@ define(function (require) {
});
aggConfig = vis.aggs.byTypeName.count[0];
expect(aggType.getFormat(aggConfig)).to.be(fieldFormat.getDefaultInstance('number'));
expect(aggType.getFormat(aggConfig)).to.be(fieldFormat.getDefaultInstance('string'));
});
it('can be overridden via config', function () {