2022-01-21 22:25:47 +03:00
|
|
|
import EmberObject, {computed} from '@ember/object';
|
2016-06-30 13:21:47 +03:00
|
|
|
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
|
2017-08-22 10:53:26 +03:00
|
|
|
import {isBlank} from '@ember/utils';
|
2016-04-26 12:45:59 +03:00
|
|
|
|
2016-06-11 19:52:36 +03:00
|
|
|
export default EmberObject.extend(ValidationEngine, {
|
2016-04-26 12:45:59 +03:00
|
|
|
label: '',
|
|
|
|
url: '',
|
|
|
|
isNew: false,
|
2019-12-04 07:14:45 +03:00
|
|
|
isSecondary: false,
|
2016-04-26 12:45:59 +03:00
|
|
|
|
|
|
|
validationType: 'navItem',
|
|
|
|
|
|
|
|
isComplete: computed('label', 'url', function () {
|
2019-03-06 16:53:54 +03:00
|
|
|
let {label, url} = this;
|
2016-04-26 12:45:59 +03:00
|
|
|
|
|
|
|
return !isBlank(label) && !isBlank(url);
|
|
|
|
}),
|
|
|
|
|
|
|
|
isBlank: computed('label', 'url', function () {
|
2019-03-06 16:53:54 +03:00
|
|
|
let {label, url} = this;
|
2016-04-26 12:45:59 +03:00
|
|
|
|
|
|
|
return isBlank(label) && isBlank(url);
|
|
|
|
})
|
|
|
|
});
|