diff --git a/src/app/form/orientation-form-view/global-components/needs-selection/needs-selection.component.ts b/src/app/form/orientation-form-view/global-components/needs-selection/needs-selection.component.ts index f69e882d5a2b9f0bb01c3f702cf691383d81d2d7..544db2f1b3950f12a9315640e2211a24476d4412 100644 --- a/src/app/form/orientation-form-view/global-components/needs-selection/needs-selection.component.ts +++ b/src/app/form/orientation-form-view/global-components/needs-selection/needs-selection.component.ts @@ -30,7 +30,7 @@ export class NeedsSelectionComponent implements OnInit { }, { title: 'Réaliser une démarche en ligne', - hint: '(Démarche Caf, CPAM, Pôle emploi…)', + hint: '(Démarche Caf, CPAM, France Travail…)', key: NeedsType.onlineDemarch, icon: 'orientationIndex2', }, diff --git a/src/app/models/personalOffer.model.ts b/src/app/models/personalOffer.model.ts index 0cb13b9c93cb9a32ee2feb82fbc665122da11ab9..463fe0832b8f7e5fef7063e40fb59a4aa1f959d5 100644 --- a/src/app/models/personalOffer.model.ts +++ b/src/app/models/personalOffer.model.ts @@ -1,7 +1,9 @@ +import { Module } from '../structure-list/models/module.model'; + export class PersonalOffer { public _id: string = null; public categories: Record<string, string[]>; - public categoriesDisplay?: Record<string, string[]>; + public categoriesDisplay?: Record<string, Module[]>; constructor(obj?: any) { Object.assign(this, obj, { diff --git a/src/app/models/structure.model.ts b/src/app/models/structure.model.ts index 435d925f9609280766421f7c7900a79755712b2a..0f7f135e33a03d3400fa30359098109a96d8c5cf 100644 --- a/src/app/models/structure.model.ts +++ b/src/app/models/structure.model.ts @@ -1,6 +1,7 @@ import { StructureCategoryEnum } from '../shared/enum/structureCategory.enum'; import { StructureCategoryIconEnum } from '../shared/enum/structureCategoryIcon.enum'; import { Weekday } from '../structure-list/enum/weekday.enum'; +import { Module } from '../structure-list/models/module.model'; import { FreeWorkshop } from '../structure/enums/freeWorkshop.enum'; import { Address } from './address.model'; import { OpeningDay } from './openingDay.model'; @@ -35,7 +36,7 @@ export class Structure { public contactPersonLastName: string = null; public contactPersonEmail: string = null; public categories: Record<string, string[]>; - public categoriesDisplay: Record<string, string[]>; + public categoriesDisplay: Record<string, Module[]>; public remoteAccompaniment: boolean = null; public nbComputers: number = null; public nbPrinters: number = null; diff --git a/src/app/profile/profile-structure/personal-offer/personal-offer.component.html b/src/app/profile/profile-structure/personal-offer/personal-offer.component.html index 43f7c529c8aeb4b267694e0084dfe53b8e65c27b..4bb0938ceee03218bb1980dfb8578039b36a9559 100644 --- a/src/app/profile/profile-structure/personal-offer/personal-offer.component.html +++ b/src/app/profile/profile-structure/personal-offer/personal-offer.component.html @@ -30,7 +30,7 @@ <app-collapse-content> <ul> <li *ngFor="let onlineProcedure of this.personalOffer.categoriesDisplay.onlineProcedures"> - {{ onlineProcedure }} + {{ onlineProcedure.name }} </li> </ul> </app-collapse-content> @@ -44,7 +44,7 @@ </app-collapse-header> <app-collapse-content> <ul> - <li *ngFor="let baseSkill of this.personalOffer.categoriesDisplay.baseSkills">{{ baseSkill }}</li> + <li *ngFor="let baseSkill of this.personalOffer.categoriesDisplay.baseSkills">{{ baseSkill.name }}</li> </ul> </app-collapse-content> </app-collapse> @@ -58,7 +58,7 @@ <app-collapse-content> <ul> <li *ngFor="let advancedSkill of this.personalOffer.categoriesDisplay.advancedSkills"> - {{ advancedSkill }} + {{ advancedSkill.name }} </li> </ul> </app-collapse-content> diff --git a/src/app/profile/structure-edition-summary/structure-edition-summary.component.html b/src/app/profile/structure-edition-summary/structure-edition-summary.component.html index 8b77f7e6864d27d2827f864e47719b19ad6ab60f..4cc10cfa94c424637654f9a395c853b6239b12cc 100644 --- a/src/app/profile/structure-edition-summary/structure-edition-summary.component.html +++ b/src/app/profile/structure-edition-summary/structure-edition-summary.component.html @@ -289,7 +289,7 @@ <div *ngIf="containsDigitalHelp()" class="list"> <app-tag-item *ngFor="let digitalHelp of structure.categoriesDisplay.onlineProcedures" - [label]="digitalHelp" + [label]="digitalHelp.name" [color]="'red'" [size]="'small'" /> @@ -362,7 +362,7 @@ <hr /> <ul> <li *ngFor="let skill of structure.categoriesDisplay.baseSkills"> - {{ skill }} + {{ skill.name }} </li> </ul> </app-collapse-content> @@ -378,7 +378,7 @@ <hr /> <ul> <li *ngFor="let skill of structure.categoriesDisplay.advancedSkills"> - {{ skill }} + {{ skill.name }} </li> </ul> </app-collapse-content> @@ -505,7 +505,7 @@ <div class="list"> <app-tag-item *ngFor="let material of structure.categoriesDisplay.solidarityMaterial" - [label]="material" + [label]="material.name" [color]="'red'" [size]="'small'" /> @@ -536,7 +536,7 @@ <div *ngIf="isFieldValid('accessModality', 'categories')" class="list"> <app-tag-item *ngFor="let accessModality of structure.categoriesDisplay.accessModality" - [label]="accessModality" + [label]="accessModality.name" [color]="'red'" [size]="'small'" /> @@ -569,7 +569,7 @@ <div *ngIf="isFieldValid('age', 'categories') && structure.categoriesDisplay.age" class="list"> <app-tag-item *ngFor="let public of structure.categoriesDisplay.age" - [label]="public" + [label]="public.name" [color]="'red'" [size]="'small'" /> @@ -606,7 +606,7 @@ <div *ngIf="structure.categoriesDisplay.languageAndIlliteracy.length" class="list"> <app-tag-item *ngFor="let public of structure.categoriesDisplay.languageAndIlliteracy" - [label]="public" + [label]="public.name" [color]="'red'" [size]="'small'" /> @@ -618,7 +618,7 @@ <div *ngIf="structure.categoriesDisplay.handicaps.length" class="list"> <app-tag-item *ngFor="let public of structure.categoriesDisplay.handicaps" - [label]="public" + [label]="public.name" [color]="'red'" [size]="'small'" /> @@ -630,7 +630,7 @@ <div *ngIf="structure.categoriesDisplay.genre.length" class="list"> <app-tag-item *ngFor="let public of structure.categoriesDisplay.genre" - [label]="public" + [label]="public.name" [color]="'red'" [size]="'small'" /> @@ -722,9 +722,12 @@ /> </div> <div class="content"> - <app-no-information *ngIf="structure.categories.labelsQualifications.length === 0" /> + <app-no-information *ngIf="structure.categoriesDisplay.labelsQualifications.length === 0" /> <div class="labelsContainer"> - <app-logo-card *ngFor="let label of structure.categories.labelsQualifications.sort()" [name]="label" /> + <app-logo-card + *ngFor="let label of structure.categoriesDisplay.labelsQualifications.sort()" + [module]="label" + /> </div> </div> </section> diff --git a/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts b/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts index dcf3e589b9db689b70a0ea9a19c7c3b9eeec9b57..9a9b89aaf63d434934b95e209ea133a406250862 100644 --- a/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts +++ b/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts @@ -10,7 +10,6 @@ import { Structure } from '../../models/structure.model'; import { NotificationService } from '../../services/notification.service'; import { StructureService } from '../../services/structure.service'; import { CategoryEnum } from '../../shared/enum/category.enum'; -import { Demarches } from '../../shared/enum/demarches.enum'; import { AccessModality } from '../../structure-list/enum/access-modality.enum'; import { Equipment } from '../../structure-list/enum/equipment.enum'; import { Category } from '../../structure-list/models/category.model'; @@ -156,10 +155,6 @@ export class StructureEditionSummaryComponent implements OnInit { return this.structure.categoriesDisplay.onlineProcedures?.length > 0; } - public getDigitalHelpLabel(digitalHelp: Demarches): string { - return this.utils.getDigitalHelpLabel(digitalHelp); - } - public isBaseSkills(): boolean { return this.structure.categories.baseSkills?.length > 0; } diff --git a/src/app/shared/components/logo-card/logo-card.component.html b/src/app/shared/components/logo-card/logo-card.component.html index a8b43209e76f0b647abaf1dd82b811698c508c3c..cf2170a0c50d5d42d49a6708bb7d3613e94496cf 100644 --- a/src/app/shared/components/logo-card/logo-card.component.html +++ b/src/app/shared/components/logo-card/logo-card.component.html @@ -1,4 +1,4 @@ -<div *ngIf="name"> - <img class="icon-40" [src]="getPath(name)" [alt]="" /> - <p>{{ getName(name) }}</p> +<div *ngIf="module"> + <img class="icon-40" [src]="getPath()" [alt]="" /> + <p>{{ module.name }}</p> </div> diff --git a/src/app/shared/components/logo-card/logo-card.component.ts b/src/app/shared/components/logo-card/logo-card.component.ts index a9f4bd2c9fad0197d1baa5b505307e51ea702422..e51156c3f83a27ec3f1e7e9295f9d71a79b37607 100644 --- a/src/app/shared/components/logo-card/logo-card.component.ts +++ b/src/app/shared/components/logo-card/logo-card.component.ts @@ -1,6 +1,5 @@ import { Component, Input } from '@angular/core'; -import { Demarches } from '../../enum/demarches.enum'; -import { Labels } from '../../enum/labels.emum'; +import { Module } from '../../../structure-list/models/module.model'; @Component({ selector: 'app-logo-card', @@ -8,18 +7,9 @@ import { Labels } from '../../enum/labels.emum'; styleUrls: ['./logo-card.component.scss'], }) export class LogoCardComponent { - @Input() public name: string; + @Input() public module: Module; - public getName(key: string): string { - if (Labels[key]) { - return Labels[key]; - } else { - return key; - } - } - - public getPath(value: string): string { - const path = Object.entries(Demarches).find(([, val]) => val === value)?.[0]; - return `assets/logos/${path || this.name}.svg`; + public getPath(): string { + return `assets/logos/${this.module.id}.svg`; } } diff --git a/src/app/shared/enum/demarches.enum.ts b/src/app/shared/enum/demarches.enum.ts deleted file mode 100644 index eea5e4880170dce74f3848a49e02d2e6ae289946..0000000000000000000000000000000000000000 --- a/src/app/shared/enum/demarches.enum.ts +++ /dev/null @@ -1,16 +0,0 @@ -export enum Demarches { - caf = 'CAF', - idDoc = 'Carte d’identité, passeport', - needs = 'Énergie, téléphonie, internet', - foreigners = 'Démarches liées aux étrangers', - franceConnect = 'France Connect', - training = 'Formation (CPF...)', - taxes = 'Impôts', - housing = 'Logement', - retirement = 'Retraite', - health = 'Santé (Ameli, CPAM...)', - scolarity = 'Scolarité (CROUS…)', - transport = 'Transports (carte grise, permis, TCL…)', - work = 'Travail (Pôle emploi, CESU…)', - autres = 'Autres', -} diff --git a/src/app/shared/enum/demarchesLogo.enum.ts b/src/app/shared/enum/demarchesLogo.enum.ts deleted file mode 100644 index d9f55e20d0135a6853af54cca3678bf4f26b42e4..0000000000000000000000000000000000000000 --- a/src/app/shared/enum/demarchesLogo.enum.ts +++ /dev/null @@ -1,16 +0,0 @@ -export enum DemarchesLogo { - caf = 'caf', - idDoc = 'Carte d’identité, passeport', - needs = 'Énergie, téléphonie, internet', - foreigners = 'Démarches liées aux étrangers', - franceConnect = 'France Connect', - training = 'Formation (CPF...)', - taxes = 'Impôts', - housing = 'Logement', - retirement = 'Retraite', - health = 'Santé (Ameli...)', - scolarity = 'Scolarité (CROUS…)', - transport = 'Transports (carte grise, permis, TCL…)', - work = 'Travail (Pôle emploi, CESU…)', - autres = 'Autres', -} diff --git a/src/app/shared/enum/labels.emum.ts b/src/app/shared/enum/labels.emum.ts deleted file mode 100644 index 8e4c20f9573d8edbf9045ea012ea5933337c212b..0000000000000000000000000000000000000000 --- a/src/app/shared/enum/labels.emum.ts +++ /dev/null @@ -1,12 +0,0 @@ -export enum Labels { - passNumerique = 'Pass numérique', - espacePublicNumeriqueepn = 'Espace public numérique', - maisonFranceService = 'Maison france service', - aidantsConnect = 'Aidants connect', - fabriqueDeTerritoire = 'Fabrique de territoire', - demarcheMetropolitaine = 'Démarches Métropolitaines', - conseillerNumFranceServices = 'Conseiller numérique', - monEspaceSante = 'Mon espace santé', - numRelay = 'Les relais numériques', - mesPapiers = 'Mes papiers', -} 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 c58d595a40a62418a76584a2f64634668b5e77ce..6f0773b9bf2303348f58f259a37ee9d48054bce2 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 @@ -185,7 +185,7 @@ <div class="inline"> <app-tag-item *ngFor="let access of structure.categoriesDisplay.accessModality" - [label]="access" + [label]="access.name" [color]="'red'" [size]="'small'" [clickable]="false" @@ -204,7 +204,7 @@ <div class="inline"> <app-tag-item *ngFor="let label of structure.categoriesDisplay.age.sort()" - [label]="label" + [label]="label.name" [color]="'red'" [size]="'small'" [clickable]="false" @@ -221,7 +221,7 @@ <div class="inline"> <app-tag-item *ngFor="let label of structure.categoriesDisplay.languageAndIlliteracy.sort()" - [label]="label" + [label]="label.name" [color]="'red'" [size]="'small'" [clickable]="false" @@ -234,7 +234,7 @@ <div class="inline"> <app-tag-item *ngFor="let label of structure.categoriesDisplay.handicaps.sort()" - [label]="label" + [label]="label.name" [color]="'red'" [size]="'small'" [clickable]="false" @@ -247,7 +247,7 @@ <div class="inline"> <app-tag-item *ngFor="let label of structure.categoriesDisplay.genre.sort()" - [label]="label" + [label]="label.name" [color]="'red'" [size]="'small'" [clickable]="false" @@ -257,10 +257,10 @@ </section> <!-- Labellisation --> - <section *ngIf="structure.categories.labelsQualifications.length" class="labels"> + <section *ngIf="structure.categoriesDisplay.labelsQualifications.length" class="labels"> <h2>Labellisations</h2> <div class="wrapper"> - <app-logo-card *ngFor="let label of structure.categories.labelsQualifications.sort()" [name]="label" /> + <app-logo-card *ngFor="let label of structure.categoriesDisplay.labelsQualifications.sort()" [module]="label" /> </div> </section> @@ -296,7 +296,7 @@ <div class="wrapper"> <app-logo-card *ngFor="let accompagnement of structure.categoriesDisplay.onlineProcedures.sort()" - [name]="accompagnement" + [module]="accompagnement" /> </div> <div *ngIf="structure.otherDescription" class="otherDescription"> @@ -314,7 +314,7 @@ <div *ngIf="hasBaseSkills()" class="skillsContainer"> <h3 class="titleSkills">Compétences numériques de base</h3> <ul> - <li *ngFor="let skill of structure.categoriesDisplay.baseSkills" class="details">{{ skill }}</li> + <li *ngFor="let skill of structure.categoriesDisplay.baseSkills" class="details">{{ skill.name }}</li> </ul> </div> @@ -323,7 +323,7 @@ <h3 class="titleSkills">Approfondir sa culture numérique</h3> <ul> <li *ngFor="let skill of structure.categoriesDisplay.advancedSkills" class="details"> - {{ skill }} + {{ skill.name }} </li> </ul> </div> @@ -369,7 +369,7 @@ <div class="inline"> <app-tag-item *ngFor="let equipment of structure.categoriesDisplay.solidarityMaterial" - [label]="equipment" + [label]="equipment.name" [color]="'red'" [size]="'small'" [clickable]="false" diff --git a/src/app/utils/utils.ts b/src/app/utils/utils.ts index 1ee5d70610b5946eb33317be2b60801721dd6635..35ff3314fe1233f7226956b65c3225a16f5b4225 100644 --- a/src/app/utils/utils.ts +++ b/src/app/utils/utils.ts @@ -3,7 +3,6 @@ import { UntypedFormGroup } from '@angular/forms'; import { Owner } from '../models/owner.model'; import { Structure } from '../models/structure.model'; import { User } from '../models/user.model'; -import { Demarches } from '../shared/enum/demarches.enum'; import { OtherServices } from '../shared/enum/otherServices.enum'; import { AccessModality } from '../structure-list/enum/access-modality.enum'; import { Equipment } from '../structure-list/enum/equipment.enum'; @@ -79,10 +78,6 @@ export class Utils { return structure.website !== null && structure.website !== ''; } - public getDigitalHelpLabel(digitalHelp: Demarches): string { - return Demarches[digitalHelp]; - } - public hasWifi(selfServiceMaterial: string[]): boolean { return selfServiceMaterial.includes('wifiEnAccesLibre'); } @@ -140,7 +135,7 @@ export class Utils { const moduleNames = category.modules .map((module) => { if (structureModuleIds.includes(module.id)) { - return module.name; + return module; } }) .filter((value) => value !== undefined);