From 4e1c4d15bd17286b778111b60676f184180639f1 Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Wed, 7 Dec 2022 14:28:03 +0100 Subject: [PATCH 01/23] fix wording --- .../information-step/information-step.component.html | 4 ++-- .../personal-offer-accompaniment.component.html | 2 +- .../personal-offer-training-type.component.html | 2 +- .../profile-employer-selection.component.html | 2 +- .../structure-digital-helping-accompaniment.component.html | 2 +- .../structure-equipments/structure-equipments.component.ts | 2 +- .../structure-public-target.component.html | 2 +- .../structure-training-type.component.html | 2 +- .../structure-wifi/structure-wifi.component.html | 2 +- .../online-demarch-common/online-demarch.component.html | 2 +- src/app/profile/profile.component.html | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) 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 e2ebe4be5..e24e9cb9e 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/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 74bf05fec..2cbad5fcd 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 48295eb96..fb1af6343 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 0e5cb2e32..d4c0f045c 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 employeue ?</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/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 e9c68c498..8cb1a8d5c 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 8c803479e..9949356f9 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-public-target/structure-public-target.component.html b/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html index beaaccd14..c3470aa9c 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 0863dd5c0..1d4834e25 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-wifi/structure-wifi.component.html b/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.html index 0cd01afb0..e576b7862 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,7 +8,7 @@ [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 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 adc5a7c74..240720982 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/profile/profile.component.html b/src/app/profile/profile.component.html index 4da17b1d3..dc9f9d921 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -62,7 +62,7 @@ <section> <div class="header"> - <h1>Structures</h1> + <h1>Structure{{ userProfile.structuresLink.length > 1 && 's' }}</h1> <app-button *ngIf="!isPublic && userProfile.structuresLink.length > 0" class="hide-on-mobile" -- GitLab From 0e451543c9670f62f494ec3914b746a4bb2e14de Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Wed, 7 Dec 2022 15:06:01 +0100 Subject: [PATCH 02/23] first returns --- src/app/profile/edit/edit.component.html | 2 +- src/app/profile/edit/edit.component.ts | 17 +++++++---------- .../components/svg-icon/svg-icon.component.scss | 5 ++++- .../structure-details.component.html | 6 +++--- .../structure-list-search.component.html | 2 +- .../structure-list-search.component.ts | 1 + 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/app/profile/edit/edit.component.html b/src/app/profile/edit/edit.component.html index d974550d5..08226e02f 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="isEditing()" [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 fc39fd088..e6c32de79 100644 --- a/src/app/profile/edit/edit.component.ts +++ b/src/app/profile/edit/edit.component.ts @@ -11,6 +11,7 @@ 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 * as _ from 'lodash'; enum tabsEnum { details, @@ -74,7 +75,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 }; const otherJob = new Job({ name: 'Autre' }); @@ -116,14 +117,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) { @@ -137,6 +130,10 @@ export class EditComponent implements OnInit { this.userProfile = { ...this.initialUserProfile }; } + public isEditing(): boolean { + return !_.isEqual(this.userProfile, this.initialUserProfile); + } + public showEmailModal(): void { this.emailModal = true; } @@ -157,7 +154,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.isEditing() && 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/shared/components/svg-icon/svg-icon.component.scss b/src/app/shared/components/svg-icon/svg-icon.component.scss index ded8d76a1..2b4fb3ebc 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/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html index d39b0625a..c6de1bb16 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 @@ -469,13 +469,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 78095863c..73b7060bc 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 41eabc42b..8b6231fb9 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) { -- GitLab From ee2eefbcc1f4bea468cd592c9f0a00436c9e15d7 Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Wed, 7 Dec 2022 15:21:06 +0100 Subject: [PATCH 03/23] fix mail inputs --- src/app/utils/CustomRegExp.ts | 2 +- src/app/utils/orientationUtils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/utils/CustomRegExp.ts b/src/app/utils/CustomRegExp.ts index 68317997e..74d77eba7 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/orientationUtils.ts b/src/app/utils/orientationUtils.ts index 74bd48cf5..730fd1d2c 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)]), }); } -- GitLab From df4ea57d4d52f72ad800d23e39fb50b4869ddea9 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Wed, 7 Dec 2022 16:22:05 +0100 Subject: [PATCH 04/23] fix: remove unnecessary text --- .../account-form/account-info/account-info.component.html | 1 - 1 file changed, 1 deletion(-) 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 d9a40b8a7..d22955e49 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> -- GitLab From 94faabed1f6da0ffe892de218379e5095a38232d Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Wed, 7 Dec 2022 16:29:54 +0100 Subject: [PATCH 05/23] fix mail reset --- .../reset-password.component.html | 4 +- .../reset-password.component.ts | 25 ++++++----- .../password-form.component.scss | 2 +- .../password-form/password-form.component.ts | 44 ++++++++++++++----- .../structure-pmr.component.html | 2 +- 5 files changed, 51 insertions(+), 26 deletions(-) diff --git a/src/app/reset-password/reset-password.component.html b/src/app/reset-password/reset-password.component.html index ed9aa01a9..591b304e3 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.ts b/src/app/reset-password/reset-password.component.ts index 834a043f4..c3bd84f80 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 cb5596ff0..dd8fd1356 100644 --- a/src/app/shared/components/password-form/password-form.component.scss +++ b/src/app/shared/components/password-form/password-form.component.scss @@ -21,7 +21,7 @@ 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; 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 9afa68840..3a29d4ade 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 76b215f8b..2212f0be8 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"> -- GitLab From bf6c3642e87dd8c2d6318faf4ff784d764736fef Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Wed, 7 Dec 2022 17:25:12 +0100 Subject: [PATCH 06/23] fix(ios): icon size handling --- .../structure-type-picker.component.html | 22 ++++++------------- .../structure-type-picker.component.scss | 4 ---- 2 files changed, 7 insertions(+), 19 deletions(-) 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 af194b4c1..ab0a9b37d 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 0d606be80..9c488917a 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 @@ -40,10 +40,6 @@ @include lato-bold-14; color: $grey-1; } - .svgContainer { - height: 52px; - width: 52px; - } .logo { height: 24px; width: 24px; -- GitLab From d0901952bbcf1a639faf85dd5880e85dd4694f4c Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Wed, 7 Dec 2022 17:28:55 +0100 Subject: [PATCH 07/23] fix(ios): progress bar --- .../global-components/progress-bar/progress-bar.component.scss | 2 ++ 1 file changed, 2 insertions(+) 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 dcc16bb91..cac88f4da 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,8 @@ width: 100%; height: 6px; border-radius: 7px; + user-select: none; + -webkit-user-select: none; &::-webkit-progress-bar { background-color: $grey-6; border-radius: 7px; -- GitLab From 09b4b706185fc1f6860318aeb2c33846731b6c55 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 12 Dec 2022 09:57:04 +0100 Subject: [PATCH 08/23] fix: plural handling --- src/app/profile/profile.component.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html index dc9f9d921..90aaa6df9 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -62,7 +62,10 @@ <section> <div class="header"> - <h1>Structure{{ userProfile.structuresLink.length > 1 && 's' }}</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" -- GitLab From 4295ec9cfa1329f72f448745807c9d17353fa9bb Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 12 Dec 2022 10:07:15 +0100 Subject: [PATCH 09/23] fix: console error and typo --- src/app/annuaire/result-list/result-list.component.html | 2 +- .../orientation-structure-list.component.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/annuaire/result-list/result-list.component.html b/src/app/annuaire/result-list/result-list.component.html index 2e61398f1..f65e60528 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/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 9d91f7fbe..6ddbc32e1 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) { -- GitLab From 1cc037668429cc58f1c33694f71cd2b33fb6e4db Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 12 Dec 2022 10:41:36 +0100 Subject: [PATCH 10/23] fix: typo + NG04013 issue for admin routing --- .../attached-users/attached-users.component.ts | 4 ++-- src/app/admin/components/panel/panel.component.ts | 8 ++++---- src/app/admin/services/panel-route.service.ts | 6 +++--- src/app/app-routing.module.ts | 1 + src/app/profile/profile.component.html | 6 +++--- src/app/shared/enum/adminPanel.enum.ts | 4 ++-- 6 files changed, 15 insertions(+), 14 deletions(-) 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 8b3e0d512..c5c516db4 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 67e40039f..9f0ce725b 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 23f6944ec..111a50102 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/app-routing.module.ts b/src/app/app-routing.module.ts index 1df6f3126..ab0da4053 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -236,6 +236,7 @@ const routes: Routes = [ canActivate: [AdminGuard], loadChildren: () => import('./admin/admin.module').then((m) => m.AdminModule), }, + footerOutletRoute, ], }, { diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html index 90aaa6df9..1055550bb 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -60,7 +60,7 @@ </div> </section> - <section> + <section *ngIf="userProfile.structuresLink.length"> <div class="header"> <h1 [ngPlural]="userProfile.structuresLink.length"> <ng-template ngPluralCase="1">Structure</ng-template> @@ -86,7 +86,7 @@ [routerLinkActive]="'active'" ></app-button> </div> - <div class="structuresContainer" *ngIf="userProfile.structuresLink.length > 0 && structures"> + <div class="structuresContainer" *ngIf="structures"> <div *ngFor="let structure of structures; let i = index"> <app-profile-structure [structureWithOwners]="structure" @@ -106,7 +106,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/shared/enum/adminPanel.enum.ts b/src/app/shared/enum/adminPanel.enum.ts index 8c81a0ef3..c6c1e63e5 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, } -- GitLab From 778a7cac6d37c3350aa6af62e4831f1e05ac9401 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 12 Dec 2022 11:04:09 +0100 Subject: [PATCH 11/23] fix: plural and form exit --- src/app/form/form-view/form-view.component.ts | 25 +++++++++++++------ src/app/profile/profile.component.html | 2 +- .../structures-management.component.html | 6 ++++- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index 41b2ad9ac..ea9c03f49 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -517,15 +517,26 @@ export class FormViewComponent implements OnInit, AfterViewInit { } } + private setExitPages(): number[] { + switch (this.currentFormType) { + case formType.structure: + return [ + structureFormStep.noStructure, + structureFormStep.structureCreationFinishedInfo, + structureFormStep.mailSentInfo, + ]; + case formType.profile: + return [profileFormStep.profileJobSelection]; + case formType.personaloffer: + return [personalOfferFormStep.personalOfferFinishedInfo]; + default: + []; + } + } + 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/profile/profile.component.html b/src/app/profile/profile.component.html index 1055550bb..3101814f5 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -71,7 +71,7 @@ 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'" diff --git a/src/app/profile/structures-management/structures-management.component.html b/src/app/profile/structures-management/structures-management.component.html index 0b5302e27..85fe99b9b 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" -- GitLab From d52ec3cdeef9f4c4e130697c4225afb4059b5e4f Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 12 Dec 2022 12:01:44 +0100 Subject: [PATCH 12/23] fix(orientation): add date on time slot --- .../mediation-hours-selection.component.scss | 1 + .../mediation-hours-selection.component.ts | 31 ++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) 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 0411e111c..25425d7e9 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 0f9e648bb..272e064f7 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); -- GitLab From 01ca2bfb86d1b3fb59fdd290f42991140d16174e Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 12 Dec 2022 16:20:45 +0100 Subject: [PATCH 13/23] fix: backward for wifi --- .../form-view/structure-form/structure-form.component.html | 1 + .../structure-wifi/structure-wifi.component.html | 4 +++- .../structure-wifi/structure-wifi.component.ts | 6 ++++++ src/app/utils/formUtils.ts | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) 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 6fbba87db..847438c3c 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-wifi/structure-wifi.component.html b/src/app/form/form-view/structure-form/structure-wifi/structure-wifi.component.html index e576b7862..a7ebe790f 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 @@ -12,7 +12,9 @@ </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 7ecde8dc6..088132a11 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/utils/formUtils.ts b/src/app/utils/formUtils.ts index 97cb7c613..ecec60dc6 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), }); -- GitLab From dba4bb31449e7b5d267495b6ce4f4e3b4f51bcbf Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Mon, 12 Dec 2022 16:07:01 +0100 Subject: [PATCH 14/23] fix display for small screens + structure list --- src/app/form/form-view/form-view.component.scss | 8 -------- .../information-step/information-step.component.scss | 1 - .../profile-structure-choice.component.scss | 1 + .../structure-web-and-social-network.component.scss | 3 --- .../structure-type-picker.component.scss | 3 --- .../training-type-picker.component.scss | 3 --- src/styles.scss | 8 ++++++++ 7 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/app/form/form-view/form-view.component.scss b/src/app/form/form-view/form-view.component.scss index 119f921df..60a6d2831 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/global-components/information-step/information-step.component.scss b/src/app/form/form-view/global-components/information-step/information-step.component.scss index b52cb8280..249d23a3d 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/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 77a2378d5..6d50a12d1 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/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 bf18ddaa7..0310b8aac 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/shared/components/structure-type-picker/structure-type-picker.component.scss b/src/app/shared/components/structure-type-picker/structure-type-picker.component.scss index 9c488917a..923fb9d09 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 { 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 577cef943..a85177b17 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/styles.scss b/src/styles.scss index 1392301f1..548f930e2 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 { -- GitLab From 2dfcc304d053bbca2b62083886bc9e94b732a362 Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Mon, 12 Dec 2022 16:42:32 +0100 Subject: [PATCH 15/23] fix login design --- .../progress-bar/progress-bar.component.ts | 1 - src/app/login/login.component.scss | 11 +++++------ src/app/reset-password/reset-password.component.scss | 7 +------ .../password-form/password-form.component.scss | 5 ----- 4 files changed, 6 insertions(+), 18 deletions(-) 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 a7ad96e43..7b2862691 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/login/login.component.scss b/src/app/login/login.component.scss index a9f367453..4283e56ed 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/reset-password/reset-password.component.scss b/src/app/reset-password/reset-password.component.scss index cc2549e55..70621e99a 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/shared/components/password-form/password-form.component.scss b/src/app/shared/components/password-form/password-form.component.scss index dd8fd1356..c8a7fa3c4 100644 --- a/src/app/shared/components/password-form/password-form.component.scss +++ b/src/app/shared/components/password-form/password-form.component.scss @@ -26,11 +26,6 @@ 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; -- GitLab From ec0873bd602a9fd623b4b4c7740dd91de47e4b3e Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Mon, 12 Dec 2022 17:01:15 +0100 Subject: [PATCH 16/23] improve title size on orientation fiche --- .../mediation-recap/mediation-recap.component.html | 2 +- .../mediation-recap/mediation-recap.component.scss | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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 8abe05c6a..7c4de0e0e 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 6f8ad9fd2..d502aad04 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; + } } } } -- GitLab From 77d45eb9549c1aee459e56aa9bd1ce3a6ec2eca8 Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Mon, 12 Dec 2022 17:21:36 +0100 Subject: [PATCH 17/23] save structure orientator state --- .../structure-orientator.component.html | 4 ++-- .../structure-orientator.component.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) 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 abfd6a2d1..5e8599dbe 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,7 @@ <div *ngFor="let structure of structuresLinked" (click)="select(structure)" - [class]="structure === selected ? 'item-selected structure-item' : 'structure-item'" + [class]="structure.structureName === selected?.structureName ? 'item-selected structure-item' : 'structure-item'" > <div class="item-frame"> <div class="name">{{ structure.structureName }}</div> @@ -12,7 +12,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 44e1a7cf0..04f0e01c6 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; -- GitLab From 87d2e3d4eb0da7863991d661f0ac5615a41205e3 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Tue, 13 Dec 2022 09:48:01 +0100 Subject: [PATCH 18/23] fix(orientation): go back --- .../base-skills-choice.component.ts | 6 +- .../base-skills/base-skills.component.ts | 2 +- .../equipment-access-choice.component.ts | 6 +- .../equipment-access.component.html | 2 +- .../equipment-access.component.ts | 6 +- .../equipment-buy-type.component.ts | 6 +- .../equipment-buy.component.html | 2 +- .../equipment-buy/equipment-buy.component.ts | 6 +- .../onlineDemarch-form.component.html | 10 --- .../onlineDemarch-form.component.ts | 8 +- .../orientation-form-view.component.html | 4 +- .../orientation-form-view.component.ts | 87 +++++++++++++------ 12 files changed, 93 insertions(+), 52 deletions(-) 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 f95cef021..86b728d06 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 7f979e960..5f8cb744a 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 65f8eb265..ebd54d299 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 686b87fc2..684e8543a 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 b6001e66c..c45a83319 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 d3ab43eb2..c1a617264 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 d3388c86f..c59e5db73 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 8117db660..ee8388a47 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/online-demarch/onlineDemarch-form.component.html b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html index e182623a3..9d0ba6415 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 @@ -71,16 +71,6 @@ </ng-container> <!-- ONLINE MEDIATION FORM --> <ng-container *ngIf="currentType === onlineDemarcheTypeEnum.onlineMediation"> - <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 6211a791e..58efb5276 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 1374af209..f10eff85a 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 43725bd6a..a04df105e 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.currentType = OnlineDemarche.meetings; 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.mediationBeneciaryInfo; 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 = []; -- GitLab From ba650845d63d47906f618c984eb31caa50343253 Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Tue, 13 Dec 2022 10:25:49 +0100 Subject: [PATCH 19/23] fix structure form validation --- .../profile-structure-choice.component.ts | 1 + 1 file changed, 1 insertion(+) 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 bf3ca1daf..673af8d56 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 { -- GitLab From 8bc3d5e2ebc4c4c3c14aea826b9fe4c0672df539 Mon Sep 17 00:00:00 2001 From: gcarron <gcarron@grandlyon.com> Date: Tue, 13 Dec 2022 10:49:43 +0100 Subject: [PATCH 20/23] fix sonar + add exit page --- src/app/form/form-view/form-view.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index dba0b7268..b68828603 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -526,13 +526,14 @@ export class FormViewComponent implements OnInit, AfterViewInit { structureFormStep.noStructure, structureFormStep.structureCreationFinishedInfo, structureFormStep.mailSentInfo, + structureFormStep.StructureInfoUnknown, ]; case formType.profile: return [profileFormStep.profileJobSelection]; case formType.personaloffer: return [personalOfferFormStep.personalOfferFinishedInfo]; default: - []; + return []; } } -- GitLab From 552cde5e82e32668bb74cd15765b385906aba6f5 Mon Sep 17 00:00:00 2001 From: Bastien DUMONT <bdumont@grandlyon.com> Date: Tue, 13 Dec 2022 12:56:23 +0000 Subject: [PATCH 21/23] Apply 3 suggestion(s) to 1 file(s) --- .../components/password-form/password-form.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 3a29d4ade..f598a9b41 100644 --- a/src/app/shared/components/password-form/password-form.component.ts +++ b/src/app/shared/components/password-form/password-form.component.ts @@ -131,7 +131,7 @@ export class PasswordFormComponent implements OnInit { this.passwordError = false; }, error: () => { - this.notificationService.showError('Echec de la réinitialisation de votre mot de passe', ''); + this.notificationService.showError('Echec de la réinitialisation de votre mot de passe'); this.passwordError = true; }, complete: () => { @@ -141,10 +141,10 @@ export class PasswordFormComponent implements OnInit { } else { 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.', ''); + 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', ''); + this.notificationService.showError('Echec de la réinitialisation de votre mot de passe'); }, complete: () => { this.router.navigate(['']); -- GitLab From de93db5fcef9d2773f704ca44360cfe641dc1c7f Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Tue, 13 Dec 2022 13:59:31 +0100 Subject: [PATCH 22/23] fix: typos and cas class usage --- .../profile-employer-selection.component.html | 2 +- .../structure-orientator.component.html | 3 ++- src/app/profile/edit/edit.component.html | 2 +- src/app/profile/edit/edit.component.ts | 12 ++++++------ 4 files changed, 10 insertions(+), 9 deletions(-) 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 d4c0f045c..9e42d84a9 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>Quel est votre employeue ?</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/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 5e8599dbe..790553ab6 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.structureName === selected?.structureName ? '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> diff --git a/src/app/profile/edit/edit.component.html b/src/app/profile/edit/edit.component.html index 08226e02f..74e5e0438 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 *ngIf="isEditing()" [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 23f1ce628..3f243acba 100644 --- a/src/app/profile/edit/edit.component.ts +++ b/src/app/profile/edit/edit.component.ts @@ -1,17 +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 * as _ from 'lodash'; +import { ProfileService } from '../services/profile.service'; enum tabsEnum { details, @@ -133,7 +133,7 @@ export class EditComponent implements OnInit { this.userProfile = { ...this.initialUserProfile }; } - public isEditing(): boolean { + public profileChanged(): boolean { return !_.isEqual(this.userProfile, this.initialUserProfile); } @@ -157,7 +157,7 @@ export class EditComponent implements OnInit { public isPageValid(): boolean { if (this.currentTab === tabsEnum.details) { - return this.isEditing() && 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; -- GitLab From 9ea26ed0458b4899a68479481904bb964a2fb3e0 Mon Sep 17 00:00:00 2001 From: Bastien DUMONT <bdumont@grandlyon.com> Date: Wed, 14 Dec 2022 10:32:18 +0100 Subject: [PATCH 23/23] fix color issue on safari --- .../progress-bar/progress-bar.component.scss | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 cac88f4da..21ab5a5a4 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,8 +23,12 @@ width: 100%; height: 6px; border-radius: 7px; - user-select: none; - -webkit-user-select: none; + + &[value] { + // fix color issue on safari + appearance: none; + } + &::-webkit-progress-bar { background-color: $grey-6; border-radius: 7px; -- GitLab