Loading admin/website-angular/src/app/@shared/carrier/carrier-mutation/carrier-mutation.component.ts +13 −2 Original line number Diff line number Diff line import { Component, ViewChild, EventEmitter } from '@angular/core'; import { Component, ViewChild, EventEmitter, AfterViewInit } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { ToasterService } from 'angular2-toaster'; Loading @@ -16,7 +21,7 @@ import { TranslateService } from '@ngx-translate/core'; templateUrl: './carrier-mutation.component.html', styleUrls: ['./carrier-mutation.component.scss'] }) export class CarrierMutationComponent { export class CarrierMutationComponent implements AfterViewInit { @ViewChild('basicInfoForm', { static: false }) basicInfoForm: BasicInfoFormComponent; Loading Loading @@ -66,6 +71,12 @@ export class CarrierMutationComponent { return this._translate(this.BUTTON_PREV); } ngAfterViewInit(): void { if (this.locationForm) { this.locationForm.setDefaultCoords(); } } onGeometrySend( geometry: | google.maps.places.PlaceGeometry Loading admin/website-angular/src/app/@shared/forms/location/location-form.component.ts +11 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import { pick, isEmpty } from 'lodash'; import { ToasterService } from 'angular2-toaster'; import { countries } from '@modules/server.common/data/abbreviation-to-country'; import { environment } from 'environment'; @Component({ selector: 'ea-location-form', Loading Loading @@ -206,6 +207,16 @@ export class LocationFormComponent implements AfterViewInit { this.showCoordinates = !this.showCoordinates; } setDefaultCoords() { const lat = environment.DEFAULT_LATITUDE; const lng = environment.DEFAULT_LONGITUDE; if (lat && lng) { this.coordinates.setValue([lat, lng]); this.onCoordinatesChanged(); } } private _applyFormattedAddress(address: string) { if (this.searchElement) { this.searchElement.nativeElement.value = address; Loading admin/website-angular/src/app/@shared/warehouse/warehouse-mutation/warehouse-mutation.component.ts +4 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ export class WarehouseMutationComponent implements AfterViewInit { elementRef['style']['zIndex'] = 10000; } }, 2000); if (this.locationForm) { this.locationForm.setDefaultCoords(); } } onCoordinatesChanges(coords: number[]) { Loading Loading
admin/website-angular/src/app/@shared/carrier/carrier-mutation/carrier-mutation.component.ts +13 −2 Original line number Diff line number Diff line import { Component, ViewChild, EventEmitter } from '@angular/core'; import { Component, ViewChild, EventEmitter, AfterViewInit } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { ToasterService } from 'angular2-toaster'; Loading @@ -16,7 +21,7 @@ import { TranslateService } from '@ngx-translate/core'; templateUrl: './carrier-mutation.component.html', styleUrls: ['./carrier-mutation.component.scss'] }) export class CarrierMutationComponent { export class CarrierMutationComponent implements AfterViewInit { @ViewChild('basicInfoForm', { static: false }) basicInfoForm: BasicInfoFormComponent; Loading Loading @@ -66,6 +71,12 @@ export class CarrierMutationComponent { return this._translate(this.BUTTON_PREV); } ngAfterViewInit(): void { if (this.locationForm) { this.locationForm.setDefaultCoords(); } } onGeometrySend( geometry: | google.maps.places.PlaceGeometry Loading
admin/website-angular/src/app/@shared/forms/location/location-form.component.ts +11 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import { pick, isEmpty } from 'lodash'; import { ToasterService } from 'angular2-toaster'; import { countries } from '@modules/server.common/data/abbreviation-to-country'; import { environment } from 'environment'; @Component({ selector: 'ea-location-form', Loading Loading @@ -206,6 +207,16 @@ export class LocationFormComponent implements AfterViewInit { this.showCoordinates = !this.showCoordinates; } setDefaultCoords() { const lat = environment.DEFAULT_LATITUDE; const lng = environment.DEFAULT_LONGITUDE; if (lat && lng) { this.coordinates.setValue([lat, lng]); this.onCoordinatesChanged(); } } private _applyFormattedAddress(address: string) { if (this.searchElement) { this.searchElement.nativeElement.value = address; Loading
admin/website-angular/src/app/@shared/warehouse/warehouse-mutation/warehouse-mutation.component.ts +4 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ export class WarehouseMutationComponent implements AfterViewInit { elementRef['style']['zIndex'] = 10000; } }, 2000); if (this.locationForm) { this.locationForm.setDefaultCoords(); } } onCoordinatesChanges(coords: number[]) { Loading