diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 8ccaba5fc7a2c28232b0ff8513a15724420c6065..34e9906b3b48219860203b553cf3f24060bfbd2c 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,6 +1,4 @@ import { Component, OnInit } from '@angular/core'; -import { Observable } from 'rxjs'; -import { mergeMap } from 'rxjs/operators'; const { DateTime } = require('luxon'); import * as _ from 'lodash'; @@ -98,7 +96,7 @@ export class HomeComponent implements OnInit { * @param value string */ private isLocationRequest(value: string): boolean { - const regex = /^\d+\s[A-z]+\s[A-z]+/g; + const regex = /^\d+\s[A-z]+\s[A-z]+/g; //NOSONAR if (value.match(regex)) { return true; } diff --git a/src/app/map/components/map.component.ts b/src/app/map/components/map.component.ts index 348453ad2846d2c579581d7c2dda656303af4628..52e310348b69b4c92738ec5fa01a931fc8487675 100644 --- a/src/app/map/components/map.component.ts +++ b/src/app/map/components/map.component.ts @@ -8,23 +8,8 @@ import { SimpleChanges, ViewChild, } from '@angular/core'; -import { - latLng, - MapOptions, - tileLayer, - Map, - CRS, - TileLayer, - LatLngBounds, - latLngBounds, - Marker, - layerGroup, - polyline, -} from 'leaflet'; -import { Observable } from 'rxjs'; -import { mergeMap } from 'rxjs/operators'; +import { latLng, MapOptions, tileLayer, Map, CRS, TileLayer, LatLngBounds, latLngBounds, layerGroup } from 'leaflet'; import { Structure } from '../../models/structure.model'; -import { GeoJson } from '../models/geojson.model'; import { GeojsonService } from '../../services/geojson.service'; import { MapService } from '../services/map.service'; import { NgxLeafletLocateComponent } from '@runette/ngx-leaflet-locate'; diff --git a/src/app/map/services/map.service.spec.ts b/src/app/map/services/map.service.spec.ts index eb3b55054360a7cfcab7375d35bb9e02d4e9a277..ca4b202d0b46c786fe7e90b1b554daa0b793689e 100644 --- a/src/app/map/services/map.service.spec.ts +++ b/src/app/map/services/map.service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from '@angular/core/testing'; -import { Map } from 'leaflet'; import { MapService } from './map.service'; diff --git a/src/app/services/geojson.service.spec.ts b/src/app/services/geojson.service.spec.ts index 71045a64d867491b1fe53f051ffd73cb0159749d..8610cc4fef2ba41f175c85e6f88e6dbfb5b9ec92 100644 --- a/src/app/services/geojson.service.spec.ts +++ b/src/app/services/geojson.service.spec.ts @@ -1,5 +1,4 @@ import { TestBed } from '@angular/core/testing'; -import { Address } from '../models/address.model'; import { GeojsonService } from './geojson.service'; import { HttpClientModule } from '@angular/common/http'; diff --git a/src/app/services/geojson.service.ts b/src/app/services/geojson.service.ts index 5f15ae6d84f1e101b7def155dde13eb0b2035609..b48ce0da4b6dd0a1d46bc8557607893691bb2003 100644 --- a/src/app/services/geojson.service.ts +++ b/src/app/services/geojson.service.ts @@ -1,8 +1,7 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Address } from '../models/address.model'; import { GeoJson } from '../map/models/geojson.model'; import * as _ from 'lodash'; diff --git a/src/app/services/structure-list.service.spec.ts b/src/app/services/structure-list.service.spec.ts index 5a1b05cc44b9160457a6d3b5b0744cac775d9f14..fa4b0f4eb574066e2a7d22e038db56f7501bb35d 100644 --- a/src/app/services/structure-list.service.spec.ts +++ b/src/app/services/structure-list.service.spec.ts @@ -1,5 +1,5 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { inject, TestBed } from '@angular/core/testing'; +import { TestBed } from '@angular/core/testing'; import { Day } from '../models/day.model'; import { Structure } from '../models/structure.model'; import { Time } from '../models/time.model'; 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 ed7ddbcf3ccf49734257b16655e47f6f2c6fa062..874d23679a152895a06448b72f3301cbe5a069ac 100644 --- a/src/app/shared/components/logo-card/logo-card.component.ts +++ b/src/app/shared/components/logo-card/logo-card.component.ts @@ -19,11 +19,10 @@ export class LogoCardComponent implements OnInit { // Get the custom or default name from a demarche. public getName(demarche: string): string { - switch (demarche) { - case Demarches.caf: - return 'Caf'; - default: - return demarche; + if (demarche === Demarches.caf) { + return 'Caf'; + } else { + return demarche; } } public getLogoKey(demarche: string): string { diff --git a/src/app/structure-list/components/search/search.component.spec.ts b/src/app/structure-list/components/search/search.component.spec.ts index be7013937a1b0b5882c840ca2ed33e1ad60e5dcf..8753300fe133e848c6f2912822770d1a2f0075d3 100644 --- a/src/app/structure-list/components/search/search.component.spec.ts +++ b/src/app/structure-list/components/search/search.component.spec.ts @@ -104,7 +104,7 @@ describe('SearchComponent', () => { const checkedModules: Module[] = [{ id: evt.target.value, text: categ, count: 0 }]; component.checkedModulesFilter = checkedModules; component.numericPassCheck(evt, categ); - const expectArray: Module[] = [new Module(evt.target.value, categ)]; + new Module(evt.target.value, categ); expect(component.checkedModulesFilter.length).toEqual(0); expect(component.numberMoreFiltersChecked).toEqual(0); }); diff --git a/src/app/structure-list/components/search/search.component.ts b/src/app/structure-list/components/search/search.component.ts index 485ad2e503cab01c9cd8508436730fd35464ad98..5d3aa934eea5271b3ef0d71fc8605214d30fb746 100644 --- a/src/app/structure-list/components/search/search.component.ts +++ b/src/app/structure-list/components/search/search.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, OnInit, Output, Type } from '@angular/core'; +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; import { forkJoin } from 'rxjs'; import { GeoJson } from '../../../map/models/geojson.model'; diff --git a/src/app/structure-list/structure-list.component.spec.ts b/src/app/structure-list/structure-list.component.spec.ts index bffca76c343bfe1350d9115679918fe1ddb9107e..86f83cd7549aef89f9815a859567ed73a9dc7747 100644 --- a/src/app/structure-list/structure-list.component.spec.ts +++ b/src/app/structure-list/structure-list.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { StyleUtils } from '@angular/flex-layout'; import { OpeningDay } from '../models/openingDay.model'; import { Structure } from '../models/structure.model'; import { Filter } from './models/filter.model'; diff --git a/src/app/structure-list/structure-list.component.ts b/src/app/structure-list/structure-list.component.ts index 19a694e2cddba8665d265c05d845226a6ffcba20..fedd27acfa4334b060e851cd845ac01683c21052 100644 --- a/src/app/structure-list/structure-list.component.ts +++ b/src/app/structure-list/structure-list.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, OnInit, Output, OnChanges, SimpleChanges } from '@angular/core'; +import { Component, EventEmitter, Input, Output, OnChanges, SimpleChanges } from '@angular/core'; import { Filter } from './models/filter.model'; import { Structure } from '../models/structure.model'; import { GeoJson } from '../map/models/geojson.model'; @@ -64,8 +64,6 @@ export class StructureListComponent implements OnChanges { } public onScrollDown(event): void { - if (event.target.offsetHeight + event.target.scrollTop >= event.target.scrollHeight - 100) { - } if (event.target.offsetHeight + event.target.scrollTop >= event.target.scrollHeight - 50) { this.loadMoreStructures(); } diff --git a/src/test.ts b/src/test.ts index 50193eb0f283fa7064c483c2d85a07c2190cceb5..f5a348084b3c5ba735033fa51a4e3c90391e1bc7 100644 --- a/src/test.ts +++ b/src/test.ts @@ -2,24 +2,22 @@ import 'zone.js/dist/zone-testing'; import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; +import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; declare const require: { - context(path: string, deep?: boolean, filter?: RegExp): { + context( + path: string, + deep?: boolean, + filter?: RegExp + ): { keys(): string[]; <T>(id: string): T; }; }; // First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); +getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. -context.keys().map(context); +context.keys().map(context); //NOSONAR