Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/FarmMapsLib into develop
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Peter Bastiani 2021-04-23 10:50:50 +02:00
commit c0d8e6d615
7 changed files with 41 additions and 15 deletions

View File

@ -154,14 +154,15 @@ export class MapEffects {
@Effect()
zoomToExtent2$: Observable<Action> = this.actions$.pipe(
ofType(mapActions.SETFEATURES),
map((action: mapActions.SetFeatures) => {
switchMap((action: mapActions.SetFeatures) => {
let extent = createEmpty();
if (extent) {
for (let f of action.features) {
extend(extent, (f as Feature).getGeometry().getExtent());
}
}
return new mapActions.SetExtent(extent);
if (extent) {
for (let f of action.features) {
extend(extent, (f as Feature).getGeometry().getExtent());
}
if(action.features.length>0) return of(new mapActions.SetExtent(extent));
}
return EMPTY;
}));
@Effect()

View File

@ -1,8 +1,8 @@
<div>
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user}">
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user || noContent}">
<span i18n-title title="Apps"><i class="fas fa-th" aria-hidden="true"></i></span>
<div class="menu hidden" [ngClass]="{'hidden':!showMenu}">
<router-outlet name="app-menu"></router-outlet>
<router-outlet name="app-menu" (activate)="activateRoute()" (deactivate)="deActivateRoute()"></router-outlet>
</div>
</div>
</div>

View File

@ -1,6 +1,5 @@
import { Component, OnInit, Input } from '@angular/core';
import { IUser } from '../../models/user';
import {Store} from '@ngrx/store';
import * as appReducers from '../../reducers/app-common.reducer';
@ -15,6 +14,7 @@ export class AppMenuComponent implements OnInit {
@Input() user:IUser;
@Input() showMenu:boolean;
public noContent: boolean = true;
constructor(private store: Store<appReducers.State>) { }
@ -26,4 +26,12 @@ export class AppMenuComponent implements OnInit {
this.store.dispatch(new appActions.ToggleAppMenu());
}
activateRoute() {
this.noContent=false;
}
deActivateRoute() {
this.noContent=true;
}
}

View File

@ -1,8 +1,8 @@
<div>
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user}">
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user || noContent}">
<span i18n-title title="Help"><i class="fas fa-question" aria-hidden="true"></i></span>
<div class="menu hidden" [ngClass]="{'hidden':!showMenu}">
<router-outlet name="help-menu"></router-outlet>
<router-outlet name="help-menu" (activate)="activateRoute()" (deactivate)="deActivateRoute()"></router-outlet>
</div>
</div>
</div>

View File

@ -15,6 +15,7 @@ export class HelpMenuComponent implements OnInit {
@Input() user:IUser;
@Input() showMenu:boolean;
public noContent: boolean = true;
constructor(private store: Store<appReducers.State>) { }
@ -25,4 +26,12 @@ export class HelpMenuComponent implements OnInit {
event.stopPropagation();
this.store.dispatch(new appActions.ToggleHelpMenu());
}
activateRoute() {
this.noContent=false;
}
deActivateRoute() {
this.noContent=true;
}
}

View File

@ -1,9 +1,9 @@
<div>
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user}">
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user || noContent}">
<span class="unread badge bg-info notification rounded-pill hidden" [ngClass]="{'hidden':unread==0}">{{unread}}</span>
<span i18n-title title="Notifications"><i class="fas fa-bell" [ngClass]="{'fa-bell-on':unread!=0}" aria-hidden="true"></i></span>
<div class="menu hidden" [ngClass]="{'hidden':!showMenu}">
<router-outlet name="notification-menu"></router-outlet>
<router-outlet name="notification-menu" (activate)="activateRoute()" (deactivate)="deActivateRoute()"></router-outlet>
</div>
</div>
</div>

View File

@ -1,6 +1,5 @@
import { Component, OnInit, Input } from '@angular/core';
import { IUser } from '../../models/user';
import {Store} from '@ngrx/store';
import * as appReducers from '../../reducers/app-common.reducer';
@ -16,6 +15,7 @@ export class NotificationMenuComponent implements OnInit {
@Input() unread:number;
@Input() user:IUser;
@Input() showMenu:boolean;
public noContent: boolean = true;
constructor(private store: Store<appReducers.State>) { }
@ -27,4 +27,12 @@ export class NotificationMenuComponent implements OnInit {
this.store.dispatch(new appActions.ToggleNotificationMenu());
}
activateRoute() {
this.noContent=false;
}
deActivateRoute() {
this.noContent=true;
}
}