Revize abe9aea2
Přidáno uživatelem Jakub Hlaváč před téměř 4 roky(ů)
src/app/dashboard/components/unit-popup/unit-popup.component.html | ||
---|---|---|
2 | 2 |
|
3 | 3 |
<form [formGroup]="insertForm"> |
4 | 4 |
<div class="input-group form-group"> |
5 |
<input type="text" formControlName="unitId" class="form-control" id="unitId" placeholder="{{ unit?.unitId}}"/>
|
|
6 |
</div>
|
|
7 |
<div class="input-group form-group">
|
|
5 |
<div class="input-group-prepend">
|
|
6 |
<span class="input-group-text">Description</span>
|
|
7 |
</div>
|
|
8 | 8 |
<input type="text" formControlName="unitDescription" class="form-control" id="unitDescription" placeholder="{{unit?.description}}"/> |
9 | 9 |
</div> |
10 | 10 |
</form> |
src/app/dashboard/components/unit-popup/unit-popup.component.ts | ||
---|---|---|
24 | 24 |
|
25 | 25 |
initForm() { |
26 | 26 |
this.insertForm = this.formBuilder.group({ |
27 |
unitDescription: [''], |
|
28 |
unitId: [''] |
|
27 |
unitDescription: ['', Validators.required] |
|
29 | 28 |
}); |
30 | 29 |
} |
31 | 30 |
|
... | ... | |
34 | 33 |
|
35 | 34 |
|
36 | 35 |
saveUnit() { |
37 |
// TODO |
|
38 |
this.managementService.updateUnit({ body: { unit: this.unit}}) |
|
36 |
if (this.insertForm.controls.unitDescription.value && this.insertForm.controls.unitDescription.value !== this.unit.description) { |
|
37 |
this.unit.description = this.insertForm.controls.unitDescription.value; |
|
38 |
// TODO this.managementService.updateUnit({ body: { unit: this.unit}}); |
|
39 |
console.log(this.unit); |
|
40 |
} |
|
39 | 41 |
} |
40 | 42 |
|
41 | 43 |
close() { |
Také k dispozici: Unified diff
Re #8785 - Úprava unit - tweak formuláře