From 93d33c0592074b7a78b89aef4ff1a315e430cd86 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 4 Mar 2021 17:23:05 +0100 Subject: [PATCH 1/5] fix(task) : fix orthographe --- src/app/form/form.component.html | 2 +- .../structure-details/structure-details.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index a3d85c2a6..aa2263591 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> 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 2e865d93f..fc3993a6c 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 @@ -328,7 +328,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> -- GitLab From 5a29be5d857b9899af3532bed57cc4ac240ea153 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 4 Mar 2021 17:54:57 +0100 Subject: [PATCH 2/5] fix(task): fix only first letter Upper on structure name --- src/app/structure-list/components/card/card.component.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/structure-list/components/card/card.component.scss b/src/app/structure-list/components/card/card.component.scss index 687abf098..6deabb870 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; -- GitLab From 284c0024c7682acb4d40eb8fa34a5f09b033d29f Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Thu, 4 Mar 2021 17:55:16 +0100 Subject: [PATCH 3/5] fix(task): fix public name --- .../components/structure-details/structure-details.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9604623b9..215f44fa9 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 @@ -202,7 +202,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: -- GitLab From 1f1ffb94f5b08038fe800bd8df6fb710aa42869f Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 9 Mar 2021 14:21:52 +0100 Subject: [PATCH 4/5] fix(structure-details) : can go back on Home page --- .../components/card/card.component.ts | 9 +++++++- .../structure-details.component.html | 2 +- .../structure-details.component.scss | 2 +- .../structure-details.component.ts | 6 +++-- .../structure-list.component.ts | 22 ++++++++++++++++++- src/index.html | 1 - 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/app/structure-list/components/card/card.component.ts b/src/app/structure-list/components/card/card.component.ts index ed8b3158f..94440ab2d 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 99d3963e8..160c48a0b 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%"> 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 19284a7cc..77a9025cc 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 215f44fa9..2bea610b8 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 { diff --git a/src/app/structure-list/structure-list.component.ts b/src/app/structure-list/structure-list.component.ts index 45624ec9e..22404f28f 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/index.html b/src/index.html index 17a60d8dc..51427aa9d 100644 --- a/src/index.html +++ b/src/index.html @@ -11,7 +11,6 @@ content="Plateforme à destination des acteurs de l'inclusion numérique de la métropole de Lyon" /> <meta property="og:image" content="https://resin.grandlyon.com/assets/logos/logo_1200.svg" /> - > <link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css" /> -- GitLab From d6ae4ccdfdfc05e7adc98f853634f879d52648b8 Mon Sep 17 00:00:00 2001 From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com> Date: Tue, 9 Mar 2021 15:00:41 +0100 Subject: [PATCH 5/5] fix(route) : fix routing params with id --- src/app/form/form.component.html | 2 ++ .../user-verification/user-verification.component.html | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index aa2263591..46b374e87 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -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/user-verification/user-verification.component.html b/src/app/user-verification/user-verification.component.html index 628bb8efe..c1e11207d 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> -- GitLab