How to use the ilios-common/decorators/validation.Length function in ilios-common

To help you get started, we’ve selected a few ilios-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ilios / frontend / app / components / competency-title-editor.js View on Github external
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { dropTask } from 'ember-concurrency-decorators';
import { validatable, Length, NotBlank } from 'ilios-common/decorators/validation';

@validatable
export default class CompetencyTitleEditorComponent extends Component {
  @Length(1, 200) @NotBlank() @tracked title;

  constructor() {
    super(...arguments);
    this.title = this.args.competency.title;
  }

  @action
  revert() {
    this.title = this.args.competency.title;
  }

  @dropTask
  *save() {
    this.addErrorDisplayFor('title');
    const isValid = yield this.isValid('title');
    if (!isValid) {

ilios-common

Common shared code for ilios ember apps.

MIT
Latest version published 10 months ago

Package Health Score

45 / 100
Full package analysis