Ghost/ghost/admin/app/components/gh-benefit-item.js
Kevin Ansfield c3487fea41 Refactored <GhBenefitItem>
refs https://github.com/TryGhost/Ghost/issues/14101

- migrated component to Glimmer
- swapped usage of `ValidationState` mixin for `{{validation-status}}` modifier
  - updated modifier to accept custom error/success classes
- removed unnecessary/unused code in the `gh-benefit-item.js` backing class
2022-12-14 11:57:54 +00:00

20 lines
437 B
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
export default class GhBenefitItem extends Component {
@action
handleLabelInput(event) {
this.updateLabel(event.target.value);
}
@action
updateLabel(value) {
this.args.updateLabel(value, this.args.benefitItem);
}
@action
clearLabelErrors() {
this.args.benefitItem.errors?.remove('name');
}
}