mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
46b311b561
refs https://github.com/TryGhost/Team/issues/792 - updates product benefit to use `name` instead of `label` attribute for benefit text - updates model/serializer/validator to correctly handle benefit attributes - added `+` button for adding new labels as the enter behavior is closing the popup(needs fix)
19 lines
444 B
JavaScript
19 lines
444 B
JavaScript
import BaseValidator from './base';
|
|
import {isBlank} from '@ember/utils';
|
|
|
|
export default BaseValidator.create({
|
|
properties: ['name'],
|
|
|
|
name(model) {
|
|
let name = model.get('name');
|
|
let hasValidated = model.get('hasValidated');
|
|
|
|
if (isBlank(name)) {
|
|
model.get('errors').add('name', 'You must specify a name');
|
|
this.invalidate();
|
|
}
|
|
|
|
hasValidated.addObject('name');
|
|
}
|
|
});
|