mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
0e2f4ea33e
no issue - moves the `NavItem` object from the navigation controller to an explicit `NavigationItem` model file - adds a custom transform `navigation-settings` that transforms the navigation settings JSON string to/from an array of `NavigationItem` objects - simplifies the `settings/navigation` controller as it no longer has to export it's own internal model and handle serialization and deserialization This pattern should also help simplify the apps/slack integration code if implemented there.
28 lines
622 B
JavaScript
28 lines
622 B
JavaScript
import Ember from 'ember';
|
|
import ValidationEngine from 'ghost/mixins/validation-engine';
|
|
|
|
const {
|
|
computed,
|
|
isBlank
|
|
} = Ember;
|
|
|
|
export default Ember.Object.extend(ValidationEngine, {
|
|
label: '',
|
|
url: '',
|
|
isNew: false,
|
|
|
|
validationType: 'navItem',
|
|
|
|
isComplete: computed('label', 'url', function () {
|
|
let {label, url} = this.getProperties('label', 'url');
|
|
|
|
return !isBlank(label) && !isBlank(url);
|
|
}),
|
|
|
|
isBlank: computed('label', 'url', function () {
|
|
let {label, url} = this.getProperties('label', 'url');
|
|
|
|
return isBlank(label) && isBlank(url);
|
|
})
|
|
});
|