Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Commit

Permalink
Todo: Issue #94
Browse files Browse the repository at this point in the history
Not rendered: frontile forms form-input
  • Loading branch information
hotsoft-desenv4 committed Dec 29, 2020
1 parent e59f357 commit a8f6c18
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
24 changes: 9 additions & 15 deletions app/components/grupo-centro-custos/grupo-centro-custos-form.hbs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">Nome:</label>
<div class="col-sm-6">
<Input @type="text" @value={{@model.nome}} class="form-control" placeholder="Grupo centro custo" />
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
{{!- TODO: Do not use `action` as. Instead, use the `on` modifier and `fn` -}}
{{!- TODO: helper.ember-template-lint -}}
<button type="submit" class="btn btn-success" {{on "click" (fn this.save @model)}}>Salvar</button>
</div>
</div>
</div>
<FormInput
@value={{this.value}}
@onInput={{this.setValue}}
placeholder="Insira um nome"
/>

<p>
Você digiou, "{{this.value}}"
</p>
13 changes: 13 additions & 0 deletions app/components/grupo-centro-custos/grupo-centro-custos-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ export default class GrupoCentroCustosFormComponent extends DefaultComponent {
// TODO: 'service' is defined but never used.eslintno-unused-vars
@tracked redirectTo = '/grupo_centro_custos';
@tracked modelString = 'grupo_centro_custo';
@tracked value = '';
get validationErrors() {
if (/^$/.test(this.value)) {
return ['Digite o Nome'];
} else {
return [];
}
}

@action setValue(value) {
this.value = value;
}

@action
save(model, ...event) {
Expand Down

0 comments on commit a8f6c18

Please sign in to comment.