Skip to content

Instantly share code, notes, and snippets.

@rashidkpc
Created February 10, 2016 17:32
Show Gist options
  • Save rashidkpc/e89de8e7317fe6f315cd to your computer and use it in GitHub Desktop.
Save rashidkpc/e89de8e7317fe6f315cd to your computer and use it in GitHub Desktop.
import _ from 'lodash';
import FieldFormatProvider from 'ui/index_patterns/_field_format/FieldFormat';
import fieldFormatsRegistry from 'ui/registry/field_formats';
import KibanaPlugin from 'somewhere/in/there'
module.exports = new KibanaPlugin('myPluginName', {
type: 'fieldFormat',
init: function () {
fieldFormatsRegistry.register(function UrlFormatProvider(Private) {
const FieldFormat = Private(FieldFormatProvider);
return class MyFieldFormat extends FieldFormat {
static id = 'lowercase';
static title = 'lowercase';
static fieldType = '*';
static editor = null;
static paramDefaults = {};
_convert(value) {
return String(value).toLowerCase();
}
};
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment