Skip to content

Commit

Permalink
fix: Check either for a feature or coordinate to show feature info panel
Browse files Browse the repository at this point in the history
  • Loading branch information
DailisLangovskis authored and raitisbe committed May 17, 2021
1 parent a90b43a commit 3d4de73
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 55 deletions.
68 changes: 17 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -24,7 +24,6 @@ export class HsAddDataListItemComponent {

explanationsVisible: boolean;
metadata;
metadataModalVisible: boolean;
selected_ds;
selected_layer;
selectedType: string; //do not rename to 'type', would clash in the template
Expand Down Expand Up @@ -67,7 +66,6 @@ export class HsAddDataListItemComponent {
this.selectTypeToAddLayerVisible = false;
this.selectedType = null;
}
this.metadataModalVisible = false;
this.explanationsVisible = false;
}

Expand Down
@@ -1,4 +1,4 @@
<div [hidden]="!(HsQueryBaseService.data.features.length > 0)" class="card hs-main-panel">
<div *ngIf="(HsQueryBaseService.data.features.length > 0) || (HsQueryBaseService.data.coordinates.length > 0)" class="card hs-main-panel">
<div class="card-body">
<div class="dropdown" [hidden]="!(HsQueryBaseService.data.featureInfoHtmls.length > 0)">
<button class="btn btn-light w-100 dropdown-toggle rounded-0" data-toggle="dropdown" [aria-expanded]="featureInfoExpanded" (click)="featureInfoExpanded = !featureInfoExpanded">
Expand Down
@@ -1,5 +1,5 @@
<hs-panel-header name="info" [title]="'PANEL_HEADER.INFO' | translate"></hs-panel-header>
<div class="card hs-main-panel" *ngIf="HsQueryBaseService.data.features.length == 0">
<div class="card hs-main-panel" *ngIf="noFeatureSelected()">
<div class="d-flex flex-column align-items-center p-4">
<i class="icon-cursor bg-primary p-3 text-white rounded " style="font-size: x-large; color:hsl(208, 100%, 97%)"></i>
<p class="h4">No features selected</p>
Expand Down
7 changes: 7 additions & 0 deletions projects/hslayers/src/components/query/query.component.ts
Expand Up @@ -126,6 +126,13 @@ export class HsQueryComponent implements OnDestroy {
);
});
}
noFeatureSelected(): boolean {
return (
this.HsQueryBaseService.data.features.length == 0 &&
(this.HsQueryBaseService.data.coordinates === undefined ||
this.HsQueryBaseService.data.coordinates.length == 0)
);
}
showQueryDialog(ev) {
//TODO Rewrite this to new material design
/* this.$mdDialog
Expand Down

0 comments on commit 3d4de73

Please sign in to comment.