discourse/app/assets/javascripts/wizard/models/wizard-field.js.es6
Mark VanLandingham c7475ee03b
DEV: Import EmberObject rather than global variable (#8256)
* DEV: Import ember/object rather than Ember.Object globally

* fixed broken object proxy import

* prettier on js

* added @ember/object/proxy to loader

* added unstaged file

* Fixed objet proxy reference is loader

* Linting!
2019-10-29 14:23:50 -05:00

24 lines
432 B
JavaScript

import EmberObject from "@ember/object";
import ValidState from "wizard/mixins/valid-state";
export default EmberObject.extend(ValidState, {
id: null,
type: null,
value: null,
required: null,
warning: null,
check() {
if (!this.required) {
this.setValid(true);
return true;
}
const val = this.value;
const valid = val && val.length > 0;
this.setValid(valid);
return valid;
}
});