Skip to content

Commit

Permalink
task/WG-91-Allow non-persistent tile layer adjustments in public hazm…
Browse files Browse the repository at this point in the history
…apper maps (#175)

* users can now tweak layers in public view without saving

* fixing angular linting issues

* Adding Overlays title back to public view

---------

Co-authored-by: Taylor Grafft <[email protected]>
  • Loading branch information
tjgrafft and Taylor Grafft authored Dec 7, 2023
1 parent 562e291 commit 518e3e7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions angular/src/app/components/dock/dock.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>
</button>
</div>
<div class="dock-button" [ngClass]="{ active: panelsDisplay.layers }" *ngIf="!isPublicView">
<div class="dock-button" [ngClass]="{ active: panelsDisplay.layers }">
<button (click)="showPanel('layers')" [disabled]="!activeProject">
<div>
<img class="dock-button-icon" src="assets/layers.png" width="32px" />
Expand Down Expand Up @@ -68,7 +68,7 @@
</div>
<div class="cell auto dock-panel">
<app-assets-panel *ngIf="panelsDisplay.assets" [isPublicView]="isPublicView"></app-assets-panel>
<app-layers-panel *ngIf="panelsDisplay.layers"></app-layers-panel>
<app-layers-panel *ngIf="panelsDisplay.layers" [isPublicView]="isPublicView"></app-layers-panel>
<app-filters-panel *ngIf="panelsDisplay.filters"></app-filters-panel>
<app-measure-panel *ngIf="panelsDisplay.measure"></app-measure-panel>
<app-settings-panel *ngIf="panelsDisplay.settings"></app-settings-panel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="dock-panel-content">
<p class="dock-panel-title">Layers</p>
<h6>Tile Layers</h6>
<button class="button expanded hollow tiny success" (click)="openCreateTileServerModal()">
<button class="button expanded hollow tiny success" (click)="openCreateTileServerModal()" *ngIf="!isPublicView">
<i class="fa fa-plus"></i>
</button>
<div #cdkList cdkDropList class="tile-servers-list" (cdkDropListDropped)="drop($event)">
Expand Down Expand Up @@ -35,6 +35,7 @@ <h6>Tile Layers</h6>
(blur)="updateName(activeText.value, ts)"
(keyup.enter)="updateName(activeText.value, ts)"
[value]="ts.name"
[readOnly]="isPublicView"
/>
<div
id="tile-server-name"
Expand All @@ -53,7 +54,7 @@ <h6>Tile Layers</h6>
</div>

<div class="cell small-4 grid-x tile-server-right">
<button class="button secondary clear edit-buttons">
<button class="button secondary clear edit-buttons" *ngIf="!isPublicView">
<i class="fas fa-edit edit-button" (click)="showInput(ts, true)" *ngIf="!ts.uiOptions.showInput"></i>
<i class="fas fa-check edit-button" (click)="showInput(ts, false)" *ngIf="ts.uiOptions.showInput"></i>
</button>
Expand All @@ -63,6 +64,7 @@ <h6>Tile Layers</h6>
<button
class="button secondary clear button-no-margin delete-button"
(click)="openDeleteTileServerModal(deleteTiles)"
*ngIf="!isPublicView"
>
<i class="fa fa-trash"></i>
</button>
Expand Down Expand Up @@ -95,21 +97,21 @@ <h6>Tile Layers</h6>
</div>
</div>

<div *ngIf="dirtyOptions" class="tile-server-dirty-options">
<div *ngIf="dirtyOptions && !isPublicView" class="tile-server-dirty-options">
<i class="tile-server-dirty-options-warning">
Layer options have been changed!
<br />
Save to persist changes.
</i>
</div>

<div class="tile-server-save-button">
<div *ngIf="dirtyOptions && !isPublicView" class="tile-server-save-button">
<button class="button small success" [disabled]="!dirtyOptions" (click)="saveTileOptions()">Save Layer Options</button>
</div>
<hr />

<h6>Overlays</h6>
<button class="button expanded hollow tiny success" (click)="openCreateOverlayModal()">
<button class="button expanded hollow tiny success" (click)="openCreateOverlayModal()" *ngIf="!isPublicView">
<i class="fa fa-plus"></i>
</button>
<div *ngFor="let ov of overlays" class="overlay">
Expand All @@ -121,7 +123,7 @@ <h6>Overlays</h6>
<span class="overlay-label"> {{ ov.label }} </span>
</div>
<div class="cell grid-x auto align-right">
<button class="button hollow tiny alert button-no-margin" (click)="deleteOverlay(ov)">
<button class="button hollow tiny alert button-no-margin" (click)="deleteOverlay(ov)" [disabled]="isPublicView">
<i class="fa fa-trash"></i>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, ElementRef, ViewChildren, QueryList, TemplateRef, OnDestroy } from '@angular/core';
import { Component, OnInit, ElementRef, ViewChildren, QueryList, TemplateRef, OnDestroy, Input } from '@angular/core';
import { GeoDataService } from '../../services/geo-data.service';
import { Overlay, Project, TileServer } from '../../models/models';
import { BsModalRef, BsModalService } from 'ngx-foundation';
Expand All @@ -17,6 +17,7 @@ import { Subscription } from 'rxjs';
})
export class LayersPanelComponent implements OnInit, OnDestroy {
@ViewChildren('activeText') activeInputs: QueryList<ElementRef>;
@Input() isPublicView = false;

dragHeight: number;
releaseHeight: number;
Expand Down

0 comments on commit 518e3e7

Please sign in to comment.