From cfb968e325bb9d183f2158a95473588f94084f57 Mon Sep 17 00:00:00 2001 From: Guilhem CARRON <gcarron@grandlyon.com> Date: Tue, 24 May 2022 11:55:27 +0000 Subject: [PATCH] feat(structure): Add structure members in details --- .../structure-details.component.html | 34 +++++++++++++++---- .../structure-details.component.scss | 21 ++++++++++++ .../structure-details.component.ts | 13 +++---- 3 files changed, 56 insertions(+), 12 deletions(-) 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 71e621ba5..a8a333e41 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 @@ -88,12 +88,9 @@ <div fxLayout="column"> <h2>Informations</h2> <div class="info-block"> - <div *ngIf="structure.getLabelTypeStructure()"> + <div> {{ structure.getLabelTypeStructure() }} </div> - <div *ngIf="structure.structureName"> - {{ structure.structureName }} - </div> <div *ngIf="structure.address"> {{ structure.address.numero }} {{ structure.address.street }}, {{ structure.address.commune }} </div> @@ -243,7 +240,7 @@ fxLayout="column" class="structure-details-block" fxLayoutAlign="baseline baseline" - fxLayoutGap="12px" + fxLayoutGap="8px" > <h2>Labellisations</h2> <div class="wrapper"> @@ -253,6 +250,31 @@ </div> </div> + <!-- Members --> + <div + *ngIf="userIsLoggedIn() && structureAdmins.length" + fxLayout="column" + class="structure-details-block" + fxLayoutAlign="baseline baseline" + fxLayoutGap="8px" + > + <h2>Membres</h2> + <div fxLayout="column" fxLayoutGap="8px"> + <div *ngFor="let member of structureAdmins" class="member-card"> + <app-svg-icon + class="avatar" + [type]="'avatar'" + [icon]="'defaultAvatar'" + [iconClass]="'icon-40'" + ></app-svg-icon> + <div class="info-member"> + <p class="member">{{ member.name }} {{ member.surname }}</p> + <p class="job" *ngIf="displayJobEmployer(member)">{{ displayJobEmployer(member) }}</p> + </div> + </div> + </div> + </div> + <!-- Aides numérique --> <div *ngIf="structure.proceduresAccompaniment.length || structure.otherDescription" @@ -261,7 +283,7 @@ fxLayoutAlign="baseline baseline" fxLayoutGap="12px" > - <h2>Aides numérique</h2> + <h2>Aides au numérique</h2> <div fxLayout="column"> <div class="wrapper"> <div *ngFor="let accompagnement of structure.proceduresAccompaniment"> 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 a55589857..79b7b871a 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 @@ -103,6 +103,27 @@ h3 { border-bottom: none; padding-bottom: 0px; } + .member-card { + display: flex; + justify-content: center; + align-items: center; + .avatar { + background-color: $grey-8; + border-radius: 4px; + } + .info-member { + margin-left: 1rem; + p { + margin: 0; + } + .member { + @include lato-bold-14; + } + .job { + @include lato-regular-14; + } + } + } .info-block > div { margin-top: 4px; 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 ad805b9a1..9e4124857 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 @@ -11,6 +11,7 @@ import { AuthService } from '../../../services/auth.service'; import { StructureService } from '../../../services/structure.service'; import { TclService } from '../../../services/tcl.service'; import { PrintService } from '../../../shared/service/print.service'; +import { Utils } from '../../../utils/utils'; import { AccessModality } from '../../enum/access-modality.enum'; import { Equipment } from '../../enum/equipment.enum'; import { PublicCategorie } from '../../enum/public.enum'; @@ -120,12 +121,9 @@ export class StructureDetailsComponent implements OnInit { private async initForm(): Promise<void> { if (this.userIsLoggedIn()) { this.currentProfile = await this.profileService.getProfile(); - - if (this.profileService.isAdmin()) { - this.structureService.getStructureWithOwners(this.structure._id, this.currentProfile).subscribe((res) => { - this.structureAdmins = res.owners; - }); - } + this.structureService.getStructureWithOwners(this.structure._id, this.currentProfile).subscribe((res) => { + this.structureAdmins = res.owners; + }); } this.isClaimed = await this.structureService.isClaimed(this.structure._id, this.currentProfile).toPromise(); @@ -410,4 +408,7 @@ export class StructureDetailsComponent implements OnInit { public goToWebsite(): void { window.open(this.structure.website, '_blank'); } + public displayJobEmployer(profile: User): string { + return new Utils().getJobEmployer(profile); + } } -- GitLab