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();
|
this.get('params')[this.get('info.identifier')] = value.toString();
|
||||||
}
|
}
|
||||||
return this.get('params')[this.get('info.identifier')];
|
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() {
|
valid: function() {
|
||||||
const type = this.get('info.type'),
|
const type = this.get('info.type'),
|
||||||
|
|
|
@ -35,7 +35,10 @@ const Query = RestModel.extend({
|
||||||
if (oldParams[pinfo.identifier]) {
|
if (oldParams[pinfo.identifier]) {
|
||||||
newParams[name] = oldParams[name];
|
newParams[name] = oldParams[name];
|
||||||
} else if (pinfo['default'] !== null) {
|
} else if (pinfo['default'] !== null) {
|
||||||
|
if (pinfo['default'] === false) { debugger; }
|
||||||
newParams[name] = pinfo['default'];
|
newParams[name] = pinfo['default'];
|
||||||
|
} else if (pinfo['type'] === 'boolean') {
|
||||||
|
newParams[name] = 'false';
|
||||||
} else {
|
} else {
|
||||||
newParams[name] = '';
|
newParams[name] = '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{{#if info.nullable}}
|
{{#if info.nullable}}
|
||||||
{{combo-box valueAttribute="id" value=value nameProperty="name" content=boolTypes}}
|
{{combo-box valueAttribute="id" value=value nameProperty="name" content=boolTypes}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{input type="checkbox" checked=value}}
|
{{input type="checkbox" checked=valueBool}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<span class="param-name">{{info.identifier}}</span>
|
<span class="param-name">{{info.identifier}}</span>
|
||||||
|
|
|
@ -171,6 +171,9 @@
|
||||||
overflow-x: visible;
|
overflow-x: visible;
|
||||||
.ac-wrap {
|
.ac-wrap {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
input {
|
||||||
|
width: 100px !important; // override an inline style
|
||||||
|
}
|
||||||
}
|
}
|
||||||
input {
|
input {
|
||||||
width: 190px;
|
width: 190px;
|
||||||
|
|
Loading…
Reference in New Issue