Merge pull request #3493 from lukasolson/fix-booleans-index-patterns
Fix boolean and index pattern editors in advanced settings.
This commit is contained in:
commit
a8eb412116
|
@ -40,7 +40,6 @@
|
|||
<input
|
||||
ng-show="conf.bool"
|
||||
ng-model="conf.unsavedValue"
|
||||
ng-checked="conf.unsavedValue === undefined ? conf.defVal : conf.unsavedValue"
|
||||
type="checkbox"
|
||||
class="form-control">
|
||||
</form>
|
||||
|
|
|
@ -38,7 +38,7 @@ define(function (require) {
|
|||
};
|
||||
|
||||
$scope.edit = function (conf) {
|
||||
conf.unsavedValue = conf.value || conf.defVal;
|
||||
conf.unsavedValue = conf.value == null ? conf.defVal : conf.value;
|
||||
$scope.configs.forEach(function (c) {
|
||||
c.editting = (c === conf);
|
||||
});
|
||||
|
|
|
@ -47,7 +47,7 @@ define(function (require) {
|
|||
|
||||
var editor = getEditorType(conf);
|
||||
conf.json = editor === 'json';
|
||||
conf.bool = editor === 'bool';
|
||||
conf.bool = editor === 'boolean';
|
||||
conf.array = editor === 'array';
|
||||
conf.normal = editor === 'normal';
|
||||
conf.tooComplex = !editor;
|
||||
|
|
|
@ -15,7 +15,7 @@ define(function (require) {
|
|||
return 'array';
|
||||
}
|
||||
|
||||
return (typeof def.value);
|
||||
return (def.value != null ? typeof def.value : typeof value);
|
||||
}
|
||||
|
||||
return getValType;
|
||||
|
|
|
@ -26,6 +26,10 @@ define(function (require) {
|
|||
expect(getValType({value: 'someString'})).to.be('string');
|
||||
expect(getValType({value: 'someString'}, 42)).to.be('string');
|
||||
});
|
||||
|
||||
it('should return the type of the value if the default value is null', function () {
|
||||
expect(getValType({value: null}, 'someString')).to.be('string');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue