Commit 1dd5ceb9 authored by Curtis Adam's avatar Curtis Adam

Merge branch '122-poi-info-modal-for-not-logged-in-users' into 'develop'

add info modal for POIs to show when users are not logged in

Closes #122

See merge request !111
parents 0a444892 dc57fb89
Pipeline #29963 passed with stage
in 7 minutes and 54 seconds
<app-add-edit-header-view [modelDefinition]="modelDefinition"></app-add-edit-header-view>
<app-add-edit-header-view [modelDefinition]="modelDefinition" *ngIf="this.authService.isLoggedIn()"></app-add-edit-header-view>
<div class="modal-body">
<div class="modal-body" >
<div class="form-container" *ngIf="poi">
<div class="form-group row" *ngIf="commonAddEditService.isEditMode()">
<div class="form-group row" *ngIf="commonAddEditService.isEditMode() && this.authService.isLoggedIn()">
<label class="col-3 col-form-label col-form-label-sm">ID</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" disabled [(ngModel)]="poi.id">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.id">
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label col-form-label-sm">Name</label>
<div class="col-9">
<input class="form-control form-control-sm" appFocus type="text" [(ngModel)]="poi.name">
<input class="form-control form-control-sm" appFocus type="text" [disabled]="!this.authService.isLoggedIn()" [(ngModel)]="poi.name">
</div>
</div>
......@@ -31,7 +31,7 @@
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.authService.isLoggedIn()">
<label class="col-3 col-form-label col-form-label-sm">Coordinates</label>
<div class="col-9">
<div class="row">
......@@ -63,7 +63,7 @@
class="btn btn-outline-primary"
ngbButtonLabel>
<input type="checkbox" autocomplete="off" ngbButton [ngModel]="poi.levels.includes(level)"
(click)="toggleLevel(level)">
(click)="toggleLevel(level)" [disabled]="!this.authService.isLoggedIn()" >
{{level}}
</label>
</div>
......@@ -73,11 +73,11 @@
<div class="form-group row">
<label class="col-3 col-form-label col-form-label-sm">Description</label>
<div class="col-9">
<textarea class="form-control form-control-sm" rows="4" [(ngModel)]="poi.description"></textarea>
<textarea class="form-control form-control-sm" rows="4" [(ngModel)]="poi.description" [disabled]="!this.authService.isLoggedIn()" ></textarea>
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.authService.isLoggedIn()">
<label class="col-3 col-form-label col-form-label-sm">Active</label>
<div class="col-9">
<app-boolean-input [(active)]="poi.active" falseLabel="Inactive" trueLabel="Active"></app-boolean-input>
......@@ -87,45 +87,52 @@
<div class="form-group row">
<label class="col-3 col-form-label col-form-label-sm">Building</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.building">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.building" [disabled]="!this.authService.isLoggedIn()" >
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label col-form-label-sm">Street</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.street">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.street" [disabled]="!this.authService.isLoggedIn()" >
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label col-form-label-sm">ZIP</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.zip">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.zip" [disabled]="!this.authService.isLoggedIn()" >
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label col-form-label-sm">City</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.city">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.city" [disabled]="!this.authService.isLoggedIn()" >
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.authService.isLoggedIn()">
<label class="col-3 col-form-label col-form-label-sm"><span class="align-middle">Publish Start</span></label>
<div class="col-9">
<app-date-input [(date)]="poi.publishStart"></app-date-input>
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.authService.isLoggedIn()">
<label class="col-3 col-form-label col-form-label-sm">Publish End</label>
<div class="col-9">
<app-date-input [(date)]="poi.publishEnd"></app-date-input>
</div>
</div>
<div class="form-group row" *ngIf="this.authService.isLoggedIn()">
<label class="col-3 col-form-label col-form-label-sm">Locale</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.locale">
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label col-form-label-sm">Contacts</label>
<div class="col-9">
......@@ -136,4 +143,4 @@
</div>
</div>
<app-add-edit-bottom-view [modelDefinition]="modelDefinition"></app-add-edit-bottom-view>
<app-add-edit-bottom-view [modelDefinition]="modelDefinition" *ngIf="this.authService.isLoggedIn()"></app-add-edit-bottom-view>
......@@ -7,6 +7,7 @@ import {categoryModelDefinition} from '../../../model-definitions/CategoryModelD
import {personModelDefinition} from '../../../model-definitions/PersonModelDefinition';
import {contentModelDefinition} from '../../../model-definitions/ContentModelDefinition';
import {BuildingModel} from '../../../models/building.model';
import {AuthService} from '../../../services/auth/auth.service';
import {Level} from '../../../models/sub-types/level.model';
@Component({
......@@ -29,7 +30,7 @@ export class AddEditPoiComponent implements OnInit {
personModelDefinition = personModelDefinition;
contentModelDefinition = contentModelDefinition;
constructor(public commonAddEditService: CommonAddEditService) {
constructor(public commonAddEditService: CommonAddEditService, private authService: AuthService) {
}
async ngOnInit(): Promise<void> {
......
<button class="btn btn-outline-primary btn-sm" (click)="addContact()">
<button class="btn btn-outline-primary btn-sm" (click)="addContact()" *ngIf="this.authService.isLoggedIn()">
<span class="fa fa-plus">
</span>
</button>
......@@ -8,10 +8,10 @@
<app-single-enum-input [(model)]="contact.type"></app-single-enum-input>
</div>
<div class="col-8">
<input type="text" class="form-control form-control-sm" [(ngModel)]="contact.value">
<input type="text" class="form-control form-control-sm" [(ngModel)]="contact.value" [disabled]="!this.authService.isLoggedIn()" />
</div>
<div class="col-1">
<button class="btn btn-outline-danger btn-sm" (click)="removeContact(contact)"><span class="fa fa-trash"></span></button>
<button class="btn btn-outline-danger btn-sm" (click)="removeContact(contact)" *ngIf="this.authService.isLoggedIn()"><span class="fa fa-trash"></span></button>
</div>
</div>
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {ContactModel} from '../../../../models/sub-types/contact.model';
import {AuthService} from '../../../../services/auth/auth.service';
@Component({
selector: 'app-contact-input',
......@@ -11,7 +12,7 @@ export class ContactInputComponent implements OnInit {
@Input() contacts: ContactModel[];
@Output() contactsChange = new EventEmitter<ContactModel[]>();
constructor() { }
constructor(private authService: AuthService) { }
ngOnInit() {
}
......
<button class="btn btn-outline-primary btn-sm" (click)="expandButtonClicked()">
<button class="btn btn-outline-primary btn-sm" (click)="expandButtonClicked()" *ngIf="this.authService.isLoggedIn()">
<span class="fa" [ngClass]="listSelectionExpanded ? 'fa-chevron-up' : 'fa-chevron-down'">
</span>
</button>
......@@ -37,7 +37,7 @@
<button
class="btn btn-outline-danger mr-2 btn-sm"
(click)="removeButtonClicked(i)"
>
*ngIf="this.authService.isLoggedIn()">
<span class="fa fa-trash">
</span>
</button>
......
......@@ -4,6 +4,7 @@ import {IModelDefinition} from '../../../../interfaces/IModelDefinition';
import {GenericDataService} from '../../../../services/generic-data/generic-data.service';
import {SearchManager} from '../../../../classes/SearchManager';
import {TypeAheadManager} from '../../../../classes/TypeAheadManager';
import {AuthService} from '../../../../services/auth/auth.service';
@Component({
selector: 'app-multi-model-input',
......@@ -26,7 +27,7 @@ export class MultiModelInputComponent implements OnInit {
loading: boolean;
constructor(public genericDataService: GenericDataService) {
constructor(public genericDataService: GenericDataService, private authService: AuthService) {
this.listSelectionExpanded = false;
this.searchManager = new SearchManager();
this.selectionList = [];
......@@ -58,8 +59,8 @@ export class MultiModelInputComponent implements OnInit {
}
addButtonClicked(model: IModel): void {
this.modelList.push(model);
this.modelListChange.emit(this.modelList);
this.modelList.push(model);
this.modelListChange.emit(this.modelList);
}
expandButtonClicked(): void {
......
<div ngbDropdown class="d-inline-block">
<button class="btn btn-outline-primary btn-sm" id="dropdownBasic1" ngbDropdownToggle>{{model.toString()}}</button>
<button class="btn btn-outline-primary btn-sm" id="dropdownBasic1" ngbDropdownToggle [disabled]="!this.authService.isLoggedIn()" >{{model.toString()}}</button>
<div ngbDropdownMenu class="shadow">
<button class="dropdown-item btn btn-sm" *ngFor="let value of model.getAllPossibleValues()"
(click)="enumValueSelected(value)">
......
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {ICustomEnum} from '../../../../interfaces/ICustomEnum';
import {AuthService} from '../../../../services/auth/auth.service';
@Component({
selector: 'app-single-enum-input',
......@@ -11,7 +12,7 @@ export class SingleEnumInputComponent implements OnInit {
@Input() model: ICustomEnum;
@Output() modelChange = new EventEmitter<ICustomEnum>();
constructor() { }
constructor(private authService: AuthService) { }
ngOnInit() {
}
......
......@@ -3,7 +3,7 @@
</div>
<div ngbDropdown class="d-inline-block" *ngIf="model">
<button class="btn btn-outline-primary btn-sm" id="dropdownBasic1" ngbDropdownToggle>
<button class="btn btn-outline-primary btn-sm" id="dropdownBasic1" ngbDropdownToggle *ngIf="this.authService.isLoggedIn()">
{{model.toString()}}
</button>
<div ngbDropdownMenu class="shadow">
......
......@@ -3,6 +3,7 @@ import {IModel} from '../../../../interfaces/IModel';
import {IModelDefinition} from '../../../../interfaces/IModelDefinition';
import {GenericDataService} from '../../../../services/generic-data/generic-data.service';
import { AttachSession } from 'protractor/built/driverProviders';
import {AuthService} from '../../../../services/auth/auth.service';
@Component({
selector: 'app-single-model-input',
......@@ -18,7 +19,7 @@ export class SingleModelInputComponent implements OnInit {
availableObjects: IModel[];
loading: boolean;
constructor(private genericDataLoader: GenericDataService) {
constructor(private genericDataLoader: GenericDataService, private authService: AuthService) {
this.availableObjects = [];
this.loading = false;
}
......
......@@ -33,6 +33,7 @@ import {NavigationPoint} from '../../classes/NavigationPoint';
import {Edge} from '../../models/sub-types/edge.model';
import {EdgeNode} from '../../models/sub-types/edgenode.model';
import {NavigationEndType} from '../../enums/NavigationEndType';
import {forEach} from '@angular/router/src/utils/collection';
@Injectable()
export class MapRendererService {
......@@ -255,9 +256,7 @@ export class MapRendererService {
icon: categoryIcon(poi.category.icon, poi.category.icon),
});
marker.on('click', () => {
if (this.authService.isLoggedIn()) {
this.editPoi(poi.getID());
}
});
marker.on('mouseover', () => {
this.poiMarked = true;
......@@ -407,8 +406,8 @@ export class MapRendererService {
case NavigationEndType.EnterBuilding: {
this.polygons.forEach((polygon) => {
if (this.isMarkerInsidePolygon(this.navigationEndMarker, polygon) === true) {
this.enterBuilding(polygon.building);
}
this.enterBuilding(polygon.building);
}
});
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment