mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
27 lines
No EOL
799 B
JavaScript
27 lines
No EOL
799 B
JavaScript
define(function (require) {
|
|
return function (Private) {
|
|
var Registry = require('utils/registry/registry');
|
|
var fieldFormats = Private(require('components/index_patterns/_field_formats'));
|
|
|
|
function StubIndexPattern(pattern, timeField, fields) {
|
|
this.fields = new Registry({
|
|
index: ['name'],
|
|
group: ['type'],
|
|
initialSet: fields.map(function (field) {
|
|
field.count = field.count || 0;
|
|
|
|
// non-enumerable type so that it does not get included in the JSON
|
|
Object.defineProperty(field, 'format', {
|
|
enumerable: false,
|
|
get: function () {
|
|
fieldFormats.defaultByType[field.type];
|
|
}
|
|
});
|
|
|
|
return field;
|
|
})
|
|
});
|
|
}
|
|
return StubIndexPattern;
|
|
};
|
|
}); |