diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index 1599d788955d506bf2c29a1edb005929b140b210..f1b1929d9e3a227379f6cacc435da79c81e25622 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -35,12 +35,7 @@ [value]="progressStatus" ></progress> </div> - <div - *ngIf="currentPage == pageTypeEnum.summary && !isEditMode" - class="home page" - fxLayout="column" - fxLayoutAlign="space-between" - > + <div *ngIf="displayAddStructure()" class="home page" fxLayout="column" fxLayoutAlign="space-between"> <h2>Ajouter votre structure</h2> <img src="../../assets/form/schedule.svg" alt="logo schedule" /> <div> @@ -51,6 +46,23 @@ <button class="btn-primary start" (click)="nextPage()">C'est Parti</button> </div> </div> + <div + *ngIf="displayClaimStructure()" + class="home page" + fxLayout="column" + fxLayoutAlign="space-between center" + fxLayoutAlign.lt-sm="center" + > + <h2> + Revendiquer la structure <span>{{ claimStructure.structureName }}</span> + </h2> + <div> + <p>Une fois réalisé cela vous permettra de devenir propriétaire de cette structure</p> + </div> + <div class="btnStart"> + <button class="btn-primary start" (click)="nextPage()">C'est Parti</button> + </div> + </div> <div *ngIf="currentPage == pageTypeEnum.summary && isEditMode" class="editHome page" diff --git a/src/app/form/form.component.scss b/src/app/form/form.component.scss index 17ced3d6b57f7035ff1dd40de552ebfad0d56c4a..8ab5aa6f497016a494aa88bad2231c11d91eba64 100644 --- a/src/app/form/form.component.scss +++ b/src/app/form/form.component.scss @@ -86,6 +86,7 @@ h3 { ) !important; // -1px because of header border } @media #{$tablet} { + height: 100%; &.editMode { .page { height: calc( @@ -103,8 +104,11 @@ h3 { height: auto; h2 { @include cn-bold-28; - color: $secondary-color; + color: $black; margin-bottom: 0; + span { + color: $secondary-color; + } } h3 { @include cn-bold-22; @@ -163,7 +167,7 @@ h3 { color: $grey-3; margin-top: 4px; - width: 256px; + width: 280px; &.invalid { color: $orange-warning; } diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index 716865200738f0dd9b3fbcd2284a7038f1e95783..a090151708f27ff42dc39594dc782197ec920d36 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -41,7 +41,7 @@ export class FormComponent implements OnInit { public equipmentsAndServices: { module: Module; openned: boolean }[] = []; public trainingCategories: { category: Category; openned: boolean }[] = []; public pageTypeEnum = PageTypeEnum; - public claimStructureId = null; + public claimStructure: Structure = null; // Page and progress var public currentPage = 0; @@ -93,7 +93,7 @@ export class FormComponent implements OnInit { } else if (history.state.newUser) { this.isClaimMode = true; this.createAccountForm(); - this.claimStructureId = history.state.newUser; + this.claimStructure = history.state.newUser; this.setValidationsForm(); } else { this.initForm(new Structure()); @@ -523,7 +523,7 @@ export class FormComponent implements OnInit { const user = new User(this.accountForm.value); // Create user and claim structure this.authService.register(user).subscribe(() => { - this.structureService.claimStructureWithAccount(this.claimStructureId, user).subscribe(() => { + this.structureService.claimStructureWithAccount(this.claimStructure._id, user).subscribe(() => { this.progressStatus = 100; }); }); @@ -814,4 +814,12 @@ export class FormComponent implements OnInit { }); } } + + public displayAddStructure(): boolean { + return this.currentPage == this.pageTypeEnum.summary && !this.isEditMode && !this.isClaimMode; + } + + public displayClaimStructure(): boolean { + return this.currentPage == this.pageTypeEnum.summary && !this.isEditMode && this.isClaimMode; + } } diff --git a/src/app/structure-list/components/structure-details/structure-details.component.ts b/src/app/structure-list/components/structure-details/structure-details.component.ts index a46e89ef8ddeb2c6cc08407c8ec403cf09ddabcc..a3c33e73128703ca7e505b82034a8d8e45e27634 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.ts +++ b/src/app/structure-list/components/structure-details/structure-details.component.ts @@ -126,7 +126,7 @@ export class StructureDetailsComponent implements OnInit { if (this.userIsLoggedIn()) { this.toggleClaimModal(); } else { - this.router.navigate(['create-structure'], { state: { newUser: this.structure._id } }); + this.router.navigate(['create-structure'], { state: { newUser: this.structure } }); } }