diff --git a/karma.conf.js b/karma.conf.js index e0feaefc765ff9a114afb9babfec76106204a163..5cee0fd8e3f3150dc8c6a2886e2dbb9556dad15b 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -30,7 +30,7 @@ module.exports = function (config) { target: 'https://passerelle.formulaireextranet.grandlyon.com', changeOrigin: true, }, - '/geocoding/photon/api': { + '/geocoding/photon-bal/api': { target: 'https://download.data.grandlyon.com', changeOrigin: true, }, diff --git a/nginx/dev.conf b/nginx/dev.conf index 7609f90b77cf963d3628bce01b5bf1e677de4952..38db77c594a2a93b823addfc1721b26b37a59764 100644 --- a/nginx/dev.conf +++ b/nginx/dev.conf @@ -52,8 +52,8 @@ server { proxy_pass https://passerelle.formulaireextranet.grandlyon.com/base-adresse/base-adresse-nationale/streets; } - location /geocoding/photon/api { - proxy_pass https://download.data.grandlyon.com/geocoding/photon/api; + location /geocoding/photon-bal/api { + proxy_pass https://download.data.grandlyon.com/geocoding/photon-bal/api; } location /reverse { diff --git a/proxy.conf.json b/proxy.conf.json index 0feeb012e6b5ff251979cd7b736db83dd9b2ab88..09812b4a54ece1f43066d1fd7ae5f71675623c58 100644 --- a/proxy.conf.json +++ b/proxy.conf.json @@ -27,7 +27,7 @@ "logLevel": "info" }, "/geocoding/photon-bal/api": { - "target": "https://download.data.grandlyon.com/geocoding/photon-bal/api", + "target": "https://download.data.grandlyon.com", "secure": false, "changeOrigin": true, "logLevel": "info" diff --git a/src/app/admin/components/panel/panel.component.ts b/src/app/admin/components/panel/panel.component.ts index 15052b62182f573d25a8040ea6a2d9543e5f9822..8168d693ff69afe60a5cc27e3b4fe21b64b05d5f 100644 --- a/src/app/admin/components/panel/panel.component.ts +++ b/src/app/admin/components/panel/panel.component.ts @@ -15,7 +15,6 @@ export class PanelComponent implements OnInit { ngOnInit(): void { this.selectedFeature = this.features.pendingStructures; - console.log(this.ghostLink); } public changeActiveFeature(newFeature: AdminPannelEnum) { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 960ec879326b557d58d9bf86c4cec2792149f238..eaf45b743245eb5ffd8b5f67941b7460b6b2a422 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -13,7 +13,7 @@ import { SharedModule } from './shared/shared.module'; import { MapModule } from './map/map.module'; import { StructureListComponent } from './structure-list/structure-list.component'; import { CardComponent } from './structure-list/components/card/card.component'; -import { SearchComponent } from './structure-list/components/search/search.component'; +import { StructureListSearchComponent } from './structure-list/components/structure-list-search/structure-list-search.component'; import { StructureDetailsComponent } from './structure-list/components/structure-details/structure-details.component'; import { StructureOpeningStatusComponent } from './structure-list/components/structure-opening-status/structure-opening-status.component'; import { ModalFilterComponent } from './structure-list/components/modal-filter/modal-filter.component'; @@ -43,7 +43,7 @@ import { NewsletterSubscriptionComponent } from './newsletter-subscription/newsl CartoComponent, StructureListComponent, CardComponent, - SearchComponent, + StructureListSearchComponent, ModalFilterComponent, StructureDetailsComponent, StructureOpeningStatusComponent, diff --git a/src/app/map/components/map.component.ts b/src/app/map/components/map.component.ts index 1b80b2b5693af01ab724d8606e8fc3c732f0c692..61da5c52dc51eb9ba70bfc45bb193abfc5555f72 100644 --- a/src/app/map/components/map.component.ts +++ b/src/app/map/components/map.component.ts @@ -53,8 +53,11 @@ export class MapComponent implements OnChanges { ngOnChanges(changes: SimpleChanges): void { if (changes.searchedValue && !changes.searchedValue.firstChange) { - if (changes.searchedValue.currentValue) this.processTownCoordinate(changes.searchedValue.currentValue); - else this.map.setView(this.mapOptions.center, this.mapOptions.zoom); + if (changes.searchedValue.currentValue) { + this.processTownCoordinate(changes.searchedValue.currentValue); + } else { + this.map.setView(this.mapOptions.center, this.mapOptions.zoom); + } } if (changes.isMapPhone) { if (this.isMapPhone) { @@ -99,8 +102,10 @@ export class MapComponent implements OnChanges { public processTownCoordinate(queryString: string): void { this.geoJsonService.getTownshipCoord(queryString).subscribe( (townData) => { - const bounds = new L.LatLngBounds(townData.map((dataArray) => dataArray.reverse())); - this.map.fitBounds(bounds); + if (townData.length > 0) { + const bounds = new L.LatLngBounds(townData.map((dataArray) => dataArray.reverse())); + this.map.fitBounds(bounds); + } }, (err) => { this.map.setView(this.mapOptions.center, this.mapOptions.zoom); diff --git a/src/app/structure-list/components/search/search.component.html b/src/app/structure-list/components/structure-list-search/structure-list-search.component.html similarity index 100% rename from src/app/structure-list/components/search/search.component.html rename to src/app/structure-list/components/structure-list-search/structure-list-search.component.html diff --git a/src/app/structure-list/components/search/search.component.scss b/src/app/structure-list/components/structure-list-search/structure-list-search.component.scss similarity index 100% rename from src/app/structure-list/components/search/search.component.scss rename to src/app/structure-list/components/structure-list-search/structure-list-search.component.scss diff --git a/src/app/structure-list/components/search/search.component.spec.ts b/src/app/structure-list/components/structure-list-search/structure-list-search.component.spec.ts similarity index 93% rename from src/app/structure-list/components/search/search.component.spec.ts rename to src/app/structure-list/components/structure-list-search/structure-list-search.component.spec.ts index 8753300fe133e848c6f2912822770d1a2f0075d3..2e96293cdb8557a20e044d53a88b37f89d6f34f6 100644 --- a/src/app/structure-list/components/search/search.component.spec.ts +++ b/src/app/structure-list/components/structure-list-search/structure-list-search.component.spec.ts @@ -2,26 +2,26 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { Filter } from '../../models/filter.model'; import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { SearchComponent } from './search.component'; +import { StructureListSearchComponent } from './structure-list-search.component'; import { Module } from '../../models/module.model'; import { TypeModal } from '../../enum/typeModal.enum'; import { GeojsonService } from '../../../services/geojson.service'; import { GeoJson } from '../../../map/models/geojson.model'; import { of } from 'rxjs'; -describe('SearchComponent', () => { - let component: SearchComponent; - let fixture: ComponentFixture<SearchComponent>; +describe('StructureListSearchComponent', () => { + let component: StructureListSearchComponent; + let fixture: ComponentFixture<StructureListSearchComponent>; let geoService: GeojsonService; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [SearchComponent], + declarations: [StructureListSearchComponent], imports: [HttpClientTestingModule, ReactiveFormsModule], }).compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(SearchComponent); + fixture = TestBed.createComponent(StructureListSearchComponent); component = fixture.componentInstance; fixture.detectChanges(); geoService = TestBed.inject(GeojsonService); diff --git a/src/app/structure-list/components/search/search.component.ts b/src/app/structure-list/components/structure-list-search/structure-list-search.component.ts similarity index 97% rename from src/app/structure-list/components/search/search.component.ts rename to src/app/structure-list/components/structure-list-search/structure-list-search.component.ts index b743d1cfd0760270fd73e7ebdd4e2ad279559ed3..ad0bdcf73ec395751bff0c3c55e5fe169aaa745b 100644 --- a/src/app/structure-list/components/search/search.component.ts +++ b/src/app/structure-list/components/structure-list-search/structure-list-search.component.ts @@ -12,10 +12,10 @@ import { SearchService } from '../../services/search.service'; @Component({ selector: 'app-structure-list-search', - templateUrl: './search.component.html', - styleUrls: ['./search.component.scss'], + templateUrl: './structure-list-search.component.html', + styleUrls: ['./structure-list-search.component.scss'], }) -export class SearchComponent implements OnInit, OnChanges { +export class StructureListSearchComponent implements OnInit, OnChanges { @Output() searchEvent = new EventEmitter(); // Show/hide form createStructure