Skip to content
Snippets Groups Projects
Commit c68f9baf authored by Jérémie BRISON's avatar Jérémie BRISON
Browse files

fix(editForm): fix logic validate/close form

parent 0f404550
No related branches found
No related tags found
4 merge requests!85Recette,!84Dev,!74Fix/claim with form,!72Feat/edit structure
......@@ -1040,7 +1040,7 @@
</div>
<div *ngIf="isEditMode && currentPage == 0" class="footerEditMode">
<div fxLayout="row" fxLayoutAlign="center center">
<button class="btn-primary unique" (click)="validateForm()">Terminé</button>
<button class="btn-primary unique" (click)="closeEditMode()">Terminé</button>
</div>
</div>
</div>
......
......@@ -612,7 +612,7 @@ export class FormComponent implements OnInit {
let user: User;
if (this.isEditMode) {
this.structureService.editStructure(structure).subscribe((s: Structure) => {
this.router.navigateByUrl('home', { state: { data: s } });
this.editForm = this.createStructureForm(s);
});
} else {
if (this.profile) {
......@@ -671,7 +671,7 @@ export class FormComponent implements OnInit {
public goToSpecificPage(numPage: number, isSave: boolean): void {
if (isSave) {
this.editForm = this.createStructureForm(new Structure(this.structureForm.value));
this.validateForm();
} else {
const structure = new Structure(this.editForm.value);
this.structureForm = this.createStructureForm(structure);
......@@ -679,4 +679,8 @@ export class FormComponent implements OnInit {
}
this.currentPage = numPage;
}
public closeEditMode(): void {
this.router.navigateByUrl('home', { state: { data: this.editForm.value } });
}
}
......@@ -76,4 +76,7 @@
&.small {
width: 149px;
}
&.invalid {
opacity: 0.4;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment