Skip to content
Snippets Groups Projects
Commit 2ef36f46 authored by Antonin COQUET's avatar Antonin COQUET
Browse files

WIP: login on structure form

parent b1d1ec36
No related branches found
No related tags found
3 merge requests!178release V1.10.0,!135Dev,!128Feat/formulaire feedback
......@@ -121,6 +121,13 @@
<h3>Qui êtes-vous ?</h3>
<p>Ces informations ne seront pas visibles sur la plateforme</p>
</div>
<div class="title">
<h4>Vous possédez déja un compte ? Connectez-vous:</h4>
<button class="btn-primary small next" *ngIf="!isLoggedIn" (click)="isPopUpOpen = !isPopUpOpen">
Se connecter
</button>
<h4>Sinon, inscrivez-vous en suivant le formulaire ci-dessous:</h4>
</div>
<div class="form-group" fxLayout="column">
<label for="surname">Nom</label>
<div fxLayout="row" fxLayoutGap="13px">
......@@ -1213,4 +1220,9 @@
Voir ma structure
</button>
</div>
<app-signup-modal
*ngIf="displaySignUp"
[openned]="isPopUpOpen"
(closed)="closeSignUpModal($event)"
></app-signup-modal>
</div>
......@@ -77,6 +77,9 @@ export class FormComponent implements OnInit {
public isWifiChoosen = null;
public structureWithOwners: StructureWithOwners;
public isPopUpOpen = false;
public displaySignUp = true;
constructor(
private structureService: StructureService,
private searchService: SearchService,
......@@ -138,6 +141,27 @@ export class FormComponent implements OnInit {
}
}
public closeSignUpModal(value: boolean): void {
if (!value) {
this.displaySignUp = false;
} else {
this.isPopUpOpen = false;
}
if (this.isLoggedIn) {
this.updateFormOnLogin();
}
}
public updateFormOnLogin() {
//TODO -> switch to signed mode, update user data, validate/delete previous field, skip 2 pages
this.isAccountMode = true;
this.currentPage = PageTypeEnum.structureNameAndAddress;
}
public get isLoggedIn(): boolean {
return this.authService.isLoggedIn();
}
async setCategories(): Promise<void> {
this.searchService.getCategoriesAccompaniment().subscribe((categories: Category[]) => {
this.proceduresAccompaniment = categories[0];
......
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