diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index a3d85c2a6c444ba89b0008442c29479f0b66a29b..46b374e8754b7dd64adab067332bdfe1761e0ee6 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -331,7 +331,7 @@ </div> <div *ngIf="currentPage == pageTypeEnum.structurePhone" class="page"> <div class="title"> - <h3>Quel numéro appelé pour joindre votre structure ?</h3> + <h3>Quel numéro appeler pour joindre votre structure ?</h3> </div> <div class="form-group" fxLayout="column"> <label for="contactPhone">Téléphone de la structure</label> @@ -1151,6 +1151,7 @@ *ngIf="currentPage == nbPagesForm && profile" class="btn-primary unique" routerLink="/home" + [queryParams]="{ id: createdStructure._id }" [state]="{ data: createdStructure }" > Voir ma structure @@ -1193,6 +1194,7 @@ *ngIf="currentPage == nbPagesForm && profile" class="btn-primary unique" routerLink="/home" + [queryParams]="{ id: createdStructure._id }" [state]="{ data: createdStructure }" > Voir ma structure diff --git a/src/app/structure-list/components/card/card.component.scss b/src/app/structure-list/components/card/card.component.scss index 687abf098d16804365bd2c3b0d1dd13940809f52..6deabb870aa37f73a9b53c9efa120ca599f370fc 100644 --- a/src/app/structure-list/components/card/card.component.scss +++ b/src/app/structure-list/components/card/card.component.scss @@ -21,7 +21,10 @@ @include cn-bold-18; padding-bottom: 5px; width: 100%; - text-transform: capitalize; + text-transform: lowercase; + &::first-letter { + text-transform: uppercase; + } } .distanceStructure { @include cn-regular-16; diff --git a/src/app/structure-list/components/card/card.component.ts b/src/app/structure-list/components/card/card.component.ts index ed8b3158f0c7c573c571d644a3c6eb1a1bbc3206..94440ab2d1d22a56d29fd2585b81971ffd13f0a2 100644 --- a/src/app/structure-list/components/card/card.component.ts +++ b/src/app/structure-list/components/card/card.component.ts @@ -1,4 +1,5 @@ import { Component, Input, Output, OnInit, EventEmitter } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; import { Structure } from '../../../models/structure.model'; import { GeojsonService } from '../../../services/geojson.service'; @@ -12,7 +13,7 @@ export class CardComponent implements OnInit { @Output() public showDetails: EventEmitter<Structure> = new EventEmitter<Structure>(); @Output() public hover: EventEmitter<Structure> = new EventEmitter<Structure>(); - constructor(private geoJsonService: GeojsonService) {} + constructor(private route: ActivatedRoute, private router: Router) {} ngOnInit(): void {} /** @@ -28,6 +29,12 @@ export class CardComponent implements OnInit { public cardClicked(): void { this.showDetails.emit(this.structure); + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + id: this.structure._id, + }, + }); } public cardHover(): void { diff --git a/src/app/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html index f7683fb0c2acdcc662f7d430e236f0ffa1324e03..160c48a0b30d7d0a7d4442e9d6e546c97bf10a8d 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.html +++ b/src/app/structure-list/components/structure-details/structure-details.component.html @@ -1,7 +1,7 @@ <div class="structrue-details-container" *ngIf="structure && !isLoading"> <!-- Header info --> <div fxLayout="row" fxLayoutAlign="end center"> - <div (click)="close(false)" class="ico-close-details"></div> + <div (click)="close()" class="ico-close-details"></div> </div> <div fxLayout="row" class="structure-details-block" fxLayoutAlign="baseline baseline" fxLayoutGap="8px"> <div fxLayout="column" fxLayoutGap="10px" fxFlex="100%"> @@ -336,7 +336,7 @@ <app-modal-confirmation [openned]="claimModalOpenned" [content]=" - 'Voulez-vous vraiment revendiquer cette structure ? Une demande sera envoyée a l\'administrateur pour validation' + 'Voulez-vous vraiment revendiquer cette structure ? Une demande sera envoyée à l\'administrateur pour validation' " (closed)="claimStructure($event)" ></app-modal-confirmation> diff --git a/src/app/structure-list/components/structure-details/structure-details.component.scss b/src/app/structure-list/components/structure-details/structure-details.component.scss index 19284a7cc69c13612863296b2667cefa0dfa7332..77a9025cc2ea1a08097687f61b7cfa76d1b9acda 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.scss +++ b/src/app/structure-list/components/structure-details/structure-details.component.scss @@ -18,7 +18,7 @@ a { left: 0; max-width: 980px; width: 100%; - height: calc(100vh - #{$header-height} - #{$footer-height}); + height: calc(100vh - #{$header-height} - #{$footer-height} - 20px); padding: 10px 24px; overflow: auto; @media #{$tablet} { 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 9604623b998ad702839646fcd29bad779078a6e6..2bea610b866f383a497841222d6c0497d8b063ae 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 @@ -107,8 +107,10 @@ export class StructureDetailsComponent implements OnInit { } } - public close(refreshRequired: boolean): void { - this.closeDetails.emit(refreshRequired); + public close(): void { + this.router.navigate([], { + relativeTo: this.route, + }); } public print(): void { @@ -202,7 +204,7 @@ export class StructureDetailsComponent implements OnInit { case PublicCategorie.young: return 'Jeunes (16 - 25 ans)'; case PublicCategorie.adult: - return 'Adultes (25 - 65 ans)'; + return 'Adultes'; case PublicCategorie.elderly: return 'Séniors (+ de 65 ans)'; case PublicCategorie.all: diff --git a/src/app/structure-list/structure-list.component.ts b/src/app/structure-list/structure-list.component.ts index 45624ec9e82de52c0c5bb07504e1ae6719840317..22404f28f83b5e1d3da84f4b27216dc6b0a024b0 100644 --- a/src/app/structure-list/structure-list.component.ts +++ b/src/app/structure-list/structure-list.component.ts @@ -3,6 +3,8 @@ import { Filter } from './models/filter.model'; import { Structure } from '../models/structure.model'; import { GeoJson } from '../map/models/geojson.model'; import * as _ from 'lodash'; +import { ActivatedRoute, Router } from '@angular/router'; +import { StructureService } from '../services/structure.service'; @Component({ selector: 'app-structure-list', @@ -28,11 +30,29 @@ export class StructureListComponent implements OnChanges { private arrayChunked: Structure[][] = []; private chunck = 10; - constructor() {} + constructor(private route: ActivatedRoute, private router: Router, private structureService: StructureService) { + this.route.queryParams.subscribe((queryParams) => { + if (queryParams.id) { + if (!this.structure) { + this.structureService.getStructure(queryParams.id).subscribe((s) => { + this.showDetails(new Structure(s)); + }); + } + } else { + this.closeDetails(); + } + }); + } ngOnChanges(changes: SimpleChanges): void { if (changes.selectedStructure && this.selectedStructure) { this.showDetails(this.selectedStructure); + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + id: this.selectedStructure._id, + }, + }); } if (changes.structureList) { this.structuresListChunked = this.chunckAnArray(this.structureList); diff --git a/src/app/user-verification/user-verification.component.html b/src/app/user-verification/user-verification.component.html index 628bb8efe98b0575616bac18c89923a28424e1f0..c1e11207de2a2234f859bfea4c4f7a6494075bb2 100644 --- a/src/app/user-verification/user-verification.component.html +++ b/src/app/user-verification/user-verification.component.html @@ -37,7 +37,13 @@ ></div> </div> <div class="btnSection" fxLayout="row" fxLayoutAlign="space-around center"> - <button *ngIf="structure && verificationSuccess" class="btn" routerLink="/home" [state]="{ data: structure }"> + <button + *ngIf="structure && verificationSuccess" + class="btn" + routerLink="/home" + [queryParams]="{ id: structure._id }" + [state]="{ data: structure }" + > Voir ma structure </button> </div>