mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[field formats] Use default on all new fields
This commit is contained in:
parent
f86145fce4
commit
8221872678
1 changed files with 11 additions and 9 deletions
|
@ -1,10 +1,15 @@
|
|||
define(function (require) {
|
||||
return function _StringProvider(Private) {
|
||||
var _ = require('lodash');
|
||||
var FieldFormat = Private(require('ui/index_patterns/_field_format/FieldFormat'));
|
||||
|
||||
require('ui/stringify/editors/color.less');
|
||||
|
||||
const _ = require('lodash');
|
||||
const FieldFormat = Private(require('ui/index_patterns/_field_format/FieldFormat'));
|
||||
const DEFAULT_COLOR = {
|
||||
range: `${Number.NEGATIVE_INFINITY}:${Number.POSITIVE_INFINITY}`,
|
||||
text: '#000000',
|
||||
background: '#ffffff'
|
||||
};
|
||||
|
||||
_.class(_Color).inherits(FieldFormat);
|
||||
function _Color(params) {
|
||||
_Color.Super.call(this, params);
|
||||
|
@ -20,7 +25,7 @@ define(function (require) {
|
|||
template: require('ui/stringify/editors/color.html'),
|
||||
controller($scope) {
|
||||
$scope.addColor = function () {
|
||||
$scope.editor.formatParams.colors.push({});
|
||||
$scope.editor.formatParams.colors.push(_.cloneDeep(DEFAULT_COLOR));
|
||||
};
|
||||
|
||||
$scope.removeColor = function (index) {
|
||||
|
@ -29,12 +34,9 @@ define(function (require) {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
_Color.paramDefaults = {
|
||||
colors: [{
|
||||
range: `${Number.NEGATIVE_INFINITY}:${Number.POSITIVE_INFINITY}`,
|
||||
text: '#000000',
|
||||
background: '#ffffff'
|
||||
}]
|
||||
colors: [_.cloneDeep(DEFAULT_COLOR)]
|
||||
};
|
||||
|
||||
_Color.prototype._convert = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue