Skip to content

Commit

Permalink
style(LM): Fix typos, prefer named imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacura committed Feb 19, 2024
1 parent 4a103d3 commit 9d93575
Show file tree
Hide file tree
Showing 19 changed files with 70 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
[ngClass]="{'hs-checkmark':withChildren[subLayer.Name],'hs-uncheckmark':!withChildren[subLayer.Name]}"
[attr.for]="'hs-sublayers-' + subLayer.Name + '-' + app "></label>
<div (click)="toggleExpanded()" style="cursor:pointer"
[ngClass]="{'grayed': hsLayerManagerVisiblityService.currentResolution >= subLayer.maxResolution}">
[ngClass]="{'grayed': hsLayerManagerVisibilityService.currentResolution >= subLayer.maxResolution}">
{{subLayer.Title || subLayer.Name}}
<button type="button" class="btn btn-sm p-0" style="font-size: 0.6rem;">
<i [ngClass]="{'icon-chevron-down': expanded, 'icon-chevron-right': !expanded}"></i>
Expand All @@ -34,7 +34,7 @@
<label class="form-check-label m-0" [ngClass]="{
'hs-checkmark':checkedSubLayers[subLayer.Name],
'hs-uncheckmark':!checkedSubLayers[subLayer.Name],
'grayed': (hsLayerManagerVisiblityService.currentResolution > subLayer.maxResolution) }"
'grayed': (hsLayerManagerVisibilityService.currentResolution > subLayer.maxResolution) }"
[attr.for]="'hs-sublayers-' + subLayer.Name + '-' + app ">{{subLayer.Title ||
subLayer.Name}}</label>
</div>
Expand All @@ -55,4 +55,4 @@
</div>

</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from './layer-editor-sub-layer.service';
import {
HsLayerManagerService,
HsLayerManagerVisiblityService,
HsLayerManagerVisibilityService,
} from 'hslayers-ng/shared/layer-manager';

@Component({
Expand All @@ -22,7 +22,7 @@ export class HsLayerEditorSubLayerCheckboxesComponent implements OnInit {
withChildren: KeyBooleanDict;
constructor(
public HsLayerEditorSublayerService: HsLayerEditorSublayerService,
public hsLayerManagerVisiblityService: HsLayerManagerVisiblityService,
public hsLayerManagerVisibilityService: HsLayerManagerVisibilityService,
public HsLayerManagerService: HsLayerManagerService,
private hsConfig: HsConfig,
) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Injectable} from '@angular/core';
import {HsLayerDescriptor} from 'hslayers-ng/types';
import {
HsLayerManagerService,
HsLayerManagerVisiblityService,
HsLayerManagerVisibilityService,
} from 'hslayers-ng/shared/layer-manager';
import {HsLayerSelectorService} from 'hslayers-ng/shared/layer-manager';
import {HsLayerUtilsService} from 'hslayers-ng/shared/utils';
Expand All @@ -27,7 +27,7 @@ export class HsLayerEditorSublayerService {
public HsLayerManagerService: HsLayerManagerService,
private HsLayerUtilsService: HsLayerUtilsService,
private hsLayerSelectorService: HsLayerSelectorService,
private hsLayerManagerVisiblityService: HsLayerManagerVisiblityService,
private hsLayerManagerVisibilityService: HsLayerManagerVisibilityService,
) {
this.hsLayerSelectorService.layerSelected.subscribe((layer) => {
this.resetSublayers(layer);
Expand Down Expand Up @@ -120,14 +120,14 @@ export class HsLayerEditorSublayerService {
params.LAYERS = `show:${params.LAYERS}`;
}
if (params.LAYERS == '' || params.LAYERS == 'show:') {
this.hsLayerManagerVisiblityService.changeLayerVisibility(
this.hsLayerManagerVisibilityService.changeLayerVisibility(
!layer.visible,
layer,
);
return;
}
if (layer.visible == false) {
this.hsLayerManagerVisiblityService.changeLayerVisibility(
this.hsLayerManagerVisibilityService.changeLayerVisibility(
!layer.visible,
layer,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
</div>
<div (click)="toggleBasemap()">
<div style="height: 4.5em; width: 100%; background: white"
[ngClass]="{'active': !hsLayerManagerVisiblityService.baselayersVisible}"></div>
[ngClass]="{'active': !hsLayerManagerVisibilityService.baselayersVisible}"></div>
<a class="dropdown-item flex-grow-1 d-flex align-items-center text-truncate"
[ngClass]="{'active': !hsLayerManagerVisiblityService.baselayersVisible}">{{'LAYERMANAGER.baseMapGallery.noBaseMap'
[ngClass]="{'active': !hsLayerManagerVisibilityService.baselayersVisible}">{{'LAYERMANAGER.baseMapGallery.noBaseMap'
| translateHs }}</a>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {HsGuiOverlayBaseComponent} from 'hslayers-ng/common/panels';
import {HsLayerDescriptor} from 'hslayers-ng/types';
import {
HsLayerManagerService,
HsLayerManagerVisiblityService,
HsLayerManagerVisibilityService,
HsLayerSelectorService,
} from 'hslayers-ng/shared/layer-manager';
import {HsLayerUtilsService} from 'hslayers-ng/shared/utils';
Expand All @@ -32,7 +32,7 @@ export class HsLayerManagerGalleryComponent extends HsGuiOverlayBaseComponent {
public hsLayerManagerService: HsLayerManagerService,
private hsLayerSelectorService: HsLayerSelectorService,
public hsLayerUtilsService: HsLayerUtilsService,
public hsLayerManagerVisiblityService: HsLayerManagerVisiblityService,
public hsLayerManagerVisibilityService: HsLayerManagerVisibilityService,
) {
super(hsLayoutService);
}
Expand All @@ -48,7 +48,7 @@ export class HsLayerManagerGalleryComponent extends HsGuiOverlayBaseComponent {
toggleBasemap(layer?: HsLayerDescriptor): void {
if (layer) {
if (!layer.active) {
this.hsLayerManagerVisiblityService.changeBaseLayerVisibility(
this.hsLayerManagerVisibilityService.changeBaseLayerVisibility(
true,
layer,
);
Expand All @@ -63,7 +63,10 @@ export class HsLayerManagerGalleryComponent extends HsGuiOverlayBaseComponent {
this.dropdown.close();
this.hsLayerSelectorService.currentLayer = null;

this.hsLayerManagerVisiblityService.changeBaseLayerVisibility(null, null);
this.hsLayerManagerVisibilityService.changeBaseLayerVisibility(
null,
null,
);
}
}
expandMenu(layer: HsLayerDescriptor): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</div>
<div class="p-0">
<button type="button" class="btn btn-sm hs-btn-baselayers" (click)="changeBaseLayerVisibility()"
[ngClass]="hsLayerManagerVisiblityService.baselayersVisible ? 'hs-checkmark' : 'hs-uncheckmark'"></button>
[ngClass]="hsLayerManagerVisibilityService.baselayersVisible ? 'hs-checkmark' : 'hs-uncheckmark'"></button>
</div>
</div>
</li>
Expand All @@ -65,7 +65,7 @@
<div class="p-0">
<button type="button" class="btn btn-sm btn-light hs-lm-item-visibility"
(click)="changeBaseLayerVisibility($event, layer);"
[ngClass]="(hsLayerManagerVisiblityService.baselayersVisible && layer.visible) ? 'hs-checkmark' : 'hs-uncheckmark'"></button>
[ngClass]="(hsLayerManagerVisibilityService.baselayersVisible && layer.visible) ? 'hs-checkmark' : 'hs-uncheckmark'"></button>
</div>
<ng-template #abstractTooltip>
<span [innerHtml]="hsLayerManagerService.makeSafeAndTranslate('LAYERS', layer.abstract)"></span>
Expand All @@ -87,7 +87,7 @@
</li>
</ul>

<ul class="list-group hs-lm-baselayerlist" [hidden]="!(hsLayerManagerService.data.terrainlayers.length > 0)">
<ul class="list-group hs-lm-baselayerlist" [hidden]="!(hsLayerManagerService.data.terrainLayers.length > 0)">
<li class="list-group-item hs-lm-item hs-lm-header clearfix list-group-item-primary">
<div class="d-flex">
<div class="p-0 flex-grow-1 hs-lm-item-title">
Expand All @@ -97,7 +97,7 @@
</div>
</li>
<li class="list-group-item hs-lm-item"
*ngFor="let layer of hsLayerManagerService.data.terrainlayers | filter:baselayerFilter"
*ngFor="let layer of hsLayerManagerService.data.terrainLayers | filter:baselayerFilter"
(click)="changeTerrainLayerVisibility($event, layer)" (mouseenter)="hovering=true"
(mouseleave)="hovering=false" [ngClass]="{'hovering': (hovering && !layer.active)}">
<div class="d-flex ">
Expand All @@ -108,7 +108,7 @@
</div> -->
<div class="p-0">
<button type="button" class="btn btn-sm btn-light hs-lm-item-visibility"
[ngClass]="(hsLayerManagerVisiblityService.baselayersVisible && layer.visible) ? 'hs-checkmark' : 'hs-uncheckmark'"></button>
[ngClass]="(hsLayerManagerVisibilityService.baselayersVisible && layer.visible) ? 'hs-checkmark' : 'hs-uncheckmark'"></button>
</div>
<ng-template #abstractTooltip>
<span [innerHtml]="hsLayerManagerService.makeSafeAndTranslate('LAYERS', layer.abstract)"></span>
Expand Down Expand Up @@ -167,4 +167,4 @@
[hidden]="!hsLayerSelectorService.currentLayer" class="hs-layerpanel w-100">
</hs-layer-editor>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {HsLayerListService} from './logical-list/layer-manager-layerlist.service
import {HsLayerManagerRemoveAllDialogComponent} from './dialogs/remove-all-dialog.component';
import {
HsLayerManagerService,
HsLayerManagerVisiblityService,
HsLayerManagerVisibilityService,
HsLayerSelectorService,
} from 'hslayers-ng/shared/layer-manager';
import {HsLayerSynchronizerService} from 'hslayers-ng/shared/save-map';
Expand Down Expand Up @@ -135,7 +135,7 @@ export class HsLayerManagerComponent
public hsSidebarService: HsSidebarService,
private HsRemoveLayerDialogService: HsRemoveLayerDialogService,
public hsLayerSelectorService: HsLayerSelectorService,
public hsLayerManagerVisiblityService: HsLayerManagerVisiblityService,
public hsLayerManagerVisibilityService: HsLayerManagerVisibilityService,
) {
super(hsLayoutService);
this.hsEventBusService.layerRemovals
Expand Down Expand Up @@ -195,21 +195,21 @@ export class HsLayerManagerComponent
}

changeBaseLayerVisibility(e?, layer?: Layer<Source>) {
return this.hsLayerManagerVisiblityService.changeBaseLayerVisibility(
return this.hsLayerManagerVisibilityService.changeBaseLayerVisibility(
e,
layer,
);
}

changeTerrainLayerVisibility(e, layer: Layer<Source>) {
return this.hsLayerManagerVisiblityService.changeTerrainLayerVisibility(
return this.hsLayerManagerVisibilityService.changeTerrainLayerVisibility(
e,
layer,
);
}

changeLayerVisibility(toWhat: boolean, layer: HsLayerDescriptor) {
return this.hsLayerManagerVisiblityService.changeLayerVisibility(
return this.hsLayerManagerVisibilityService.changeLayerVisibility(
toWhat,
layer,
);
Expand All @@ -220,7 +220,7 @@ export class HsLayerManagerComponent
}

activateTheme(e) {
return this.hsLayerManagerVisiblityService.activateTheme(e);
return this.hsLayerManagerVisibilityService.activateTheme(e);
}

baselayerFilter = (item): boolean => {
Expand All @@ -235,7 +235,7 @@ export class HsLayerManagerComponent
toggleVisibilityForAll(): void {
this.allLayersVisible = !this.allLayersVisible;
this.hsLayerManagerService.data.layers.forEach((l) => {
this.hsLayerManagerVisiblityService.changeLayerVisibility(
this.hsLayerManagerVisibilityService.changeLayerVisibility(
this.allLayersVisible,
l,
);
Expand Down Expand Up @@ -302,7 +302,7 @@ export class HsLayerManagerComponent
* @param layer - Selected layer
*/
isLayerInResolutionInterval(layer: Layer<Source>): boolean {
return this.hsLayerManagerVisiblityService.isLayerInResolutionInterval(
return this.hsLayerManagerVisibilityService.isLayerInResolutionInterval(
layer,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="p-0" [ngClass]="getExclusive(layer.layer) ? 'exclusive' : ''">
<!-- TODO: Remove function call from template -->
<button type="button" class="btn btn-sm btn-light hs-lm-item-visibility"
(click)="hsLayerManagerVisiblityService.changeLayerVisibility(!layer.visible, layer);hsLayerListService.toggleSublayersVisibility(layer);$event.stopPropagation()"
(click)="hsLayerManagerVisibilityService.changeLayerVisibility(!layer.visible, layer);hsLayerListService.toggleSublayersVisibility(layer);$event.stopPropagation()"
[ngClass]="layer.visible ? 'hs-checkmark' : 'hs-uncheckmark'"></button>
</div>
<ng-template #abstractTooltip>
Expand Down Expand Up @@ -62,4 +62,4 @@
</hs-layer-manager-time-editor>
</li>
</ul>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {HsLayerDescriptor} from 'hslayers-ng/types';
import {HsLayerListService} from './layer-manager-layerlist.service';
import {
HsLayerManagerService,
HsLayerManagerVisiblityService,
HsLayerManagerVisibilityService,
HsLayerSelectorService,
} from 'hslayers-ng/shared/layer-manager';
import {HsLayerUtilsService} from 'hslayers-ng/shared/utils';
Expand Down Expand Up @@ -39,7 +39,7 @@ export class HsLayerListComponent implements OnInit, OnDestroy {
public hsEventBusService: HsEventBusService,
public hsLayerUtilsService: HsLayerUtilsService,
public hsLayerListService: HsLayerListService,
public hsLayerManagerVisiblityService: HsLayerManagerVisiblityService,
public hsLayerManagerVisibilityService: HsLayerManagerVisibilityService,
) {
this.layerManagerUpdatesSubscription =
this.hsEventBusService.layerManagerUpdates.subscribe(() => {
Expand Down
2 changes: 1 addition & 1 deletion projects/hslayers/shared/add-data/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export * from './catalogue/catalogue-map.service';

export * from './vector/vector.service';
export * from './vector/vector-upload.service';
export * from './vector/vector.utils.service';
export * from './vector/vector-utils.service';
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {PROJECTIONS as epsg4326Aliases} from 'ol/proj/epsg4326';
import {HsLogService} from 'hslayers-ng/shared/log';
import {HsMapService} from 'hslayers-ng/shared/map';

import {HsAddDataVectorUtilsService} from './vector.utils.service';
import {HsAddDataVectorUtilsService} from './vector-utils.service';

@Injectable({
providedIn: 'root',
Expand Down
2 changes: 1 addition & 1 deletion projects/hslayers/shared/add-data/vector/vector.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from 'hslayers-ng/common/layman';
import {setDefinition} from 'hslayers-ng/common/extensions';

import {HsAddDataVectorUtilsService} from './vector.utils.service';
import {HsAddDataVectorUtilsService} from './vector-utils.service';
import {HsVectorLayerOptions} from 'hslayers-ng/types';
import {VectorLayerDescriptor} from 'hslayers-ng/types';
import {VectorSourceDescriptor} from 'hslayers-ng/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {HsEventBusService} from 'hslayers-ng/shared/event-bus';
import {HsLanguageService} from 'hslayers-ng/shared/language';
import {
HsLayerManagerService,
HsLayerManagerVisiblityService,
HsLayerManagerVisibilityService,
} from 'hslayers-ng/shared/layer-manager';
import {HsLayoutService} from 'hslayers-ng/shared/layout';
import {HsLogService} from 'hslayers-ng/shared/log';
Expand Down Expand Up @@ -88,7 +88,7 @@ export class HsCompositionsParserService {
private hsCommonLaymanService: HsCommonLaymanService,
private hsLayerManagerService: HsLayerManagerService,
private hsToastService: HsToastService,
private HsLayerManagerVisiblityService: HsLayerManagerVisiblityService,
private HsLayerManagerVisibilityService: HsLayerManagerVisibilityService,
) {
/**
* Composition opened -> request its descriptor
Expand Down Expand Up @@ -450,7 +450,7 @@ export class HsCompositionsParserService {
lyr,
true,
);
this.HsLayerManagerVisiblityService.changeBaseLayerVisibility(
this.HsLayerManagerVisibilityService.changeBaseLayerVisibility(
true,
layerDescriptor,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import VectorLayer from 'ol/layer/Vector';
import VectorSource from 'ol/source/Vector';
import {Cluster} from 'ol/source';
import {Injectable} from '@angular/core';

import {Cluster, Vector as VectorSource} from 'ol/source';
import {Vector as VectorLayer} from 'ol/layer';

import {HsAddDataOwsService} from 'hslayers-ng/shared/add-data';
import {HsLayerManagerUtilsService} from './layer-manager-utils.service';
import {HsLayerSelectorService} from './layer-selector.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {Injectable} from '@angular/core';
import {Subject} from 'rxjs';

import {Cluster, Source} from 'ol/source';
import {Cluster, Source, Vector as VectorSource} from 'ol/source';
import {GeoJSON} from 'ol/format';
import {Layer} from 'ol/layer';

import VectorSource from 'ol/source/Vector';
import {GeoJSON} from 'ol/format';
import {HsConfig} from 'hslayers-ng/config';
import {HsLayerDescriptor} from 'hslayers-ng/types';
import {HsLayerSelectorService} from './layer-selector.service';
Expand Down Expand Up @@ -47,7 +46,7 @@ export class HsLayerManagerUtilsService {
}

/**
Generates downloadable geoJSON for vector layer.
Generates downloadable GeoJSON for vector layer.
Features are also transformed into the EPSG:4326 projection
*/
saveGeoJson(): void {
Expand Down
Loading

0 comments on commit 9d93575

Please sign in to comment.