7 Commits

49 changed files with 13648 additions and 8485 deletions

1
.gitignore vendored
View File

@@ -51,5 +51,4 @@ projects/common-map/node_modules/
.angular/*
projects/common-map3d/node_modules/
projects/common-map/node_modules/
projects/ng-openlayers/node_modules/
projects/common/node_modules/

View File

@@ -51,7 +51,7 @@ npm install -g @angular/cli
npm install
ng serve
```
*Go*`
*Go*
Point your browser to http://localhost:4200

21543
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "farmmaps-lib-app",
"version": "4.5.0",
"version": "4.2.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
@@ -11,24 +11,23 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^17.3.3",
"@angular/common": "^17.3.3",
"@angular/compiler": "^17.3.3",
"@angular/core": "^17.3.3",
"@angular-eslint/eslint-plugin": "^15.2.1",
"@angular/forms": "^17.3.3",
"@angular/platform-browser": "^17.3.3",
"@angular/platform-browser-dynamic": "^17.3.3",
"@angular/router": "^17.3.3",
"@angular/animations": "^16.2.12",
"@angular/common": "^16.2.12",
"@angular/compiler": "^16.2.12",
"@angular/core": "^16.2.12",
"@angular/forms": "^16.2.12",
"@angular/platform-browser": "^16.2.12",
"@angular/platform-browser-dynamic": "^16.2.12",
"@angular/router": "^16.2.12",
"@farmmaps/common": "file:dist/common",
"@farmmaps/common-map": "file:dist/common-map",
"@farmmaps/common-map3d": "file:dist/common-map3d",
"ng-openlayers": "17.1.3",
"@microsoft/signalr": "^3.1.16",
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"@microsoft/signalr": "^8.0.0",
"@ng-bootstrap/ng-bootstrap": "^15.0.0",
"@ngrx/effects": "^15",
"@ngrx/router-store": "^15",
"@ngrx/store": "^14",
"@popperjs/core": "^2.11.6",
"angular-oauth2-oidc": "^13",
"assert": "^2.0.0",
@@ -39,12 +38,13 @@
"core-js": "^2.6.12",
"https-browserify": "^1.0.0",
"moment": "^2.29.4",
"ngrx-store-localstorage": "17.0.0",
"ngx-avatars": "1.7.0",
"ngx-clipboard": "16.0.0",
"ngx-image-cropper": "^7.2.1",
"ngx-uploadx": "^6.2.0",
"ol": "^8.2.0",
"ngrx-store-localstorage": "^14",
"ngx-avatars": "^1.7.0",
"ngx-clipboard": "^15.1.0",
"ngx-image-cropper": "^6.0.2",
"ngx-openlayers": "1.0.0-next.21",
"ngx-uploadx": "^5.2.0",
"ol": "6.14.1",
"olcs": "^2.13.1",
"resumablejs": "^1.1.0",
"rxjs": "^7.8.1",
@@ -54,23 +54,22 @@
"tslib": "^2.4.0",
"url": "^0.11.0",
"util": "^0.12.4",
"zone.js": "~0.14.4"
"zone.js": "~0.13.3"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^17",
"@angular-devkit/build-angular": "^17.3.3",
"@angular/cli": "^17.3.3",
"@angular/compiler-cli": "^17.3.3",
"@angular/language-service": "^17.3.3",
"@angular/localize": "^17.3.3",
"@angular-builders/custom-webpack": "^17.0.0",
"@angular-devkit/build-angular": "^17.0.8",
"@angular/cli": "^16.2.11",
"@angular/compiler-cli": "^16.2.12",
"@angular/language-service": "^16.2.12",
"@angular/localize": "^16.2.12",
"@types/arcgis-rest-api": "^10.4.5",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "^2.0.9",
"@types/node": "^12.20.15",
"@typescript-eslint/eslint-plugin": "^6.18.0",
"@typescript-eslint/eslint-plugin-tslint": "^6.18.0",
"@typescript-eslint/parser": "^6.18.0",
"codelyzer": "^0.0.28",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/eslint-plugin-tslint": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.27.5",
@@ -81,9 +80,9 @@
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"ng-packagr": "^17.3.0",
"protractor": "~7.0.0",
"ng-packagr": "^16.2.3",
"protractor": "^7.0.0",
"ts-node": "^8.8.1",
"typescript": "~5.4.4"
"typescript": "~5.1.6"
}
}

View File

@@ -1,24 +1,24 @@
{
"name": "@farmmaps/common-map",
"version": "2.0.0",
"version": "2.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@farmmaps/common-map",
"version": "2.0.0",
"version": "2.1.0",
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/core": "^17.3.3",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"ng-openlayers": "17.1.3",
"ngrx-store-localstorage": "^17",
"ol": "^8.2.0",
"tassign": "^1.0.0"
"@angular/core": ">=16.0.0",
"@ngrx/effects": ">=16.0.0",
"@ngrx/router-store": ">=16.0.0",
"@ngrx/store": ">=16.0.0",
"ngrx-store-localstorage": ">=16.0.0",
"ngx-openlayers": ">=1.0.0-next.21",
"ol": ">=6.8.1",
"tassign": ">=1.0.0"
}
},
"node_modules/tslib": {

View File

@@ -1,6 +1,6 @@
{
"name": "@farmmaps/common-map",
"version": "2.0.0",
"version": "2.1.0",
"publishConfig": {
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
},
@@ -8,13 +8,13 @@
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/core": "^17.3.3",
"ngrx-store-localstorage": "^17",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"tassign": "^1.0.0",
"ng-openlayers": "17.1.3",
"ol": "^8.2.0"
"@angular/core": ">=16.0.0",
"ngrx-store-localstorage": ">=16.0.0",
"@ngrx/effects": ">=16.0.0",
"@ngrx/router-store":">=16.0.0",
"@ngrx/store":">=16.0.0",
"tassign": ">=1.0.0",
"ngx-openlayers": ">=1.0.0-next.21",
"ol": ">=6.8.1"
}
}

View File

@@ -58,7 +58,7 @@ export const GETLAYERVALUESUCCESS = '[Map] GetLayerValueSuccess'
export const TOGGLESHOWDATALAYERSLIDE = '[Map] ToggleShowDataLayerSlide'
export const SETVIEWSTATE = '[Map] SetViewState'
export const CLEARFEATURES = '[Map] ClearFeatures';
export const SETPANELEXTRAWIDE = '[Map] SetPanelExtraWide';
export class Clear implements Action {
readonly type = CLEAR;
@@ -342,11 +342,6 @@ export class ClearFeatures implements Action {
constructor() {}
}
export class SetPanelExtraWide implements Action {
readonly type = SETPANELEXTRAWIDE;
constructor(public panelExtraWide:boolean) {}
}
export type Actions = SetMapState
| Init
| Clear
@@ -394,6 +389,5 @@ export type Actions = SetMapState
| SetPeriod
| ToggleShowDataLayerSlide
| SetViewState
| ClearFeatures
| SetPanelExtraWide;
| ClearFeatures;

View File

@@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
//external modules
import { AngularOpenlayersModule } from 'ng-openlayers';
import { AngularOpenlayersModule } from 'ngx-openlayers';
import { StoreModule, ActionReducer, MetaReducer } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";

View File

@@ -1,5 +1,5 @@
import { Component, Input, OnDestroy, OnInit, EventEmitter, Output, Inject } from '@angular/core';
import { MapComponent } from 'ng-openlayers';
import { MapComponent } from 'ngx-openlayers';
import * as proj from 'ol/proj';
import {Point,Geometry} from 'ol/geom';

View File

@@ -1,5 +1,5 @@
import { Component, OnInit, Input, ViewChild, ElementRef, OnChanges, SimpleChanges ,Host} from '@angular/core';
import { MapComponent } from 'ng-openlayers';
import { MapComponent } from 'ngx-openlayers';
import Overlay from 'ol/Overlay';
import { fromLonLat, toLonLat } from 'ol/proj';

View File

@@ -1,5 +1,5 @@
import { Component, Host, Input, Output, EventEmitter,OnDestroy, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
import { LayerGroupComponent, MapComponent } from 'ng-openlayers';
import { LayerGroupComponent, MapComponent } from 'ngx-openlayers';
import { ItemService,IItem,AppConfig } from '@farmmaps/common';
import { IItemLayer, ITemporalItemLayer} from '../../../models/item.layer';
import { ILayerData} from '../../../models/layer.data';
@@ -19,7 +19,6 @@ import VectorTileLayer from 'ol/layer/VectorTile';
import {GeoJSON,MVT} from 'ol/format';
import { Geometry } from 'ol/geom';
import BaseLayer from 'ol/layer/Base';
import Feature from 'ol/Feature';
@Component({
selector: 'fm-map-item-layers',
@@ -181,9 +180,9 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
const source = new VectorSource({
strategy: loadingstrategy.bbox,
loader: function (extent: Extent, resolution: number, projection: Projection) {
const source = this as VectorSource<Feature<Geometry>>;
const source = this as VectorSource<Geometry>;
__this.itemService.getItemFeatures(item.code, extent, projection.getCode(), layerIndex).subscribe(function (data) {
const features = format.readFeatures(data).filter(feature => feature instanceof Feature) as Feature[];
const features = format.readFeatures(data);
for (const f of features) {
if (f.get("code")) {
f.setId(f.get("code"));

View File

@@ -1,5 +1,5 @@
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken, OnDestroy, LOCALE_ID } from '@angular/core';
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from 'ng-openlayers';
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from 'ngx-openlayers';
import { ItemService, ItemTypeService, IItem, IItemType, FolderService } from '@farmmaps/common';
import { Feature } from 'ol';
@@ -29,7 +29,7 @@ import { formatNumber } from '@angular/common';
]
})
export class ItemVectorSourceComponent extends SourceVectorComponent implements OnInit, OnDestroy, OnChanges {
instance: Vector<Feature<Geometry>>;
instance: Vector<Geometry>;
private _format: GeoJSON;
private _select: Select;
private _hoverSelect: Select;
@@ -83,7 +83,6 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
ngOnInit() {
this.sub = this.folderService.getFolder('my_settings').subscribe(
userSettingsRoot => {
if (userSettingsRoot == undefined) return;
this.itemService.getChildItemList(userSettingsRoot.code, 'vnd.farmmaps.itemtype.settings.general').subscribe(
items => {
if (items && items.length > 0 && items[0].data?.displayMapFeatureSettings) {

View File

@@ -3,7 +3,7 @@ import { IItemLayer } from '../../../models/item.layer';
import { Store } from '@ngrx/store';
import * as mapReducers from '../../../reducers/map.reducer';
import * as mapActions from '../../../actions/map.actions';
import { MapComponent } from 'ng-openlayers';
import { MapComponent } from 'ngx-openlayers';
import { ILayervalue } from '../../../models/layer.value';
import { Observable, interval, Subject } from 'rxjs';
import { debounce, throttle } from 'rxjs/operators';

View File

@@ -1,9 +1,8 @@
import { Component, OnDestroy, OnInit, Input, OnChanges, SimpleChanges } from '@angular/core';
import { LayerVectorComponent, MapComponent } from 'ng-openlayers';
import { LayerVectorComponent, MapComponent } from 'ngx-openlayers';
import RenderType from 'ol/layer/Vector';
import { Vector as VectorSource } from 'ol/source';
import { Geometry } from 'ol/geom';
import Feature from 'ol/Feature';
@Component({
selector: 'fm-map-aol-layer-vector-image',
@@ -15,7 +14,7 @@ export class LayerVectorImageComponent extends LayerVectorComponent implements O
//public source: Vector;
@Input()
renderMode: RenderType<VectorSource<Feature<Geometry>>> | string = "image";
renderMode: RenderType<VectorSource<Geometry>> | string = "image";
constructor(map: MapComponent) {
super(map);

View File

@@ -1,5 +1,5 @@
import { Component, OnInit, Input, Host, OnChanges, SimpleChanges,ChangeDetectorRef } from '@angular/core';
import { MapComponent } from 'ng-openlayers';
import { MapComponent } from 'ngx-openlayers';
import {IMapState} from '../../../models/map.state'
import {View} from 'ol';
import { fromLonLat } from 'ol/proj';

View File

@@ -1,5 +1,5 @@
import { Component, Host, Input, OnInit, ChangeDetectorRef } from '@angular/core';
import { ViewComponent, MapComponent } from 'ng-openlayers';
import { ViewComponent, MapComponent } from 'ngx-openlayers';
import {View} from 'ol';

View File

@@ -1,6 +1,6 @@
import { Component, Host, Input, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ViewComponent, MapComponent } from 'ng-openlayers';
import { ViewComponent, MapComponent } from 'ngx-openlayers';
@Component({

View File

@@ -1,7 +1,7 @@
import { Directive, ViewContainerRef,TemplateRef,OnInit,Input, OnChanges } from '@angular/core';
import { Layer } from 'ol/layer';
import { Source } from 'ol/source';
import { MapComponent } from 'ng-openlayers';
import { MapComponent } from 'ngx-openlayers';
@Directive({
selector: '[fmMapIfZoomToShow]',

View File

@@ -10,7 +10,6 @@
panelVisible:panelVisible$|async,
openedModalName:openedModalName$|async,
panelCollapsed:panelCollapsed$|async,
panelExtraWide:panelExtraWide$|async,
searchMinified:searchMinified$|async,
selectedItem:selectedItem$|async,
parentItem:parentItem$|async,
@@ -65,7 +64,7 @@
</div>
<div class="side-panel-container">
<fm-side-panel [resizeable]="true" (onResize)="handlePanelResize($event)" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false" [extrawide]="state.panelExtraWide">
<fm-side-panel [resizeable]="true" (onResize)="handlePanelResize($event)" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false">
<div class="panel-wrapper" *ngIf="noContent">
<div class="panel-top bg-secondary" *ngIf="!(state.searchMinified)">
</div>
@@ -85,7 +84,7 @@
</div>
</div>
</fm-side-panel>
<fm-side-panel [resizeable]="true" [visible]="!noContent" [extrawide]="state.panelExtraWide">
<fm-side-panel [resizeable]="true" [visible]="!noContent">
<router-outlet (activate)="handleSidepaneloutletActivate($event)" (deactivate)="handleSidepaneloutletDeactivate($event)"></router-outlet>
</fm-side-panel>
</div>

View File

@@ -66,7 +66,6 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
public parentCode$: Observable<string> =this.store.select(mapReducers.selectGetParentCode);
public panelVisible$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelVisible);
public panelCollapsed$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelCollapsed);
public panelExtraWide$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelExtraWide);
public selectedFeature$: Observable<Feature<Geometry>> = this.store.select(mapReducers.selectGetSelectedFeature);
public clickedFeature: Subject<Feature<Geometry>> = new Subject<Feature<Geometry>>();
public selectedItem$: Observable<IItem> = this.store.select(mapReducers.selectGetSelectedItem);
@@ -209,18 +208,12 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
if(component && component.hasOwnProperty('clickedFeature')) {
(component as IClickedFeature).clickedFeature = this.clickedFeature;
}
if(component && component.hasOwnProperty('extrawide')) {
this.store.dispatch(new mapActions.SetPanelExtraWide(true));
}
}
handleSidepaneloutletDeactivate(component:any) {
if(component && component.hasOwnProperty('clickedFeature')) {
(component as IClickedFeature).clickedFeature = null;
}
if(component && component.hasOwnProperty('extrawide')) {
this.store.dispatch(new mapActions.SetPanelExtraWide(false));
}
}
handlePrerender(event:any) {

View File

@@ -41,7 +41,7 @@ export const {
selectRouteParam, // factory function to select a route param
selectRouteData, // select the current route data
selectUrl, // select the current url
} = fromRouter.getRouterSelectors(getRouterState);
} = fromRouter.getSelectors(getRouterState);
@Injectable()
@@ -133,7 +133,7 @@ export class MapEffects {
f.id = f.properties["code"];
}
}
return of(new mapActions.StartSearchSuccess(this._geojsonFormat.readFeatures(features).filter(feature => feature instanceof Feature) as Feature[], a.queryState));
return of(new mapActions.StartSearchSuccess(this._geojsonFormat.readFeatures(features), a.queryState));
}
),
catchError(error => of(new commonActions.Fail(error))));
@@ -218,7 +218,7 @@ export class MapEffects {
if (!this.overrideSelectedItemLayer) {
return this.itemService$.getFeature(action.item.code, "EPSG:3857").pipe(
map((feature: any) => {
const f = this._geojsonFormat.readFeature(feature) as Feature;
const f = this._geojsonFormat.readFeature(feature);
f.setId(action.item.code);
return new mapActions.AddFeatureSuccess(f);
}),

View File

@@ -49,7 +49,6 @@ export interface State {
features: Array<Feature<Geometry>>,
panelVisible: boolean,
panelCollapsed: boolean,
panelExtraWide: boolean,
selectedFeature: Feature<Geometry>,
selectedItem:IItem,
parentItem:IItem,
@@ -95,7 +94,6 @@ export const initialState: State = {
features: [],
panelVisible: false,
panelCollapsed: false,
panelExtraWide: false,
selectedFeature: null,
selectedItem: null,
parentItem: null,
@@ -574,10 +572,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
}
return state;
}
case mapActions.SETPANELEXTRAWIDE:{
const a= action as mapActions.SetPanelExtraWide;
return tassign(state,{panelExtraWide:a.panelExtraWide});
}
default: {
return state;
}
@@ -589,7 +583,6 @@ export const getParentCode = (state: State) => state.parentCode;
export const getFeatures = (state: State) => state.features;
export const getPanelVisible = (state: State) => state.panelVisible;
export const getPanelCollapsed = (state: State) => state.panelCollapsed;
export const getPanelExtraWide = (state: State) => state.panelExtraWide;
export const getSelectedFeature = (state: State) => state.selectedFeature;
export const getSelectedItem = (state: State) => state.selectedItem;
export const getParentItem = (state: State) => state.parentItem;
@@ -625,7 +618,6 @@ export const selectGetParentCode = createSelector(selectMapState, getParentCode)
export const selectGetFeatures = createSelector(selectMapState, getFeatures);
export const selectGetPanelVisible = createSelector(selectMapState, getPanelVisible);
export const selectGetPanelCollapsed = createSelector(selectMapState, getPanelCollapsed);
export const selectGetPanelExtraWide = createSelector(selectMapState, getPanelExtraWide);
export const selectGetSelectedFeature = createSelector(selectMapState, getSelectedFeature);
export const selectGetSelectedItem = createSelector(selectMapState, getSelectedItem);
export const selectGetParentItem = createSelector(selectMapState, getParentItem);

View File

@@ -10,27 +10,18 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"esModuleInterop": true,
"types": [],
"lib": [
"dom",
"es2018"
],
"paths": {
"@angular/*": [
"node_modules/@angular/*"
]
}
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"compilationMode": "partial"
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",

View File

@@ -1,20 +1,20 @@
{
"name": "@farmmaps/common-map3d",
"version": "2.0.0",
"version": "2.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@farmmaps/common-map3d",
"version": "2.0.0",
"version": "2.1.0",
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^17.3.3",
"@angular/core": "^17.3.3",
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0",
"cesium": ">=1.82.1",
"ng-openlayers": "17.1.3",
"ngx-openlayers": "1.0.0-next.21",
"ol-cesium": ">=2.13.0"
}
},

View File

@@ -1,13 +1,13 @@
{
"name": "@farmmaps/common-map3d",
"version": "2.0.0",
"version": "2.1.0",
"publishConfig": {
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
},
"peerDependencies": {
"@angular/common": "^17.3.3",
"@angular/core": "^17.3.3",
"ng-openlayers": "17.1.3",
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0",
"ngx-openlayers": "1.0.0-next.21",
"cesium": ">=1.82.1",
"ol-cesium": ">=2.13.0"
},

View File

@@ -1,6 +1,6 @@
import { Component, OnInit,Input,Host } from '@angular/core';
import { Interaction} from 'ol/interaction';
import { MapComponent } from 'ng-openlayers';
import { MapComponent } from 'ngx-openlayers';
import OLCesium from 'olcs/OLCesium';
import RasterSynchronizer from 'olcs/RasterSynchronizer';
import VectorSynchronizer from 'olcs/VectorSynchronizer';

View File

@@ -11,27 +11,18 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"esModuleInterop": true,
"types": [],
"lib": [
"dom",
"es2018"
],
"paths": {
"@angular/*": [
"node_modules/@angular/*"
]
}
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"compilationMode": "partial"
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",

View File

@@ -1,29 +1,29 @@
{
"name": "@farmmaps/common",
"version": "2.0.0",
"version": "2.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@farmmaps/common",
"version": "2.0.0",
"version": "2.1.0",
"peerDependencies": {
"@angular/common": "^17.3.3",
"@angular/core": "^17.3.3",
"@angular/forms": "^17.3.3",
"@microsoft/signalr": "^3.1.16",
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"angular-oauth2-oidc": "^13",
"bootstrap": "^5.2.0",
"moment": "^2.29.4",
"ngx-avatars": "1.7.0",
"ngx-clipboard": "16.0.0",
"ngx-image-cropper": "^7.2.1",
"ngx-uploadx": "^6.2.0",
"tassign": "^1.0.0"
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0",
"@angular/forms": ">=16.0.0",
"@microsoft/signalr": ">=3.1.3",
"@ng-bootstrap/ng-bootstrap": ">=16.0.0",
"@ngrx/effects": ">=16.0.0",
"@ngrx/router-store": ">=16.0.0",
"@ngrx/store": ">=16.0.0",
"angular-oauth2-oidc": ">=13.0.0",
"bootstrap": ">=4.4.1",
"moment": ">=2.27.0",
"ngx-avatar": ">=4.1.0",
"ngx-clipboard": ">=15.1.0",
"ngx-image-cropper": ">=6.0.2",
"ngx-uploadx": ">=5.1.0",
"tassign": ">=1.0.0"
}
}
}

View File

@@ -1,25 +1,25 @@
{
"name": "@farmmaps/common",
"version": "2.0.0",
"version": "2.1.0",
"publishConfig": {
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
},
"peerDependencies": {
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@angular/common": "^17.3.3",
"@angular/core": "^17.3.3",
"@angular/forms": "^17.3.3",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"tassign": "^1.0.0",
"bootstrap": "^5.2.0",
"@microsoft/signalr": "^3.1.16",
"ngx-uploadx": "^6.2.0",
"angular-oauth2-oidc": "^13",
"moment": "^2.29.4",
"ngx-avatars": "1.7.0",
"ngx-image-cropper": "^7.2.1",
"ngx-clipboard": "16.0.0"
"@ng-bootstrap/ng-bootstrap": ">=16.0.0",
"@angular/common": ">=16.0.0",
"@angular/core": ">=16.0.0",
"@angular/forms": ">=16.0.0",
"@ngrx/effects": ">=16.0.0",
"@ngrx/router-store": ">=16.0.0",
"@ngrx/store": ">=16.0.0",
"tassign": ">=1.0.0",
"bootstrap": ">=4.4.1",
"@microsoft/signalr": ">=3.1.3",
"ngx-uploadx": ">=5.1.0",
"angular-oauth2-oidc": ">=13.0.0",
"moment": ">=2.27.0",
"ngx-avatar": ">=4.1.0",
"ngx-image-cropper": ">=6.0.2",
"ngx-clipboard": ">=15.1.0"
}
}

View File

@@ -7,7 +7,6 @@ import {NavBarGuard} from './services/nav-bar-guard.service';
import {FullScreenGuard} from './services/full-screen-guard.service';
import {SessionClearedComponent} from './components/session-cleared/session-cleared.component';
import {NotFoundComponent} from './components/not-found/not-found.component';
import { ProductionGuard } from './services/production-guard.service';
const routes = [
@@ -22,7 +21,7 @@ const routes = [
},
{
path: '**', component: NotFoundComponent,
canActivate: [NavBarGuard, ProductionGuard]
canActivate: [NavBarGuard]
}
];

View File

@@ -18,7 +18,6 @@ import { EventService } from './services/event.service';
import { TypeaheadService } from './services/typeahead.service';
import { UserService } from './services/user.service';
import { ImageService } from './services/image.service';
import { DownloadService } from './services/download.service';
import { GeolocatorService } from './services/geolocator.service';
import { WeatherService} from './services/weather.service';
import { AppConfig } from './shared/app.config';
@@ -49,7 +48,6 @@ export {
TypeaheadService,
UserService,
ImageService,
DownloadService,
GeolocatorService,
WeatherService,
AppConfig,

View File

@@ -9,8 +9,8 @@ import { OAuthModule, AuthConfig, OAuthService, OAuthStorage } from 'angular-oau
import { StoreModule, Store } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { UploadxModule } from 'ngx-uploadx';
import { ClipboardModule } from 'ngx-clipboard';
import { UploadxModule } from 'ngx-uploadx/ngx-uploadx';
import { ClipboardModule } from 'ngx-clipboard/ngx-clipboard';
// routing module

View File

@@ -1,4 +1,4 @@
<div class="side-panel hidden" [ngClass]="{'hidden':!visible,'collapsed':collapsed,'resizeable':(resizeable && mobile),'resizing':resizing,'left':left,'extrawide':extrawide}" [ngStyle]="{'top':top}">
<div class="side-panel hidden" [ngClass]="{'hidden':!visible,'collapsed':collapsed,'resizeable':(resizeable && mobile),'resizing':resizing,'left':left}" [ngStyle]="{'top':top}">
<div *ngIf="collapsable" class="arrow rounded-end p-2" (click)="handleToggleClick($event)">
<i class="fal fa-chevron-left" aria-hidden="true"></i>
</div>

View File

@@ -15,7 +15,7 @@
}
.side-panel.collapsed {
left:-44rem;
left:-22rem;
}
.arrow {
@@ -76,6 +76,7 @@ div.resizegrip > span {
.resizeable .resizegrip {
display:block;
}
.resizeable .content {
@@ -93,17 +94,10 @@ div.resizegrip > span {
.side-panel.hidden {
width: 22rem;
left:-22rem;
left:-24rem;
height:100%;
top: 0px;
}
.side-panel.extrawide {
top:0px;
width: 44rem;
height:100%;
left:0px;
}
}

View File

@@ -1,4 +1,4 @@
import { Component, Input,Output,ViewChild,EventEmitter, ElementRef,OnChanges,SimpleChanges,HostListener,ChangeDetectorRef, ViewEncapsulation } from '@angular/core';
import { Component, Input,Output,ViewChild,EventEmitter, ElementRef,OnChanges,SimpleChanges,HostListener,ChangeDetectorRef } from '@angular/core';
@Component({
selector: 'fm-side-panel',
@@ -13,7 +13,6 @@ export class SidePanelComponent implements OnChanges {
@Input() public collapsable: boolean;
@Input() public resizeable = false;
@Input() public left = false;
@Input() public extrawide: boolean;
@Output() onResize: EventEmitter<number> = new EventEmitter<number>();
@ViewChild("resizeGrip") elementView: ElementRef;
public mobile = true;
@@ -42,7 +41,7 @@ export class SidePanelComponent implements OnChanges {
}
ngAfterViewInit() {
this.parentHeight = this.element.nativeElement.offsetParent?.clientHeight;
this.parentHeight = this.element.nativeElement.offsetParent.clientHeight;
this.setTop();
}

View File

@@ -5,9 +5,6 @@
<div class="card" *ngIf="user">
<div class="card-body">
<div class="username">{{user.name}}</div>
<div *ngIf="getProvider(); let provider">
<small><span i18n>Provider</span><span> {{provider}}</span></small>
</div>
<div><a href="#" (click)="logout($event)" i18n>logout</a></div>
</div>
</div>

View File

@@ -20,14 +20,11 @@ export class UserMenuComponent implements OnInit {
ngOnInit(): void {
}
getProvider():string | null {
const ownedClaims = this.oauthService.getIdentityClaims();
if(ownedClaims) {
if (ownedClaims["idp"] != "local") {
return ownedClaims["idp"];
}
}
return null;
getLetter():string {
if (this.user && this.user.firstName && this.user.lastName)
return this.user.firstName.substr(0,1).toUpperCase() +
this.user.lastName.substr(0,1).toUpperCase();
return this.user && this.user.name ? this.user.name.substr(0,1).toUpperCase():"";
}
logout(event:MouseEvent) {

View File

@@ -64,8 +64,6 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
code:a.user.code,
email:claims["email"]!== undefined ? claims["email"] : a.user.name,
name:claims["name"]!== undefined?claims["name"] : a.user.email,
lastName:a.user.lastName,
firstName:a.user.firstName,
claims:claims,
searchable: false
};

View File

@@ -1,29 +0,0 @@
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { IItem } from '../models/item';
import { HttpClient } from "@angular/common/http";
import { AppConfig } from "../shared/app.config";
import {ItemTypeService} from './itemtype.service';
@Injectable({
providedIn: 'root',
})
export class DownloadService {
constructor(public httpClient: HttpClient, public appConfig: AppConfig,private itemTypeService:ItemTypeService) {
}
ApiEndpoint() {
return this.appConfig.getConfig("apiEndPoint");
}
getData(itemCode: string): Observable<any> {
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/data`);
}
getData2(item: IItem): Observable<any> {
if (item.size > 0) {
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/data`)
}
return of({});
}
}

View File

@@ -152,13 +152,6 @@ export class ItemService {
return this.httpClient.put<IItem>(`${this.ApiEndpoint()}/api/v1/items/${item.code}`,item);
}
putItemFile(item: IItem, jsonObject: any): Observable<IItem> {
const formData = new FormData();
const file = new File([JSON.stringify(jsonObject, undefined, '\t')], 'data.dat', {type: 'application/json'});
formData.append('file', file);
return this.httpClient.put<any>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/data`, formData);
}
deleteItem(code: string): Observable<any> {
return this.httpClient.delete<any>(`${this.ApiEndpoint()}/api/v1/items/${code}`);
}
@@ -203,4 +196,5 @@ export class ItemService {
getBreadcrumbs(itemCode: string): Observable<IListItem[]> {
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/breadcrumbs`);
}
}

View File

@@ -27,7 +27,7 @@ export class ItemTypeService {
getExtraAttributes(itemType: string) {
let extraAttributes = null;
if (this.itemTypes[itemType] && this.itemTypes[itemType].extraAttributes) extraAttributes = this.itemTypes[itemType].extraAttributes;
if (this.itemTypes[itemType]) extraAttributes = this.itemTypes[itemType].extraAttributes;
return extraAttributes;
}

View File

@@ -1,10 +0,0 @@
import { Injectable, isDevMode } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class ProductionGuard {
canActivate(): boolean {
return !isDevMode();
}
}

View File

@@ -29,8 +29,7 @@
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true,
"compilationMode": "partial"
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",

View File

@@ -1,34 +0,0 @@
{
"compileOnSave": false,
"compilerOptions": {
"skipLibCheck": true,
"baseUrl": ".",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "es2020",
"moduleResolution": "node",
"importHelpers": true,
"target": "ES2022",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"useDefineForClassFields": false,
"rootDir": "."
},
"angularCompilerOptions": {
"skipLibs": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
},
"exclude": [
"node_modules",
"tmp"
]
}

View File

@@ -31,9 +31,6 @@
"common-map3d": [
"dist/common-map3d/common-map3d",
"dist/common-map3d"
],
"ng-openlayers/*": [
"dist/ng-openlayers/*"
]
},
"useDefineForClassFields": false