diff --git a/src/app/admin/components/manage-employers/manage-employers.component.html b/src/app/admin/components/manage-employers/manage-employers.component.html index acdcc7b103f0a619dae2dba9d7d529f5546ae753..823f405ba3f39dcf6ed7adc747b0ef2b7af84321 100644 --- a/src/app/admin/components/manage-employers/manage-employers.component.html +++ b/src/app/admin/components/manage-employers/manage-employers.component.html @@ -9,7 +9,7 @@ </div> <div class="adminLayout"> - <h3 *ngIf="unvalidatedEmployers" class="title">Employeurs non validées ({{ unvalidatedEmployers.length }})</h3> + <h3 *ngIf="unvalidatedEmployers" class="title">Employeurs non validés ({{ unvalidatedEmployers.length }})</h3> <ag-grid-angular *ngIf="unvalidatedEmployers" class="ag-theme-alpine user-table" @@ -24,7 +24,7 @@ > </ag-grid-angular> - <h3 *ngIf="validatedEmployers" class="title">Employeurs validées ({{ validatedEmployers.length }})</h3> + <h3 *ngIf="validatedEmployers" class="title">Employeurs validés ({{ validatedEmployers.length }})</h3> <ag-grid-angular *ngIf="validatedEmployers" class="ag-theme-alpine user-table" diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1e510d4de01e0fe08c392981239c983472aac3fd..4d33f39f3c7ffce2fe6ddcc370fe465cd1058da3 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -14,7 +14,6 @@ import { ResetEmailComponent } from './reset-email/reset-email.component'; import { ResetPasswordComponent } from './reset-password/reset-password.component'; import { StructureResolver } from './resolvers/structure.resolver'; import { PasswordFormComponent } from './shared/components'; -import { StructureListPrintComponent } from './shared/components/structure-list-print/structure-list-print.component'; import { StructureDetailsComponent } from './structure-list/components/structure-details/structure-details.component'; import { StructureListSearchPrintComponent } from './structure-list/components/structure-list-search-print/structure-list-search-print.component'; import { StructureListComponent } from './structure-list/structure-list.component'; @@ -39,17 +38,10 @@ const routes: Routes = [ { path: 'print', outlet: 'print', - children: [{ path: 'structure', component: StructureDetailsComponent }, footerOutletRoute], - }, - { - path: 'print', - outlet: 'print', - children: [{ path: 'structures', component: StructureListPrintComponent }, footerOutletRoute], - }, - { - path: 'print', - outlet: 'print', - children: [{ path: 'structures-search', component: StructureListSearchPrintComponent }, footerOutletRoute], + children: [ + { path: 'structure', component: StructureDetailsComponent }, + { path: 'structures-search', component: StructureListSearchPrintComponent }, + ], }, { path: 'acteurs', diff --git a/src/app/app.component.html b/src/app/app.component.html index 500e14908479aecd275ec8a835e7f412af821c67..88b82cf7c5ea54bbada9e995a06ce3a7ef5f887f 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -7,8 +7,8 @@ <ng-container *ngIf="!loading"> <router-outlet name="left-pane"></router-outlet> <router-outlet></router-outlet> - <router-outlet name="print"></router-outlet> </ng-container> <router-outlet *ngIf="!loading" name="footer"></router-outlet> </div> </div> +<router-outlet name="print"></router-outlet> diff --git a/src/app/profile/edit/edit.component.ts b/src/app/profile/edit/edit.component.ts index 7a15626dd5ed895acc9a683617219df364dd9647..759539d9cc59e4ac11249bef445a51b8e6505e44 100644 --- a/src/app/profile/edit/edit.component.ts +++ b/src/app/profile/edit/edit.component.ts @@ -2,6 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http'; import { ChangeDetectorRef, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import * as _ from 'lodash'; +import { lastValueFrom } from 'rxjs'; import { catchError, first } from 'rxjs/operators'; import { Employer } from '../../models/employer.model'; import { Job } from '../../models/job.model'; @@ -231,17 +232,14 @@ export class EditComponent implements OnInit { }); } - public confirmEmployer(): void { + public async confirmEmployer(): Promise<void> { if (this.newJob) { this.selectedJob = this.newJob; - this.profileService.createJob(this.selectedJob).subscribe((res) => { - console.log(res); - }); + + const resJob = await lastValueFrom(this.profileService.createJob(this.selectedJob)); } if (this.isNewEmployer) { - this.profileService.createEmployer(this.selectedEmployer).subscribe((res) => { - console.log(res); - }); + const resEmployer = await lastValueFrom(this.profileService.createEmployer(this.selectedEmployer)); } this.profileService diff --git a/src/app/profile/services/profile.service.ts b/src/app/profile/services/profile.service.ts index 9ef8564810d6741d7c1955a38506eb0e59f9d53f..da35a4a9caf46de0df37a68ab90a2987311a64db 100644 --- a/src/app/profile/services/profile.service.ts +++ b/src/app/profile/services/profile.service.ts @@ -75,11 +75,14 @@ export class ProfileService { }); } public changeEmail(newEmail: string, oldEmail: string): Observable<User> { - return this.http.post<any>(`${this.baseUrl}/change-email`, { newEmail, oldEmail }); + return this.http.post<any>(`${this.baseUrl}/change-email`, { + newEmail: newEmail.toLowerCase(), + oldEmail: oldEmail.toLowerCase(), + }); } public isEmailAlreadyUsed(newMail: string): Observable<boolean> { - return this.http.post<boolean>(`${this.baseUrl}/verify-exist-user`, { newMail }); + return this.http.post<boolean>(`${this.baseUrl}/verify-exist-user`, { newMail: newMail.toLowerCase() }); } public getAllDataConsentPendingStructures(): Observable<Structure[]> { diff --git a/src/app/profile/structure-add-member-modal/structure-add-member-modal.component.ts b/src/app/profile/structure-add-member-modal/structure-add-member-modal.component.ts index 1992f4fc3f79b0a50bf61874a0a893bad66954a9..96b184a4931bf1d05d06f67739822ed6b8ad236a 100644 --- a/src/app/profile/structure-add-member-modal/structure-add-member-modal.component.ts +++ b/src/app/profile/structure-add-member-modal/structure-add-member-modal.component.ts @@ -47,7 +47,7 @@ export class StructureAddMemberModalComponent implements OnInit { return; } const user = new TempUser(); - user.email = this.fAddAccount.email.value; + user.email = this.fAddAccount.email.value.toLowerCase(); this.structureService.addOwnerToStructure(user, this.structure.structure._id).subscribe( (res) => { if ((res as TempUser).email) { diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 093bfe6da41196b6d4748356a9e84975cde5f099..bdcd462fbced8208a6da8a9dc028116c6d6c5657 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -68,7 +68,7 @@ export class AuthService { } public login(email: string, password: string): Observable<any> { - return this.http.post<UserAuth>('api/auth/login', { email, password }).pipe( + return this.http.post<UserAuth>('api/auth/login', { email: email.toLowerCase(), password }).pipe( map((user) => { // store user details and jwt token in local storage to keep user logged in between page refreshes localStorage.setItem('user', JSON.stringify(user)); @@ -79,7 +79,7 @@ export class AuthService { } public resendEmail(email: string, password: string): Observable<User> { - return this.http.post<User>(`api/auth/resendEmail`, { email, password }); + return this.http.post<User>(`api/auth/resendEmail`, { email: email.toLowerCase(), password }); } public verifyUser(userId: string, token: string): Observable<User> { @@ -89,7 +89,7 @@ export class AuthService { } public resetPassword(email: string): Observable<any> { - return this.http.post(`api/users/reset-password`, { email }); + return this.http.post(`api/users/reset-password`, { email: email.toLowerCase() }); } public resetPasswordApply(token: string, password: string): Observable<any> { diff --git a/src/app/services/newsletter.service.ts b/src/app/services/newsletter.service.ts index 4635c10d871562b4d920512bb3f33daec575da3c..0f2c17569b004495c4a20f4bd043803ccae06818 100644 --- a/src/app/services/newsletter.service.ts +++ b/src/app/services/newsletter.service.ts @@ -10,14 +10,14 @@ export class NewsletterService { constructor(private http: HttpClient) {} public subscribe(email: string): Observable<NewsletterSubscription> { - return this.http.post<NewsletterSubscription>('/api/newsletter/subscribe', { email }); + return this.http.post<NewsletterSubscription>('/api/newsletter/subscribe', { email: email.toLowerCase() }); } public unsubscribe(email: string): Observable<NewsletterSubscription> { - return this.http.post<NewsletterSubscription>('/api/newsletter/unsubscribe', { email }); + return this.http.post<NewsletterSubscription>('/api/newsletter/unsubscribe', { email: email.toLowerCase() }); } public find(email: string): Observable<NewsletterSubscription> { - return this.http.get<NewsletterSubscription>(`/api/newsletter?email=${email}`); + return this.http.get<NewsletterSubscription>(`/api/newsletter?email=${email.toLowerCase()}`); } } diff --git a/src/app/shared/components/index.ts b/src/app/shared/components/index.ts index 04859a36d103ab1d361bd3222aedc225f70ce855..0f5424ca2ce3b0ea06da294569862f8788f3e073 100644 --- a/src/app/shared/components/index.ts +++ b/src/app/shared/components/index.ts @@ -14,7 +14,6 @@ import { ModalJoinConfirmationComponent } from './modal-join-confirmation/modal- import { PasswordFormComponent } from './password-form/password-form.component'; import { RadioFormComponent } from './radio-form/radio-form.component'; import { StructureDetailPrintComponent } from './structure-detail-print/structure-detail-print.component'; -import { StructureListPrintComponent } from './structure-list-print/structure-list-print.component'; import { StructurePmrComponent } from './structure-pmr/structure-pmr.component'; import { StructureTypePickerComponent } from './structure-type-picker/structure-type-picker.component'; import { SvgIconComponent } from './svg-icon/svg-icon.component'; @@ -46,7 +45,6 @@ export { ProgressBarComponent, RadioFormComponent, StructureDetailPrintComponent, - StructureListPrintComponent, StructurePmrComponent, StructurePublicTargetComponent, StructureTypePickerComponent, @@ -78,7 +76,6 @@ export const SharedComponents = [ RadioFormComponent, RadioV3Component, StructureDetailPrintComponent, - StructureListPrintComponent, StructurePmrComponent, StructurePublicTargetComponent, StructureTypePickerComponent, diff --git a/src/app/shared/components/structure-list-print/structure-list-print.component.html b/src/app/shared/components/structure-list-print/structure-list-print.component.html deleted file mode 100644 index abd158620f28461099fde12211e5bdb85f7493af..0000000000000000000000000000000000000000 --- a/src/app/shared/components/structure-list-print/structure-list-print.component.html +++ /dev/null @@ -1,7 +0,0 @@ -<div *ngFor="let structure of structures" class="multi-print"> - <app-structure-detail-print [structure]="structure" /> -</div> -<div class="loader" aria-busy="true"> - <img class="loader-gif" src="/assets/gif/loader_circle_grey.gif" alt /> - <p>Liste en cours d'impression</p> -</div> diff --git a/src/app/shared/components/structure-list-print/structure-list-print.component.scss b/src/app/shared/components/structure-list-print/structure-list-print.component.scss deleted file mode 100644 index 3eb08118daa42ef0a87712ab37c388bfea8b554e..0000000000000000000000000000000000000000 --- a/src/app/shared/components/structure-list-print/structure-list-print.component.scss +++ /dev/null @@ -1,49 +0,0 @@ -@import 'color'; -@import 'layout'; - -.list-to-print { - height: 600px; - overflow-x: hidden; - overflow-y: auto; -} - -.multi-print { - :host { - background-color: $grey-9; - } - ::ng-deep { - .structure-details-container { - margin-top: 2%; - margin-left: 34%; - height: 98%; - } - .print-header { - height: 100%; - } - } - page-break-after: always; - print-color-adjust: exact; - width: 50%; - margin-left: 23%; - margin-right: 23%; - padding-left: 2%; - padding-right: 2%; - height: 100%; - overflow-x: hidden; - background-color: $white; - @media screen { - display: none; - } - @media print { - width: 100%; - margin: 0; - padding: 0; - } -} - -.loader { - height: calc(100vh - #{$header-height} - #{$footer-height}); - @media print { - display: none; - } -} diff --git a/src/app/shared/components/structure-list-print/structure-list-print.component.ts b/src/app/shared/components/structure-list-print/structure-list-print.component.ts deleted file mode 100644 index b03bfe5e67c4fa0c459299d5c4d77370cc7201b8..0000000000000000000000000000000000000000 --- a/src/app/shared/components/structure-list-print/structure-list-print.component.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { Structure } from '../../../models/structure.model'; - -@Component({ - selector: 'app-structure-list-print', - templateUrl: './structure-list-print.component.html', - styleUrls: ['./structure-list-print.component.scss'], -}) -export class StructureListPrintComponent { - @Input() public structures: Structure[]; -} diff --git a/src/styles.scss b/src/styles.scss index bdf5eb8f920a7a17241aaa4f02e798e519587af4..6f462e3649355b0da840d60c4fc931df6426bd47 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -331,7 +331,7 @@ button { @media print { body, html, - .forPrint { + .root { height: auto; } @@ -608,17 +608,3 @@ button { white-space: nowrap !important; border: 0 !important; } - -// Status colors -.error { - color: $info-error; -} -.success { - color: $info-success; -} -.info { - color: $info-blue; -} -.warning { - color: $info-warning; -}