From 42d5b064b60481ffc203f1daedba98f63aefe5f5 Mon Sep 17 00:00:00 2001 From: Antonin Coquet <ext.sopra.acoquet@grandlyon.com> Date: Tue, 23 Mar 2021 11:33:37 +0100 Subject: [PATCH] fix: display all workshop categories --- .../structure-details.component.html | 18 +++++++++-- .../structure-details.component.scss | 7 +++++ .../structure-details.component.ts | 30 +++++++++++++++++++ .../structure-list/models/category.model.ts | 12 ++++++++ 4 files changed, 64 insertions(+), 3 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 475c4791b..3847236f6 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 @@ -250,15 +250,27 @@ <div *ngIf="!structure.freeWorkShop"> <span class="bold-info">L'accès à ces ateliers est payant</span> </div> - <div fxLayout="row" class="w-100 mobile-column"> - <div fxFlex="50%" *ngIf="isBaseSkills()"> + <div class="wrapper"> + <div *ngIf="isBaseSkills()"> <h3 class="subtitle">Compétences de base</h3> <p *ngFor="let skill of baseSkills">{{ skill.text }}</p> </div> - <div fxFlex="50%" *ngIf="isAccessRights()"> + <div *ngIf="isAccessRights()"> <h3 class="subtitle">Accès aux droits</h3> <p *ngFor="let rights of accessRights">{{ rights.text }}</p> </div> + <div *ngIf="isParentingHelp()"> + <h3 class="subtitle">Aide à la parentalité</h3> + <p *ngFor="let help of parentingHelp">{{ help.text }}</p> + </div> + <div *ngIf="isSocialAndProfessional()"> + <h3 class="subtitle">Insertion sociale et professionnelle</h3> + <p *ngFor="let skill of socialAndProfessional">{{ skill.text }}</p> + </div> + <div *ngIf="isDigitalSecurity()"> + <h3 class="subtitle">Culture et sécurité numérique</h3> + <p *ngFor="let skill of digitalCultureSecurity">{{ skill.text }}</p> + </div> </div> </div> <!-- Equipements --> 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 77a9025cc..3cd1e7184 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 @@ -119,3 +119,10 @@ p, .info { color: $ram-hover-principal; } + +.wrapper { + width: 100%; + display: grid; + gap: 20px 30px; + grid-template-columns: 1fr 1fr; +} \ No newline at end of file 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 2bea610b8..286c670b5 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 @@ -27,8 +27,14 @@ export class StructureDetailsComponent implements OnInit { public baseSkillssReferentiel: Category; public accessRightsReferentiel: Category; + public digitalCultureSecuritysReferentiel: Category; + public socialAndProfessionalsReferentiel: Category; + public parentingHelpsReferentiel: Category; public baseSkills: Module[]; public accessRights: Module[]; + public parentingHelp: Module[]; + public socialAndProfessional: Module[]; + public digitalCultureSecurity: Module[]; public tclStopPoints: TclStopPoint[] = []; public printMode = false; public isClaimed: boolean = null; @@ -70,6 +76,12 @@ export class StructureDetailsComponent implements OnInit { this.baseSkillssReferentiel = referentiel; } else if (referentiel.isRigthtsAccess()) { this.accessRightsReferentiel = referentiel; + } else if (referentiel.isDigitalCultureSecurity()) { + this.digitalCultureSecuritysReferentiel = referentiel; + } else if (referentiel.isParentingHelp()) { + this.parentingHelpsReferentiel = referentiel; + } else if (referentiel.isSocialAndProfessional()) { + this.socialAndProfessionalsReferentiel = referentiel; } }); this.setServiceCategories(); @@ -223,6 +235,15 @@ export class StructureDetailsComponent implements OnInit { this.accessRights = this.structure.accessRight.map((rights) => _.find(this.accessRightsReferentiel.modules, { id: rights }) ); + this.parentingHelp = this.structure.parentingHelp.map((help) => + _.find(this.parentingHelpsReferentiel.modules, { id: help }) + ); + this.socialAndProfessional = this.structure.socialAndProfessional.map((skill) => + _.find(this.socialAndProfessionalsReferentiel.modules, { id: skill }) + ); + this.digitalCultureSecurity = this.structure.digitalCultureSecurity.map((skill) => + _.find(this.digitalCultureSecuritysReferentiel.modules, { id: skill }) + ); } public keepOriginalOrder = (a, b) => a.key; @@ -233,6 +254,15 @@ export class StructureDetailsComponent implements OnInit { public isAccessRights(): boolean { return this.accessRights && this.accessRights[0] !== undefined; } + public isParentingHelp(): boolean { + return this.parentingHelp && this.parentingHelp[0] !== undefined; + } + public isSocialAndProfessional(): boolean { + return this.socialAndProfessional && this.socialAndProfessional[0] !== undefined; + } + public isDigitalSecurity(): boolean { + return this.digitalCultureSecurity && this.digitalCultureSecurity[0] !== undefined; + } public getTclStopPoints(): void { this.tclService.getTclStopPointBycoord(this.structure.getLon(), this.structure.getLat()).subscribe((res) => { diff --git a/src/app/structure-list/models/category.model.ts b/src/app/structure-list/models/category.model.ts index e08e40a15..2aa78bbf3 100644 --- a/src/app/structure-list/models/category.model.ts +++ b/src/app/structure-list/models/category.model.ts @@ -21,4 +21,16 @@ export class Category { public isRigthtsAccess(): boolean { return this.name === 'Accès aux droits'; } + + public isParentingHelp(): boolean { + return this.name === 'Aide à la parentalité'; + } + + public isDigitalCultureSecurity(): boolean { + return this.name === 'Culture et sécurité numérique'; + } + + public isSocialAndProfessional(): boolean { + return this.name === 'Insertion sociale et professionnelle'; + } } -- GitLab