diff --git a/src/app/admin/components/manage-jobs/attached-users/attached-users.component.ts b/src/app/admin/components/manage-jobs/attached-users/attached-users.component.ts index 8b3e0d5128b2631fdb84c6f14db9afd404127e3d..c5c516db42fd8a5acc66eafb741d1c039d83a4d9 100644 --- a/src/app/admin/components/manage-jobs/attached-users/attached-users.component.ts +++ b/src/app/admin/components/manage-jobs/attached-users/attached-users.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { AdminPannelEnum } from '../../../../shared/enum/adminPanel.enum'; +import { AdminPanelEnum } from '../../../../shared/enum/adminPanel.enum'; import { PanelRouteService } from '../../../services/panel-route.service'; @Component({ @@ -14,7 +14,7 @@ export class AttachedUsersComponent { constructor(private panelRouteService: PanelRouteService) {} public redirectTo() { - this.panelRouteService.redirectTo(AdminPannelEnum.manageUsers); + this.panelRouteService.redirectTo(AdminPanelEnum.manageUsers); } public agInit(params: any): void { diff --git a/src/app/admin/components/panel/panel.component.ts b/src/app/admin/components/panel/panel.component.ts index 67e40039f96a7a73d6b41ff2b1d95a6ae10fcba9..9f0ce725b8ee376c2624142fb2b60295d64925fc 100644 --- a/src/app/admin/components/panel/panel.component.ts +++ b/src/app/admin/components/panel/panel.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { environment } from '../../../../environments/environment'; import { ButtonType } from '../../../shared/components/button/buttonType.enum'; -import { AdminPannelEnum } from '../../../shared/enum/adminPanel.enum'; +import { AdminPanelEnum } from '../../../shared/enum/adminPanel.enum'; import { PanelRouteService } from '../../services/panel-route.service'; @Component({ @@ -10,13 +10,13 @@ import { PanelRouteService } from '../../services/panel-route.service'; providers: [PanelRouteService], }) export class PanelComponent implements OnInit { - public features = AdminPannelEnum; + public features = AdminPanelEnum; public ghostLink = environment.ghostAdmin; public selectedFeature; public buttonTypeEnum = ButtonType; constructor(private panelRouteService: PanelRouteService) { - this.panelRouteService.destinationChanged$.subscribe((selected: AdminPannelEnum) => { + this.panelRouteService.destinationChanged$.subscribe((selected: AdminPanelEnum) => { this.selectedFeature = selected; }); } @@ -25,7 +25,7 @@ export class PanelComponent implements OnInit { this.selectedFeature = this.features.pendingStructures; } - public changeActiveFeature(newFeature: AdminPannelEnum): void { + public changeActiveFeature(newFeature: AdminPanelEnum): void { this.selectedFeature = newFeature; } } diff --git a/src/app/admin/services/panel-route.service.ts b/src/app/admin/services/panel-route.service.ts index 23f6944ec4a67ba4b0d05ce4a44a34f8d4ee2f0c..111a50102938f038b3af8bf6a97a4517923d34f7 100644 --- a/src/app/admin/services/panel-route.service.ts +++ b/src/app/admin/services/panel-route.service.ts @@ -1,14 +1,14 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; -import { AdminPannelEnum } from '../../shared/enum/adminPanel.enum'; +import { AdminPanelEnum } from '../../shared/enum/adminPanel.enum'; @Injectable() export class PanelRouteService { - private destination = new Subject<AdminPannelEnum>(); + private destination = new Subject<AdminPanelEnum>(); destinationChanged$ = this.destination.asObservable(); - redirectTo(dest: AdminPannelEnum) { + redirectTo(dest: AdminPanelEnum) { this.destination.next(dest); } } diff --git a/src/app/annuaire/result-list/result-list.component.html b/src/app/annuaire/result-list/result-list.component.html index 2e61398f1681872b34806a3cfe94f1dae6b11d4b..f65e605287b7bdaa8be7e10227aff878a0dff2e8 100644 --- a/src/app/annuaire/result-list/result-list.component.html +++ b/src/app/annuaire/result-list/result-list.component.html @@ -40,7 +40,7 @@ ></app-button> </div> -<div class="results unlogged" *ngIf="!isLogged"> +<div class="results unlogged" *ngIf="!isLogged && totalUserResult"> <img src="../../assets/ico/annuaire-unlogged.svg" alt="Illustration annuaire" /> <div class="users" [ngPlural]="totalUserResult"> <ng-template ngPluralCase="0">Aucun utilisateur n'est présent dans l'annuaire Rés'in</ng-template> diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index fd1620f13f72e9bf2bdd11af42fb7943e52e89d1..e430e5e6f98eb7b7e645c1bdccd627340847c5e1 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -250,6 +250,7 @@ const routes: Routes = [ canActivate: [AdminGuard], loadChildren: () => import('./admin/admin.module').then((m) => m.AdminModule), }, + footerOutletRoute, ], }, { diff --git a/src/app/form/form-view/account-form/account-info/account-info.component.html b/src/app/form/form-view/account-form/account-info/account-info.component.html index d9a40b8a712be3a3da30c91820e3562e7ec47f7f..d22955e49737936c6ff03c61925a4a5c12bfdbb0 100644 --- a/src/app/form/form-view/account-form/account-info/account-info.component.html +++ b/src/app/form/form-view/account-form/account-info/account-info.component.html @@ -1,7 +1,6 @@ <form [formGroup]="accountForm" *ngIf="accountForm && !profile"> <div class="title"> <h3>Qui êtes-vous ?</h3> - <p>Vous pourrez choisir de rendre visibles ces informations sur votre profil public</p> </div> <div class="form-group" fxLayout="column"> <label for="name">Prénom</label> diff --git a/src/app/form/form-view/form-view.component.scss b/src/app/form/form-view/form-view.component.scss index 119f921dffb84abdab9414cbfe87261766788c2d..60a6d2831de46132e8afbaf0dac0d96fe86b8ce3 100644 --- a/src/app/form/form-view/form-view.component.scss +++ b/src/app/form/form-view/form-view.component.scss @@ -92,11 +92,3 @@ font-style: italic; } } - -@media #{$tablet} { - .page { - height: calc( - 100vh - #{$header-height-phone} - #{$footer-height-phone} - 87px - 1px - ); // -1px because of header border - } -} diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index 4fd15c6f3f8c761d97eab3d980493e861a54e54c..b68828603c77ba9a0f93f915b856302b61198322 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -519,15 +519,27 @@ export class FormViewComponent implements OnInit, AfterViewInit { } } + private setExitPages(): number[] { + switch (this.currentFormType) { + case formType.structure: + return [ + structureFormStep.noStructure, + structureFormStep.structureCreationFinishedInfo, + structureFormStep.mailSentInfo, + structureFormStep.StructureInfoUnknown, + ]; + case formType.profile: + return [profileFormStep.profileJobSelection]; + case formType.personaloffer: + return [personalOfferFormStep.personalOfferFinishedInfo]; + default: + return []; + } + } + public canExit(): Promise<boolean> { // List all exit pages in order to authorise exit - const exitPages: stepType[] = [ - structureFormStep.noStructure, - structureFormStep.structureCreationFinishedInfo, - structureFormStep.mailSentInfo, - profileFormStep.profileJobSelection, - personalOfferFormStep.personalOfferFinishedInfo, - ]; + const exitPages: stepType[] = this.setExitPages(); // Avoid confirmation when user submit form and leave. if ( this.currentPage === this.nbSteps || diff --git a/src/app/form/form-view/global-components/information-step/information-step.component.html b/src/app/form/form-view/global-components/information-step/information-step.component.html index e2ebe4be5c1cd334c24e662f760e77fb3b97ddc3..e24e9cb9ebdfe4328d29d3f7168d8b3facf68b80 100644 --- a/src/app/form/form-view/global-components/information-step/information-step.component.html +++ b/src/app/form/form-view/global-components/information-step/information-step.component.html @@ -2,8 +2,8 @@ <div class="information-step-container no-max-width"> <img src="../../assets/form/emailVerification.svg" alt="Image de validation de finalisation de l'inscription" /> <p> - Un email vous a été envoyé<br /> - afin de finaliser votre inscription + Merci !<br /> + Finalisez votre inscription en ouvrant l’email qui vient de vous être envoyé </p> </div> </ng-container> diff --git a/src/app/form/form-view/global-components/information-step/information-step.component.scss b/src/app/form/form-view/global-components/information-step/information-step.component.scss index b52cb828072975cc4192f851741955fae9206990..249d23a3daa900ea9120cb6784362da30668573f 100644 --- a/src/app/form/form-view/global-components/information-step/information-step.component.scss +++ b/src/app/form/form-view/global-components/information-step/information-step.component.scss @@ -7,7 +7,6 @@ align-items: center; justify-content: center; min-height: inherit; - height: 450px; svg { width: 100%; max-width: 200px; diff --git a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.scss b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.scss index dcc16bb91178e582280ac18e0e15907aa30bac28..21ab5a5a4b527af957caf35b65d88cb9ec4442ea 100644 --- a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.scss +++ b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.scss @@ -23,6 +23,12 @@ width: 100%; height: 6px; border-radius: 7px; + + &[value] { + // fix color issue on safari + appearance: none; + } + &::-webkit-progress-bar { background-color: $grey-6; border-radius: 7px; diff --git a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.ts b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.ts index a7ad96e43d1f35ce52f783721d4891ac8801be45..7b2862691b2812a75c1e3e4f35670895bd9affc6 100644 --- a/src/app/form/form-view/global-components/progress-bar/progress-bar.component.ts +++ b/src/app/form/form-view/global-components/progress-bar/progress-bar.component.ts @@ -1,6 +1,5 @@ import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; import { formType } from '../../formType.enum'; -import { personalOfferFormStep } from '../../personal-offer-form/personalOfferFormStep.enum'; import { profileFormStep } from '../../profile-form/profileFormStep.enum'; import { structureFormStep } from '../../structure-form/structureFormStep.enum'; diff --git a/src/app/form/form-view/personal-offer-form/personal-offer-accompaniment/personal-offer-accompaniment.component.html b/src/app/form/form-view/personal-offer-form/personal-offer-accompaniment/personal-offer-accompaniment.component.html index 74bf05feca3c89ccaba0672235e045616f6eb23e..2cbad5fcdd29f1c990129c14e39214639d563ee7 100644 --- a/src/app/form/form-view/personal-offer-form/personal-offer-accompaniment/personal-offer-accompaniment.component.html +++ b/src/app/form/form-view/personal-offer-form/personal-offer-accompaniment/personal-offer-accompaniment.component.html @@ -1,7 +1,7 @@ <form [formGroup]="personalOfferForm" *ngIf="personalOfferForm"> <div class="title"> <p class="overtitle">{{ structureName }}</p> - <h3>Quelles aides au numérique proposez-vous ?</h3> + <h3>Quelles aides aux démarches en ligne proposez-vous, en tant qu’intervenant dans cette structure ?</h3> <p>Facultatif</p> </div> diff --git a/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.html b/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.html index 48295eb96c57d48c48154f7e4b8a8909e5e927da..fb1af6343f13fb4415a08a69630648dddd21826a 100644 --- a/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.html +++ b/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.html @@ -1,7 +1,7 @@ <form [formGroup]="personalOfferForm" *ngIf="personalOfferForm"> <div class="title"> <p class="overtitle">{{ structureName }}</p> - <h3>Quels accompagnements au numérique proposez-vous ?</h3> + <h3>Quels accompagnements au numérique proposez-vous, en tant qu’intervenant dans cette structure ?</h3> <p>Facultatif</p> </div> <app-training-type-picker diff --git a/src/app/form/form-view/profile-form/profile-employer-selection/profile-employer-selection.component.html b/src/app/form/form-view/profile-form/profile-employer-selection/profile-employer-selection.component.html index 0e5cb2e324f3384f614d167717a9ee90a973975c..9e42d84a9ec5992bb48383276f3fccc27d48d329 100644 --- a/src/app/form/form-view/profile-form/profile-employer-selection/profile-employer-selection.component.html +++ b/src/app/form/form-view/profile-form/profile-employer-selection/profile-employer-selection.component.html @@ -1,6 +1,6 @@ <form [formGroup]="profileForm"> <div class="title"> - <h3>Qui vous emploie ?</h3> + <h3>Quel est votre employeur ?</h3> <p>L’employeur demandé est celui qui figure sur votre fiche de paie (ou fiche de poste)</p> </div> <div class="search-structure"> diff --git a/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.scss b/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.scss index 77a2378d53c240c4719d5ff6562eaa9ea3257c7e..6d50a12d15891d357bff4036b80e9875391d4ce9 100644 --- a/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.scss +++ b/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.scss @@ -5,6 +5,7 @@ .search-structure { width: 380px; + padding-bottom: 1.5rem; } h2 { diff --git a/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.ts b/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.ts index bf3ca1dafee6ff33447b68a36d187266d5573685..673af8d5664d83b20b284534ec44c610f4ae1c92 100644 --- a/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.ts +++ b/src/app/form/form-view/profile-form/profile-structure-choice/profile-structure-choice.component.ts @@ -35,6 +35,7 @@ export class ProfileStructureChoiceComponent implements OnInit { this.profilePendingStructureLink = [...profile.pendingStructuresLink]; this.getStructures(null); }); + this.validateForm.emit(); } public onSearchChange(searchString: string): void { diff --git a/src/app/form/form-view/structure-form/structure-digital-helping-accompaniment/structure-digital-helping-accompaniment.component.html b/src/app/form/form-view/structure-form/structure-digital-helping-accompaniment/structure-digital-helping-accompaniment.component.html index e9c68c498edb821940919430c06819b8f327622e..8cb1a8d5c192428d0d7a708edc5c09d458b34fcb 100644 --- a/src/app/form/form-view/structure-form/structure-digital-helping-accompaniment/structure-digital-helping-accompaniment.component.html +++ b/src/app/form/form-view/structure-form/structure-digital-helping-accompaniment/structure-digital-helping-accompaniment.component.html @@ -12,7 +12,7 @@ [icon]="'arrowBack'" ></app-svg-icon> <div class="titleContent"> - <h3>Quelles démarches en ligne propose la structure ?</h3> + <h3>Quelles aides aux démarches en ligne votre structure propose-t-elle ?</h3> <p>Facultatif</p> </div> </div> diff --git a/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.ts b/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.ts index 8c803479ec28df676bf25d4824533f0326b400f2..9949356f9e9905de0bb316223259921b098f47ef 100644 --- a/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.ts +++ b/src/app/form/form-view/structure-form/structure-equipments/structure-equipments.component.ts @@ -46,7 +46,7 @@ export class StructureEquipmentsComponent implements OnInit { */ public formatEquipment(equipment: string): string { if (this.vowels.includes(equipment.toLocaleLowerCase()[0])) return `d'${equipment.toLocaleLowerCase()}`; - return `de ${equipment.toLocaleLowerCase()}`; + return `de ${equipment.toLocaleLowerCase()}(s)`; } public goBack(): void { history.back(); diff --git a/src/app/form/form-view/structure-form/structure-form.component.html b/src/app/form/form-view/structure-form/structure-form.component.html index 6fbba87db95c38950e0257788821c7381c2710df..847438c3cff24ec166b9559289e662e6148a833c 100644 --- a/src/app/form/form-view/structure-form/structure-form.component.html +++ b/src/app/form/form-view/structure-form/structure-form.component.html @@ -162,6 +162,7 @@ [structureForm]="structureForm" (validateForm)="setValidationsForm($event)" (checkChange)="onCheckChange($event)" + (radioChange)="onRadioChange($event)" ></app-structure-wifi> </div> <div *ngIf="currentStep == structureFormStep.structureEquipments"> diff --git a/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html b/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html index beaaccd1434998e66e284c883758a04406dd8901..c3470aa9cdf1af57daf3fcb1f9cff42dd94d408c 100644 --- a/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html +++ b/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html @@ -12,7 +12,7 @@ {{ isMandatoryFields ? 'Quel public peut être accueilli dans cette structure ?' - : 'Quels publics spécifiques peuvent être accueillis dans cette structure ?' + : 'Proposez-vous des accompagnements adaptés à des publics spécifiques ? Lesquels ?' }} </h3> <p>{{ isMandatoryFields ? '' : 'Facultatif - ' }}Plusieurs choix possibles</p> diff --git a/src/app/form/form-view/structure-form/structure-training-type/structure-training-type.component.html b/src/app/form/form-view/structure-form/structure-training-type/structure-training-type.component.html index 0863dd5c03bf3712fc8dbb826a6636007fe0e0a5..1d4834e25f6517ff573790c49457d141781a329d 100644 --- a/src/app/form/form-view/structure-form/structure-training-type/structure-training-type.component.html +++ b/src/app/form/form-view/structure-form/structure-training-type/structure-training-type.component.html @@ -8,7 +8,7 @@ [icon]="'arrowBack'" ></app-svg-icon> <div class="titleContent"> - <h3>Quels accompagnements au numérique proposez-vous ?</h3> + <h3>Quels accompagnements au numérique votre structure propose-t-elle ?</h3> <p>Facultatif</p> </div> </div> diff --git a/src/app/form/form-view/structure-form/structure-web-and-social-network/structure-web-and-social-network.component.scss b/src/app/form/form-view/structure-form/structure-web-and-social-network/structure-web-and-social-network.component.scss index bf18ddaa745f037f59376251da07fad4d55416ad..0310b8aac6e5391bc6db7edf217250b1b62b5244 100644 --- a/src/app/form/form-view/structure-form/structure-web-and-social-network/structure-web-and-social-network.component.scss +++ b/src/app/form/form-view/structure-form/structure-web-and-social-network/structure-web-and-social-network.component.scss @@ -10,9 +10,6 @@ @media #{$small-phone} { width: 95% !important; } - @media #{$tablet} { - width: 296px; - } &.notCollapsed { margin-bottom: 8px; background: $grey-8; diff --git a/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.html b/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.html index 0cd01afb084a7309785e9925766e513bbdc38776..a7ebe790ffaf3c5bec9397f569c676cceffae4b7 100644 --- a/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.html +++ b/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.html @@ -8,11 +8,13 @@ [icon]="'arrowBack'" ></app-svg-icon> <div class="titleContent"> - <h3>Proposez-vous du wifi en accès libre ?</h3> + <h3>Votre structure propose-t-elle du wifi en accès libre ?</h3> </div> </div> <app-radio-form - [selectedOption]="isEditMode ? isInArray('selfServiceMaterial', 'wifiEnAccesLibre') : null" + [selectedOption]=" + isEditMode ? isInArray('selfServiceMaterial', 'wifiEnAccesLibre') : structureForm.get('freeWifi').value + " (selectedEvent)="onCheckChange($event, 'categories.selfServiceMaterial', 'wifiEnAccesLibre')" > </app-radio-form> diff --git a/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.ts b/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.ts index 7ecde8dc631400c96d38c6fa8aa8a638d636670d..088132a11e2d6d5019291bcb03eedc2b6fb1b860 100644 --- a/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.ts +++ b/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.ts @@ -11,6 +11,7 @@ export class StructureWifiComponent implements OnInit { @Input() isEditMode: boolean; @Output() validateForm = new EventEmitter<any>(); @Output() checkChange = new EventEmitter<any>(); + @Output() radioChange = new EventEmitter<any>(); public formUtils = new formUtils(); ngOnInit(): void { @@ -21,6 +22,11 @@ export class StructureWifiComponent implements OnInit { } public onCheckChange(event, catId: string, modId: string): void { this.checkChange.emit({ event, formControlName: catId, value: modId }); + this.onRadioChange('freeWifi', event); + } + + public onRadioChange(name: string, value: boolean): void { + this.radioChange.emit({ name, value }); } public goBack(): void { history.back(); diff --git a/src/app/form/orientation-form-view/base-skills/base-skills-choice/base-skills-choice.component.ts b/src/app/form/orientation-form-view/base-skills/base-skills-choice/base-skills-choice.component.ts index f95cef021bf9a5690fe9cfd1f411a0530cf0fa50..86b728d06459e1c034084625d82eb865b51d5698 100644 --- a/src/app/form/orientation-form-view/base-skills/base-skills-choice/base-skills-choice.component.ts +++ b/src/app/form/orientation-form-view/base-skills/base-skills-choice/base-skills-choice.component.ts @@ -1,15 +1,18 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; import { CategoryEnum } from '../../../../shared/enum/category.enum'; import { Category } from '../../../../structure-list/models/category.model'; import { Module } from '../../../../structure-list/models/module.model'; import { SearchService } from '../../../../structure-list/services/search.service'; import { SelectComponent } from '../../global-components/select/select.component'; +import { FiltersForm } from '../../interfaces/filtersForm.interface'; @Component({ selector: 'app-base-skills-choice', templateUrl: './base-skills-choice.component.html', }) export class BaseSkillsChoiceComponent extends SelectComponent implements OnInit { + @Input() form: FormGroup<FiltersForm>; public baseSkills: Module[] = []; constructor(private searchService: SearchService) { @@ -17,6 +20,7 @@ export class BaseSkillsChoiceComponent extends SelectComponent implements OnInit } ngOnInit(): void { + this.selectedModules = this.form.get('filters').value; this.searchService.getCategories().subscribe((categories: Category[]) => { this.baseSkills = categories.find((el) => el.id === CategoryEnum.baseSkills).modules; }); diff --git a/src/app/form/orientation-form-view/base-skills/base-skills.component.ts b/src/app/form/orientation-form-view/base-skills/base-skills.component.ts index 7f979e96080dd413cb6d32cd0ff46c67859a18a5..5f8cb744a89e086412fd9f5b924ccc6735000c55 100644 --- a/src/app/form/orientation-form-view/base-skills/base-skills.component.ts +++ b/src/app/form/orientation-form-view/base-skills/base-skills.component.ts @@ -38,7 +38,7 @@ export class BaseSkillsComponent { ); break; default: - throw new Error('Not implemented tunnel type in OnlineDemarchFormComponent'); + throw new Error('Not implemented tunnel type in BaseSkillsComponent'); } } } diff --git a/src/app/form/orientation-form-view/equipment-access/equipment-access-choice/equipment-access-choice.component.ts b/src/app/form/orientation-form-view/equipment-access/equipment-access-choice/equipment-access-choice.component.ts index 65f8eb26581ea744389052bf1b4f3d2435729c9a..ebd54d299906ba4373fce237c2a6af955ff2a6fc 100644 --- a/src/app/form/orientation-form-view/equipment-access/equipment-access-choice/equipment-access-choice.component.ts +++ b/src/app/form/orientation-form-view/equipment-access/equipment-access-choice/equipment-access-choice.component.ts @@ -1,16 +1,19 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; import { CategoryEnum } from '../../../../shared/enum/category.enum'; import { Category } from '../../../../structure-list/models/category.model'; import { Module } from '../../../../structure-list/models/module.model'; import { SearchService } from '../../../../structure-list/services/search.service'; import { SelectComponent } from '../../global-components/select/select.component'; +import { FiltersForm } from '../../interfaces/filtersForm.interface'; @Component({ selector: 'app-equipment-access-choice', templateUrl: './equipment-access-choice.component.html', }) export class EquipmentAccessChoiceComponent extends SelectComponent implements OnInit { + @Input() form: FormGroup<FiltersForm>; public equipmentType: Module[] = []; constructor(private searchService: SearchService) { @@ -18,6 +21,7 @@ export class EquipmentAccessChoiceComponent extends SelectComponent implements O } ngOnInit(): void { + this.selectedModules = this.form.get('filters').value; this.searchService.getCategories().subscribe((categories: Category[]) => { this.equipmentType = categories.find((el) => el.id === CategoryEnum.selfServiceMaterial).modules; }); diff --git a/src/app/form/orientation-form-view/equipment-access/equipment-access.component.html b/src/app/form/orientation-form-view/equipment-access/equipment-access.component.html index 686b87fc2b6df571e8767aa09d46ca0118223210..684e8543af552ffa0c5e167f82fbcc39ab193dd3 100644 --- a/src/app/form/orientation-form-view/equipment-access/equipment-access.component.html +++ b/src/app/form/orientation-form-view/equipment-access/equipment-access.component.html @@ -8,7 +8,7 @@ ></app-equipment-access-choice> <app-orientation-structure-list *ngIf="currentType === GenericOrientationSteps.structureList" - [form]="form" + [form]="orientationForm" [currentStep]="currentStep" [filters]="filters" [profile]="profile" diff --git a/src/app/form/orientation-form-view/equipment-access/equipment-access.component.ts b/src/app/form/orientation-form-view/equipment-access/equipment-access.component.ts index b6001e66c3da8cbd2917093a3425f73e9365716a..c45a83319add62e9c543339a21d9b21abb5112c2 100644 --- a/src/app/form/orientation-form-view/equipment-access/equipment-access.component.ts +++ b/src/app/form/orientation-form-view/equipment-access/equipment-access.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { FormGroup, UntypedFormGroup } from '@angular/forms'; +import { FormGroup } from '@angular/forms'; import { User } from '../../../models/user.model'; import { Filter } from '../../../structure-list/models/filter.model'; import { OrientationUtils } from '../../../utils/orientationUtils'; @@ -8,6 +8,7 @@ import { GenericOrientationSteps } from '../enums/genericOrientationSteps.enum'; import { RecapsType } from '../enums/recapsType.enum'; import { StructuresListSteps } from '../enums/structuresListSteps.enum'; import { FiltersForm } from '../interfaces/filtersForm.interface'; +import { StructureOrientationForm } from '../interfaces/structureOrientationForm.interface'; @Component({ selector: 'app-equipment-access', @@ -17,6 +18,7 @@ export class EquipmentAccessComponent { @Input() currentStep: FiltersSteps | StructuresListSteps; @Input() currentType: GenericOrientationSteps; @Input() form: FormGroup<FiltersForm>; + @Input() orientationForm: FormGroup<StructureOrientationForm>; @Input() filters: Filter[] = []; @Input() profile: User; @Output() validatePage = new EventEmitter<any>(); @@ -42,7 +44,7 @@ export class EquipmentAccessComponent { case GenericOrientationSteps.structureList: this.orientationUtils.setValidationsStructuresForm( this.pagesValidation, - this.form as UntypedFormGroup, + this.orientationForm, (isValid) => this.validatePage.emit(isValid), this.currentStep as StructuresListSteps ); diff --git a/src/app/form/orientation-form-view/equipment-buy/equipment-buy-type/equipment-buy-type.component.ts b/src/app/form/orientation-form-view/equipment-buy/equipment-buy-type/equipment-buy-type.component.ts index d3ab43eb26c5fe99df596ddbb0c775d8fd175999..c1a617264f5a2960309e484c7d1c94bfd6dd5f28 100644 --- a/src/app/form/orientation-form-view/equipment-buy/equipment-buy-type/equipment-buy-type.component.ts +++ b/src/app/form/orientation-form-view/equipment-buy/equipment-buy-type/equipment-buy-type.component.ts @@ -1,21 +1,25 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; import { CategoryEnum } from '../../../../shared/enum/category.enum'; import { Category } from '../../../../structure-list/models/category.model'; import { Module } from '../../../../structure-list/models/module.model'; import { SearchService } from '../../../../structure-list/services/search.service'; import { SelectComponent } from '../../global-components/select/select.component'; +import { FiltersForm } from '../../interfaces/filtersForm.interface'; @Component({ selector: 'app-equipment-buy-type', templateUrl: './equipment-buy-type.component.html', }) export class EquipmentBuyTypeComponent extends SelectComponent implements OnInit { + @Input() form: FormGroup<FiltersForm>; public equipmentType: Module[] = []; constructor(private searchService: SearchService) { super(); } ngOnInit(): void { + this.selectedModules = this.form.get('filters').value; this.searchService.getCategories().subscribe((categories: Category[]) => { this.equipmentType = categories.find((el) => el.id === CategoryEnum.solidarityMaterial).modules; }); diff --git a/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.html b/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.html index d3388c86f0f223ec92d2b0fe69fd3930e9379c5c..c59e5db73d682c00300ca1464a3b711efe0e0203 100644 --- a/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.html +++ b/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.html @@ -8,7 +8,7 @@ ></app-equipment-buy-type> <app-orientation-structure-list *ngIf="currentType === GenericOrientationSteps.structureList" - [form]="form" + [form]="orientationForm" [currentStep]="currentStep" [filters]="filters" [profile]="profile" diff --git a/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.ts b/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.ts index 8117db6604767b69dea7797145370d5ef04fe478..ee8388a47ec61ad8ed51a5d023e205daae31de7a 100644 --- a/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.ts +++ b/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { FormGroup, UntypedFormGroup } from '@angular/forms'; +import { FormGroup } from '@angular/forms'; import { User } from '../../../models/user.model'; import { Filter } from '../../../structure-list/models/filter.model'; import { OrientationUtils } from '../../../utils/orientationUtils'; @@ -8,6 +8,7 @@ import { GenericOrientationSteps } from '../enums/genericOrientationSteps.enum'; import { RecapsType } from '../enums/recapsType.enum'; import { StructuresListSteps } from '../enums/structuresListSteps.enum'; import { FiltersForm } from '../interfaces/filtersForm.interface'; +import { StructureOrientationForm } from '../interfaces/structureOrientationForm.interface'; @Component({ selector: 'app-equipment-buy', @@ -17,6 +18,7 @@ export class EquipmentBuyComponent { @Input() currentStep: FiltersSteps | StructuresListSteps; @Input() currentType: GenericOrientationSteps; @Input() form: FormGroup<FiltersForm>; + @Input() orientationForm: FormGroup<StructureOrientationForm>; @Input() filters: Filter[] = []; @Input() profile: User; @Output() validatePage = new EventEmitter<any>(); @@ -42,7 +44,7 @@ export class EquipmentBuyComponent { case GenericOrientationSteps.structureList: this.orientationUtils.setValidationsStructuresForm( this.pagesValidation, - this.form as UntypedFormGroup, + this.orientationForm, (isValid) => this.validatePage.emit(isValid), this.currentStep as StructuresListSteps ); diff --git a/src/app/form/orientation-form-view/global-components/mediation-recap/mediation-recap.component.html b/src/app/form/orientation-form-view/global-components/mediation-recap/mediation-recap.component.html index 8abe05c6a39705eee6b32ad94e4a3f24f8826510..7c4de0e0e743e8a8f77c1f5ff26f03cca83ba8f9 100644 --- a/src/app/form/orientation-form-view/global-components/mediation-recap/mediation-recap.component.html +++ b/src/app/form/orientation-form-view/global-components/mediation-recap/mediation-recap.component.html @@ -3,7 +3,7 @@ <div class="orientator header" *ngIf="isOrientator()"> <h3>Orienté par</h3> <div class="content"> - <div class="infos">{{ orientator.structureName }}</div> + <div class="infos structureName">{{ orientator.structureName }}</div> <div class="infos" *ngIf="orientator.structureMail">{{ orientator.structureMail }}</div> <div class="infos" *ngIf="orientator.structurePhone">{{ orientator.structurePhone }}</div> </div> diff --git a/src/app/form/orientation-form-view/global-components/mediation-recap/mediation-recap.component.scss b/src/app/form/orientation-form-view/global-components/mediation-recap/mediation-recap.component.scss index 6f8ad9fd2ccc725ee1f369215cf3d80c8647c317..d502aad04b21cde12baccc1d1aee382f1d185c88 100644 --- a/src/app/form/orientation-form-view/global-components/mediation-recap/mediation-recap.component.scss +++ b/src/app/form/orientation-form-view/global-components/mediation-recap/mediation-recap.component.scss @@ -43,6 +43,9 @@ .infos { @include lato-bold-14; margin-bottom: 1rem; + &.structureName { + @include lato-bold-18; + } } } } diff --git a/src/app/form/orientation-form-view/global-components/structure-orientator/structure-orientator.component.html b/src/app/form/orientation-form-view/global-components/structure-orientator/structure-orientator.component.html index abfd6a2d1b6b398c16ba3e30d44a60c0876c5beb..790553ab65e90e6fa52910710ad9062167c420a4 100644 --- a/src/app/form/orientation-form-view/global-components/structure-orientator/structure-orientator.component.html +++ b/src/app/form/orientation-form-view/global-components/structure-orientator/structure-orientator.component.html @@ -4,7 +4,8 @@ <div *ngFor="let structure of structuresLinked" (click)="select(structure)" - [class]="structure === selected ? 'item-selected structure-item' : 'structure-item'" + class="structure-item" + [ngClass]="{ 'item-selected': structure.structureName === selected?.structureName }" > <div class="item-frame"> <div class="name">{{ structure.structureName }}</div> @@ -12,7 +13,7 @@ </div> <app-svg-icon class="form-icon" - *ngIf="structure === selected" + *ngIf="structure.structureName === selected?.structureName" [iconClass]="'icon-26'" [type]="'form'" [icon]="'validate'" diff --git a/src/app/form/orientation-form-view/global-components/structure-orientator/structure-orientator.component.ts b/src/app/form/orientation-form-view/global-components/structure-orientator/structure-orientator.component.ts index 44e1a7cf071183cdd56b38615fe9ac9ee2769fae..04f0e01c69df14b69270a9da8256cbaf19e2d695 100644 --- a/src/app/form/orientation-form-view/global-components/structure-orientator/structure-orientator.component.ts +++ b/src/app/form/orientation-form-view/global-components/structure-orientator/structure-orientator.component.ts @@ -24,9 +24,12 @@ export class StructureOrientatorComponent implements OnInit { if (this.profile?.structuresLink?.length) { this.hasStructures = true; for (let structure of this.profile.structuresLink) { - this.structureService - .getStructure(structure) - .subscribe((_structure) => this.structuresLinked.push(new Structure(_structure))); + this.structureService.getStructure(structure).subscribe((_structure) => { + this.structuresLinked.push(new Structure(_structure)); + if (this.form.get('structureName')?.value === _structure.structureName) { + this.select(_structure); + } + }); } } else { this.hasStructures = false; diff --git a/src/app/form/orientation-form-view/online-demarch/online-demarch-common/online-demarch.component.html b/src/app/form/orientation-form-view/online-demarch/online-demarch-common/online-demarch.component.html index adc5a7c7488e6430d7a49e9b7ea63d3f68f70e4e..24072098262d7742ef98032fd28c148e7f5bb0c9 100644 --- a/src/app/form/orientation-form-view/online-demarch/online-demarch-common/online-demarch.component.html +++ b/src/app/form/orientation-form-view/online-demarch/online-demarch-common/online-demarch.component.html @@ -13,7 +13,7 @@ <app-modal-confirmation [openned]="showStrangersModal" [content]=" - 'Les premières demandes de titres de séjour doivent être redirigées vers les associations spécialisées sur les droits des étrangers.' + 'Les premières demandes de titres de séjour et les demandes de naturalisation doivent être redirigées vers les associations spécialisées sur les droits des étrangers.' " [customConfirmationText]="'Ok'" [singleButton]="true" diff --git a/src/app/form/orientation-form-view/online-demarch/online-mediation/mediation-hours-selection/mediation-hours-selection.component.scss b/src/app/form/orientation-form-view/online-demarch/online-mediation/mediation-hours-selection/mediation-hours-selection.component.scss index 0411e111c72355133c2da1b3bed71fcd66735dca..25425d7e9035b7aa7b9af915507e62a9be672235 100644 --- a/src/app/form/orientation-form-view/online-demarch/online-mediation/mediation-hours-selection/mediation-hours-selection.component.scss +++ b/src/app/form/orientation-form-view/online-demarch/online-mediation/mediation-hours-selection/mediation-hours-selection.component.scss @@ -40,6 +40,7 @@ border-radius: 4px; color: $grey-1; @include lato-regular-14; + margin: auto; background: $white; display: flex; flex-direction: column; diff --git a/src/app/form/orientation-form-view/online-demarch/online-mediation/mediation-hours-selection/mediation-hours-selection.component.ts b/src/app/form/orientation-form-view/online-demarch/online-mediation/mediation-hours-selection/mediation-hours-selection.component.ts index 0f9e648bb774edb0a38e7a53058634b66a43cdfd..272e064f7fc4560d7775d092198124b379784abd 100644 --- a/src/app/form/orientation-form-view/online-demarch/online-mediation/mediation-hours-selection/mediation-hours-selection.component.ts +++ b/src/app/form/orientation-form-view/online-demarch/online-mediation/mediation-hours-selection/mediation-hours-selection.component.ts @@ -11,14 +11,8 @@ export class MediationHoursSelectionComponent implements OnInit { @Input() form: UntypedFormGroup; @Output() checkValidation = new EventEmitter<any>(); public selected: string; - public timeSlots = [ - { day: 'Lundi', hours: '15h00 - 17h00' }, - { day: 'Mardi', hours: '15h00 - 17h00' }, - { day: 'Mercredi', hours: '15h00 - 17h00' }, - { day: 'Jeudi', hours: '15h00 - 19h00' }, - { day: 'Vendredi', hours: '15h00 - 17h00' }, - { day: 'Samedi', hours: '10h00 - 12h00' }, - ]; + public timeSlots = this.setDateSlot(); + ngOnInit(): void { this.checkValidation.emit(); if (this.form.get('dateSlot').value) { @@ -30,6 +24,27 @@ export class MediationHoursSelectionComponent implements OnInit { this.timeSlots = temp.concat(this.timeSlots); } } + + private setDateSlot(): any { + let date = new Date(); + let dateSlot = []; + for (let i = 0; i < 7; i++) { + date.setDate(date.getDate() + 1); + dateSlot[date.getDay()] = date.toLocaleDateString('fr-FR', { + month: 'numeric', + day: 'numeric', + }); + } + + return [ + { day: `Lundi ${dateSlot[1]}`, hours: '15h00 - 17h00' }, + { day: `Mardi ${dateSlot[2]}`, hours: '15h00 - 17h00' }, + { day: `Mercredi ${dateSlot[3]}`, hours: '15h00 - 17h00' }, + { day: `Jeudi ${dateSlot[4]}`, hours: '15h00 - 19h00' }, + { day: `Vendredi ${dateSlot[5]}`, hours: '15h00 - 17h00' }, + { day: `Samedi ${dateSlot[6]}`, hours: '10h00 - 12h00' }, + ]; + } public selectHour(slot: any): void { this.selected = slot.day; this.form.get('dateSlot').patchValue(slot); diff --git a/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html index 41cff0b868f406648f72e9262d9bdf4b42d5a2f9..74e6d5968a802b6467c5b017a6113badb2027681 100644 --- a/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html +++ b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html @@ -81,16 +81,6 @@ [currentType]="currentType" (checkValidation)="checkValidation()" ></app-information-screen> - <app-online-demarch - *ngIf="currentStep === HotlineMediationStepsEnum.onlineDemarch" - [form]="form" - (checkValidation)="checkValidation()" - ></app-online-demarch> - <app-accompaniment-type - *ngIf="currentStep === HotlineMediationStepsEnum.accompanimentType" - [form]="form" - (checkValidation)="checkValidation()" - ></app-accompaniment-type> <app-mediation-beneciary-info *ngIf="currentStep === HotlineMediationStepsEnum.mediationBeneciaryInfo" [form]="form" diff --git a/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.ts b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.ts index 6211a791e2c30dabde2ec7aba12ea2ebd2d45b4a..58efb5276cfb6455c19fd1df829565fce61db120 100644 --- a/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.ts +++ b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { User } from '../../../models/user.model'; import { Category } from '../../../structure-list/models/category.model'; @@ -25,7 +25,7 @@ export class OnlineDemarchFormComponent { @Input() categories: { [key: string]: Category | [] }; @Output() validatePage = new EventEmitter<any>(); @Output() setResetOrientation = new EventEmitter<any>(); - + public orientationUtils = new OrientationUtils(); public pagesValidation: any[] = []; @@ -113,7 +113,7 @@ export class OnlineDemarchFormComponent { this.form.get(name).setValue(value); this.checkValidation(); } - public showResetOrientation():void { - this.setResetOrientation.emit() + public showResetOrientation(): void { + this.setResetOrientation.emit(); } } diff --git a/src/app/form/orientation-form-view/orientation-form-view.component.html b/src/app/form/orientation-form-view/orientation-form-view.component.html index 1374af2099567832a9c57eb116d589eb71569f77..f10eff85ab9a2c0a024f13c7a007e4a207a68a3c 100644 --- a/src/app/form/orientation-form-view/orientation-form-view.component.html +++ b/src/app/form/orientation-form-view/orientation-form-view.component.html @@ -13,6 +13,7 @@ [currentStep]="currentStep" [currentType]="currentType" [form]="filtersForm" + [orientationForm]="structureOrientationForm" [filters]="filters" [profile]="profile" (validatePage)="validatePage($event)" @@ -22,6 +23,7 @@ [currentStep]="currentStep" [currentType]="currentType" [form]="filtersForm" + [orientationForm]="structureOrientationForm" [filters]="filters" [profile]="profile" (validatePage)="validatePage($event)" @@ -30,7 +32,7 @@ *ngIf="needType == needEnum.onlineDemarch" [currentStep]="currentStep" [currentType]="currentType" - [form]="onlineDemarchForm" + [form]="onlineDemarcheForm" [filters]="filters" [profile]="profile" [categories]="categories" diff --git a/src/app/form/orientation-form-view/orientation-form-view.component.ts b/src/app/form/orientation-form-view/orientation-form-view.component.ts index 53b0f9c90e94542d35d473e118b74a7a153170c5..58ea8067f0da450f93948dca37b02775f50868d8 100644 --- a/src/app/form/orientation-form-view/orientation-form-view.component.ts +++ b/src/app/form/orientation-form-view/orientation-form-view.component.ts @@ -34,32 +34,35 @@ import { MediationStepType } from './types/mediationStep.type'; styleUrls: ['./orientation-form-view.component.scss'], }) export class OrientationFormViewComponent implements OnInit, AfterContentChecked { + public static readonly MAX_STEP = + (Math.max( + Object.keys(HotlineMediationSteps).length, + Object.keys(MeetingRDVSSteps).length, + Object.keys(StructuresListSteps).length + ) + + Object.keys(OnlineDemarchesCommonSteps).length) / + 2; public orientationUtils = new OrientationUtils(); public utils = new Utils(); // OnlineDemarches - public onlineDemarchForm: UntypedFormGroup; + public onlineDemarcheForm: UntypedFormGroup; public onlineDemarcheType: OnlineDemarche; // Equipments - public filtersForm: FormGroup<FiltersForm> | FormGroup<StructureOrientationForm>; + public filtersForm: FormGroup<FiltersForm>; + public structureOrientationForm: FormGroup<StructureOrientationForm>; // Orientator public orientator: FormGroup<StructureOrientator>; // Enum public needEnum = NeedsType; // Global public needType: NeedsType; + public previousNeedType: NeedsType; public currentType: MediationType = OnlineDemarche.common; public currentStep: MediationStepType = null; public isLastStep = false; public isRdvsWindowStep = false; public hideNavButtons = false; - public nbSteps: number = - (Math.max( - Object.keys(HotlineMediationSteps).length, - Object.keys(MeetingRDVSSteps).length, - Object.keys(StructuresListSteps).length - ) + - Object.keys(OnlineDemarchesCommonSteps).length) / - 2; + public nbSteps: number = OrientationFormViewComponent.MAX_STEP; public isPageValid: boolean = false; public filters: Filter[] = []; public profile: User; @@ -133,7 +136,7 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked // Init form according to needType switch (needType) { case NeedsType.onlineDemarch: - this.onlineDemarchForm = this.orientationUtils.createOnlineDemarchesForm(); + this.onlineDemarcheForm = this.orientationUtils.createOnlineDemarchesForm(); break; case NeedsType.equipmentAccess: case NeedsType.equipmentBuy: @@ -141,7 +144,7 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked break; case NeedsType.learnSkills: this.filtersForm = this.orientationUtils.createFiltersForm(); - this.onlineDemarchForm = this.orientationUtils.createOnlineDemarchesForm(); + this.onlineDemarcheForm = this.orientationUtils.createOnlineDemarchesForm(); break; default: throw new Error(`Not implemented NeedsType in OrientationFormViewComponent ${needType}`); @@ -168,12 +171,12 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked } /** - * Handle online mediation finsh by sending appointement to server + * Handle online mediation finish by sending appointements to server */ public handleOnlineAppointment(): void { const toCreate: IOnlineMediation = { - ...this.onlineDemarchForm.value, - onlineDemarchType: this.onlineDemarchForm.value.filters.map((module: Module) => module.displayText), + ...this.onlineDemarcheForm.value, + onlineDemarchType: this.onlineDemarcheForm.value.filters.map((module: Module) => module.displayText), }; this.onlineMediationService.createOnlineMediation(toCreate).subscribe((data) => { if (data) { @@ -197,21 +200,21 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked public setOnlineEquipmentsForm() { this.currentType = OnlineDemarche.structureList; this.currentStep = StructuresListSteps.pmrAccess; - // first filter screnn + regular StructureList form + // first filter screen + regular StructureList form this.setStepNumber(Object.keys(StructuresListSteps).length); - this.filtersForm = this.orientationUtils.createStructureOrientationForm( + this.structureOrientationForm = this.orientationUtils.createStructureOrientationForm( this.filtersForm.value.filters, this.orientator ); } public setOnlineProceduresForm() { - switch (this.onlineDemarchForm.get('accompanimentType').value) { + switch (this.onlineDemarcheForm.get('accompanimentType').value) { case OnlineDemarche.structureList: this.currentType = OnlineDemarche.structureList; this.currentStep = StructuresListSteps.pmrAccess; this.setStepNumber(Object.keys(StructuresListSteps).length); - this.onlineDemarchForm = this.orientationUtils.createStructureOrientationForm( + this.onlineDemarcheForm = this.orientationUtils.createStructureOrientationForm( this.utils.convertFiltersToModule(this.filters) ); break; @@ -220,13 +223,13 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked this.currentStep = MeetingRDVSSteps.infoScreen; this.setStepNumber(Object.keys(MeetingRDVSSteps).length); this.skipStructureOrientator(); - this.onlineDemarchForm = this.orientationUtils.createMeetingRDVSForm(this.filters, this.orientator); + this.onlineDemarcheForm = this.orientationUtils.createMeetingRDVSForm(this.filters, this.orientator); break; case OnlineDemarche.onlineMediation: this.currentType = OnlineDemarche.onlineMediation; this.currentStep = HotlineMediationSteps.infoScreen; this.setStepNumber(Object.keys(HotlineMediationSteps).length); - this.onlineDemarchForm = this.orientationUtils.createOnlineMediationForm( + this.onlineDemarcheForm = this.orientationUtils.createOnlineMediationForm( this.utils.convertFiltersToModule(this.filters) ); break; @@ -268,7 +271,7 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked public setOnlineProcedureFilters(): void { // Handle online procedures - const onlineProcedures: Filter[] = this.onlineDemarchForm.value.onlineDemarcheType.map((module: Module) => { + const onlineProcedures: Filter[] = this.onlineDemarcheForm.value.onlineDemarcheType.map((module: Module) => { return new Filter('onlineProcedures', module.id, module.displayText); }); if (onlineProcedures.length > 0) this.filters = [...onlineProcedures, ...this.filters]; @@ -293,16 +296,19 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked ) { switch (this.needType) { case NeedsType.equipmentAccess: + this.previousNeedType = NeedsType.equipmentAccess; this.setFilters('selfServiceMaterial'); // Switch to structure list form this.setOnlineEquipmentsForm(); break; case NeedsType.equipmentBuy: + this.previousNeedType = NeedsType.equipmentBuy; this.setFilters('solidarityMaterial'); // Switch to structure list form this.setOnlineEquipmentsForm(); break; case NeedsType.learnSkills: + this.previousNeedType = NeedsType.learnSkills; this.setFilters('baseSkills'); this.needType = NeedsType.onlineDemarch; this.currentStep = OnlineDemarchesCommonSteps.accompanimentType; @@ -318,6 +324,7 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked ) { this.setOnlineProcedureFilters(); this.setOnlineProceduresForm(); + this.previousNeedType = NeedsType.onlineDemarch; return; } // Handle last screen Online appointment and print @@ -375,13 +382,39 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked } } - // Default case + // Default case for first form step. If there was a previous form (like filterForm) we go back to this form if (this.currentStep === 0) { + switch (this.previousNeedType) { + case NeedsType.onlineDemarch: + this.currentType = OnlineDemarche.common; + this.currentStep = OnlineDemarchesCommonSteps.accompanimentType; + this.onlineDemarcheForm = this.orientationUtils.createOnlineDemarchesForm(); + this.previousNeedType = null; + return; + case NeedsType.learnSkills: + case NeedsType.equipmentAccess: + case NeedsType.equipmentBuy: + this.needType = this.previousNeedType; + this.currentType = OnlineDemarche.common; + this.currentStep = OnlineDemarchesCommonSteps.accompanimentType; + this.previousNeedType = null; + break; + default: + // Last step, reset all + this.reset(); + return; + } + // return; // handle the form start - this.reset(); - return; } if (this.currentStep > 0) { + // Special case for learnSkills + if (this.previousNeedType === NeedsType.learnSkills && this.currentStep === 1) { + this.needType = this.previousNeedType; + this.currentType = OnlineDemarche.common; + this.currentStep = OnlineDemarchesCommonSteps.accompanimentType; + this.previousNeedType = null; + } this.currentStep--; this.checkLastStep(); this.checkHideNavButtons(); @@ -389,12 +422,12 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked } public reset(): void { - this.onlineDemarchForm = undefined; + this.onlineDemarcheForm = undefined; this.onlineDemarcheType = undefined; this.filtersForm = undefined; this.currentStep = null; this.currentType = OnlineDemarche.common; - this.nbSteps = Object.keys(HotlineMediationSteps).length / 2; + this.nbSteps = OrientationFormViewComponent.MAX_STEP; this.isPageValid = false; this.needType = undefined; this.filters = []; diff --git a/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.ts b/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.ts index 9d91f7fbe6b583a87b0d6f78865e7a968796cce4..6ddbc32e17bb34b47589a5a862d67712a17b6907 100644 --- a/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.ts +++ b/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.ts @@ -29,7 +29,7 @@ export class OrientationStructureListComponent implements OnChanges { public radioChange(event: { name: string; value: boolean }): void { const { name, value } = event; this.form.get(name).setValue(value); - this.manualySetOfPmr(event); + this.manuallySetOfPmr(event); } public checkValidation(event?: any): void { @@ -48,7 +48,7 @@ export class OrientationStructureListComponent implements OnChanges { this.validatePage.emit(event); } - private manualySetOfPmr(event: { name: string; value: boolean }): void { + private manuallySetOfPmr(event: { name: string; value: boolean }): void { // Handle special PMR access case if (event.name === 'pmrAccess') { if (event.value) { diff --git a/src/app/login/login.component.scss b/src/app/login/login.component.scss index a9f3674537d21d6a6f20ae11ea9af1fedd7298b0..4283e56eddb6372985d86bd446f20a995551557d 100644 --- a/src/app/login/login.component.scss +++ b/src/app/login/login.component.scss @@ -11,6 +11,7 @@ height: calc(100% - $footer-height); } .loginPage { + display: flex; width: 100%; max-width: 980px; box-sizing: border-box; @@ -24,7 +25,7 @@ border: 1px solid $grey-6; padding: 70px 40px; @media #{$desktop} { - padding: 30px; + padding: 1rem; } .title { @@ -35,7 +36,7 @@ } p { @include lato-regular-14; - margin-top: 0.5rem; + margin: 0.5rem; } } .inputInvalid { @@ -52,7 +53,7 @@ } .form-group { - margin: 2rem 0; + margin: 1.5rem 0; .notValidate { min-width: 26px; width: 26px; @@ -117,8 +118,6 @@ @media #{$tablet} { .loginPage { - height: calc( - 100vh - #{$header-height-phone} - #{$footer-height-phone} - 87px - 1px - ); // -1px because of header border + height: 100%; } } diff --git a/src/app/profile/edit/edit.component.html b/src/app/profile/edit/edit.component.html index d974550d58ca515a4493244d91381c5cda408366..74e5e0438029c0abb34f3c1c1bf7e27007bacfc2 100644 --- a/src/app/profile/edit/edit.component.html +++ b/src/app/profile/edit/edit.component.html @@ -205,7 +205,7 @@ <!-- Footer --> <div class="footer" *ngIf="currentTab !== tabsEnum.credentials"> - <app-button [text]="'Annuler'" [iconBtn]="'close'" (action)="cancel()"></app-button> + <app-button *ngIf="profileChanged()" [text]="'Annuler'" [iconBtn]="'close'" (action)="cancel()"></app-button> <app-button [text]="'Valider'" [iconBtn]="'check'" diff --git a/src/app/profile/edit/edit.component.ts b/src/app/profile/edit/edit.component.ts index 8e272bcc28d8b65df4a7193787c27a9acd113af4..3f243acba8645366fe871ce6f8fdb8d26d4a0f3d 100644 --- a/src/app/profile/edit/edit.component.ts +++ b/src/app/profile/edit/edit.component.ts @@ -1,16 +1,17 @@ +import { HttpErrorResponse } from '@angular/common/http'; import { ChangeDetectorRef, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; -import { HttpErrorResponse } from '@angular/common/http'; +import * as _ from 'lodash'; import { forkJoin, of } from 'rxjs'; import { catchError, first, map } from 'rxjs/operators'; +import { Employer } from '../../models/employer.model'; import { Job } from '../../models/job.model'; import { User } from '../../models/user.model'; -import { Employer } from '../../models/employer.model'; import { AuthService } from '../../services/auth.service'; -import { ProfileService } from '../services/profile.service'; import { NotificationService } from '../../services/notification.service'; import { ButtonType } from '../../shared/components/button/buttonType.enum'; import { CustomRegExp } from '../../utils/CustomRegExp'; +import { ProfileService } from '../services/profile.service'; enum tabsEnum { details, @@ -75,7 +76,7 @@ export class EditComponent implements OnInit { this.profileService.getProfile().then((profile) => { this.userProfile = new User(profile); - this.initialUserProfile = { ...profile }; + this.initialUserProfile = new User({ ...profile }); this.selectedEmployer = { ...profile.employer }; if (!profile.employer || !profile.job) { this.isNewUser = true; @@ -119,14 +120,6 @@ export class EditComponent implements OnInit { ); } - public detailsChanged(): boolean { - return ( - this.initialUserProfile.name !== this.userProfile.name || - this.initialUserProfile.surname !== this.userProfile.surname || - this.initialUserProfile.phone !== this.userProfile.phone - ); - } - public navigateTo(tab: tabsEnum): void { this.currentTab = tab; if (tab === tabsEnum.employer) { @@ -140,6 +133,10 @@ export class EditComponent implements OnInit { this.userProfile = { ...this.initialUserProfile }; } + public profileChanged(): boolean { + return !_.isEqual(this.userProfile, this.initialUserProfile); + } + public showEmailModal(): void { this.emailModal = true; } @@ -160,7 +157,7 @@ export class EditComponent implements OnInit { public isPageValid(): boolean { if (this.currentTab === tabsEnum.details) { - return this.detailsChanged() && this.phoneValid() && this.nameValid() && this.surnameValid(); + return this.profileChanged() && this.phoneValid() && this.nameValid() && this.surnameValid(); } else if (this.currentTab === tabsEnum.credentials) { if (this.emailModal) { return this.emailValid(this.newEmail) && this.newEmail === this.newEmailConfirm; diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html index 5fe6c53a59d63bbe4c251089ba06ebbfa0c549fe..1a1f46f2f1ada7a8b018b2f40e3f63e5c192c02e 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -60,15 +60,18 @@ </div> </section> - <section> + <section *ngIf="userProfile.structuresLink.length"> <div class="header"> - <h1>Structures</h1> + <h1 [ngPlural]="userProfile.structuresLink.length"> + <ng-template ngPluralCase="1">Structure</ng-template> + <ng-template ngPluralCase="other">Structures</ng-template> + </h1> <app-button *ngIf="!isPublic && userProfile.structuresLink.length > 0" class="hide-on-mobile" [type]="'button'" [iconBtn]="'edit'" - [text]="'Gérer mes structures'" + [text]="userProfile.structuresLink.length > 1 ? 'Gérer mes structures' : 'Gérer ma structure'" [style]="buttonTypeEnum.SecondaryWide" routerLink="./structures-management" [routerLinkActive]="'active'" @@ -116,7 +119,7 @@ ></app-button> </section> - <!-- Features not impleted yet --> + <!-- Features not implemented yet --> <!-- <section *ngIf="!isPublic"> <div class="header"> <h1>Ressources</h1> diff --git a/src/app/profile/structures-management/structures-management.component.html b/src/app/profile/structures-management/structures-management.component.html index 0b5302e275fa8f1e66cbe1535d07d268698fe752..85fe99b9bbe48e19ebe350569d89323343e0f747 100644 --- a/src/app/profile/structures-management/structures-management.component.html +++ b/src/app/profile/structures-management/structures-management.component.html @@ -4,7 +4,11 @@ <div fxLayout="row wrap" fxLayoutAlign="space-between center" fxFill> <div fxLayout="row" fxLayoutAlign="start center" class="headerBack"> <app-svg-icon [iconClass]="'backArrow'" [type]="'ico'" [icon]="'arrowBack'" (click)="goBack()"></app-svg-icon> - <h1>Gérer mes structures</h1> + <h1></h1> + <h1 [ngPlural]="structures.length"> + <ng-template ngPluralCase="1">Gestion des structures</ng-template> + <ng-template ngPluralCase="other">Gérer mes structures</ng-template> + </h1> </div> <app-button [style]="buttonTypeEnum.SecondaryWide" diff --git a/src/app/reset-password/reset-password.component.html b/src/app/reset-password/reset-password.component.html index ed9aa01a98becca8e9dcd1fcab9177e786b6ca11..591b304e3397e790b9ec0438060989f57ec69f8f 100644 --- a/src/app/reset-password/reset-password.component.html +++ b/src/app/reset-password/reset-password.component.html @@ -1,5 +1,5 @@ <div class="content"> - <div class="resetPage"> + <div class="resetPage" *ngIf="!token"> <div class="resetPasswordForm"> <div class="title"> <h1>Mot de passe oublié</h1> @@ -42,7 +42,7 @@ </div> </form> </div> - <!-- <app-password-form *ngIf="token" (passwordForm)="onSubmitPassword($event)"></app-password-form> --> </div> </div> + <app-password-form *ngIf="token"></app-password-form> </div> diff --git a/src/app/reset-password/reset-password.component.scss b/src/app/reset-password/reset-password.component.scss index cc2549e558fc5c09945cdfb2d6d6ea63ef891e16..70621e99a16ac129d7281f94baa4b7af1232029c 100644 --- a/src/app/reset-password/reset-password.component.scss +++ b/src/app/reset-password/reset-password.component.scss @@ -8,7 +8,7 @@ flex-direction: column; align-items: center; justify-content: center; - height: 100%; + height: calc(100% - $footer-height); } .resetPage { width: 100%; @@ -27,11 +27,6 @@ flex-direction: column; align-items: center; justify-content: center; - @media #{$tablet} { - height: calc( - 100vh - #{$header-height-phone} - #{$footer-height-phone} - 87px - 1px - ); // -1px because of header border - } } .resetPasswordForm { display: flex; diff --git a/src/app/reset-password/reset-password.component.ts b/src/app/reset-password/reset-password.component.ts index 834a043f4ea2d441752b5be116429b6326aa4826..c3bd84f80dfe236dc5e39e8404ceffafd5964b47 100644 --- a/src/app/reset-password/reset-password.component.ts +++ b/src/app/reset-password/reset-password.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { AuthService } from '../services/auth.service'; import { NotificationService } from '../services/notification.service'; import { ButtonType } from '../shared/components/button/buttonType.enum'; @@ -8,12 +8,13 @@ import { ButtonType } from '../shared/components/button/buttonType.enum'; @Component({ selector: 'app-reset-password', templateUrl: './reset-password.component.html', - styleUrls: ['./reset-password.component.scss'] + styleUrls: ['./reset-password.component.scss'], }) export class ResetPasswordComponent implements OnInit { public resetForm: UntypedFormGroup; public loading = false; public submitted = false; + public token: string; // Condition form public isShowConfirmPassword = false; public isShowPassword = false; @@ -23,12 +24,16 @@ export class ResetPasswordComponent implements OnInit { private formBuilder: UntypedFormBuilder, private authService: AuthService, private router: Router, - private notificationService: NotificationService + private notificationService: NotificationService, + private activatedRoute: ActivatedRoute ) {} ngOnInit(): void { + this.activatedRoute.queryParams.subscribe((params) => { + this.token = params['token']; + }); this.resetForm = this.formBuilder.group({ - email: ['', Validators.required] + email: ['', Validators.required], }); } @@ -46,18 +51,18 @@ export class ResetPasswordComponent implements OnInit { } this.loading = true; - this.authService.resetPassword(this.f.email.value).subscribe( - () => { + this.authService.resetPassword(this.f.email.value).subscribe({ + next: () => { this.notificationService.showSuccess( 'Un mail de confirmation de modification de votre mot de passe vous a été envoyé.', '' ); - this.router.navigate(['']); + this.router.navigate(['/login']); }, - () => { + complete: () => { this.loading = false; - } - ); + }, + }); } public goLogin(): void { diff --git a/src/app/shared/components/password-form/password-form.component.scss b/src/app/shared/components/password-form/password-form.component.scss index cb5596ff073b49223d5adaec58a1dfa6da531551..c8a7fa3c40e0126b03017b2d6b90fcbcbb5da6c7 100644 --- a/src/app/shared/components/password-form/password-form.component.scss +++ b/src/app/shared/components/password-form/password-form.component.scss @@ -21,16 +21,11 @@ background: $white; border-radius: 8px; border: 1px solid $grey-6; - padding: 32px 24px 32px 48px; + padding: 1.5rem 2.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; - @media #{$tablet} { - height: calc( - 100vh - #{$header-height-phone} - #{$footer-height-phone} - 47px - 1px - ); // -1px because of header border - } } h1 { @include lato-bold-24; diff --git a/src/app/shared/components/password-form/password-form.component.ts b/src/app/shared/components/password-form/password-form.component.ts index 9afa68840f5fdaad05ab6f06e8176329b2dde3ea..f598a9b416a7008e0e14d9cdae2ecfbef4cbe36c 100644 --- a/src/app/shared/components/password-form/password-form.component.ts +++ b/src/app/shared/components/password-form/password-form.component.ts @@ -1,8 +1,9 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { ProfileService } from '../../../profile/services/profile.service'; import { AuthService } from '../../../services/auth.service'; +import { NotificationService } from '../../../services/notification.service'; import { CustomRegExp } from '../../../utils/CustomRegExp'; import { MustMatch } from '../../validator/form'; import { ButtonType } from '../button/buttonType.enum'; @@ -30,7 +31,8 @@ export class PasswordFormComponent implements OnInit { private auth: AuthService, private activatedRoute: ActivatedRoute, private authService: AuthService, - private profileService: ProfileService + private profileService: ProfileService, + private notificationService: NotificationService ) {} ngOnInit(): void { @@ -118,17 +120,35 @@ export class PasswordFormComponent implements OnInit { } else if (this.oldPasswordNeeded) { // stop here if form is invalid this.passwordError = false; - this.profileService.changePassword(this.accountForm.value.password, this.accountForm.value.oldPassword).subscribe( - () => { - this.passwordError = false; - }, - (_error) => { - this.passwordError = true; - } - ); + this.profileService + .changePassword(this.accountForm.value.password, this.accountForm.value.oldPassword) + .subscribe({ + next: () => { + this.notificationService.showSuccess( + 'Votre mot de passe a été réinitialisé avec succès.', + 'Veuillez vous connecter' + ); + this.passwordError = false; + }, + error: () => { + this.notificationService.showError('Echec de la réinitialisation de votre mot de passe'); + this.passwordError = true; + }, + complete: () => { + this.router.navigate(['/login']); + }, + }); } else { - this.authService.resetPasswordApply(this.token, this.accountForm.value.password).subscribe(() => { - this.router.navigate(['']); + this.authService.resetPasswordApply(this.token, this.accountForm.value.password).subscribe({ + next: () => { + this.notificationService.showSuccess('Votre mot de passe a été réinitialisé avec succès.'); + }, + error: () => { + this.notificationService.showError('Echec de la réinitialisation de votre mot de passe'); + }, + complete: () => { + this.router.navigate(['']); + }, }); } } diff --git a/src/app/shared/components/structure-pmr/structure-pmr.component.html b/src/app/shared/components/structure-pmr/structure-pmr.component.html index 76b215f8b8dbe53dc46ef94cc15f1bafe21d5137..2212f0be89be0d41ff62f5f813b6e4973999cf04 100644 --- a/src/app/shared/components/structure-pmr/structure-pmr.component.html +++ b/src/app/shared/components/structure-pmr/structure-pmr.component.html @@ -8,7 +8,7 @@ [icon]="'arrowBack'" ></app-svg-icon> <div class="titleContent"> - <h3>La structure est-elle accessible pour les personnes à mobilité réduite ?</h3> + <h3>La structure doit-elle être accessible pour les personnes à mobilité réduite ?</h3> </div> </div> <p class="missing-information" *ngIf="isEditMode && !structureForm.get('pmrAccess').valid"> diff --git a/src/app/shared/components/structure-type-picker/structure-type-picker.component.html b/src/app/shared/components/structure-type-picker/structure-type-picker.component.html index af194b4c1da4fe4ecdb6043837656f0b98181f90..ab0a9b37de2caea5aea55182788686f0aa25de5f 100644 --- a/src/app/shared/components/structure-type-picker/structure-type-picker.component.html +++ b/src/app/shared/components/structure-type-picker/structure-type-picker.component.html @@ -1,11 +1,7 @@ <div class="typeContainer"> <div class="collapse" [ngClass]="{ notCollapsed: !showPublic }"> <div class="collapseHeader" (click)="togglePublic()"> - <div class="svgContainer"> - <svg aria-hidden="true"> - <use [attr.xlink:href]="'assets/ico/sprite.svg#' + structureTypeIconEnum.public"></use> - </svg> - </div> + <app-svg-icon [iconClass]="'icon-52'" [type]="'ico'" [icon]="structureTypeIconEnum.public"></app-svg-icon> <div class="titleCollapse"> {{ structureTypeCategoryEnum.public }} </div> @@ -31,11 +27,7 @@ </div> <div class="collapse" [ngClass]="{ notCollapsed: !showPrivate }"> <div class="collapseHeader" (click)="togglePrivate()"> - <div class="svgContainer"> - <svg aria-hidden="true"> - <use [attr.xlink:href]="'assets/ico/sprite.svg#' + structureTypeIconEnum.private"></use> - </svg> - </div> + <app-svg-icon [iconClass]="'icon-52'" [type]="'ico'" [icon]="structureTypeIconEnum.private"></app-svg-icon> <div class="titleCollapse"> {{ structureTypeCategoryEnum.private }} </div> @@ -61,11 +53,11 @@ </div> <div class="collapse" [ngClass]="{ notCollapsed: !showPrivateLucrative }"> <div class="collapseHeader" (click)="togglePrivateLucrative()"> - <div class="svgContainer"> - <svg aria-hidden="true"> - <use [attr.xlink:href]="'assets/ico/sprite.svg#' + structureTypeIconEnum.privateLucrative"></use> - </svg> - </div> + <app-svg-icon + [iconClass]="'icon-52'" + [type]="'ico'" + [icon]="structureTypeIconEnum.privateLucrative" + ></app-svg-icon> <div class="titleCollapse"> {{ structureTypeCategoryEnum.privateLucrative }} </div> diff --git a/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss b/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss index 0d606be805cd97ce018dde24d9a62fe04c3662c7..923fb9d0922b56aa76764b854d5c655c959ca961 100644 --- a/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss +++ b/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss @@ -14,9 +14,6 @@ @media #{$small-phone} { width: 95% !important; } - @media #{$tablet} { - width: 296px; - } &.notCollapsed { background: $grey-8; .logo { @@ -40,10 +37,6 @@ @include lato-bold-14; color: $grey-1; } - .svgContainer { - height: 52px; - width: 52px; - } .logo { height: 24px; width: 24px; diff --git a/src/app/shared/components/svg-icon/svg-icon.component.scss b/src/app/shared/components/svg-icon/svg-icon.component.scss index ded8d76a148b01c5b677fed23a35acc96d09fd01..2b4fb3ebcf1744ce2a40714daf997a4268820d66 100644 --- a/src/app/shared/components/svg-icon/svg-icon.component.scss +++ b/src/app/shared/components/svg-icon/svg-icon.component.scss @@ -76,10 +76,13 @@ $sizes: ( svg { // Scale the SVG to cover the whole app-icon container. - top: 0.125em; position: relative; } .icon-centered { padding-top: 0.15rem; } +.acces-icon { + width: 3rem; + height: 1rem; +} diff --git a/src/app/shared/components/training-type-picker/training-type-picker.component.scss b/src/app/shared/components/training-type-picker/training-type-picker.component.scss index 577cef9436dd2f05695777b0def81c631a16331a..a85177b171ade4ff7c9471dc25541d7c439ded25 100644 --- a/src/app/shared/components/training-type-picker/training-type-picker.component.scss +++ b/src/app/shared/components/training-type-picker/training-type-picker.component.scss @@ -23,9 +23,6 @@ label.checkbox { @media #{$small-phone} { width: 95% !important; } - @media #{$tablet} { - width: 296px; - } &.notCollapsed { border: 1px solid $grey-8; background: $grey-8; diff --git a/src/app/shared/enum/adminPanel.enum.ts b/src/app/shared/enum/adminPanel.enum.ts index 8c81a0ef3ac8f413b67f3fac2dd4ab7417ef918f..c6c1e63e5ee0facaa0a21b6be1fda6b9715aeedd 100644 --- a/src/app/shared/enum/adminPanel.enum.ts +++ b/src/app/shared/enum/adminPanel.enum.ts @@ -1,8 +1,8 @@ -export enum AdminPannelEnum { +export enum AdminPanelEnum { manageUsers, pendingStructures, structuresList, jobsList, employersList, - lockdownInfo + lockdownInfo, } 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 e1866193f4ff93221bfc31a4a999734ae8b34d44..d544e07534b6a6e9daa69ee9fa2251f03aeb769c 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 @@ -472,13 +472,13 @@ {{ tclStop.name }} <div fxLayout="row wrap" fxLayoutGap="16px"> <p *ngFor="let sub of tclStop.subLines"> - <app-svg-icon [type]="'tcl'" [icon]="sub" [iconClass]="'icon-75'"></app-svg-icon> + <app-svg-icon [type]="'tcl'" [icon]="sub" [iconClass]="'acces-icon'"></app-svg-icon> </p> <p *ngFor="let tram of tclStop.tramLines"> - <app-svg-icon [type]="'tcl'" [icon]="tram" [iconClass]="'icon-75'"></app-svg-icon> + <app-svg-icon [type]="'tcl'" [icon]="tram" [iconClass]="'acces-icon'"></app-svg-icon> </p> <p *ngFor="let bus of tclStop.busLines"> - <app-svg-icon [type]="'tcl'" [icon]="bus" [iconClass]="'icon-75'"></app-svg-icon> + <app-svg-icon [type]="'tcl'" [icon]="bus" [iconClass]="'acces-icon'"></app-svg-icon> </p> </div> </div> diff --git a/src/app/structure-list/components/structure-list-search/structure-list-search.component.html b/src/app/structure-list/components/structure-list-search/structure-list-search.component.html index 78095863c0232a845205f44759b1c22f34386726..73b7060bc8bb7a64efa27d420147c03a24a0b682 100644 --- a/src/app/structure-list/components/structure-list-search/structure-list-search.component.html +++ b/src/app/structure-list/components/structure-list-search/structure-list-search.component.html @@ -35,7 +35,7 @@ fxLayoutAlign="space-between center" (click)="openModal(TypeModal.accompaniment)" > - <span>Démarches en ligne</span> + <span>Démarches en ligne</span> <div class="arrow"></div> </button> <button diff --git a/src/app/structure-list/components/structure-list-search/structure-list-search.component.ts b/src/app/structure-list/components/structure-list-search/structure-list-search.component.ts index 41eabc42ba96208c9c2132ad4f0a51fe32ae7b72..8b6231fb94d95e8fa5bea87771564abb58963aa8 100644 --- a/src/app/structure-list/components/structure-list-search/structure-list-search.component.ts +++ b/src/app/structure-list/components/structure-list-search/structure-list-search.component.ts @@ -182,6 +182,7 @@ export class StructureListSearchComponent implements OnInit { // Management of the checkbox event (Check / Uncheck) public externalCheckboxCheck(event, categ, displayName): void { + this.closeModal(); const checkValue: string = event.target.value; const inputTerm = this.searchForm.get('searchTerm').value; if (event.target.checked) { diff --git a/src/app/utils/CustomRegExp.ts b/src/app/utils/CustomRegExp.ts index 68317997e5fae1446e0254f80247c84392212201..74d77eba7ebb090dc12e194af8b053fc4cbd465a 100644 --- a/src/app/utils/CustomRegExp.ts +++ b/src/app/utils/CustomRegExp.ts @@ -17,7 +17,7 @@ export class CustomRegExp { /** * Validate an email */ - public static readonly EMAIL: RegExp = /^[a-z0-9.\-_]+@[a-z0-9.-]+[.][a-z]{2,3}$/; //NOSONAR + public static readonly EMAIL: RegExp = /^[A-Za-z0-9.\-_]+@[A-Za-z0-9.-]+[.][a-z]{2,3}$/; //NOSONAR public static readonly TEXT_WITHOUT_NUMBER: RegExp = /^[A-Za-zÀ-ÖØ-öø-ÿ- ]{1,}$/; //NOSONAR /** * Validate a phone number (4 or 10 digits, allowing spaces, dashes and dots as spacers) diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts index 97cb7c613b01f86777a4b1029477773a6a587bd8..ecec60dc6ed9836cdfc26bdca29515f97ae7eeed 100644 --- a/src/app/utils/formUtils.ts +++ b/src/app/utils/formUtils.ts @@ -158,6 +158,7 @@ export class formUtils { ] ), freeWorkShop: new UntypedFormControl(structure.freeWorkShop, [Validators.required]), + freeWifi: new UntypedFormControl(null, [Validators.required]), // Field used has a pivot, not sent in final form. dataShareConsentDate: new UntypedFormControl(structure.dataShareConsentDate), personalOffers: new UntypedFormControl(structure.personalOffers), }); diff --git a/src/app/utils/orientationUtils.ts b/src/app/utils/orientationUtils.ts index 3c69623c992420a254b16a7b43d4a2e5ba98d8ef..9cc467b866f173189cd6acc64313eafc573ea530 100644 --- a/src/app/utils/orientationUtils.ts +++ b/src/app/utils/orientationUtils.ts @@ -104,7 +104,7 @@ export class OrientationUtils { }): FormGroup<StructureOrientator> { return new FormGroup<StructureOrientator>({ structureName: new FormControl(orientator?.structureName || '', Validators.required), - structureMail: new FormControl(orientator?.structureMail || ''), + structureMail: new FormControl(orientator?.structureMail || '', [Validators.pattern(CustomRegExp.EMAIL)]), structurePhone: new FormControl(orientator?.structurePhone || '', [Validators.pattern(CustomRegExp.PHONE)]), }); } diff --git a/src/styles.scss b/src/styles.scss index 1392301f126fcd1bfce57a670e7cc69e8e36758e..548f930e2e1bf1dd64a9479fa2c162d00417ad8e 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -176,6 +176,14 @@ form p.notRequired { input { margin-top: 4px; } +.form-group .addressRow { + padding-bottom: 1.5rem; +} +.formView { + form { + padding-bottom: 1rem; + } +} /** Textarea **/ .textareaBlock {