Fix boolean parameters
This commit is contained in:
parent
5b11bbec68
commit
45c2636ea0
|
@ -43,7 +43,14 @@ export default Ember.Component.extend({
|
|||
this.get('params')[this.get('info.identifier')] = value.toString();
|
||||
}
|
||||
return this.get('params')[this.get('info.identifier')];
|
||||
}.property('params', 'pname'),
|
||||
}.property('params', 'info.identifier'),
|
||||
|
||||
valueBool: function(key, value, previousValue) {
|
||||
if (arguments.length > 1) {
|
||||
this.get('params')[this.get('info.identifier')] = (!!value).toString();
|
||||
}
|
||||
return this.get('params')[this.get('info.identifier')] !== 'false';
|
||||
}.property('params', 'info.identifier'),
|
||||
|
||||
valid: function() {
|
||||
const type = this.get('info.type'),
|
||||
|
|
|
@ -35,7 +35,10 @@ const Query = RestModel.extend({
|
|||
if (oldParams[pinfo.identifier]) {
|
||||
newParams[name] = oldParams[name];
|
||||
} else if (pinfo['default'] !== null) {
|
||||
if (pinfo['default'] === false) { debugger; }
|
||||
newParams[name] = pinfo['default'];
|
||||
} else if (pinfo['type'] === 'boolean') {
|
||||
newParams[name] = 'false';
|
||||
} else {
|
||||
newParams[name] = '';
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#if info.nullable}}
|
||||
{{combo-box valueAttribute="id" value=value nameProperty="name" content=boolTypes}}
|
||||
{{else}}
|
||||
{{input type="checkbox" checked=value}}
|
||||
{{input type="checkbox" checked=valueBool}}
|
||||
{{/if}}
|
||||
<span class="param-name">{{info.identifier}}</span>
|
||||
|
|
|
@ -171,6 +171,9 @@
|
|||
overflow-x: visible;
|
||||
.ac-wrap {
|
||||
display: inline-block;
|
||||
input {
|
||||
width: 100px !important; // override an inline style
|
||||
}
|
||||
}
|
||||
input {
|
||||
width: 190px;
|
||||
|
|
Loading…
Reference in New Issue