Some refactoring
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
6
projects/common-map/package-lock.json
generated
6
projects/common-map/package-lock.json
generated
@@ -5,9 +5,9 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@farmmaps/common": {
|
||||
"version": "0.0.1-prerelease.51",
|
||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-0.0.1-prerelease.51.tgz",
|
||||
"integrity": "sha512-1E7BDQVQ34N+dFiipHHUj9X50fpU3c8UqTLqwb9UpE+PpfLp+njN4rg2MXYwglbB8chlz/glaPPurYwjzDadxQ==",
|
||||
"version": "0.0.1-prerelease.56",
|
||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-0.0.1-prerelease.56.tgz",
|
||||
"integrity": "sha512-m9KxWsLkTSz2JI074gIJH1kDR0PCLsFAug8oBjtlU/QxgBySrvqHCRiODpNmNWnFyNTZHqKHJQefn3Q9iAil4g==",
|
||||
"requires": {
|
||||
"angular-oauth2-oidc": "^5.0.2",
|
||||
"ngx-uploadx": "^3.1.3",
|
||||
|
@@ -5,7 +5,7 @@
|
||||
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@farmmaps/common": "0.0.1-prerelease.51",
|
||||
"@farmmaps/common": "0.0.1-prerelease.56",
|
||||
"ngx-openlayers": "1.0.0-next.9",
|
||||
"ol": "^5.3.3"
|
||||
},
|
||||
@@ -15,6 +15,7 @@
|
||||
"@ngrx/effects": "^7.2",
|
||||
"@ngrx/router-store": "^7.2",
|
||||
"@ngrx/store": "^7.2",
|
||||
"tassign": "^1.0.0"
|
||||
"tassign": "^1.0.0",
|
||||
"@farmmaps/common": "^0.0.1"
|
||||
}
|
||||
}
|
||||
|
@@ -12,9 +12,17 @@ import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
||||
import { AppCommonModule } from '@farmmaps/common';
|
||||
|
||||
import { MODULE_NAME } from './module-name';
|
||||
import * as mapReducer from './reducers/map.reducer';
|
||||
import * as mapReducers from './reducers/map.reducer';
|
||||
import * as mapActions from './actions/map.actions';
|
||||
import * as mapEffects from './effects/map.effects';
|
||||
|
||||
import { IMapState} from './models';
|
||||
import { ISelectedFeatures } from './models';
|
||||
import { IItemLayer } from './models';
|
||||
import { ItemLayer} from './models';
|
||||
import { IQueryState } from './models';
|
||||
import { IPeriodState } from './models';
|
||||
|
||||
// components
|
||||
import { GpsLocation} from './components/aol/gps-location/gps-location.component';
|
||||
//import {Switch2D3DComponent } from './components/aol/switch2d3d/switch2d3d.component';
|
||||
@@ -58,7 +66,8 @@ import { WidgetStatusComponent } from './components/widget-status/widget-status.
|
||||
|
||||
export {
|
||||
mapEffects,
|
||||
mapReducer,
|
||||
mapReducers,
|
||||
mapActions,
|
||||
ZoomToExtentComponent,
|
||||
ItemVectorSourceComponent,
|
||||
ItemFeaturesSourceComponent,
|
||||
@@ -99,7 +108,13 @@ export {
|
||||
AbstractItemListItemComponent,
|
||||
AbstractItemListComponent,
|
||||
StateSerializerService,
|
||||
GeolocationService
|
||||
GeolocationService,
|
||||
IMapState,
|
||||
ISelectedFeatures,
|
||||
IItemLayer,
|
||||
ItemLayer,
|
||||
IQueryState,
|
||||
IPeriodState
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
@@ -107,7 +122,7 @@ export {
|
||||
CommonModule,
|
||||
AngularOpenlayersModule,
|
||||
MapRoutingModule,
|
||||
StoreModule.forFeature(MODULE_NAME, mapReducer.reducer),
|
||||
StoreModule.forFeature(MODULE_NAME, mapReducers.reducer),
|
||||
EffectsModule.forFeature([mapEffects.MapEffects]),
|
||||
NgbModule,
|
||||
FormsModule,
|
||||
|
@@ -46,51 +46,11 @@
|
||||
<div class="container-fluid">
|
||||
<div class="body">
|
||||
<div class="logo">
|
||||
<span><img src="/images/farmmapslogo.png" /></span>
|
||||
<router-outlet name="side-panel-logo"></router-outlet>
|
||||
<span><button type="button" class="btn btn-outline-secondary" (click)="handleToggleMenu($event)"><i class="fa fa-times" aria-hidden="true"></i></button></span>
|
||||
</div>
|
||||
|
||||
<div class="card menu-card">
|
||||
<div class="d-flex flex-row flex-wrap">
|
||||
<div class="shortcut-icon" (click)="handlePredefinedQuery($event,{itemType:'vnd.farmmaps.itemtype.croppingscheme'})">
|
||||
<div class="icon rounded-circle farm-icon"><i class="fm fm-farm" aria-hidden="true"></i></div>
|
||||
<div class="caption" i18n>Farms</div>
|
||||
</div>
|
||||
<div class="shortcut-icon" (click)="handleTrijntjeClick($event,{itemType:'vnd.farmmaps.itemtype.trijntje'})">
|
||||
<div class="icon rounded-circle trijntje-icon"><i class="fa fa-tint" aria-hidden="true"></i></div>
|
||||
<div class="caption" i18n>Trijntje</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card menu-card">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item py-0"><a [routerLinkActive]="['active']" [routerLink]="['/explorer/folder/my_drive']" class="nav-link"><span i18n><i class="fa fa-folder" aria-hidden="true"></i> My Drive</span></a></li>
|
||||
<li class="nav-item py-0"><a [routerLinkActive]="['active']" [routerLink]="['/explorer/folder/map_uploads']" class="nav-link"><span i18n><i class="fa fa-cloud-upload" aria-hidden="true"></i> Map uploads</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card menu-card">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item py-0">
|
||||
<a class="nav-link" href="#" (click)="handleToggleBaseLayers($event)" i18n><i class="fa fa-map" aria-hidden="true"></i> Base maps <i class="fa" [ngClass]="{'fa-caret-down':baseLayersCollapsed,'fa-caret-up':!baseLayersCollapsed}" aria-hidden="true"></i></a>
|
||||
<div [ngbCollapse]="baseLayersCollapsed" class="mb-4">
|
||||
<fm-map-layer-list [baseLayers]="true" [itemLayers]="baseLayers|async" [selectedLayer]="selectedBaseLayer|async" (onSelectLayer)="handleSelectBaseLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item py-0">
|
||||
<a class="nav-link" href="#" (click)="handleToggleOverlayLayers($event)" i18n><i class="fa fa-map" aria-hidden="true"></i> Overlays <i class="fa" [ngClass]="{'fa-caret-down':overlayLayersCollapsed,'fa-caret-up':!overlayLayersCollapsed}" aria-hidden="true"></i></a>
|
||||
<div [ngbCollapse]="overlayLayersCollapsed" class="mb-4">
|
||||
<fm-map-layer-list [itemLayers]="overlayLayers|async" [selectedLayer]="selectedOverlayLayer|async" (onDelete)="handleOnDelete($event)" (onToggleVisibility)="handleOnToggleVisibility($event)" (onSetOpacity)="handleOnSetOpacity($event)" (onZoomToExtent)="handleZoomToExtent($event)" (onSelectLayer)="handleSelectOverlayLayer($event)"></fm-map-layer-list>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--<div class="card menu-card">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item py-0"><a class="nav-link" href="#" (click)="handlePredefinedQuery($event,{itemType:'vnd.farmmaps.itemtype.croppingscheme'})"><span i18n>Farms</span></a></li>
|
||||
<li class="nav-item py-0"><a class="nav-link" href="#" (click)="handlePredefinedQuery($event,{itemType:'vnd.farmmaps.itemtype.layer'})"><span i18n>Layers</span></a></li>
|
||||
</ul>
|
||||
</div>-->
|
||||
</div>
|
||||
<router-outlet name="side-panel-menu"></router-outlet>
|
||||
</div>
|
||||
</div>
|
||||
</fm-side-panel>
|
||||
|
||||
|
@@ -91,11 +91,6 @@ div.logo {
|
||||
margin-bottom:1em;
|
||||
}
|
||||
|
||||
div.logo img {
|
||||
width:100%;
|
||||
align-self:center;
|
||||
}
|
||||
|
||||
div.logo button {
|
||||
margin-left:1em;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// angular modules
|
||||
import { NgModule, APP_INITIALIZER, ModuleWithProviders, Injector } from '@angular/core';
|
||||
import { NgModule, APP_INITIALIZER, ModuleWithProviders, Injector,Optional,SkipSelf } from '@angular/core';
|
||||
import { CommonModule, DatePipe } from '@angular/common';
|
||||
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
@@ -137,6 +137,12 @@ export {FolderService,
|
||||
]
|
||||
})
|
||||
export class AppCommonModule {
|
||||
constructor (@Optional() @SkipSelf() parentModule: AppCommonModule) {
|
||||
if (parentModule) {
|
||||
throw new Error(
|
||||
'AppCommonModule is already loaded. Import it in the AppModule only');
|
||||
}
|
||||
}
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return {
|
||||
ngModule: AppCommonModule,
|
||||
@@ -152,19 +158,7 @@ export class AppCommonModule {
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: AccessTokenInterceptor,
|
||||
multi: true
|
||||
},
|
||||
ResumableFileUploadService,
|
||||
EventService,
|
||||
FolderService,
|
||||
UserService,
|
||||
ItemService,
|
||||
TypeaheadService,
|
||||
AuthCallbackGuard,
|
||||
AuthGuard,
|
||||
NavBarGuard,
|
||||
FullScreenGuard,
|
||||
TimespanService,
|
||||
ItemTypeService
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
@@ -13,7 +13,9 @@ import * as appCommonReducer from '../reducers/app-common.reducer'
|
||||
import * as appCommonActions from '../actions/app-common.actions';
|
||||
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class AuthGuard implements CanActivate, CanLoad, CanActivateChild {
|
||||
|
||||
private loginDispatched = false;
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import { Component, Injectable } from '@angular/core';
|
||||
import { NgbDateAdapter, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class NgbDateNativeAdapter extends NgbDateAdapter<Date> {
|
||||
|
||||
fromModel(date: Date): NgbDateStruct {
|
||||
|
@@ -6,7 +6,9 @@ import { HubConnection, HubConnectionBuilder, LogLevel ,HttpTransportType} from
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EventService {
|
||||
|
||||
public event:Subject <IEventMessage> = new Subject<IEventMessage>();
|
||||
|
@@ -6,7 +6,9 @@ import { IItem } from '../models/item';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class FolderService {
|
||||
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
|
@@ -7,7 +7,9 @@ import * as appCommonReducer from '../reducers/app-common.reducer'
|
||||
import * as appCommonActions from '../actions/app-common.actions';
|
||||
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class FullScreenGuard implements CanActivate {
|
||||
|
||||
private loginDispatched = false;
|
||||
|
@@ -7,7 +7,9 @@ import { IItemTask } from '../models/itemTask';
|
||||
import { HttpClient, HttpParams } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ItemService {
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
}
|
||||
|
@@ -4,7 +4,9 @@ import * as appCommonReducer from '../reducers/app-common.reducer'
|
||||
import {IItemTypes} from '../models/item.types'
|
||||
import {IItem} from '../models/item'
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ItemTypeService {
|
||||
public itemTypes: IItemTypes;
|
||||
|
||||
|
@@ -7,7 +7,9 @@ import * as appCommonReducer from '../reducers/app-common.reducer'
|
||||
import * as appCommonActions from '../actions/app-common.actions';
|
||||
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class NavBarGuard implements CanActivate {
|
||||
|
||||
private loginDispatched = false;
|
||||
|
@@ -3,7 +3,9 @@ import { DatePipe } from '@angular/common';
|
||||
import { Observable , Observer } from 'rxjs';
|
||||
import { ITypeaheadItem } from '../models/typeahead.item';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TimespanService {
|
||||
constructor(private datePipe: DatePipe) {
|
||||
}
|
||||
|
@@ -4,7 +4,9 @@ import { ITypeaheadItem } from '../models/typeahead.item';
|
||||
import { HttpClient, HttpParams } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TypeaheadService {
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
}
|
||||
|
@@ -4,7 +4,9 @@ import { IUser } from '../models/user';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
|
||||
@Injectable()
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class UserService {
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
}
|
||||
|
@@ -20,7 +20,6 @@ export class AppConfig {
|
||||
return this.config[key];
|
||||
}
|
||||
|
||||
|
||||
public load(): Promise<any> {
|
||||
return this.httpClient.get('/configuration.json')
|
||||
.toPromise()
|
||||
|
Reference in New Issue
Block a user