diff --git a/src/app/admin/components/claim-structure/claim-structure.component.ts b/src/app/admin/components/claim-structure/claim-structure.component.ts index af6820d83f049eebb44cf6c1d482e079e9772fd4..df55627f47dbd523eb35e4e49c660455dfaf1e50 100644 --- a/src/app/admin/components/claim-structure/claim-structure.component.ts +++ b/src/app/admin/components/claim-structure/claim-structure.component.ts @@ -36,7 +36,7 @@ export class ClaimStructureComponent implements OnInit { }); } - public claimedStructure(event: boolean): void { + public claimedStructure(_event: boolean): void { this.isClaimedStructure = !this.isClaimedStructure; } } diff --git a/src/app/admin/components/manage-employers/manage-employers.component.ts b/src/app/admin/components/manage-employers/manage-employers.component.ts index 1d2d78d875d5f2bb6647345e136c4b697dda4672..347f33871f85f17f163f2348e0b89ce724c235d9 100644 --- a/src/app/admin/components/manage-employers/manage-employers.component.ts +++ b/src/app/admin/components/manage-employers/manage-employers.component.ts @@ -18,7 +18,7 @@ export class ManageEmployersComponent implements OnInit { public validatedEmployers: Employer[] = []; public unvalidatedEmployers: Employer[] = []; public deleteModalOpenned = false; - public validatedEmployersName: String[] = []; + public validatedEmployersName: string[] = []; public mergeEmployerModalOpenned = false; public employerToDelete: Employer = null; public mergeOpe: any = { @@ -209,8 +209,8 @@ export class ManageEmployersComponent implements OnInit { } } - public validateEmployer(employerId: string, context?): void { - this.adminService.validateEmployer(employerId).subscribe((data) => { + public validateEmployer(employerId: string, _context?): void { + this.adminService.validateEmployer(employerId).subscribe((_data) => { this.findValidatedEmployers(); this.findUnvalidatedEmployers(); }); diff --git a/src/app/admin/components/manage-jobs/manage-jobs.component.ts b/src/app/admin/components/manage-jobs/manage-jobs.component.ts index d17baf4e2424ee120561328a283e096c9535e61b..59b86510d02f9afbe2e2959f983866c5b744a352 100644 --- a/src/app/admin/components/manage-jobs/manage-jobs.component.ts +++ b/src/app/admin/components/manage-jobs/manage-jobs.component.ts @@ -20,7 +20,7 @@ export class ManageJobsComponent implements OnInit { public validatedJobs: Job[] = []; public unvalidatedJobs: Job[] = []; public deleteModalOpenned = false; - public validatedJobsName: String[] = []; + public validatedJobsName: string[] = []; public mergeJobModalOpenned = false; public jobToDelete: Job = null; public mergeOpe: any = { @@ -246,8 +246,8 @@ export class ManageJobsComponent implements OnInit { } } - public validateJob(jobId: string, context?): void { - this.adminService.validateJob(jobId).subscribe((data) => { + public validateJob(jobId: string, _context?): void { + this.adminService.validateJob(jobId).subscribe((_data) => { this.findValidatedJobs(); this.findUnvalidatedJobs(); }); diff --git a/src/app/admin/components/manage-users/manage-users.component.ts b/src/app/admin/components/manage-users/manage-users.component.ts index 37eb41805ff0f79a40f37f2534e88bde548f0d85..fc999f9d02942773f8c6571aa60856ec320fbd2c 100644 --- a/src/app/admin/components/manage-users/manage-users.component.ts +++ b/src/app/admin/components/manage-users/manage-users.component.ts @@ -18,9 +18,9 @@ export class ManageUsersComponent { public attachedUsers: User[] = []; public unAttachedUsers: User[] = []; public unVerifiedUsers: User[] = []; - public validatedJobsName: String[] = []; + public validatedJobsName: string[] = []; public validatedJobs: Job[] = []; - public validatedEmployersName: String[] = []; + public validatedEmployersName: string[] = []; public validatedEmployers: Employer[] = []; public deleteModalOpenned = false; public editJobModalOpenned = false; diff --git a/src/app/admin/components/newsletter-users/newsletter-users.component.ts b/src/app/admin/components/newsletter-users/newsletter-users.component.ts index 2b8675165164070d1dfe52af192c0f194cbc58ed..73b142f9e8e41a5f6fb12c11336abd022c0091bf 100644 --- a/src/app/admin/components/newsletter-users/newsletter-users.component.ts +++ b/src/app/admin/components/newsletter-users/newsletter-users.component.ts @@ -34,7 +34,7 @@ export class NewsletterUsersComponent { public unsubscribeEmail(email: string, shouldUnsubscribe: boolean): void { this.toggleUnsubscribeModal(email); if (shouldUnsubscribe) { - this.adminService.unsubscribeEmail(email).subscribe((data) => { + this.adminService.unsubscribeEmail(email).subscribe((_data) => { this.subscriptions = this.subscriptions.filter((obj) => obj.email !== email); this.subscriptionsCount = this.subscriptions.length; }); diff --git a/src/app/carto/carto.component.spec.ts b/src/app/carto/carto.component.spec.ts index c97da2f6abaf651f4fef425db98a6f82494c56f7..1a7b809cf0794e9ef46421bb5de608501eb23b17 100644 --- a/src/app/carto/carto.component.spec.ts +++ b/src/app/carto/carto.component.spec.ts @@ -33,7 +33,7 @@ describe('HomeComponent', () => { it('getAddress(): should getAddress', () => { spyOn(navigator.geolocation, 'getCurrentPosition').and.callFake(() => { - const position = { + return { coords: { accuracy: 1490, altitude: null, @@ -44,7 +44,6 @@ describe('HomeComponent', () => { speed: null, }, }; - return position; }); component.getLocation(); expect(navigator.geolocation.getCurrentPosition).toHaveBeenCalled(); diff --git a/src/app/config/http-interceptor.ts b/src/app/config/http-interceptor.ts index d4911dbb91d27b0ae93f214a1c4d8d52a9d4b2a2..35d410b718b064a3182f5754c5c42533c7c7c34a 100644 --- a/src/app/config/http-interceptor.ts +++ b/src/app/config/http-interceptor.ts @@ -1,10 +1,6 @@ import { Observable } from 'rxjs'; import { Injectable } from '@angular/core'; -import { HttpInterceptor } from '@angular/common/http'; -import { HttpRequest } from '@angular/common/http'; -import { HttpHandler } from '@angular/common/http'; -import { HttpEvent } from '@angular/common/http'; -import { HttpHeaders } from '@angular/common/http'; +import { HttpInterceptor, HttpHandler, HttpEvent, HttpRequest, HttpHeaders } from '@angular/common/http'; import { AuthService } from '../services/auth.service'; @Injectable() diff --git a/src/app/form/form-view/account-form/account-newsletter/account-newsletter.component.ts b/src/app/form/form-view/account-form/account-newsletter/account-newsletter.component.ts index 6b61b924560f63a91875411ca1cee785dae8cbbf..25befd1534a050eb912209f4b70dee99b7e30d2d 100644 --- a/src/app/form/form-view/account-form/account-newsletter/account-newsletter.component.ts +++ b/src/app/form/form-view/account-form/account-newsletter/account-newsletter.component.ts @@ -10,7 +10,7 @@ export class AccountNewsletterComponent { @Input() accountForm: FormGroup; @Input() profile: User; @Output() acceptNewsletter = new EventEmitter<any>(); - public userAcceptNewsletter: Boolean = false; + public userAcceptNewsletter: boolean = false; public acceptReceiveNewsletter(accepts: boolean) { this.acceptNewsletter.emit(accepts); diff --git a/src/app/form/form-view/form-view-routing.module.ts b/src/app/form/form-view/form-view-routing.module.ts index 9768d97d64e2879b27039566abb757bf7f1b831a..12765adf267195f0a77c1444cc14d0452162ad25 100644 --- a/src/app/form/form-view/form-view-routing.module.ts +++ b/src/app/form/form-view/form-view-routing.module.ts @@ -1,6 +1,5 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { AdminGuard } from '../../guards/admin.guard'; import { AuthGuard } from '../../guards/auth.guard'; import { RoleGuard } from '../../guards/role.guard'; import { StructureResolver } from '../../resolvers/structure.resolver'; diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index a2d8a24c741a1fba1881623dae3deefd27839ae3..89a08f75f16ec30b49091d0dd96d39fa1077643d 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -19,6 +19,8 @@ import { personalOfferFormStep } from './personal-offer-form/personalOfferFormSt import { profileFormStep } from './profile-form/profileFormStep.enum'; import { structureFormStep } from './structure-form/structureFormStep.enum'; +type stepType = accountFormStep | profileFormStep | structureFormStep | personalOfferFormStep; + @Component({ selector: 'app-form-view', templateUrl: './form-view.component.html', @@ -27,7 +29,7 @@ import { structureFormStep } from './structure-form/structureFormStep.enum'; export class FormViewComponent implements OnInit { public routeParam: string; public formType = formType; - public currentPage: accountFormStep | profileFormStep | structureFormStep | personalOfferFormStep; + public currentPage: stepType; public currentFormType: formType; public currentForm: FormGroup; public formUtils = new formUtils(); @@ -261,10 +263,7 @@ export class FormViewComponent implements OnInit { }); } - public async endForm(type: { - formType: formType; - formStep?: accountFormStep | profileFormStep | structureFormStep | personalOfferFormStep; - }): Promise<void> { + public async endForm(type: { formType: formType; formStep?: stepType }): Promise<void> { switch (type.formType) { case formType.account: break; @@ -308,17 +307,17 @@ export class FormViewComponent implements OnInit { forkJoin({ employer: this.profileService.createEmployer(this.profileForm.get('employer').value).pipe( map((res) => res), - catchError((e) => of(this.profileForm.get('employer').value)) + catchError((_e) => of(this.profileForm.get('employer').value)) ), job: this.profileService.createJob(this.profileForm.get('job').value).pipe( map((res) => res), - catchError((e) => of(this.profileForm.get('job').value)) + catchError((_e) => of(this.profileForm.get('job').value)) ), profile: this.profileService .updateProfile(this.profileForm.get('employer').value.name, this.profileForm.get('job').value.name) .pipe( map((res) => res), - catchError((e) => of()) + catchError((_e) => of()) ), }).subscribe(() => { this.router.navigateByUrl('form/structure'); @@ -345,7 +344,7 @@ export class FormViewComponent implements OnInit { } }); } - public setCurrentStep(step: accountFormStep | profileFormStep | structureFormStep | personalOfferFormStep): void { + public setCurrentStep(step: stepType): void { //THIS PROBABLY CREATES CONSOLE ERRORS NG100 only in dev mode, please refer to https://angular.io/errors/NG0100 for more info this.currentPage = step; } diff --git a/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.scss b/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.ts b/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.ts index 5524913cbf02814955ade9be1854fd0a70afc7e4..e28e3863fcd3e2a6a56df6d22cac60dc5e4ed229 100644 --- a/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.ts +++ b/src/app/form/form-view/personal-offer-form/personal-offer-training-type/personal-offer-training-type.component.ts @@ -5,7 +5,6 @@ import { Category } from '@gouvfr-anct/mediation-numerique'; @Component({ selector: 'app-personal-offer-training-type', templateUrl: './personal-offer-training-type.component.html', - styleUrls: ['./personal-offer-training-type.component.scss'], }) export class PersonalOfferTrainingTypeComponent { @Input() structureName: string; diff --git a/src/app/form/form-view/structure-form/structure-consent/structure-consent.component.ts b/src/app/form/form-view/structure-form/structure-consent/structure-consent.component.ts index fc907cb7a75e05d83e1fb1d1a54afe74543f386f..a4f3a52638139f6111b32577d36ab06a8a957666 100644 --- a/src/app/form/form-view/structure-form/structure-consent/structure-consent.component.ts +++ b/src/app/form/form-view/structure-form/structure-consent/structure-consent.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; import { FormGroup } from '@angular/forms'; @Component({ diff --git a/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.ts b/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.ts index f4d379d64e8eddb6a09a3a6b57a1b7e024db7230..448a906a8804197c7df22874cdb851b3252772cc 100644 --- a/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.ts +++ b/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { AbstractControl, FormGroup } from '@angular/forms'; @Component({ diff --git a/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.scss b/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.scss deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.ts b/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.ts index 471f94bfc6fbfb84fe245353235759bc0381d16d..0ef99b6d818a656dda9e888e15007a81995984a6 100644 --- a/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.ts +++ b/src/app/form/form-view/structure-form/structure-name-and-address/structure-name-and-address.component.ts @@ -5,7 +5,6 @@ import { Address } from '@gouvfr-anct/mediation-numerique'; @Component({ selector: 'app-structure-name-and-address', templateUrl: './structure-name-and-address.component.html', - styleUrls: ['./structure-name-and-address.component.scss'], }) export class StructureNameAndAddressComponent implements OnInit { @Input() structureForm: FormGroup; diff --git a/src/app/form/orientation-form/component/structure-detail-print/structure-detail-print.component.ts b/src/app/form/orientation-form/component/structure-detail-print/structure-detail-print.component.ts index 0e60189757db316155b517f9d79235305eafef4a..f8d1c4b8083fa9231ef4f39d8e43bcfb06574937 100644 --- a/src/app/form/orientation-form/component/structure-detail-print/structure-detail-print.component.ts +++ b/src/app/form/orientation-form/component/structure-detail-print/structure-detail-print.component.ts @@ -28,7 +28,7 @@ export class StructureDetailPrintComponent implements OnInit { } } - public keepOriginalOrder = (a, b) => a.key; + public keepOriginalOrder = (a, _b) => a.key; public userIsLoggedIn(): boolean { return this.authService.isLoggedIn(); diff --git a/src/app/form/orientation-form/orientation-form.component.scss b/src/app/form/orientation-form/orientation-form.component.scss index 03d833c9915b5e7b12020edde1a84b273653e104..153e469457feb5f9150dff0a459cc61a7c6c40de 100644 --- a/src/app/form/orientation-form/orientation-form.component.scss +++ b/src/app/form/orientation-form/orientation-form.component.scss @@ -26,10 +26,22 @@ h4 { } .content { + height: 100% !important; + background-color: $white; + margin-left: 25%; + margin-right: 24%; padding: 0 16px; display: block; overflow-y: auto; - height: auto; + + @media #{$tablet} { + width: 100%; + height: 100vh !important; + margin: 0; + border-bottom: $grey-4 solid 1px; + min-height: unset; + } + h3 { @include lato-bold-26; @@ -64,6 +76,16 @@ h4 { color: $grey-1; @include lato-regular-14; margin: 7px 0 0 0; + &.notRequired { + font-size: 14px; + margin-top: 0px; + font-style: italic; + color: $primary-color; + + &.lg { + font-size: 17px; + } + } } .textareaBlock { @media #{$tablet} { @@ -279,34 +301,6 @@ img { background-color: $grey-8; } -.content { - height: 100% !important; - background-color: $white; - margin-left: 25%; - margin-right: 24%; - - @media #{$tablet} { - width: 100%; - height: 100vh !important; - margin: 0; - border-bottom: $grey-4 solid 1px; - min-height: unset; - } - - p { - &.notRequired { - font-size: 14px; - margin-top: 0px; - font-style: italic; - color: $primary-color; - - &.lg { - font-size: 17px; - } - } - } -} - .content-container { width: 97%; float: right; diff --git a/src/app/form/orientation-form/orientation-form.component.ts b/src/app/form/orientation-form/orientation-form.component.ts index 2c9349de83b100bb2cc16ef8ac952d015b4d5622..0284bb8a7aeeb7e9e24c470d50207b6a2f44652d 100644 --- a/src/app/form/orientation-form/orientation-form.component.ts +++ b/src/app/form/orientation-form/orientation-form.component.ts @@ -441,7 +441,7 @@ export class OrientationFormComponent implements OnInit { this.orientationForm.value.address.postcode ? this.orientationForm.value.address.postcode : '69000' ) .subscribe((res) => { - this.structureService.getStructures(this.filters.filter((elem) => elem.checked == true)).subscribe((data) => { + this.structureService.getStructures(this.filters.filter((elem) => elem.checked)).subscribe((data) => { data.map((structure) => { structure.distance = parseInt( this.geoJsonService.getDistance( @@ -480,7 +480,7 @@ export class OrientationFormComponent implements OnInit { this.setValidationsForm(); } - public isInPrintList(id: String): boolean { + public isInPrintList(id: string): boolean { return this.structuresToPrint.findIndex((elem) => elem._id == id) > -1 ? true : false; } diff --git a/src/app/guards/admin.guard.ts b/src/app/guards/admin.guard.ts index 2f00de8acf3a7b0df675339ec50ed435224921d3..7d07a4d86835cc0dea2da81315511288e49516af 100644 --- a/src/app/guards/admin.guard.ts +++ b/src/app/guards/admin.guard.ts @@ -9,7 +9,7 @@ import { ProfileService } from '../profile/services/profile.service'; export class AdminGuard implements CanActivate { constructor(private authService: AuthService, private router: Router, private profileService: ProfileService) {} - canActivate(route: ActivatedRouteSnapshot): UrlTree | boolean { + canActivate(_route: ActivatedRouteSnapshot): UrlTree | boolean { if (this.authService.isLoggedIn() && this.profileService.isAdmin()) { return true; } diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts index 9c7fb4ab22cf6e45fb1c0853fbfb49b0623bffe5..d77c855f4e47f0521278d9784d572cc34b47d580 100644 --- a/src/app/guards/auth.guard.ts +++ b/src/app/guards/auth.guard.ts @@ -8,7 +8,7 @@ import { AuthService } from '../services/auth.service'; export class AuthGuard implements CanActivate { constructor(private authService: AuthService, private router: Router) {} - canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { + canActivate(_next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { if (this.authService.isLoggedIn()) { return true; } diff --git a/src/app/guards/deactivate.guard.ts b/src/app/guards/deactivate.guard.ts index 3f86e0502a0d593451026a2c161db5ed69c1ad1d..e9f65a50aa83049329bbd7587b9c3ed4d795b249 100644 --- a/src/app/guards/deactivate.guard.ts +++ b/src/app/guards/deactivate.guard.ts @@ -13,8 +13,6 @@ export interface IDeactivateComponent { export class DeactivateGuard implements CanDeactivate<Object> { component: Object; - constructor() {} - canDeactivate(component: IDeactivateComponent): Observable<boolean> | Promise<boolean> | boolean { return component.canExit(); } diff --git a/src/app/guards/login.guard.ts b/src/app/guards/login.guard.ts index 6f0c2d37b6936b0d4dea8990cd3a30226a520df1..b2d8e5b7f7ef49917feab39e237f9ef49968c5cb 100644 --- a/src/app/guards/login.guard.ts +++ b/src/app/guards/login.guard.ts @@ -8,7 +8,7 @@ import { AuthService } from '../services/auth.service'; export class LoginGuard implements CanActivate { constructor(private authService: AuthService, private router: Router) {} - canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { + canActivate(_next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { if (this.authService.isLoggedIn()) { return true; } diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts index fe45be0c6a54013862a33d04954a03451c11999d..34c597c03db5312c4225e6ab42b5c33215919838 100644 --- a/src/app/header/header.component.ts +++ b/src/app/header/header.component.ts @@ -1,5 +1,5 @@ import { animate, animateChild, query, style, transition, trigger } from '@angular/animations'; -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { NavigationEnd, Router } from '@angular/router'; import { Structure } from '@gouvfr-anct/mediation-numerique'; import { ButtonType } from '@gouvfr-anct/mediation-numerique/shared'; @@ -30,7 +30,7 @@ import { AuthService } from '../services/auth.service'; ]), ], }) -export class HeaderComponent implements OnInit { +export class HeaderComponent { public showMenu = false; public showProfileMenu = false; public currentRoute = ''; @@ -48,7 +48,6 @@ export class HeaderComponent implements OnInit { } }); } - ngOnInit(): void {} public openMenu(): void { this.showMenu = true; diff --git a/src/app/login/login.component.scss b/src/app/login/login.component.scss index 3141ec4b0583001c244a7cca8a18494943d046b7..be30b5475943a42605a8474592e5920f9ac92675 100644 --- a/src/app/login/login.component.scss +++ b/src/app/login/login.component.scss @@ -2,7 +2,6 @@ @import '../../assets/scss/breakpoint'; @import '../../assets/scss/layout'; @import '../../assets/scss/typography'; -@import '../../assets/scss/layout'; .content { display: flex; diff --git a/src/app/page/page.component.ts b/src/app/page/page.component.ts index 3915c15239f24e27a6e3d895ab053e4245e03db2..7a4f4f7b52b6c80955d8d39b7c9b7db98ecd0317 100644 --- a/src/app/page/page.component.ts +++ b/src/app/page/page.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { DomSanitizer } from '@angular/platform-browser'; -import { Meta } from '@angular/platform-browser'; +import { DomSanitizer, Meta } from '@angular/platform-browser'; import packageJson from '../../../package.json'; import { Page } from './models/page.model'; import { PageService } from './services/page.service'; diff --git a/src/app/post/components/post-header/post-header.component.ts b/src/app/post/components/post-header/post-header.component.ts index 5d1d62907212bb7b01514f4814a6889433c0057d..bf08e25e03924a1fc7ebc7ec6ab8cd918ac10055 100644 --- a/src/app/post/components/post-header/post-header.component.ts +++ b/src/app/post/components/post-header/post-header.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { Tag } from '../../models/tag.model'; import { TagWithMeta } from '../../models/tagWithMeta.model'; import { TypeModalNews } from '../../enum/typeModalNews.enum'; diff --git a/src/app/post/components/post-list/post-list.component.ts b/src/app/post/components/post-list/post-list.component.ts index 92293f28b31afc05debb5764bcaa1dbd32948ae6..c33a0988bd2606f8f31ff661664207373ab98b8b 100644 --- a/src/app/post/components/post-list/post-list.component.ts +++ b/src/app/post/components/post-list/post-list.component.ts @@ -64,7 +64,7 @@ export class PostListComponent implements OnInit { */ public fillArticles(news: PostWithMeta): void { this.setNews(news); - news.meta.pagination.pages > news.meta.pagination.page ? (this.isLastPage = false) : (this.isLastPage = true); + this.isLastPage = news.meta.pagination.page >= news.meta.pagination.pages; const headLineTag = this.allPosts.filter((post: Post) => post.tags.some((tag) => tag && tag.slug === TagEnum.aLaUne) ); diff --git a/src/app/post/components/post-modal-filters/post-modal-filters.component.ts b/src/app/post/components/post-modal-filters/post-modal-filters.component.ts index 6624c5d0e7e2c021ac81839cb620a7ee9ae9f00c..5b1b375046bf3647fd3ccaa18ecbc2ea75c6f134 100644 --- a/src/app/post/components/post-modal-filters/post-modal-filters.component.ts +++ b/src/app/post/components/post-modal-filters/post-modal-filters.component.ts @@ -1,7 +1,6 @@ -import { Component, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core'; +import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { Tag } from '../../models/tag.model'; import { TypeModalNews } from '../../enum/typeModalNews.enum'; -import { OnChanges } from '@angular/core'; @Component({ selector: 'app-post-modal-filters', @@ -17,8 +16,6 @@ export class PostModalFiltersComponent implements OnInit, OnChanges { @Input() public inputCheckedTags: Tag[] = []; public checkedTags: Tag[] = []; - constructor() {} - ngOnChanges(changes: SimpleChanges): void { if (changes.inputCheckedTags) { this.checkedTags = this.inputCheckedTags; diff --git a/src/app/post/news.component.ts b/src/app/post/news.component.ts index 36d43437627eafb6ec5e8e45bbb51b530b89eb99..018a0b44048b9aab5e22423cc7977764e20de0b0 100644 --- a/src/app/post/news.component.ts +++ b/src/app/post/news.component.ts @@ -1,15 +1,12 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { Tag } from './models/tag.model'; @Component({ selector: 'app-news', templateUrl: './news.component.html', }) -export class NewsComponent implements OnInit { +export class NewsComponent { public filters: Tag[]; - constructor() {} - - ngOnInit(): void {} public setFilters(tags: Tag[]): void { this.filters = tags; diff --git a/src/app/reset-email/reset-email.component.ts b/src/app/reset-email/reset-email.component.ts index 705a40ecca9024dc27d8e556177891b385c81116..4e4cd3c05bf920099b98ee38c0b6faa26da2eae8 100644 --- a/src/app/reset-email/reset-email.component.ts +++ b/src/app/reset-email/reset-email.component.ts @@ -29,7 +29,7 @@ export class ResetEmailComponent implements OnInit { this.changeSuccess = true; this.authService.logout(); }, - (err) => { + (_err) => { this.changeSuccess = false; } ); diff --git a/src/app/reset-password/reset-password.component.ts b/src/app/reset-password/reset-password.component.ts index 9349fed69cf1398c7c9d88c40fbda2cd135e04d6..98b7c3b8bef601fe0edc75fc9fe403aac2932cb9 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, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; +import { Router } from '@angular/router'; import { ButtonType } from '@gouvfr-anct/mediation-numerique/shared'; import { AuthService } from '../services/auth.service'; import { NotificationService } from '../services/notification.service'; diff --git a/src/app/services/contact.service.ts b/src/app/services/contact.service.ts index 8fb8cd52356b225cd3e7f564951281890600f50a..3ad5bd86f0ce78a3d27aba298e578d57415567b9 100644 --- a/src/app/services/contact.service.ts +++ b/src/app/services/contact.service.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable, of } from 'rxjs'; +import { Observable } from 'rxjs'; import { ContactMessage } from '../models/contact-message.model'; @Injectable({ diff --git a/src/app/services/newsletter.service.ts b/src/app/services/newsletter.service.ts index d90bd565d283f5939eb974d53c11e218697066e7..f4a0131ffa43bab37adbf373c5e0082535386439 100644 --- a/src/app/services/newsletter.service.ts +++ b/src/app/services/newsletter.service.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable, of } from 'rxjs'; +import { Observable } from 'rxjs'; @Injectable({ providedIn: 'root', diff --git a/src/app/services/notification.service.ts b/src/app/services/notification.service.ts index 5b491fd86b82cb6e9a6905a8565f6adf543de8a7..0dee1c7b4b5d942c7d95a94f6e2d93df6fe38401 100644 --- a/src/app/services/notification.service.ts +++ b/src/app/services/notification.service.ts @@ -31,7 +31,7 @@ export class NotificationService { } ); - update.onTap.subscribe((action) => { + update.onTap.subscribe((_action) => { window.location.reload(); }); } diff --git a/src/app/shared/components/checkbox-form/checkbox-form.component.ts b/src/app/shared/components/checkbox-form/checkbox-form.component.ts index 690178ae4965eae0f7960ca10d161196a03826cb..81f6046b0905a1e696b0ccfcb10b21c8ac565918 100644 --- a/src/app/shared/components/checkbox-form/checkbox-form.component.ts +++ b/src/app/shared/components/checkbox-form/checkbox-form.component.ts @@ -1,19 +1,16 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; @Component({ selector: 'app-checkbox-form', templateUrl: './checkbox-form.component.html', styleUrls: ['./checkbox-form.component.scss'], }) -export class CheckboxFormComponent implements OnInit { +export class CheckboxFormComponent { @Input() public isChecked = false; @Input() public text: string; @Input() public iconSvg: string; @Input() public iconType: string; @Output() checkEvent: EventEmitter<boolean> = new EventEmitter<boolean>(); - constructor() {} - - ngOnInit(): void {} public clicked(): void { this.isChecked = !this.isChecked; diff --git a/src/app/shared/components/create-account-form/create-account-form.component.ts b/src/app/shared/components/create-account-form/create-account-form.component.ts index 5d3d73098cdf13521befe8fa2945d1eb748519bf..7e5af34f88a24a7438e14c6bfb2970c82aeab53d 100644 --- a/src/app/shared/components/create-account-form/create-account-form.component.ts +++ b/src/app/shared/components/create-account-form/create-account-form.component.ts @@ -9,7 +9,6 @@ import { MustMatch } from '../../validator/form'; styleUrls: ['./create-account-form.component.scss'], }) export class CreateAccountFormComponent implements OnInit { - constructor() {} public accountForm: FormGroup; public submitted: boolean = false; public isShowConfirmPassword = false; diff --git a/src/app/shared/components/data-share-consent/data-share-consent.component.ts b/src/app/shared/components/data-share-consent/data-share-consent.component.ts index 63c81a71c09b06a7637355afb4005d7cc1f7cb22..d23d53b4a9c8b10f0d9a1c7ef70560af9a7f457a 100644 --- a/src/app/shared/components/data-share-consent/data-share-consent.component.ts +++ b/src/app/shared/components/data-share-consent/data-share-consent.component.ts @@ -78,7 +78,7 @@ export class DataShareConsentComponent implements OnInit { this.submitted = true; this.loading = true; for (let structure of this.dataConsentPendingStructures) { - this.structureService.editStructure(structure).subscribe((s: Structure) => {}); + this.structureService.editStructure(structure).subscribe((_s: Structure) => {}); } this.loading = false; this.openned = false; diff --git a/src/app/shared/components/hour-picker/copy-paste/copy-paste.component.ts b/src/app/shared/components/hour-picker/copy-paste/copy-paste.component.ts index 9240f96d17dbc92a5ea6692fbc47e7330a4d312c..c978315199895063d164d361a7fbbf2a30851111 100644 --- a/src/app/shared/components/hour-picker/copy-paste/copy-paste.component.ts +++ b/src/app/shared/components/hour-picker/copy-paste/copy-paste.component.ts @@ -1,20 +1,17 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; @Component({ selector: 'app-copy-paste', templateUrl: './copy-paste.component.html', styleUrls: ['./copy-paste.component.scss'], }) -export class CopyPasteComponent implements OnInit { +export class CopyPasteComponent { @Input() copiedDayName = ''; @Input() day = null; @Output() copyEvent = new EventEmitter<any>(); @Output() cancelEvent = new EventEmitter<any>(); @Output() pasteEvent = new EventEmitter<any>(); - constructor() {} - - ngOnInit(): void {} public copy(): void { this.copyEvent.emit(this.day); diff --git a/src/app/shared/components/logo-card/logo-card.component.ts b/src/app/shared/components/logo-card/logo-card.component.ts index 718e6ba20a31597c26aa11c9bef6ec4c64df6e35..69699d655c92211f6dd54cbb8fb82cd85ec30951 100644 --- a/src/app/shared/components/logo-card/logo-card.component.ts +++ b/src/app/shared/components/logo-card/logo-card.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { Demarches } from '../../enum/demarches.enum'; import { Labels } from '../../enum/labels.enum'; @@ -7,14 +7,10 @@ import { Labels } from '../../enum/labels.enum'; templateUrl: './logo-card.component.html', styleUrls: ['./logo-card.component.scss'], }) -export class LogoCardComponent implements OnInit { +export class LogoCardComponent { @Input() public logoPath: string; @Input() public name: string; - constructor() {} - - ngOnInit(): void {} - public getName(key: string): string { if (Labels[key]) { return Labels[key]; diff --git a/src/app/shared/components/modal-options/modal-options.component.ts b/src/app/shared/components/modal-options/modal-options.component.ts index 4de502a5c414fe46cc6ebf71b77002bb53ba0276..a4a23d9e9067570ac7ece8482d36f8f6a1a4e0f1 100644 --- a/src/app/shared/components/modal-options/modal-options.component.ts +++ b/src/app/shared/components/modal-options/modal-options.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; import { FunctionTypeModalOptions } from '../../enum/functionTypeModalOptions.enum'; @Component({ @@ -6,15 +6,13 @@ import { FunctionTypeModalOptions } from '../../enum/functionTypeModalOptions.en templateUrl: './modal-options.component.html', styleUrls: ['./modal-options.component.scss'], }) -export class ModalOptionsComponent implements OnInit { +export class ModalOptionsComponent { functionType = FunctionTypeModalOptions; - constructor() {} @Input() isModalProfileOpts = false; @Input() hasOwners = true; @Input() public isEditFormView? = false; @Output() closed = new EventEmitter<number>(); - ngOnInit(): void {} public closeModal(value: number): void { this.closed.emit(value); 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 d1c4490442b3ebdd3d90f4906c0d1ebebf1b2a55..a24ca05cb06d6ec96efa94d838e17a5a0233578b 100644 --- a/src/app/shared/components/password-form/password-form.component.ts +++ b/src/app/shared/components/password-form/password-form.component.ts @@ -115,7 +115,6 @@ export class PasswordFormComponent implements OnInit { // stop here if form is invalid if (this.oldPasswordNeeded && !this.checkOldPassword(this.accountForm.value.oldPassword)) { this.passwordError = true; - return; } else if (this.oldPasswordNeeded) { // stop here if form is invalid this.passwordError = false; @@ -123,7 +122,7 @@ export class PasswordFormComponent implements OnInit { () => { this.passwordError = false; }, - (error) => { + (_error) => { this.passwordError = true; } ); diff --git a/src/app/shared/components/radio-form/radio-form.component.ts b/src/app/shared/components/radio-form/radio-form.component.ts index 503a12687759864eb495971c9d0e54b3248f7726..310137f81e87794c313f129a0503e7bac6ac1d13 100644 --- a/src/app/shared/components/radio-form/radio-form.component.ts +++ b/src/app/shared/components/radio-form/radio-form.component.ts @@ -7,8 +7,6 @@ import { Observable, Subscription } from 'rxjs'; styleUrls: ['./radio-form.component.scss'], }) export class RadioFormComponent implements OnInit { - constructor() {} - @Input() public selectedOption: boolean | string; @Input() public horizontal: boolean; @Input() public layoutGap: string; diff --git a/src/app/shared/components/structure-options-modal/structure-options-modal.component.ts b/src/app/shared/components/structure-options-modal/structure-options-modal.component.ts index 0090b3115e1232ad0b69aa6751d26880e48b876a..5b603a29393a8c6b19585e6e42c7b3c875a5b828 100644 --- a/src/app/shared/components/structure-options-modal/structure-options-modal.component.ts +++ b/src/app/shared/components/structure-options-modal/structure-options-modal.component.ts @@ -158,7 +158,7 @@ export class StructureOptionsModalComponent implements OnInit { this.closeModalOptsProfile(); this.formAddAccount.reset(); }, - (err) => { + (_err) => { this.ownerAlreadyLinked = true; } ); 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 8fea868d57f8e78d5289c65e58167eeb518efd4f..54f998d04be0ca1bd37aa0511858f297b3611efd 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 @@ -93,6 +93,9 @@ svg { user-select: none; } .collapseHeader { + height: 65px; + padding: 0 15px 0 12px; + cursor: pointer; .titleCollapse { width: 100%; @include lato-bold-14; @@ -108,11 +111,6 @@ svg { } } } - .collapseHeader { - height: 65px; - padding: 0 15px 0 12px; - cursor: pointer; - } .logo { height: 24px; width: 24px; 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 9d3339106f4d319a9efd2cba54abcc4acf567bce..e394db9f922f1176881590736fd4d71bb47fc13c 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 @@ -8,8 +8,9 @@ button { outline: none; border: none; } + .tags { - padding: 15px; + padding: 8px; width: calc(100% + 2px); margin-left: -16px; height: 100%; @@ -23,7 +24,19 @@ button { height: 40px; padding: 0 28px; cursor: pointer; + outline: none; + border: none; @include lato-bold-14; + &.selectedChoice { + background: $green-1 !important; + color: $white; + } + svg { + width: 20px; + height: 10px; + margin-right: 4px; + stroke: $grey-8; + } } } .boutonSection { @@ -96,6 +109,9 @@ button { } } .collapseHeader { + height: 65px; + padding: 0 15px 0 12px; + cursor: pointer; .titleCollapse { width: 100%; @include lato-bold-14; @@ -111,11 +127,6 @@ button { } } } - .collapseHeader { - height: 65px; - padding: 0 15px 0 12px; - cursor: pointer; - } .logo { height: 24px; width: 24px; @@ -135,29 +146,3 @@ button { } } } - -.tags { - padding: 8px; - button { - background: $grey-8; - border-radius: 20px; - margin: 4px; - max-width: 100%; - height: 40px; - padding: 0 13px; - @include lato-bold-14; - outline: none; - border: none; - cursor: pointer; - &.selectedChoice { - background: $green-1 !important; - color: $white; - } - } - svg { - width: 20px; - height: 10px; - margin-right: 4px; - stroke: $grey-8; - } -} diff --git a/src/app/shared/components/validator-form/validator-form.component.ts b/src/app/shared/components/validator-form/validator-form.component.ts index cc10fe185e67d0392ba2f46850eeeea1fc490c61..53aa3ff7f80d1979893031cfc45413b9d2a98339 100644 --- a/src/app/shared/components/validator-form/validator-form.component.ts +++ b/src/app/shared/components/validator-form/validator-form.component.ts @@ -11,7 +11,6 @@ export class ValidatorFormComponent implements OnInit { @Input() public nameControl?: string; public errorPattern = 'Champ mal renseigné'; public errorMustMatch = 'Champ non identique'; - constructor() {} ngOnInit() { if (this.nameControl == 'password') { diff --git a/src/app/shared/service/windowScroll.service.ts b/src/app/shared/service/windowScroll.service.ts index ebdf325b8451d76da2c2750878956c9ad5d15b2d..cdd0342c777988c9bf311e94a8e67238eb7b0ee5 100644 --- a/src/app/shared/service/windowScroll.service.ts +++ b/src/app/shared/service/windowScroll.service.ts @@ -8,8 +8,6 @@ export class WindowScrollService { scrollY = new BehaviorSubject(null); scrollY$ = this.scrollY.asObservable(); - constructor() {} - public updateScrollY(value: Event): void { this.scrollY.next(value); } diff --git a/src/app/structure/components/structure-details-modals/structure-details-modals.component.ts b/src/app/structure/components/structure-details-modals/structure-details-modals.component.ts index f8896330871e9ab4eb19cd5f148feb379913750e..f504eb5aab655eb1f56bf0c9989d950578ecddcb 100644 --- a/src/app/structure/components/structure-details-modals/structure-details-modals.component.ts +++ b/src/app/structure/components/structure-details-modals/structure-details-modals.component.ts @@ -62,7 +62,7 @@ export class StructureDetailsModalsComponent { public deleteStructure(shouldDelete: boolean): void { this.toggleDeleteModal(); if (shouldDelete) { - this.structureService.delete(this.structure._id).subscribe((res) => { + this.structureService.delete(this.structure._id).subscribe((_res) => { this.reload(); }); } @@ -71,8 +71,8 @@ export class StructureDetailsModalsComponent { public joinStructure(shouldClaim: boolean): void { this.toggleJoinModal(); if (shouldClaim) { - this.structureService.joinStructure(this.structure._id, this.authService.userValue.username).subscribe((res) => { - this.profileService.getProfile().then((user: User) => { + this.structureService.joinStructure(this.structure._id, this.authService.userValue.username).subscribe((_res) => { + this.profileService.getProfile().then((_user: User) => { this.claimChange.emit(true); }); });