From 4143f8a18f35928755e7840c8b29ba98e9c26c59 Mon Sep 17 00:00:00 2001 From: cbourget Date: Thu, 31 Oct 2019 12:10:47 -0400 Subject: [PATCH 01/25] style(*): use the right store method --- packages/geo/src/lib/search/search-bar/search-bar.component.ts | 2 +- .../catalog-library-tool/catalog-library-tool.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/geo/src/lib/search/search-bar/search-bar.component.ts b/packages/geo/src/lib/search/search-bar/search-bar.component.ts index 34b6cbe4ba..9fa56fad51 100644 --- a/packages/geo/src/lib/search/search-bar/search-bar.component.ts +++ b/packages/geo/src/lib/search/search-bar/search-bar.component.ts @@ -370,7 +370,7 @@ export class SearchBarComponent implements OnInit, OnDestroy { this.search.emit({ research, results }); if (this.store !== undefined) { - const newResults = this.store.entities$.value + const newResults = this.store.all() .filter(result => result.source !== research.source) .concat(results); this.store.load(newResults); diff --git a/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.component.ts b/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.component.ts index 4d6dfe5803..e210794364 100644 --- a/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.component.ts +++ b/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.component.ts @@ -40,7 +40,7 @@ export class CatalogLibraryToolComponent implements OnInit { * @internal */ ngOnInit() { - if (this.store.entities$.value.length === 0) { + if (this.store.count === 0) { this.loadCatalogs(); } } From d84be88a91f25c337234f5a60f336a1785569080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Thu, 31 Oct 2019 13:11:11 -0400 Subject: [PATCH 02/25] feat(projection): add mtm projection --- packages/geo/src/lib/map/shared/map.utils.ts | 32 +++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/packages/geo/src/lib/map/shared/map.utils.ts b/packages/geo/src/lib/map/shared/map.utils.ts index 3b568eacc3..1d276d13c4 100644 --- a/packages/geo/src/lib/map/shared/map.utils.ts +++ b/packages/geo/src/lib/map/shared/map.utils.ts @@ -35,7 +35,7 @@ export function stringToLonLat(str: string, mapProjection: string): {lonLat: [nu let directionLat: string; let decimalLat: string; let pattern: string; - let timeZone: string; + let zone: string; let radius: string; let conf: string; let lon: any; @@ -57,6 +57,9 @@ export function stringToLonLat(str: string, mapProjection: string): {lonLat: [nu const patternUtm = '(UTM)\-?(\\d{1,2})[\\s,.]*(\\d+[\\s.,]?\\d+)[\\s,.]+(\\d+[\\s.,]?\\d+)'; const utmRegex = new RegExp(`^${patternUtm}`, 'gi'); + const patternMtm = '(MTM)\-?(\\d{1,2})[\\s,.]*(\\d+[\\s.,]?\\d+)[\\s,.]+(\\d+[\\s.,]?\\d+)'; + const mtmRegex = new RegExp(`^${patternMtm}`, 'gi'); + const ddCoord = '([-+])?(\\d{1,3})[,.](\\d+)'; const patternDd = `${ddCoord}[,.]?\\s*${ddCoord}`; const ddRegex = new RegExp(`^${patternDd}`, 'g'); @@ -112,12 +115,27 @@ export function stringToLonLat(str: string, mapProjection: string): {lonLat: [nu lon = convertDMSToDD(parseFloat(degreesLon), parseFloat(minutesLon), parseFloat(secondsLon), directionLon); lat = convertDMSToDD(parseFloat(degreesLat), parseFloat(minutesLat), parseFloat(secondsLat), directionLat); - } else if (utmRegex.test(coordStr)) { - isXYCoords = true; - [, pattern, timeZone, lon, lat] = coordStr.match(patternUtm); - const utm = '+proj=' + pattern + ' +zone=' + timeZone; - const wgs84 = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'; - [lon, lat] = proj4(utm.toLocaleLowerCase(), wgs84, [parseFloat(lon), parseFloat(lat)]); + } else if (utmRegex.test(coordStr)) { + isXYCoords = true; + [, pattern, zone, lon, lat] = coordStr.match(patternUtm); + const utm = '+proj=' + pattern + ' +zone=' + zone; + const wgs84 = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'; + [lon, lat] = proj4(utm.toLocaleLowerCase(), wgs84, [parseFloat(lon), parseFloat(lat)]); + + } else if (mtmRegex.test(coordStr)) { + isXYCoords = true; + [, pattern, zone, lon, lat] = coordStr.match(patternMtm); + let lon0; + if (Number(zone) <=2) { + lon0 = -50 - Number(zone) * 3; + } else if (Number(zone) >=12) { + lon0 = -81 - (Number(zone)-12) * 3; + } else { + lon0 = -49.5 - Number(zone) * 3; + } + const mtm = `+proj=tmerc +lat_0=0 +lon_0=${lon0} +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +units=m +no_defs`; + const wgs84 = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'; + [lon, lat] = proj4(mtm, wgs84, [parseFloat(lon), parseFloat(lat)]); } else if (dmdRegex.test(coordStr)) { [, From a1fc5dec295f8d65ad4558c28196c3b3f20e87a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Thu, 31 Oct 2019 13:28:43 -0400 Subject: [PATCH 03/25] feat(naturalCompare): treat undefined as nulls --- packages/utils/src/lib/object-utils.ts | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/utils/src/lib/object-utils.ts b/packages/utils/src/lib/object-utils.ts index 4137ae0b54..cd16bd327f 100644 --- a/packages/utils/src/lib/object-utils.ts +++ b/packages/utils/src/lib/object-utils.ts @@ -107,10 +107,28 @@ export class ObjectUtils { // nullsFirst = undefined : end if direction = 'asc', first if direction = 'desc' // nullsFirst = true : always first // nullsFirst = false : always end - // *** 'undefined' values are always at the end of array despite the 'nullsFirst' option - if (a === null || a === '' || b === null || b === '') { - const nullScore = - a === b ? 0 : a === null ? 2 : b === null ? -2 : a === '' ? 1 : -1; + if ( + a === null || + a === '' || + a === undefined || + b === null || + b === '' || + b === undefined + ) { + let nullScore = + a === b + ? 0 + : a === undefined + ? 3 + : b === undefined + ? -3 + : a === null + ? 2 + : b === null + ? -2 + : a === '' + ? 1 + : -1; if (direction === 'desc') { return nullsFirst !== false ? nullScore : nullScore * -1; } From a51681aabcb35269cb9d6ca21893c8961a42a227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-=C3=89ric?= Date: Thu, 31 Oct 2019 13:30:23 -0400 Subject: [PATCH 04/25] feat(entity view): add nullsFirst option (#494) * fix(entity view): null values are properly sorted * fix(entity): undefined, null and empty string are properly sorted * fix(view): naturalCompare is fixed, no need to separate undefined and null values first --- .../lib/entity/entity-table/entity-table.component.ts | 9 ++++++++- .../common/src/lib/entity/shared/entity.interfaces.ts | 6 ++++++ packages/common/src/lib/entity/shared/view.ts | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/common/src/lib/entity/entity-table/entity-table.component.ts b/packages/common/src/lib/entity/entity-table/entity-table.component.ts index f2b9f454f3..ce326a5f60 100644 --- a/packages/common/src/lib/entity/entity-table/entity-table.component.ts +++ b/packages/common/src/lib/entity/entity-table/entity-table.component.ts @@ -76,6 +76,12 @@ export class EntityTableComponent implements OnInit, OnDestroy, OnChanges { @Input() scrollBehavior: EntityTableScrollBehavior = EntityTableScrollBehavior.Auto; + /** + * Whether nulls should be first when sorting + */ + @Input() + sortNullsFirst: boolean = false; + /** * Event emitted when an entity (row) is clicked */ @@ -196,7 +202,8 @@ export class EntityTableComponent implements OnInit, OnDestroy, OnChanges { if (direction === 'asc' || direction === 'desc') { this.store.view.sort({ valueAccessor: (entity: object) => this.getValue(entity, column), - direction + direction, + nullsFirst: this.sortNullsFirst }); } else { this.store.view.sort(undefined); diff --git a/packages/common/src/lib/entity/shared/entity.interfaces.ts b/packages/common/src/lib/entity/shared/entity.interfaces.ts index cfff5a0022..887d4b9e22 100644 --- a/packages/common/src/lib/entity/shared/entity.interfaces.ts +++ b/packages/common/src/lib/entity/shared/entity.interfaces.ts @@ -36,6 +36,12 @@ export type EntityFilterClause = (entity: E) => boolean; export interface EntitySortClause { valueAccessor: (entity: E) => string | number; direction: string; + + // If true, null and undefined values will be first + // If false, null and undefined values will be last + // If undefined, default to true and false when sorting in descending and + // ascending order, respectively + nullsFirst?: boolean; } export interface EntityJoinClause { diff --git a/packages/common/src/lib/entity/shared/view.ts b/packages/common/src/lib/entity/shared/view.ts index e371982b14..9956f01e3d 100644 --- a/packages/common/src/lib/entity/shared/view.ts +++ b/packages/common/src/lib/entity/shared/view.ts @@ -255,7 +255,7 @@ export class EntityView { clause.valueAccessor(v1), clause.valueAccessor(v2), clause.direction, - false + clause.nullsFirst ); }); } From a2334fc11c72df51d02d35aef7eb5663029e592c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9reck=20Lynch?= <50959537+drekss@users.noreply.github.com> Date: Thu, 31 Oct 2019 13:31:32 -0400 Subject: [PATCH 05/25] fix(map): geolocate buffer follow the geolocation while it's tracking (#495) --- packages/geo/src/lib/map/shared/map.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/geo/src/lib/map/shared/map.ts b/packages/geo/src/lib/map/shared/map.ts index 76797f89dd..f40ed11065 100644 --- a/packages/geo/src/lib/map/shared/map.ts +++ b/packages/geo/src/lib/map/shared/map.ts @@ -382,6 +382,7 @@ export class IgoMap { ) ) { this.overlay.dataSource.ol.removeFeature(this.geolocationFeature); + this.buffer.dataSource.ol.removeFeature(this.bufferFeature); } this.geolocationFeature = new olFeature({ geometry }); this.geolocationFeature.setId('geolocationFeature'); From a8222d1650a0e76043d8747612a5223e10050536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9reck=20Lynch?= <50959537+drekss@users.noreply.github.com> Date: Thu, 31 Oct 2019 13:35:03 -0400 Subject: [PATCH 06/25] feat(network): new ionic network service (#490) * feat(network): new network service for Ionic * Update package.json --- packages/core/src/lib/network/index.ts | 2 + .../src/lib/network/network-ionic.service.ts | 111 ++++++++++++++++++ .../src/lib/network/network.interfaces.ts | 3 + .../core/src/lib/network/network.service.ts | 57 +-------- 4 files changed, 118 insertions(+), 55 deletions(-) create mode 100644 packages/core/src/lib/network/network-ionic.service.ts create mode 100644 packages/core/src/lib/network/network.interfaces.ts diff --git a/packages/core/src/lib/network/index.ts b/packages/core/src/lib/network/index.ts index 0ec10b301a..d260d1dd62 100644 --- a/packages/core/src/lib/network/index.ts +++ b/packages/core/src/lib/network/index.ts @@ -1 +1,3 @@ export * from './network.service'; +export * from './network-ionic.service'; +export * from './network.interfaces'; diff --git a/packages/core/src/lib/network/network-ionic.service.ts b/packages/core/src/lib/network/network-ionic.service.ts new file mode 100644 index 0000000000..236f373ddf --- /dev/null +++ b/packages/core/src/lib/network/network-ionic.service.ts @@ -0,0 +1,111 @@ +import { Injectable, EventEmitter, OnDestroy, Injector } from '@angular/core'; +import { Observable, Subscription, fromEvent } from 'rxjs'; +import { debounceTime, startWith } from 'rxjs/operators'; + +import { Network } from '@ionic-native/network/ngx'; +import { Platform } from '@ionic/angular'; + +import { MessageService } from '../message/shared/message.service'; +import { LanguageService } from '../language/shared/language.service'; +import { ConnectionState } from './network.interfaces'; + +@Injectable({ + providedIn: 'root' +}) +export class NetworkIonicService implements OnDestroy { + private stateChangeEventEmitter = new EventEmitter(); + private onlineSubscription: Subscription; + private offlineSubscription: Subscription; + + private state: ConnectionState = { + connection: window.navigator.onLine + }; + + constructor( + private messageService: MessageService, + private injector: Injector, + private network: Network, + private platform: Platform + ) { + this.platform.ready().then(() => { + if (this.platform.is('cordova')) { + if (this.platform.is('android')) { + this.checkNetworkStateMobile(); + } + } else { + console.log('yoy'); + this.checkNetworkState(); + } + }); + } + + private checkNetworkState() { + this.onlineSubscription = fromEvent(window, 'online').subscribe(() => { + const translate = this.injector.get(LanguageService).translate; + const message = translate.instant('igo.core.network.online.message'); + const title = translate.instant('igo.core.network.online.title'); + this.messageService.info(message, title); + this.state.connection = true; + this.emitEvent(); + }); + + this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => { + const translate = this.injector.get(LanguageService).translate; + const message = translate.instant('igo.core.network.offline.message'); + const title = translate.instant('igo.core.network.offline.title'); + this.messageService.info(message, title); + this.state.connection = false; + this.emitEvent(); + }); + } + + private checkNetworkStateMobile() { + this.offlineSubscription = this.network.onDisconnect().subscribe(() => { + this.state.connection = false; + setTimeout(() => { + if (!this.state.connection) { + const translate = this.injector.get(LanguageService).translate; + const message = translate.instant('igo.core.network.offline.message'); + const title = translate.instant('igo.core.network.offline.title'); + this.messageService.info(message, title); + this.state.connection = false; + this.emitEvent(); + } + }, 10000); + }); + + this.onlineSubscription = this.network.onConnect().subscribe(() => { + this.state.connection = true; + setTimeout(() => { + if (this.state.connection) { + const translate = this.injector.get(LanguageService).translate; + const message = translate.instant('igo.core.network.online.message'); + const title = translate.instant('igo.core.network.online.title'); + this.messageService.info(message, title); + this.state.connection = true; + this.emitEvent(); + } + }, 10000); + }); + } + + private emitEvent() { + this.stateChangeEventEmitter.emit(this.state); + } + + ngOnDestroy(): void { + try { + this.offlineSubscription.unsubscribe(); + this.onlineSubscription.unsubscribe(); + } catch (e) {} + } + + currentState(reportState = true): Observable { + return reportState + ? this.stateChangeEventEmitter.pipe( + debounceTime(300), + startWith(this.state) + ) + : this.stateChangeEventEmitter.pipe(debounceTime(300)); + } +} diff --git a/packages/core/src/lib/network/network.interfaces.ts b/packages/core/src/lib/network/network.interfaces.ts new file mode 100644 index 0000000000..3eeb739414 --- /dev/null +++ b/packages/core/src/lib/network/network.interfaces.ts @@ -0,0 +1,3 @@ +export interface ConnectionState { + connection: boolean; +} diff --git a/packages/core/src/lib/network/network.service.ts b/packages/core/src/lib/network/network.service.ts index e3750f11a4..4ed88af71d 100644 --- a/packages/core/src/lib/network/network.service.ts +++ b/packages/core/src/lib/network/network.service.ts @@ -2,15 +2,9 @@ import { Injectable, EventEmitter, OnDestroy, Injector } from '@angular/core'; import { Observable, Subscription, fromEvent } from 'rxjs'; import { debounceTime, startWith } from 'rxjs/operators'; -// import { Network } from '@ionic-native/network/ngx'; -// import { Platform } from '@ionic/angular'; - import { MessageService } from '../message/shared/message.service'; import { LanguageService } from '../language/shared/language.service'; - -export interface ConnectionState { - connection: boolean; -} +import { ConnectionState } from './network.interfaces'; @Injectable({ providedIn: 'root' @@ -27,20 +21,8 @@ export class NetworkService implements OnDestroy { constructor( private messageService: MessageService, private injector: Injector - // private network: Network, - // private platform: Platform ) { - this.checkNetworkState(); - // this.platform.ready().then(() => { - // if (this.platform.is('cordova')) { - // if (this.platform.is('android')) { - // this.checkNetworkStateMobile(); - // } - // } else { - // console.log('browser'); - // this.checkNetworkState(); - // } - // }); + this.checkNetworkState(); } private checkNetworkState() { @@ -63,41 +45,6 @@ export class NetworkService implements OnDestroy { }); } - // private checkNetworkStateMobile() { - // if (this.network.type !== this.network.Connection.NONE) { - // this.connectionType = this.network.type; - // this.state.connection = true; - // } - // - // this.offlineSubscription = this.network.onDisconnect().subscribe(() => { - // this.state.connection = false; - // setTimeout(() => { - // if (!this.state.connection) { - // const translate = this.injector.get(LanguageService).translate; - // const message = translate.instant('igo.core.network.offline.message'); - // const title = translate.instant('igo.core.network.offline.title'); - // this.messageService.info(message, title); - // this.state.connection = false; - // this.emitEvent(); - // } - // }, 10000); - // }); - // - // this.onlineSubscription = this.network.onConnect().subscribe(() => { - // this.state.connection = true; - // setTimeout(() => { - // if (this.state.connection) { - // const translate = this.injector.get(LanguageService).translate; - // const message = translate.instant('igo.core.network.online.message'); - // const title = translate.instant('igo.core.network.online.title'); - // this.messageService.info(message, title); - // this.state.connection = true; - // this.emitEvent(); - // } - // }, 10000); - // }); - // } - private emitEvent() { this.stateChangeEventEmitter.emit(this.state); } From 4d31e627292868c692c038a1ac58fd6a5fb59fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Thu, 31 Oct 2019 13:38:47 -0400 Subject: [PATCH 07/25] style(lint): fix lint --- packages/geo/src/lib/map/shared/map.utils.ts | 6 +++--- packages/utils/src/lib/object-utils.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/geo/src/lib/map/shared/map.utils.ts b/packages/geo/src/lib/map/shared/map.utils.ts index 1d276d13c4..ab80f1cada 100644 --- a/packages/geo/src/lib/map/shared/map.utils.ts +++ b/packages/geo/src/lib/map/shared/map.utils.ts @@ -126,10 +126,10 @@ export function stringToLonLat(str: string, mapProjection: string): {lonLat: [nu isXYCoords = true; [, pattern, zone, lon, lat] = coordStr.match(patternMtm); let lon0; - if (Number(zone) <=2) { + if (Number(zone) <= 2) { lon0 = -50 - Number(zone) * 3; - } else if (Number(zone) >=12) { - lon0 = -81 - (Number(zone)-12) * 3; + } else if (Number(zone) >= 12) { + lon0 = -81 - (Number(zone) - 12) * 3; } else { lon0 = -49.5 - Number(zone) * 3; } diff --git a/packages/utils/src/lib/object-utils.ts b/packages/utils/src/lib/object-utils.ts index cd16bd327f..fd88af3ebe 100644 --- a/packages/utils/src/lib/object-utils.ts +++ b/packages/utils/src/lib/object-utils.ts @@ -115,7 +115,7 @@ export class ObjectUtils { b === '' || b === undefined ) { - let nullScore = + const nullScore = a === b ? 0 : a === undefined From 46fc6c77d189ffe378cae1346917d42c34b9e089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Thu, 31 Oct 2019 14:50:08 -0400 Subject: [PATCH 08/25] doc(search-source): fix options params --- packages/geo/src/lib/search/shared/sources/source.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/geo/src/lib/search/shared/sources/source.ts b/packages/geo/src/lib/search/shared/sources/source.ts index f4e56d6be3..d0cd313ffb 100644 --- a/packages/geo/src/lib/search/shared/sources/source.ts +++ b/packages/geo/src/lib/search/shared/sources/source.ts @@ -201,6 +201,7 @@ export interface TextSearch { /** * Search by text * @param term Text + * @param options Optional: TextSearchOptions * @returns Observable or search results */ search( @@ -216,7 +217,7 @@ export interface ReverseSearch { /** * Search by text * @param lonLat Coordinates - * @param distance Optional: Search radius arounf lonLat + * @param options Optional: ReverseSearchOptions * @returns Observable or search results */ reverseSearch( From 175e637525d2859e9ac0ce8129eab8722d576399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-=C3=89ric?= Date: Thu, 31 Oct 2019 15:57:17 -0400 Subject: [PATCH 09/25] feat(i18n): merge lib and app translations and fix search-selector translation key (#498) --- packages/core/src/lib/language/shared/language.loader.ts | 4 +++- .../lib/search/search-selector/search-selector.component.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/src/lib/language/shared/language.loader.ts b/packages/core/src/lib/language/shared/language.loader.ts index d95fb7c3e0..2042d5d4b1 100644 --- a/packages/core/src/lib/language/shared/language.loader.ts +++ b/packages/core/src/lib/language/shared/language.loader.ts @@ -5,6 +5,8 @@ import { map } from 'rxjs/operators'; import { TranslateLoader } from '@ngx-translate/core'; +import { ObjectUtils } from '@igo2/utils'; + import { ConfigService } from '../../config/config.service'; declare function require(arg: string): any; @@ -35,7 +37,7 @@ export class LanguageLoader implements TranslateLoader { return locale$.pipe( map(translations => { - return Object.assign(translations[0], translations[1]); + return ObjectUtils.mergeDeep(translations[0], translations[1]); }) ); } diff --git a/packages/geo/src/lib/search/search-selector/search-selector.component.ts b/packages/geo/src/lib/search/search-selector/search-selector.component.ts index 3f4ced2b9b..0bdcc33834 100644 --- a/packages/geo/src/lib/search/search-selector/search-selector.component.ts +++ b/packages/geo/src/lib/search/search-selector/search-selector.component.ts @@ -83,7 +83,7 @@ export class SearchSelectorComponent implements OnInit, OnDestroy { * @internal */ getSearchTypeTitle(searchType: string) { - return `search.${searchType.toLowerCase()}.title`; + return `igo.geo.search.${searchType.toLowerCase()}.title`; } /** From 50e76194895aee6cab0019b184e0d6cfb39e3716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Thu, 31 Oct 2019 16:51:51 -0400 Subject: [PATCH 10/25] style(*): minor fix --- .../src/lib/tool/toolbox/toolbox.theming.scss | 21 ++++++++++++++++++- packages/core/src/lib/network/index.ts | 1 - .../layer-item/layer-item.component.scss | 6 +----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/common/src/lib/tool/toolbox/toolbox.theming.scss b/packages/common/src/lib/tool/toolbox/toolbox.theming.scss index 439d15bd45..c62dceb484 100644 --- a/packages/common/src/lib/tool/toolbox/toolbox.theming.scss +++ b/packages/common/src/lib/tool/toolbox/toolbox.theming.scss @@ -18,15 +18,34 @@ } } + igo-toolbox > igo-actionbar:not(.with-title) > mat-list { + & > #lowChevron, + & > #topChevron { + &:hover { + background-color: mat-color($accent, lighter); + color: mat-color($foreground, text); + } + } + } igo-toolbox.color-primary > igo-actionbar:not(.with-title) { box-shadow: unset; - background-color: mat-color($primary) + background-color: mat-color($primary); + #lowChevron, + #topChevron { + background-color: mat-color($primary); + color: white; + } } igo-toolbox.color-grey > igo-actionbar:not(.with-title) { box-shadow: unset; background-color: #737475; + #lowChevron, + #topChevron { + background-color: #737475; + color: white; + } } igo-toolbox.color-primary, diff --git a/packages/core/src/lib/network/index.ts b/packages/core/src/lib/network/index.ts index d260d1dd62..d4d4cf3284 100644 --- a/packages/core/src/lib/network/index.ts +++ b/packages/core/src/lib/network/index.ts @@ -1,3 +1,2 @@ export * from './network.service'; -export * from './network-ionic.service'; export * from './network.interfaces'; diff --git a/packages/geo/src/lib/layer/layer-item/layer-item.component.scss b/packages/geo/src/lib/layer/layer-item/layer-item.component.scss index f1a9427d04..a297e0f0a7 100644 --- a/packages/geo/src/lib/layer/layer-item/layer-item.component.scss +++ b/packages/geo/src/lib/layer/layer-item/layer-item.component.scss @@ -16,6 +16,7 @@ .igo-layer-actions-container { width: 100%; display: inline-block; + padding-left: 10px; } .igo-layer-actions-container > div { @@ -34,12 +35,7 @@ .igo-layer-button-group { float: right; padding: 0 $igo-list-item-padding; - display: contents; /* ie11: display: ruby-base; */ max-width: 100%; - - @include mobile { - float: none; - } } mat-icon.disabled { From 5fb8a3b0ee826ad32c156dceef7e2391022c75a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Thu, 31 Oct 2019 16:52:30 -0400 Subject: [PATCH 11/25] fix(icherche): distance options --- .../src/lib/search/shared/sources/icherche.ts | 18 +++++++++--------- .../search/shared/sources/source.interfaces.ts | 1 - .../src/lib/search/shared/sources/source.ts | 1 + 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/geo/src/lib/search/shared/sources/icherche.ts b/packages/geo/src/lib/search/shared/sources/icherche.ts index 7d696ffb00..46a816dc4e 100644 --- a/packages/geo/src/lib/search/shared/sources/icherche.ts +++ b/packages/geo/src/lib/search/shared/sources/icherche.ts @@ -521,27 +521,27 @@ export class IChercheReverseSearchSource extends SearchSource { title: '100 m', value: 100, - enabled: true + enabled: !this.options.distance || this.options.distance === 100 }, { title: '500 m', value: 500, - enabled: false + enabled: this.options.distance === 500 }, { title: '1 km', value: 1000, - enabled: false + enabled: this.options.distance === 1000 }, { title: '2 km', value: 2000, - enabled: false + enabled: this.options.distance === 2000 }, { title: '5 km', value: 5000, - enabled: false + enabled: this.options.distance === 5000 } ] } @@ -582,9 +582,9 @@ export class IChercheReverseSearchSource extends SearchSource lonLat: [number, number], options?: ReverseSearchOptions ): HttpParams { - if (options.distance) { + if (options.distance || this.options.distance) { options.params = Object.assign(options.params || {}, { - buffer: options.distance + buffer: options.distance || this.options.distance }); } @@ -595,8 +595,8 @@ export class IChercheReverseSearchSource extends SearchSource geometry: true, icon: true }, - this.params, - options.params || {} + options.params || {}, + this.params ) }); } diff --git a/packages/geo/src/lib/search/shared/sources/source.interfaces.ts b/packages/geo/src/lib/search/shared/sources/source.interfaces.ts index 5e5e411d3d..b1db0f88be 100644 --- a/packages/geo/src/lib/search/shared/sources/source.interfaces.ts +++ b/packages/geo/src/lib/search/shared/sources/source.interfaces.ts @@ -5,7 +5,6 @@ export interface SearchSourceOptions { enabled?: boolean; order?: number; distance?: number; - zoomMaxOnSelect?: number; params?: { [key: string]: string }; settings?: SearchSourceSettings[]; } diff --git a/packages/geo/src/lib/search/shared/sources/source.ts b/packages/geo/src/lib/search/shared/sources/source.ts index d0cd313ffb..1bacd71b03 100644 --- a/packages/geo/src/lib/search/shared/sources/source.ts +++ b/packages/geo/src/lib/search/shared/sources/source.ts @@ -137,6 +137,7 @@ export class SearchSource { } constructor(options: SearchSourceOptions) { + this.options = options; this.options = Object.assign({}, this.getDefaultOptions(), options); // Set Default Params from Settings From 14708084ae8ff085a539ab6845fde12bd86be24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Thu, 31 Oct 2019 17:16:25 -0400 Subject: [PATCH 12/25] style(layers-list): fix button group appearance --- .../layer-item/layer-item.component.html | 29 ++++++++++--------- .../layer-item/layer-item.component.scss | 6 ++-- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/geo/src/lib/layer/layer-item/layer-item.component.html b/packages/geo/src/lib/layer/layer-item/layer-item.component.html index d2f004b223..4e237886c5 100644 --- a/packages/geo/src/lib/layer/layer-item/layer-item.component.html +++ b/packages/geo/src/lib/layer/layer-item/layer-item.component.html @@ -37,22 +37,23 @@

- - -
+ + + +