Compare commits
28 Commits
FarmMapsLi
...
709c76a851
Author | SHA1 | Date | |
---|---|---|---|
|
709c76a851 | ||
|
677608c14d | ||
|
fd8025c674 | ||
|
560c426bc0 | ||
|
e1fef2d7f3 | ||
|
f44b079cde | ||
|
8e5383b0f2 | ||
|
615872992f | ||
|
2e0b090fb7 | ||
|
5d7fd63adc | ||
|
0948bacaaf | ||
8fd653afbc | |||
b058cb80b1 | |||
|
490ae1868b | ||
|
4384fd1387 | ||
|
529b1c9bd7 | ||
|
fc84548d8a | ||
|
e57b8297c0 | ||
|
efe38aba62 | ||
|
7bd5dada2b | ||
|
16db063339 | ||
|
5d79dcc7b6 | ||
|
deda769e8b | ||
|
f31e4154b2 | ||
|
7476e4c928 | ||
|
d5258b7c79 | ||
|
04929a1ca3 | ||
|
67e0e5ed5d |
@@ -16,8 +16,8 @@ Use one of the two options below to get started.
|
|||||||
*Setup*
|
*Setup*
|
||||||
|
|
||||||
```
|
```
|
||||||
docker pull node:10.16.0
|
docker pull node:12.13.1
|
||||||
docker run -t -i --entrypoint /bin/bash -p 4200:4200 node:10.16.0
|
docker run -t -i --entrypoint /bin/bash -p 4200:4200 node:12.13.1
|
||||||
```
|
```
|
||||||
|
|
||||||
Inside the running container
|
Inside the running container
|
||||||
|
@@ -66,7 +66,7 @@
|
|||||||
{
|
{
|
||||||
"type": "initial",
|
"type": "initial",
|
||||||
"maximumWarning": "2mb",
|
"maximumWarning": "2mb",
|
||||||
"maximumError": "5mb"
|
"maximumError": "7mb"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
9460
package-lock.json
generated
9460
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@@ -11,40 +11,40 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "~7.2.0",
|
"@angular/animations": "~8.2.14",
|
||||||
"@angular/common": "~7.2.0",
|
"@angular/common": "~8.2.14",
|
||||||
"@angular/compiler": "~7.2.0",
|
"@angular/compiler": "~8.2.14",
|
||||||
"@angular/core": "~7.2.0",
|
"@angular/core": "~8.2.14",
|
||||||
"@angular/forms": "~7.2.0",
|
"@angular/forms": "~8.2.14",
|
||||||
"@angular/platform-browser": "~7.2.0",
|
"@angular/platform-browser": "~8.2.14",
|
||||||
"@angular/platform-browser-dynamic": "~7.2.0",
|
"@angular/platform-browser-dynamic": "~8.2.14",
|
||||||
"@angular/router": "~7.2.0",
|
"@angular/router": "~8.2.14",
|
||||||
"@aspnet/signalr": "^1.1.4",
|
"@aspnet/signalr": "^1.1.4",
|
||||||
"@farmmaps/common": ">=0.0.1-prerelease.69 <0.0.1",
|
"@farmmaps/common": ">=0.0.1-prerelease.95 <0.0.1",
|
||||||
"@farmmaps/common-map": ">=0.0.1-prerelease.69 <0.0.1",
|
"@farmmaps/common-map": ">=0.0.1-prerelease.95 <0.0.1",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^4.2.1",
|
"@ng-bootstrap/ng-bootstrap": "^4.2.1",
|
||||||
"@ngrx/effects": "^7.2.0",
|
"@ngrx/effects": "^8.2.0",
|
||||||
"@ngrx/router-store": "^7.2.0",
|
"@ngrx/router-store": "^8.2.0",
|
||||||
"@ngrx/store": "^7.2.0",
|
"@ngrx/store": "^8.2.0",
|
||||||
"bootstrap": "^4.3.1",
|
"bootstrap": "^4.3.1",
|
||||||
"font-awesome": "^4.7.0",
|
"font-awesome": "^4.7.0",
|
||||||
"core-js": "^2.5.4",
|
"core-js": "^2.5.4",
|
||||||
"ngrx-store-localstorage": "^8.0.0",
|
"ngrx-store-localstorage": "^8.0.0",
|
||||||
"resumablejs": "^1.1.0",
|
"resumablejs": "^1.1.0",
|
||||||
"rxjs": "~6.3.3",
|
"rxjs": "~6.5.3",
|
||||||
"tassign": "^1.0.0",
|
"tassign": "^1.0.0",
|
||||||
"zone.js": "~0.8.26"
|
"zone.js": "~0.9.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "~0.13.0",
|
"@angular-devkit/build-angular": "~0.803.19",
|
||||||
"@angular-devkit/build-ng-packagr": "~0.13.0",
|
"@angular-devkit/build-ng-packagr": "~0.803.19",
|
||||||
"@angular/cli": "~7.3.8",
|
"@angular/cli": "~8.3.19",
|
||||||
"@angular/compiler-cli": "~7.2.0",
|
"@angular/compiler-cli": "~8.2.14",
|
||||||
"@angular/language-service": "~7.2.0",
|
"@angular/language-service": "~8.2.14",
|
||||||
"@types/node": "~8.9.4",
|
"@types/node": "~8.9.4",
|
||||||
"@types/jasmine": "~2.8.8",
|
"@types/jasmine": "~2.8.8",
|
||||||
"@types/jasminewd2": "~2.0.3",
|
"@types/jasminewd2": "~2.0.3",
|
||||||
"codelyzer": "~4.5.0",
|
"codelyzer": "^5.0.1",
|
||||||
"jasmine-core": "~2.99.1",
|
"jasmine-core": "~2.99.1",
|
||||||
"jasmine-spec-reporter": "~4.2.1",
|
"jasmine-spec-reporter": "~4.2.1",
|
||||||
"karma": "~4.0.0",
|
"karma": "~4.0.0",
|
||||||
@@ -52,12 +52,12 @@
|
|||||||
"karma-coverage-istanbul-reporter": "~2.0.1",
|
"karma-coverage-istanbul-reporter": "~2.0.1",
|
||||||
"karma-jasmine": "~1.1.2",
|
"karma-jasmine": "~1.1.2",
|
||||||
"karma-jasmine-html-reporter": "^0.2.2",
|
"karma-jasmine-html-reporter": "^0.2.2",
|
||||||
"ng-packagr": "^4.2.0",
|
"ng-packagr": "^5.4.0",
|
||||||
"protractor": "~5.4.0",
|
"protractor": "~5.4.0",
|
||||||
"ts-node": "~7.0.0",
|
"ts-node": "~7.0.0",
|
||||||
"tsickle": ">=0.34.0",
|
"tsickle": "^0.37.0",
|
||||||
"tslib": "^1.9.0",
|
"tslib": "^1.9.0",
|
||||||
"tslint": "~5.11.0",
|
"tslint": "~5.11.0",
|
||||||
"typescript": "~3.2.2"
|
"typescript": "~3.5.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
76
projects/common-map/package-lock.json
generated
76
projects/common-map/package-lock.json
generated
@@ -4,68 +4,42 @@
|
|||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@farmmaps/common": {
|
"@openlayers/pepjs": {
|
||||||
"version": "0.0.1-prerelease.56",
|
"version": "0.5.3",
|
||||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-0.0.1-prerelease.56.tgz",
|
"resolved": "https://registry.npmjs.org/@openlayers/pepjs/-/pepjs-0.5.3.tgz",
|
||||||
"integrity": "sha512-m9KxWsLkTSz2JI074gIJH1kDR0PCLsFAug8oBjtlU/QxgBySrvqHCRiODpNmNWnFyNTZHqKHJQefn3Q9iAil4g==",
|
"integrity": "sha512-Bgvi5c14BS0FJWyYWWFstNEnXsB30nK8Jt8hkAAdqr7E0gDdBBWVDglF3Ub19wTxvgJ/CVHyTY6VuCtnyRzglg=="
|
||||||
"requires": {
|
|
||||||
"angular-oauth2-oidc": "^5.0.2",
|
|
||||||
"ngx-uploadx": "^3.1.3",
|
|
||||||
"tslib": "^1.9.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"angular-oauth2-oidc": {
|
|
||||||
"version": "5.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/angular-oauth2-oidc/-/angular-oauth2-oidc-5.0.2.tgz",
|
|
||||||
"integrity": "sha512-jtOv4IWEjSFfBHVE4seWGWT/ZfWJ95QJ1JaFhVVGJEF64ibGuPwV3ztwTOUl98QHi/Yg4PXXDAisb31JnIbxBw==",
|
|
||||||
"requires": {
|
|
||||||
"jsrsasign": "^8.0.12",
|
|
||||||
"tslib": "^1.9.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"ieee754": {
|
"ieee754": {
|
||||||
"version": "1.1.13",
|
"version": "1.1.13",
|
||||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
|
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
|
||||||
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
|
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
|
||||||
},
|
},
|
||||||
"jsrsasign": {
|
|
||||||
"version": "8.0.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-8.0.12.tgz",
|
|
||||||
"integrity": "sha1-Iqu5ZW00owuVMENnIINeicLlwxY="
|
|
||||||
},
|
|
||||||
"ngx-openlayers": {
|
"ngx-openlayers": {
|
||||||
"version": "1.0.0-next.9",
|
"version": "1.0.0-next.13",
|
||||||
"resolved": "https://registry.npmjs.org/ngx-openlayers/-/ngx-openlayers-1.0.0-next.9.tgz",
|
"resolved": "https://registry.npmjs.org/ngx-openlayers/-/ngx-openlayers-1.0.0-next.13.tgz",
|
||||||
"integrity": "sha512-14UFxJX9oeOXtq+HJCJyXn0sBmYmCqj2AnFtetKk1FsDe8EUMFGIRju8UOFegCr2oEu5JsuRjALcfW7lCe+teg==",
|
"integrity": "sha512-6y724s5JV6n1oxEhryxP3wcbwzpierj9RLiMLXInfKOG3l5IO1AtPNkeK9+mKctVDUVm5URIfzzZH02Ld+bvSQ==",
|
||||||
"requires": {
|
|
||||||
"tslib": "^1.9.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ngx-uploadx": {
|
|
||||||
"version": "3.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/ngx-uploadx/-/ngx-uploadx-3.3.2.tgz",
|
|
||||||
"integrity": "sha512-gRdXXq2cRU9HE6dj65qay9GV8NRC7n8y5LtMzJWqsfu2k3CHMQxo2TqZwA9/l/PqJ76RoO7sTPy1OenFQ+krkQ==",
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^1.9.0"
|
"tslib": "^1.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ol": {
|
"ol": {
|
||||||
"version": "5.3.3",
|
"version": "6.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ol/-/ol-5.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/ol/-/ol-6.1.1.tgz",
|
||||||
"integrity": "sha512-7eU4x8YMduNcED1D5wI+AMWDRe7/1HmGfsbV+kFFROI9RNABU/6n4osj6Q3trZbxxKnK2DSRIjIRGwRHT/Z+Ww==",
|
"integrity": "sha512-0dL3i3eJqgOpqIjDKEY3grkeQnjAYfV5L/JCxhOu4SxiaizRwFrFgeas6LILRoxKa03jhQFbut2r2bbgcLGQeA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"pbf": "3.1.0",
|
"@openlayers/pepjs": "^0.5.3",
|
||||||
|
"pbf": "3.2.1",
|
||||||
"pixelworks": "1.1.0",
|
"pixelworks": "1.1.0",
|
||||||
"rbush": "2.0.2"
|
"rbush": "^3.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pbf": {
|
"pbf": {
|
||||||
"version": "3.1.0",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/pbf/-/pbf-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz",
|
||||||
"integrity": "sha512-/hYJmIsTmh7fMkHAWWXJ5b8IKLWdjdlAFb3IHkRBn1XUhIYBChVGfVwmHEAV3UfXTxsP/AKfYTXTS/dCPxJd5w==",
|
"integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ieee754": "^1.1.6",
|
"ieee754": "^1.1.12",
|
||||||
"resolve-protobuf-schema": "^2.0.0"
|
"resolve-protobuf-schema": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pixelworks": {
|
"pixelworks": {
|
||||||
@@ -79,16 +53,16 @@
|
|||||||
"integrity": "sha512-Xdayp8sB/mU+sUV4G7ws8xtYMGdQnxbeIfLjyO9TZZRJdztBGhlmbI5x1qcY4TG5hBkIKGnc28i7nXxaugu88w=="
|
"integrity": "sha512-Xdayp8sB/mU+sUV4G7ws8xtYMGdQnxbeIfLjyO9TZZRJdztBGhlmbI5x1qcY4TG5hBkIKGnc28i7nXxaugu88w=="
|
||||||
},
|
},
|
||||||
"quickselect": {
|
"quickselect": {
|
||||||
"version": "1.1.1",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/quickselect/-/quickselect-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
|
||||||
"integrity": "sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ=="
|
"integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw=="
|
||||||
},
|
},
|
||||||
"rbush": {
|
"rbush": {
|
||||||
"version": "2.0.2",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/rbush/-/rbush-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz",
|
||||||
"integrity": "sha512-XBOuALcTm+O/H8G90b6pzu6nX6v2zCKiFG4BJho8a+bY6AER6t8uQUZdi5bomQc0AprCWhEGa7ncAbbRap0bRA==",
|
"integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"quickselect": "^1.0.1"
|
"quickselect": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"resolve-protobuf-schema": {
|
"resolve-protobuf-schema": {
|
||||||
|
@@ -5,16 +5,16 @@
|
|||||||
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ngx-openlayers": "1.0.0-next.9",
|
"ngx-openlayers": "1.0.0-next.13",
|
||||||
"ol": "^5.3.3"
|
"ol": "^6.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/core": "^7.2.0",
|
"@angular/core": "^8.2.0",
|
||||||
"ngrx-store-localstorage": "^8.0.0",
|
"ngrx-store-localstorage": "^8.0.0",
|
||||||
"@ngrx/effects": "^7.2",
|
"@ngrx/effects": "^8.2",
|
||||||
"@ngrx/router-store": "^7.2",
|
"@ngrx/router-store": "^8.2",
|
||||||
"@ngrx/store": "^7.2",
|
"@ngrx/store": "^8.2",
|
||||||
"tassign": "^1.0.0",
|
"tassign": "^1.0.0",
|
||||||
"@farmmaps/common": ">=0.0.1-prerelease.56 <0.0.1"
|
"@farmmaps/common": ">=0.0.1-prerelease.90 <0.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
|
|
||||||
import { IMapState,IItemLayer,IQueryState } from '../models';
|
import { IMapState } from '../models/map.state';
|
||||||
|
import { IItemLayer } from '../models/item.layer';
|
||||||
|
import { IQueryState } from '../models/query.state';
|
||||||
import { IItem } from '@farmmaps/common';
|
import { IItem } from '@farmmaps/common';
|
||||||
import { Feature } from 'ol';
|
import { Feature } from 'ol';
|
||||||
import { Extent } from 'ol/extent';
|
import { Extent } from 'ol/extent';
|
||||||
|
@@ -16,12 +16,12 @@ import * as mapReducers from './reducers/map.reducer';
|
|||||||
import * as mapActions from './actions/map.actions';
|
import * as mapActions from './actions/map.actions';
|
||||||
import * as mapEffects from './effects/map.effects';
|
import * as mapEffects from './effects/map.effects';
|
||||||
|
|
||||||
import { IMapState} from './models';
|
import { IMapState} from './models/map.state';
|
||||||
import { ISelectedFeatures } from './models';
|
import { ISelectedFeatures } from './models/selected.features';
|
||||||
import { IItemLayer } from './models';
|
import { IItemLayer } from './models/item.layer';
|
||||||
import { ItemLayer} from './models';
|
import { ItemLayer} from './models/item.layer';
|
||||||
import { IQueryState } from './models';
|
import { IQueryState } from './models/query.state';
|
||||||
import { IPeriodState } from './models';
|
import { IPeriodState } from './models/period.state';
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import { GpsLocation} from './components/aol/gps-location/gps-location.component';
|
import { GpsLocation} from './components/aol/gps-location/gps-location.component';
|
||||||
@@ -54,7 +54,7 @@ import { LayerListComponent } from './components/aol/layer-list/layer-list.compo
|
|||||||
import { MetaDataModalComponent } from './components/meta-data-modal/meta-data-modal.component';
|
import { MetaDataModalComponent } from './components/meta-data-modal/meta-data-modal.component';
|
||||||
import { SelectPeriodModalComponent } from './components/select-period-modal/select-period-modal.component';
|
import { SelectPeriodModalComponent } from './components/select-period-modal/select-period-modal.component';
|
||||||
import { MapComponent } from './components/map/map.component';
|
import { MapComponent } from './components/map/map.component';
|
||||||
import { MapSearchComponent } from './components/map-search';
|
import { MapSearchComponent } from './components/map-search/map-search.component';
|
||||||
import { MapRoutingModule } from './common-map-routing.module';
|
import { MapRoutingModule } from './common-map-routing.module';
|
||||||
import { LegendComponent } from './components/legend/legend.component';
|
import { LegendComponent } from './components/legend/legend.component';
|
||||||
import { LayerVectorImageComponent } from './components/aol/layer-vector-image/layer-vector-image.component';
|
import { LayerVectorImageComponent } from './components/aol/layer-vector-image/layer-vector-image.component';
|
||||||
|
@@ -23,7 +23,7 @@ export class GpsLocation implements OnInit,OnChanges{
|
|||||||
public path: string = "";
|
public path: string = "";
|
||||||
public rotate: string = "";
|
public rotate: string = "";
|
||||||
private resolution: number = 0;
|
private resolution: number = 0;
|
||||||
@ViewChild('location') locationElement: ElementRef;
|
@ViewChild('location', { static: true }) locationElement: ElementRef;
|
||||||
|
|
||||||
constructor(private map: MapComponent) {
|
constructor(private map: MapComponent) {
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@ import { LayerVectorComponent, SourceVectorComponent, MapComponent, LayerImageCo
|
|||||||
import { LayerVectorImageComponent } from '../layer-vector-image/layer-vector-image.component';
|
import { LayerVectorImageComponent } from '../layer-vector-image/layer-vector-image.component';
|
||||||
import { ItemService } from '@farmmaps/common';
|
import { ItemService } from '@farmmaps/common';
|
||||||
import { IItem } from '@farmmaps/common';
|
import { IItem } from '@farmmaps/common';
|
||||||
import { ISelectedFeatures } from '../../../models';
|
import { ISelectedFeatures } from '../../../models/selected.features';
|
||||||
|
|
||||||
import {Vector} from 'ol/source';
|
import {Vector} from 'ol/source';
|
||||||
import {Feature,Collection} from 'ol';
|
import {Feature,Collection} from 'ol';
|
||||||
|
@@ -3,8 +3,9 @@ import { HttpClient } from "@angular/common/http";
|
|||||||
import { LayerVectorComponent, LayerTileComponent, LayerGroupComponent, MapComponent } from 'ngx-openlayers';
|
import { LayerVectorComponent, LayerTileComponent, LayerGroupComponent, MapComponent } from 'ngx-openlayers';
|
||||||
import { ItemService } from '@farmmaps/common';
|
import { ItemService } from '@farmmaps/common';
|
||||||
import { AppConfig } from '@farmmaps/common';
|
import { AppConfig } from '@farmmaps/common';
|
||||||
import { IItemLayer, ILayerData, IRenderoutputTiles, IRenderoutputImage, IGradientstop, ILayer, IHistogram } from '../../../models';
|
import { IItemLayer} from '../../../models/item.layer';
|
||||||
|
import { ILayerData} from '../../../models/layer.data';
|
||||||
|
import { IRenderoutputTiles,IRenderoutputImage,IGradientstop,ILayer,IHistogram} from '../../../models/color.map';
|
||||||
import {Extent} from 'ol/extent';
|
import {Extent} from 'ol/extent';
|
||||||
import Projection from 'ol/proj/Projection';
|
import Projection from 'ol/proj/Projection';
|
||||||
import * as proj from 'ol/proj';
|
import * as proj from 'ol/proj';
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Component,Input,Output,EventEmitter } from '@angular/core';
|
import { Component,Input,Output,EventEmitter } from '@angular/core';
|
||||||
import { IItemLayer } from '../../../models';
|
import { IItemLayer } from '../../../models/item.layer';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'fm-map-layer-list',
|
selector: 'fm-map-layer-list',
|
||||||
|
@@ -21,7 +21,7 @@ export class FeatureListContainerComponent {
|
|||||||
@Input() features: Array<Feature>
|
@Input() features: Array<Feature>
|
||||||
@Input() queryState: IQueryState;
|
@Input() queryState: IQueryState;
|
||||||
|
|
||||||
@ViewChild(WidgetHostDirective) widgetHost: WidgetHostDirective;
|
@ViewChild(WidgetHostDirective, { static: true }) widgetHost: WidgetHostDirective;
|
||||||
|
|
||||||
loadComponent(queryState:IQueryState) {
|
loadComponent(queryState:IQueryState) {
|
||||||
var componentFactory: ComponentFactory<AbstractFeatureListComponent> = this.componentFactoryResolver.resolveComponentFactory(FeatureListComponent); // default
|
var componentFactory: ComponentFactory<AbstractFeatureListComponent> = this.componentFactoryResolver.resolveComponentFactory(FeatureListComponent); // default
|
||||||
|
@@ -19,7 +19,7 @@ export class FeatureListFeatureContainerComponent {
|
|||||||
|
|
||||||
@Input() feature: Feature;
|
@Input() feature: Feature;
|
||||||
|
|
||||||
@ViewChild(WidgetHostDirective) widgetHost: WidgetHostDirective;
|
@ViewChild(WidgetHostDirective, { static: true }) widgetHost: WidgetHostDirective;
|
||||||
|
|
||||||
loadComponent() {
|
loadComponent() {
|
||||||
var componentFactory: ComponentFactory<AbstractFeatureListFeatureComponent> = this.componentFactoryResolver.resolveComponentFactory(FeatureListFeatureComponent); // default
|
var componentFactory: ComponentFactory<AbstractFeatureListFeatureComponent> = this.componentFactoryResolver.resolveComponentFactory(FeatureListFeatureComponent); // default
|
||||||
|
@@ -8,7 +8,7 @@ import * as mapActions from '../../actions/map.actions';
|
|||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { withLatestFrom } from 'rxjs/operators';
|
import { withLatestFrom } from 'rxjs/operators';
|
||||||
import { tassign } from 'tassign';
|
import { tassign } from 'tassign';
|
||||||
import { IQueryState } from '../../models';
|
import { IQueryState } from '../../models/query.state';
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -19,7 +19,7 @@ export class ItemListItemContainerComponent {
|
|||||||
|
|
||||||
@Input() item: IListItem;
|
@Input() item: IListItem;
|
||||||
|
|
||||||
@ViewChild(WidgetHostDirective) widgetHost: WidgetHostDirective;
|
@ViewChild(WidgetHostDirective, { static: true }) widgetHost: WidgetHostDirective;
|
||||||
|
|
||||||
loadComponent() {
|
loadComponent() {
|
||||||
var componentFactory: ComponentFactory<AbstractItemListItemComponent> = this.componentFactoryResolver.resolveComponentFactory(ItemListItemComponent); // default
|
var componentFactory: ComponentFactory<AbstractItemListItemComponent> = this.componentFactoryResolver.resolveComponentFactory(ItemListItemComponent); // default
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<div *ngIf="items;let items" class="widget-container">
|
<div *ngIf="items;let items" class="widget-container pt-0">
|
||||||
<div class="widget" *ngFor="let item of items" (click)="handleItemClick(item)">
|
<div class="widget" *ngFor="let item of items" (click)="handleItemClick(item)">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<fm-map-item-list-item-container [item]="item" class="item-container"></fm-map-item-list-item-container>
|
<fm-map-item-list-item-container [item]="item" class="item-container"></fm-map-item-list-item-container>
|
||||||
|
@@ -1,14 +1,10 @@
|
|||||||
import { Component, Input, Injectable } from '@angular/core';
|
import { Component, Input, Injectable } from '@angular/core';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { Feature } from 'ol';
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import * as mapReducers from '../../reducers/map.reducer';
|
import * as mapReducers from '../../reducers/map.reducer';
|
||||||
import { commonReducers,ItemTypeService, IItem, Item,IListItem } from '@farmmaps/common';
|
import { commonReducers,ItemTypeService,IListItem } from '@farmmaps/common';
|
||||||
import * as mapActions from '../../actions/map.actions';
|
import * as mapActions from '../../actions/map.actions';
|
||||||
import { Observable, from } from 'rxjs';
|
|
||||||
import { withLatestFrom } from 'rxjs/operators';
|
|
||||||
import { tassign } from 'tassign';
|
import { tassign } from 'tassign';
|
||||||
import { IQueryState } from '../../models';
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<div *ngIf="widgets;let widgets" class="widget-container">
|
<div *ngIf="widgets;let widgets" class="widget-container pt-0">
|
||||||
<div class="widget" *ngFor="let widget of widgets">
|
<div class="widget" *ngFor="let widget of widgets">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<ng-template #widgetTemplate></ng-template>
|
<ng-template #widgetTemplate></ng-template>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<table class="container" *ngIf="layer">
|
<table class="container" *ngIf="showLegend()">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
@@ -14,20 +14,22 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngFor="let entry of layer.renderer.colorMap.entries; let i = index ">
|
<tr *ngFor="let entry of layer.renderer.colorMap.entries; let i = index ">
|
||||||
<td class="legend-items"><div [style.background-color]="getHex(entry.color)"></div></td>
|
<td class="legend-items"><span [style.background-color]="getHex(entry.color)" class="color"></span></td>
|
||||||
<td class="legend-items-text">{{entry.value | number:'1.0-2'}} {{legendunit}}</td>
|
<td class="legend-items-text"><span *ngIf="!entry.label">{{entry.value | number:'1.0-2'}} {{legendunit}}</span><span *ngIf="entry.label">{{entry.label}}</span></td>
|
||||||
<!--<td class="histogram-items-text"><span *ngIf="histogramenabled">{{entry.value}} {{histogramunit}}</span></td>
|
|
||||||
<td class="histogram-items">
|
<td class="histogram-items">
|
||||||
<div *ngIf="histogramenabled" [style.background-color]="getHex(selectedColorMap.noValue)" [style.width]="getPart(selectedColorMap, entry)">
|
<div *ngIf="showHistogram()">
|
||||||
|
<span class="bar" [style.background-color]="getHex(entry.color)" [style.width]="getPart(layer.renderer, i)">
|
||||||
|
</span>
|
||||||
|
<span class="bar-label">{{getLabel(layer.renderer,i)}}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>-->
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4"></td>
|
<td colspan="4"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--<tr>
|
<!--<tr *ngIf="layer.renderer.colorMap.entries.length > 0">
|
||||||
<td>
|
<td>
|
||||||
<i class="fas fa-chart-bar" (click)="onClickHistoGram()"></i>
|
<i title="Show histogram" class="fa fa-bar-chart fa-rotate-90" (click)="onClickHistoGram()"></i>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="3"></td>
|
<td colspan="3"></td>
|
||||||
</tr>-->
|
</tr>-->
|
||||||
|
@@ -16,9 +16,13 @@
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.legend-items {
|
span.color {
|
||||||
|
display:inline-block;
|
||||||
width: 1.5em;
|
width: 1.5em;
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend-items {
|
||||||
padding: 0.1em;
|
padding: 0.1em;
|
||||||
border-style: none;
|
border-style: none;
|
||||||
border-width: 0.05em;
|
border-width: 0.05em;
|
||||||
@@ -36,16 +40,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.histogram-items {
|
.histogram-items {
|
||||||
width: 5em;
|
width: 100%;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.histogram-items > div {
|
|
||||||
height: 1em;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 0.05em;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.histogram-items-text {
|
.histogram-items-text {
|
||||||
max-width: 20em;
|
max-width: 20em;
|
||||||
@@ -54,5 +52,16 @@
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
display:inline-block;
|
||||||
|
height: 1em;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar-label {
|
||||||
|
margin-left:0.3em;
|
||||||
|
font-size:0.7em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit, Input,AfterViewInit } from '@angular/core';
|
import { Component, OnInit, Input,AfterViewInit } from '@angular/core';
|
||||||
import { IColorMap, IColor, IColorEntry,ILayer } from '../../models';
|
import { IColorMap, IColor, IColorEntry,ILayer, IRenderer } from '../../models/color.map';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -45,22 +45,39 @@ export class LegendComponent implements OnInit,AfterViewInit {
|
|||||||
this.histogramenabled = !this.histogramenabled;
|
this.histogramenabled = !this.histogramenabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public getHex(color: IColor): string {
|
public getHex(color: IColor): string {
|
||||||
return '#' + this.componentToHex(color.red) + this.componentToHex(color.green) + this.componentToHex(color.blue);
|
return '#' + this.componentToHex(color.red) + this.componentToHex(color.green) + this.componentToHex(color.blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentToHex(c: number): string {
|
private componentToHex(c: number): string {
|
||||||
const hex = c.toString(16);
|
const hex = c.toString(16);
|
||||||
return hex.length === 1 ? `0${hex}` : hex;
|
return hex.length === 1 ? `0${hex}` : hex;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getPart(colorMap: IColorMap, colorEntry: IColorEntry): string {
|
public getPart(renderer: IRenderer, index: number): string {
|
||||||
let sumOfValue = colorMap.entries.reduce((sum, item) => sum + item.value, 0);
|
let max = renderer.band.histogram.entries.reduce((max, entry) => entry.freqency > max ? entry.freqency : max, 0);
|
||||||
let part = ((colorEntry.value / sumOfValue) * 100) + "%";
|
let scale = 75 / max;
|
||||||
|
let part = (renderer.band.histogram.entries[index].freqency * scale) + "%";
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getLabel(renderer: IRenderer, index: number): string {
|
||||||
|
let scale = 100 / renderer.band.histogram.entries.reduce((sum, entry) => sum + entry.freqency, 0);
|
||||||
|
let percent = renderer.band.histogram.entries[index].freqency * scale;
|
||||||
|
return percent < 0.1 ? "" : percent.toFixed(1) + " %";
|
||||||
|
}
|
||||||
|
|
||||||
|
showLegend(): boolean {
|
||||||
|
return this.layer && this.layer.renderer && this.layer.renderer.renderType != "MULTIBAND_COLOR";
|
||||||
|
}
|
||||||
|
|
||||||
|
showHistogram(): boolean {
|
||||||
|
return this.histogramenabled && this.layer.renderer.band.histogram.entries && this.layer.renderer.band.histogram.entries.length > 0 && this.layer.renderer.colorMap.colormapType == "minmax";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
export * from './map-search.component';
|
|
@@ -2,8 +2,8 @@ import { Component, Input, Output, OnInit, EventEmitter, SimpleChanges, OnChange
|
|||||||
import { Observable , of } from 'rxjs';
|
import { Observable , of } from 'rxjs';
|
||||||
import { debounceTime,distinctUntilChanged,tap,switchMap,merge,catchError} from 'rxjs/operators';
|
import { debounceTime,distinctUntilChanged,tap,switchMap,merge,catchError} from 'rxjs/operators';
|
||||||
import { TypeaheadService, TimespanService } from '@farmmaps/common';
|
import { TypeaheadService, TimespanService } from '@farmmaps/common';
|
||||||
import { IQueryState,IPeriodState } from '../../models';
|
import { IQueryState } from '../../models/query.state';
|
||||||
import { fillProperties } from '@angular/core/src/util/property';
|
import { IPeriodState } from '../../models/period.state';
|
||||||
import { tassign } from 'tassign';
|
import { tassign } from 'tassign';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -13,7 +13,7 @@ import { tassign } from 'tassign';
|
|||||||
})
|
})
|
||||||
export class MapSearchComponent {
|
export class MapSearchComponent {
|
||||||
|
|
||||||
@ViewChild('searchText') searchText;
|
@ViewChild('searchText', { static: true }) searchText;
|
||||||
@Input() clearEnabled: boolean
|
@Input() clearEnabled: boolean
|
||||||
@Input() set collapsed(collapsed: boolean) {
|
@Input() set collapsed(collapsed: boolean) {
|
||||||
this.collapsedLocal = collapsed;
|
this.collapsedLocal = collapsed;
|
||||||
|
@@ -9,7 +9,11 @@ import { Store } from '@ngrx/store';
|
|||||||
// Map
|
// Map
|
||||||
import * as mapReducers from '../../reducers/map.reducer';
|
import * as mapReducers from '../../reducers/map.reducer';
|
||||||
import * as mapActions from '../../actions/map.actions';
|
import * as mapActions from '../../actions/map.actions';
|
||||||
import { IMapState,ISelectedFeatures,IItemLayer, ItemLayer,IQueryState,IPeriodState } from '../../models';
|
import { IMapState} from '../../models/map.state';
|
||||||
|
import { ISelectedFeatures } from '../../models/selected.features';
|
||||||
|
import { IItemLayer } from '../../models/item.layer';
|
||||||
|
import { IQueryState } from '../../models/query.state';
|
||||||
|
import { IPeriodState } from '../../models/period.state';
|
||||||
import { IDroppedFile } from '../aol/file-drop-target/file-drop-target.component';
|
import { IDroppedFile } from '../aol/file-drop-target/file-drop-target.component';
|
||||||
import { IMetaData } from '../meta-data-modal/meta-data-modal.component';
|
import { IMetaData } from '../meta-data-modal/meta-data-modal.component';
|
||||||
import { StateSerializerService } from '../../services/state-serializer.service';
|
import { StateSerializerService } from '../../services/state-serializer.service';
|
||||||
@@ -68,7 +72,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
public baseLayersCollapsed:boolean = true;
|
public baseLayersCollapsed:boolean = true;
|
||||||
public overlayLayersCollapsed: boolean = true;
|
public overlayLayersCollapsed: boolean = true;
|
||||||
public extent: Observable<Extent>;
|
public extent: Observable<Extent>;
|
||||||
@ViewChild('map') map;
|
@ViewChild('map', { static: true }) map;
|
||||||
|
|
||||||
constructor(private store: Store<mapReducers.State | commonReducers.State>, private route: ActivatedRoute, private router: Router, private uploadService: ResumableFileUploadService, private serializeService: StateSerializerService, public itemTypeService: ItemTypeService, private location: Location, private geolocationService: GeolocationService ) {
|
constructor(private store: Store<mapReducers.State | commonReducers.State>, private route: ActivatedRoute, private router: Router, private uploadService: ResumableFileUploadService, private serializeService: StateSerializerService, public itemTypeService: ItemTypeService, private location: Location, private geolocationService: GeolocationService ) {
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ export class MetaDataModalComponent {
|
|||||||
private modalName: string = 'metaDataModal';
|
private modalName: string = 'metaDataModal';
|
||||||
private modalRef: NgbModalRef;
|
private modalRef: NgbModalRef;
|
||||||
|
|
||||||
@ViewChild('content') _templateModal:ElementRef;
|
@ViewChild('content', { static: true }) _templateModal:ElementRef;
|
||||||
@Input() droppedFile: IDroppedFile;
|
@Input() droppedFile: IDroppedFile;
|
||||||
@Input() set modalState(_modalState:any) {;
|
@Input() set modalState(_modalState:any) {;
|
||||||
if(_modalState == this.modalName) {
|
if(_modalState == this.modalName) {
|
||||||
|
@@ -29,7 +29,7 @@ export class SelectPeriodModalComponent {
|
|||||||
fromDate: NgbDateStruct;
|
fromDate: NgbDateStruct;
|
||||||
toDate: NgbDateStruct;
|
toDate: NgbDateStruct;
|
||||||
|
|
||||||
@ViewChild('content') _templateModal:ElementRef;
|
@ViewChild('content', { static: true }) _templateModal:ElementRef;
|
||||||
|
|
||||||
@Input() set modalState(_modalState:any) {;
|
@Input() set modalState(_modalState:any) {;
|
||||||
if(_modalState == this.modalName) {
|
if(_modalState == this.modalName) {
|
||||||
|
@@ -16,7 +16,7 @@ export class SelectedItemContainerComponent {
|
|||||||
|
|
||||||
@Input() item: IItem;
|
@Input() item: IItem;
|
||||||
|
|
||||||
@ViewChild(WidgetHostDirective) widgetHost: WidgetHostDirective;
|
@ViewChild(WidgetHostDirective, { static: true }) widgetHost: WidgetHostDirective;
|
||||||
|
|
||||||
loadComponent() {
|
loadComponent() {
|
||||||
var componentFactory: ComponentFactory<AbstractSelectedItemComponent> = this.componentFactoryResolver.resolveComponentFactory(SelectedItemComponent); // default
|
var componentFactory: ComponentFactory<AbstractSelectedItemComponent> = this.componentFactoryResolver.resolveComponentFactory(SelectedItemComponent); // default
|
||||||
|
@@ -3,20 +3,21 @@
|
|||||||
<div class="card border-0">
|
<div class="card border-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="mb-2"><a href="#" (click)="handleBackToList($event)" i18n>Back</a></div>
|
<div class="mb-2"><a href="#" (click)="handleBackToList($event)" i18n>Back</a></div>
|
||||||
<h1>{{item.name}}</h1>
|
<div class="card menu-card">
|
||||||
<div class="legend-container" *ngIf="item?.data.layers;let layers">
|
<h1>{{item.name}}</h1>
|
||||||
<!--<div *ngIf="layers.length>1">
|
</div>
|
||||||
<select (change)="onLayerChanged($event.target.value)">
|
<div class="legend-container" *ngIf="item?.data.layers;let layers">
|
||||||
<option *ngFor="let l of layers;let layerIndex = index" [value]="layerIndex">{{l.name}}</option>
|
<div class="card menu-card">
|
||||||
</select>
|
<fm-map-layer-legend [layer]="layers[selectedLayer]" [histogramenabled]="true"></fm-map-layer-legend>
|
||||||
</div>-->
|
</div>
|
||||||
<fm-map-layer-legend [layer]="layers[selectedLayer]" [histogramenabled]="false" histogramunit="ha"></fm-map-layer-legend>
|
</div>
|
||||||
|
<div class="card menu-card">
|
||||||
|
<ul class="p-0 mt-2">
|
||||||
|
<!--<li><a href="/api/v1/items/{{item.code}}/file" class="mt-1 mr-1" i18n><i class="fa fa-download" aria-hidden="true" title="Download"></i> Download</a></li>-->
|
||||||
|
<li><a href="#" class="mt-1 mr-1" (click)="handleOnEdit(item)" i18n><i class="fa fa-pencil" aria-hidden="true" title="Edit"></i> Edit</a></li>
|
||||||
|
<li *ngIf="itemTypeService.isLayer(item)"><a href="#" (click)="handleAddAsLayer(item)" class="mt-1 mr-1" i18n><i class="fa fa-eye" aria-hidden="true" title="Add as layer"></i> Add as overlay</a></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<ul class="p-0 mt-2">
|
|
||||||
<!--<li><a href="/api/v1/items/{{item.code}}/file" class="mt-1 mr-1" i18n><i class="fa fa-download" aria-hidden="true" title="Download"></i> Download</a></li>-->
|
|
||||||
<li><a href="#" class="mt-1 mr-1" (click)="handleOnEdit(item)" i18n><i class="fa fa-pencil" aria-hidden="true" title="Edit"></i> Edit</a></li>
|
|
||||||
<li *ngIf="itemTypeService.isLayer(item)"><a href="#" (click)="handleAddAsLayer(item)" class="mt-1 mr-1" i18n><i class="fa fa-eye" aria-hidden="true" title="Add as layer"></i> Add as overlay</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -31,3 +31,12 @@ li {
|
|||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu-card {
|
||||||
|
margin-left: -7px;
|
||||||
|
padding-left: 7px;
|
||||||
|
margin-right: -7px;
|
||||||
|
padding-right: 7px;
|
||||||
|
margin-bottom: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<div *ngIf="item;let item">
|
<div *ngIf="item;let item">
|
||||||
<div class="card border-0">
|
<div class="card border-0">
|
||||||
<img *ngIf="item.thumbnail" class="card-img-top" [src]="'/api/v1/items/'+item.code+'/thumbnail?v='+item.updated.getTime()" />
|
<img *ngIf="item.thumbnail" class="card-img-top" [src]="config.getConfig('apiEndPoint') +'/api/v1/items/'+item.code+'/thumbnail?v='+item.updated.getTime()" />
|
||||||
<div *ngIf="!item.thumbnail" class="big-icon" [style.background-color]="itemTypeService.getColor(item.itemType)">
|
<div *ngIf="!item.thumbnail" class="big-icon" [style.background-color]="itemTypeService.getColor(item.itemType)">
|
||||||
<i [ngClass]="itemTypeService.getIcon(item.itemType)"></i>
|
<i [ngClass]="itemTypeService.getIcon(item.itemType)"></i>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -3,7 +3,7 @@ import { Location } from '@angular/common';
|
|||||||
import { Feature } from 'ol';
|
import { Feature } from 'ol';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import * as mapReducers from '../../reducers/map.reducer';
|
import * as mapReducers from '../../reducers/map.reducer';
|
||||||
import { commonReducers,ItemTypeService, IItem, Item } from '@farmmaps/common';
|
import { commonReducers,ItemTypeService, IItem, Item,AppConfig } from '@farmmaps/common';
|
||||||
import * as mapActions from '../../actions/map.actions';
|
import * as mapActions from '../../actions/map.actions';
|
||||||
import { Router, ActivatedRoute, ParamMap, Event } from '@angular/router';
|
import { Router, ActivatedRoute, ParamMap, Event } from '@angular/router';
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ export abstract class AbstractSelectedItemComponent {
|
|||||||
})
|
})
|
||||||
export class SelectedItemComponent extends AbstractSelectedItemComponent {
|
export class SelectedItemComponent extends AbstractSelectedItemComponent {
|
||||||
|
|
||||||
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router) {
|
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, public config:AppConfig) {
|
||||||
super(store, itemTypeService,location,router);
|
super(store, itemTypeService,location,router);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,7 @@ import { Effect, Actions,ofType } from '@ngrx/effects';
|
|||||||
import { Observable , of } from 'rxjs';
|
import { Observable , of } from 'rxjs';
|
||||||
import { withLatestFrom, switchMap, map, catchError, mergeMap, delay} from 'rxjs/operators';
|
import { withLatestFrom, switchMap, map, catchError, mergeMap, delay} from 'rxjs/operators';
|
||||||
|
|
||||||
import {GeoJSON} from 'ol/format';
|
import {GeoJSON,WKT} from 'ol/format';
|
||||||
import {Feature} from 'ol';
|
import {Feature} from 'ol';
|
||||||
import { getCenter, Extent, createEmpty, extend} from 'ol/extent';
|
import { getCenter, Extent, createEmpty, extend} from 'ol/extent';
|
||||||
import {Point} from 'ol/geom'
|
import {Point} from 'ol/geom'
|
||||||
@@ -25,10 +25,15 @@ import { tassign } from 'tassign';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MapEffects {
|
export class MapEffects {
|
||||||
private _format: GeoJSON;
|
private _geojsonFormat: GeoJSON;
|
||||||
|
private _wktFormat: WKT;
|
||||||
|
|
||||||
private toPointFeature(feature: any): Feature {
|
private toPointFeature(updateEvent:commonActions.DeviceUpdateEvent): Feature {
|
||||||
var f = this._format.readFeature(feature);
|
var f = this._wktFormat.readFeature(updateEvent.attributes["geometry"],{
|
||||||
|
dataProjection: 'EPSG:4326',
|
||||||
|
featureProjection: 'EPSG:3857'
|
||||||
|
});
|
||||||
|
f.setId(updateEvent.itemCode);
|
||||||
var centroid = getCenter(f.getGeometry().getExtent());
|
var centroid = getCenter(f.getGeometry().getExtent());
|
||||||
f.setGeometry(new Point(centroid));
|
f.setGeometry(new Point(centroid));
|
||||||
return f;
|
return f;
|
||||||
@@ -74,7 +79,7 @@ export class MapEffects {
|
|||||||
console.debug("Start search");
|
console.debug("Start search");
|
||||||
var startDate = action.queryState.startDate;
|
var startDate = action.queryState.startDate;
|
||||||
var endDate = action.queryState.endDate;
|
var endDate = action.queryState.endDate;
|
||||||
var newAction;
|
var newAction:Observable<Action>;
|
||||||
if (action.queryState.itemCode || action.queryState.parentCode || action.queryState.itemType || action.queryState.query || action.queryState.tags) {
|
if (action.queryState.itemCode || action.queryState.parentCode || action.queryState.itemType || action.queryState.query || action.queryState.tags) {
|
||||||
newAction= this.itemService$.getFeatures(action.queryState.bbox, "EPSG:3857", action.queryState.query, action.queryState.tags, startDate, endDate, action.queryState.itemType, action.queryState.parentCode).pipe(
|
newAction= this.itemService$.getFeatures(action.queryState.bbox, "EPSG:3857", action.queryState.query, action.queryState.tags, startDate, endDate, action.queryState.itemType, action.queryState.parentCode).pipe(
|
||||||
switchMap((features: any) => {
|
switchMap((features: any) => {
|
||||||
@@ -83,7 +88,7 @@ export class MapEffects {
|
|||||||
f.id = f.properties["code"];
|
f.id = f.properties["code"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return of(new mapActions.StartSearchSuccess(this._format.readFeatures(features), action.queryState));
|
return of(new mapActions.StartSearchSuccess(this._geojsonFormat.readFeatures(features), action.queryState));
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
catchError(error => of(new commonActions.Fail(error))));
|
catchError(error => of(new commonActions.Fail(error))));
|
||||||
@@ -135,7 +140,11 @@ export class MapEffects {
|
|||||||
ofType(mapActions.SELECTITEMSUCCESS),
|
ofType(mapActions.SELECTITEMSUCCESS),
|
||||||
switchMap((action:mapActions.SelectItemSuccess) => {
|
switchMap((action:mapActions.SelectItemSuccess) => {
|
||||||
return this.itemService$.getFeature(action.item.code, "EPSG:3857").pipe(
|
return this.itemService$.getFeature(action.item.code, "EPSG:3857").pipe(
|
||||||
map((feature: IItem) => new mapActions.AddFeatureSuccess(this._format.readFeature(feature) )),
|
map((feature: any) => {
|
||||||
|
let f = this._geojsonFormat.readFeature(feature);
|
||||||
|
f.setId(action.item.code);
|
||||||
|
return new mapActions.AddFeatureSuccess(f );
|
||||||
|
}),
|
||||||
catchError(error => of(new commonActions.Fail(error))));
|
catchError(error => of(new commonActions.Fail(error))));
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -163,21 +172,19 @@ export class MapEffects {
|
|||||||
|
|
||||||
@Effect()
|
@Effect()
|
||||||
featureUpdate$: Observable<Action> = this.actions$.pipe(
|
featureUpdate$: Observable<Action> = this.actions$.pipe(
|
||||||
ofType(commonActions.ITEMCHANGEDEVENT),
|
ofType(commonActions.DEVICEUPDATEEVENT),
|
||||||
withLatestFrom(this.store$.select(mapReducers.selectGetFeatures)),
|
withLatestFrom(this.store$.select(mapReducers.selectGetFeatures)),
|
||||||
mergeMap(([action, features]) => {
|
mergeMap(([action, features]) => {
|
||||||
let itemChangedAction = action as commonActions.ItemChangedEvent;
|
let deviceUpdateEventAction = action as commonActions.DeviceUpdateEvent;
|
||||||
var feature: Feature = null;
|
var feature: Feature = null;
|
||||||
for (let f of features) {
|
for (let f of features) {
|
||||||
if (f.get("code") == itemChangedAction.itemCode) {
|
if (f.getId() == deviceUpdateEventAction.itemCode) {
|
||||||
feature = f;
|
feature = f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (feature) {
|
if (feature) {
|
||||||
return this.itemService$.getFeature(itemChangedAction.itemCode, "EPSG:3857").pipe(
|
return of(new mapActions.UpdateFeatureSuccess(this.toPointFeature(deviceUpdateEventAction)));
|
||||||
map((feature: any) => new mapActions.UpdateFeatureSuccess(this.toPointFeature(feature))),
|
|
||||||
catchError(error => of(new commonActions.Fail(error))));
|
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@@ -225,6 +232,7 @@ export class MapEffects {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
constructor(private actions$: Actions, private store$: Store<mapReducers.State>, private folderService$: FolderService, private itemService$: ItemService) {
|
constructor(private actions$: Actions, private store$: Store<mapReducers.State>, private folderService$: FolderService, private itemService$: ItemService) {
|
||||||
this._format = new GeoJSON();
|
this._geojsonFormat = new GeoJSON();
|
||||||
|
this._wktFormat = new WKT();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,8 @@ export interface IColor {
|
|||||||
|
|
||||||
export interface IColorEntry {
|
export interface IColorEntry {
|
||||||
value: number,
|
value: number,
|
||||||
color: IColor
|
color: IColor,
|
||||||
|
label: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IHistogramEntry {
|
export interface IHistogramEntry {
|
||||||
@@ -30,9 +31,10 @@ export interface IGradientstop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IColorMap {
|
export interface IColorMap {
|
||||||
gradient: IGradientstop[],
|
gradient: IGradientstop[],
|
||||||
noValue: IColorEntry,
|
noValue: IColorEntry,
|
||||||
entries: IColorEntry[]
|
entries: IColorEntry[],
|
||||||
|
colormapType: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IBand {
|
export interface IBand {
|
||||||
@@ -42,7 +44,8 @@ export interface IBand {
|
|||||||
|
|
||||||
export interface IRenderer {
|
export interface IRenderer {
|
||||||
band:IBand,
|
band:IBand,
|
||||||
colorMap: IColorMap
|
colorMap: IColorMap,
|
||||||
|
renderType:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IRenderoutput {
|
export interface IRenderoutput {
|
||||||
|
@@ -1,7 +0,0 @@
|
|||||||
export * from './map.state';
|
|
||||||
export * from './selected.features';
|
|
||||||
export * from './item.layer'
|
|
||||||
export * from './layer.data'
|
|
||||||
export * from './color.map';
|
|
||||||
export * from './query.state';
|
|
||||||
export * from './period.state';
|
|
@@ -1,6 +1,9 @@
|
|||||||
import { tassign } from 'tassign';
|
import { tassign } from 'tassign';
|
||||||
import { IItem,Item } from '@farmmaps/common';
|
import { IItem,Item } from '@farmmaps/common';
|
||||||
import { IItemLayer,ItemLayer, IMapState,IQueryState,IPeriodState} from '../models'
|
import { IItemLayer,ItemLayer} from '../models/item.layer';
|
||||||
|
import { IMapState} from '../models/map.state';
|
||||||
|
import { IQueryState} from '../models/query.state';
|
||||||
|
import { IPeriodState} from '../models/period.state';
|
||||||
import * as mapActions from '../actions/map.actions';
|
import * as mapActions from '../actions/map.actions';
|
||||||
import {commonActions} from '@farmmaps/common';
|
import {commonActions} from '@farmmaps/common';
|
||||||
import { createSelector, createFeatureSelector } from '@ngrx/store';
|
import { createSelector, createFeatureSelector } from '@ngrx/store';
|
||||||
@@ -190,7 +193,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
|||||||
let features: any[] = [];
|
let features: any[] = [];
|
||||||
var index = -1;
|
var index = -1;
|
||||||
for (var i = 0; i < state.features.length; i++) {
|
for (var i = 0; i < state.features.length; i++) {
|
||||||
if (state.features[i].get("code") == a.feature.get("code")) {
|
if (state.features[i].getId() == a.feature.getId()) {
|
||||||
features.push(a.feature);
|
features.push(a.feature);
|
||||||
} else {
|
} else {
|
||||||
features.push(state.features[i]);
|
features.push(state.features[i]);
|
||||||
|
@@ -0,0 +1,24 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observer, Observable } from 'rxjs';
|
||||||
|
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class DeviceOrientationService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tries HTML5 geolocation.
|
||||||
|
*
|
||||||
|
* Wraps the Geolocation API into an observable.
|
||||||
|
*
|
||||||
|
* @return An observable of Bearing
|
||||||
|
*/
|
||||||
|
getCurrentBearing(): Observable<number> {
|
||||||
|
return Observable.create((observer: Observer<number>) => {
|
||||||
|
let sensor = new Magnetometer();
|
||||||
|
sensor.onreading= (ev:Event) => {
|
||||||
|
observer.next(Math.atan2(sensor.y, sensor.x) * (180 / Math.PI));
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
12
projects/common/package-lock.json
generated
12
projects/common/package-lock.json
generated
@@ -5,9 +5,9 @@
|
|||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular-oauth2-oidc": {
|
"angular-oauth2-oidc": {
|
||||||
"version": "5.0.2",
|
"version": "8.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/angular-oauth2-oidc/-/angular-oauth2-oidc-5.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/angular-oauth2-oidc/-/angular-oauth2-oidc-8.0.4.tgz",
|
||||||
"integrity": "sha512-jtOv4IWEjSFfBHVE4seWGWT/ZfWJ95QJ1JaFhVVGJEF64ibGuPwV3ztwTOUl98QHi/Yg4PXXDAisb31JnIbxBw==",
|
"integrity": "sha512-7/3niJBqD7rnElcW+SudE36g7zMWChW4gSq7NpJSzDA4aQadBgvg0hn317MfPm9tpYGrpE3G/z2NMnbzek4TMA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"jsrsasign": "^8.0.12",
|
"jsrsasign": "^8.0.12",
|
||||||
"tslib": "^1.9.0"
|
"tslib": "^1.9.0"
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
"integrity": "sha1-Iqu5ZW00owuVMENnIINeicLlwxY="
|
"integrity": "sha1-Iqu5ZW00owuVMENnIINeicLlwxY="
|
||||||
},
|
},
|
||||||
"ngx-uploadx": {
|
"ngx-uploadx": {
|
||||||
"version": "3.1.3",
|
"version": "3.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/ngx-uploadx/-/ngx-uploadx-3.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/ngx-uploadx/-/ngx-uploadx-3.3.2.tgz",
|
||||||
"integrity": "sha512-RX3uEaqMTpjTv5mtdnTQYsDOED3Qg5V3OBU5ohOyL35uL+dllF7I0y+kojJprm9thzHNAWih1DLeTlVWZKo+hQ==",
|
"integrity": "sha512-gRdXXq2cRU9HE6dj65qay9GV8NRC7n8y5LtMzJWqsfu2k3CHMQxo2TqZwA9/l/PqJ76RoO7sTPy1OenFQ+krkQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^1.9.0"
|
"tslib": "^1.9.0"
|
||||||
}
|
}
|
||||||
|
@@ -5,17 +5,17 @@
|
|||||||
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular-oauth2-oidc": "^5.0.2",
|
"angular-oauth2-oidc": "^8.0.2",
|
||||||
"ngx-uploadx": "^3.1.3"
|
"ngx-uploadx": "^3.3.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@ng-bootstrap/ng-bootstrap": "^4.2.1",
|
"@ng-bootstrap/ng-bootstrap": "^4.2.1",
|
||||||
"@angular/common": "^7.2.0",
|
"@angular/common": "^8.2.0",
|
||||||
"@angular/core": "^7.2.0",
|
"@angular/core": "^8.2.0",
|
||||||
"@angular/forms": "^7.2.0",
|
"@angular/forms": "^8.2.0",
|
||||||
"@ngrx/effects": "^7.2",
|
"@ngrx/effects": "^8.2",
|
||||||
"@ngrx/router-store": "^7.2",
|
"@ngrx/router-store": "^8.2",
|
||||||
"@ngrx/store": "^7.2",
|
"@ngrx/store": "^8.2",
|
||||||
"tassign": "^1.0.0",
|
"tassign": "^1.0.0",
|
||||||
"bootstrap": "^4.3.1",
|
"bootstrap": "^4.3.1",
|
||||||
"@aspnet/signalr": "^1.1.4",
|
"@aspnet/signalr": "^1.1.4",
|
||||||
|
@@ -27,6 +27,8 @@ export const TASKSTARTEVENT = '[AppCommon] TaskStartEvent';
|
|||||||
export const TASKENDEVENT = '[AppCommon] TaskEndEvent';
|
export const TASKENDEVENT = '[AppCommon] TaskEndEvent';
|
||||||
export const TASKERRORTEVENT = '[AppCommon] TaskErrorEvent';
|
export const TASKERRORTEVENT = '[AppCommon] TaskErrorEvent';
|
||||||
|
|
||||||
|
export const DEVICEUPDATEEVENT = '[AppCommon] DeviceUpdateEvent';
|
||||||
|
|
||||||
export const DELETEITEMS = '[AppCommon] DeleteItems';
|
export const DELETEITEMS = '[AppCommon] DeleteItems';
|
||||||
export const DELETEITEMSSUCCESS = '[AppCommon] DeleteItemsSuccess';
|
export const DELETEITEMSSUCCESS = '[AppCommon] DeleteItemsSuccess';
|
||||||
|
|
||||||
@@ -164,6 +166,12 @@ export class TaskErrorEvent implements Action {
|
|||||||
constructor(public itemCode: string, public attributes: any) { }
|
constructor(public itemCode: string, public attributes: any) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class DeviceUpdateEvent implements Action {
|
||||||
|
readonly type = DEVICEUPDATEEVENT;
|
||||||
|
|
||||||
|
constructor(public itemCode: string, public attributes: any) { }
|
||||||
|
}
|
||||||
|
|
||||||
export class DeleteItems implements Action {
|
export class DeleteItems implements Action {
|
||||||
readonly type = DELETEITEMS;
|
readonly type = DELETEITEMS;
|
||||||
|
|
||||||
@@ -231,4 +239,5 @@ export type Actions = OpenModal
|
|||||||
| InitUserSuccess
|
| InitUserSuccess
|
||||||
| TaskStartEvent
|
| TaskStartEvent
|
||||||
| TaskEndEvent
|
| TaskEndEvent
|
||||||
| TaskErrorEvent;
|
| TaskErrorEvent
|
||||||
|
| DeviceUpdateEvent;
|
||||||
|
106
projects/common/src/fm/common-service.module.ts
Normal file
106
projects/common/src/fm/common-service.module.ts
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
// angular modules
|
||||||
|
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';
|
||||||
|
|
||||||
|
// external modules
|
||||||
|
import { OAuthModule,AuthConfig, OAuthService, OAuthStorage } from 'angular-oauth2-oidc';
|
||||||
|
|
||||||
|
|
||||||
|
// routing module
|
||||||
|
import { AppCommonRoutingModule } from './common-routing.module';
|
||||||
|
|
||||||
|
import { MODULE_NAME } from './module-name';
|
||||||
|
|
||||||
|
//components
|
||||||
|
import { ItemTypeService } from './services/itemtype.service';
|
||||||
|
import { FolderService } from './services/folder.service';
|
||||||
|
import { TimespanService} from './services/timespan.service';
|
||||||
|
import { ItemService} from './services/item.service';
|
||||||
|
import { EventService } from './services/event.service';
|
||||||
|
import { TypeaheadService } from './services/typeahead.service';
|
||||||
|
import { UserService } from './services/user.service';
|
||||||
|
import { AppConfig } from './shared/app.config';
|
||||||
|
import { AccessTokenInterceptor } from "./shared/accesstoken.interceptor";
|
||||||
|
import { appConfigFactory } from "./shared/app.config.factory";
|
||||||
|
import { AuthGuard } from './services/auth-guard.service';
|
||||||
|
import { NavBarGuard } from './services/nav-bar-guard.service';
|
||||||
|
import { FullScreenGuard } from './services/full-screen-guard.service';
|
||||||
|
import { SafePipe } from './shared/safe.pipe';
|
||||||
|
import { AppComponent} from './components/app/app.component';
|
||||||
|
import { AuthCallbackComponent } from './components/auth-callback/auth-callback.component';
|
||||||
|
import { AuthCallbackGuard } from './components/auth-callback/auth-callback.guard';
|
||||||
|
import { SessionClearedComponent } from './components/session-cleared/session-cleared.component';
|
||||||
|
import { ResumableFileUploadService } from './components/resumable-file-upload/resumable-file-upload.service';
|
||||||
|
import { ResumableFileUploadComponent } from './components/resumable-file-upload/resumable-file-upload.component';
|
||||||
|
import { NotFoundComponent } from './components/not-found/not-found.component';
|
||||||
|
import { NotImplementedComponent } from './components/not-implemented/not-implemented.component';
|
||||||
|
import { SidePanelComponent } from './components/side-panel/side-panel.component';
|
||||||
|
import { TimespanComponent } from './components/timespan/timespan.component';
|
||||||
|
import { TagInputComponent } from './components/tag-input/tag-input.component';
|
||||||
|
import {IEventMessage } from './models/event.message';
|
||||||
|
import { IItem, Item } from './models/item';
|
||||||
|
import {IItemType} from './models/item.type';
|
||||||
|
import {IItemTypes} from './models/item.types';
|
||||||
|
import {IItemTask,ItemTask} from './models/itemTask';
|
||||||
|
import {IListItem} from './models/list.item';
|
||||||
|
import {ITypeaheadItem} from './models/typeahead.item';
|
||||||
|
import {IUser} from './models/user';
|
||||||
|
import * as commonActions from './actions/app-common.actions';
|
||||||
|
import * as commonReducers from './reducers/app-common.reducer';
|
||||||
|
import * as commonEffects from './effects/app-common.effects';
|
||||||
|
import {NgbDateNativeAdapter} from './services/date-adapter.service'
|
||||||
|
import { from } from 'rxjs';
|
||||||
|
import {AuthConfigFactory} from './shared/authconfigFactory';
|
||||||
|
|
||||||
|
export {FolderService,
|
||||||
|
ItemTypeService,
|
||||||
|
TimespanService,
|
||||||
|
ItemService,
|
||||||
|
EventService,
|
||||||
|
TypeaheadService,
|
||||||
|
UserService,
|
||||||
|
AppConfig,
|
||||||
|
AccessTokenInterceptor,
|
||||||
|
AuthGuard,
|
||||||
|
NavBarGuard,
|
||||||
|
FullScreenGuard,
|
||||||
|
AuthCallbackGuard,
|
||||||
|
ResumableFileUploadService,
|
||||||
|
NgbDateNativeAdapter
|
||||||
|
};
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
OAuthModule.forRoot(),
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class AppCommonServiceModule {
|
||||||
|
constructor (@Optional() @SkipSelf() parentModule: AppCommonServiceModule) {
|
||||||
|
if (parentModule) {
|
||||||
|
throw new Error(
|
||||||
|
'AppCommonServiceModule is already loaded. Import it in the AppModule only');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static forRoot(): ModuleWithProviders {
|
||||||
|
return {
|
||||||
|
ngModule: AppCommonServiceModule,
|
||||||
|
providers: [
|
||||||
|
AppConfig,
|
||||||
|
{
|
||||||
|
provide: APP_INITIALIZER,
|
||||||
|
useFactory: appConfigFactory,
|
||||||
|
deps: [Injector, AppConfig, OAuthService,AuthConfigFactory],
|
||||||
|
multi: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: HTTP_INTERCEPTORS,
|
||||||
|
useClass: AccessTokenInterceptor,
|
||||||
|
multi: true
|
||||||
|
},
|
||||||
|
DatePipe
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@@ -18,25 +18,11 @@ import { AppCommonRoutingModule } from './common-routing.module';
|
|||||||
import { MODULE_NAME } from './module-name';
|
import { MODULE_NAME } from './module-name';
|
||||||
|
|
||||||
//components
|
//components
|
||||||
import { ItemTypeService } from './services/itemtype.service';
|
|
||||||
import { FolderService } from './services/folder.service';
|
|
||||||
import { TimespanService} from './services/timespan.service';
|
|
||||||
import { ItemService} from './services/item.service';
|
|
||||||
import { EventService } from './services/event.service';
|
|
||||||
import { TypeaheadService } from './services/typeahead.service';
|
|
||||||
import { UserService } from './services/user.service';
|
|
||||||
import { AppConfig } from './shared/app.config';
|
|
||||||
import { AccessTokenInterceptor } from "./shared/accesstoken.interceptor";
|
|
||||||
import { appConfigFactory } from "./shared/app.config.factory";
|
|
||||||
import { AuthGuard } from './services/auth-guard.service';
|
|
||||||
import { NavBarGuard } from './services/nav-bar-guard.service';
|
|
||||||
import { FullScreenGuard } from './services/full-screen-guard.service';
|
|
||||||
import { SafePipe } from './shared/safe.pipe';
|
import { SafePipe } from './shared/safe.pipe';
|
||||||
|
import { AuthConfigFactory,IAuthconfigFactory} from './shared/authconfigFactory';
|
||||||
import { AppComponent} from './components/app/app.component';
|
import { AppComponent} from './components/app/app.component';
|
||||||
import { AuthCallbackComponent } from './components/auth-callback/auth-callback.component';
|
import { AuthCallbackComponent } from './components/auth-callback/auth-callback.component';
|
||||||
import { AuthCallbackGuard } from './components/auth-callback/auth-callback.guard';
|
|
||||||
import { SessionClearedComponent } from './components/session-cleared/session-cleared.component';
|
import { SessionClearedComponent } from './components/session-cleared/session-cleared.component';
|
||||||
import { ResumableFileUploadService } from './components/resumable-file-upload/resumable-file-upload.service';
|
|
||||||
import { ResumableFileUploadComponent } from './components/resumable-file-upload/resumable-file-upload.component';
|
import { ResumableFileUploadComponent } from './components/resumable-file-upload/resumable-file-upload.component';
|
||||||
import { NotFoundComponent } from './components/not-found/not-found.component';
|
import { NotFoundComponent } from './components/not-found/not-found.component';
|
||||||
import { NotImplementedComponent } from './components/not-implemented/not-implemented.component';
|
import { NotImplementedComponent } from './components/not-implemented/not-implemented.component';
|
||||||
@@ -54,27 +40,12 @@ import {IUser} from './models/user';
|
|||||||
import * as commonActions from './actions/app-common.actions';
|
import * as commonActions from './actions/app-common.actions';
|
||||||
import * as commonReducers from './reducers/app-common.reducer';
|
import * as commonReducers from './reducers/app-common.reducer';
|
||||||
import * as commonEffects from './effects/app-common.effects';
|
import * as commonEffects from './effects/app-common.effects';
|
||||||
import {NgbDateNativeAdapter} from './services/date-adapter.service'
|
|
||||||
import { from } from 'rxjs';
|
|
||||||
|
|
||||||
export {FolderService,
|
export {
|
||||||
ItemTypeService,
|
|
||||||
TimespanService,
|
|
||||||
ItemService,
|
|
||||||
EventService,
|
|
||||||
TypeaheadService,
|
|
||||||
UserService,
|
|
||||||
AppConfig,
|
|
||||||
AccessTokenInterceptor,
|
|
||||||
AuthGuard,
|
|
||||||
NavBarGuard,
|
|
||||||
FullScreenGuard,
|
|
||||||
SafePipe,
|
SafePipe,
|
||||||
AuthCallbackComponent,
|
AuthCallbackComponent,
|
||||||
AuthCallbackGuard,
|
|
||||||
AppComponent,
|
AppComponent,
|
||||||
SessionClearedComponent,
|
SessionClearedComponent,
|
||||||
ResumableFileUploadService,
|
|
||||||
ResumableFileUploadComponent,
|
ResumableFileUploadComponent,
|
||||||
NotFoundComponent,
|
NotFoundComponent,
|
||||||
NotImplementedComponent,
|
NotImplementedComponent,
|
||||||
@@ -93,7 +64,8 @@ export {FolderService,
|
|||||||
IUser,
|
IUser,
|
||||||
commonActions,
|
commonActions,
|
||||||
commonReducers,
|
commonReducers,
|
||||||
NgbDateNativeAdapter
|
IAuthconfigFactory,
|
||||||
|
AuthConfigFactory
|
||||||
};
|
};
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@@ -108,9 +80,6 @@ export {FolderService,
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
UploadxModule
|
UploadxModule
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
DatePipe
|
|
||||||
],
|
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
AuthCallbackComponent,
|
AuthCallbackComponent,
|
||||||
@@ -141,29 +110,4 @@ export {FolderService,
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AppCommonModule {
|
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,
|
|
||||||
providers: [
|
|
||||||
AppConfig,
|
|
||||||
{
|
|
||||||
provide: APP_INITIALIZER,
|
|
||||||
useFactory: appConfigFactory,
|
|
||||||
deps: [Injector, AppConfig, OAuthService],
|
|
||||||
multi: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provide: HTTP_INTERCEPTORS,
|
|
||||||
useClass: AccessTokenInterceptor,
|
|
||||||
multi: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Component, OnInit, OnDestroy, Inject, ViewEncapsulation, RendererFactory2, PLATFORM_ID, ChangeDetectionStrategy, HostListener } from '@angular/core';
|
import { Component, OnInit, OnDestroy, Inject, ViewEncapsulation, RendererFactory2, PLATFORM_ID, ChangeDetectionStrategy, HostListener } from '@angular/core';
|
||||||
import { Router, NavigationEnd, RouteConfigLoadStart, RouteConfigLoadEnd, ActivatedRoute, PRIMARY_OUTLET } from '@angular/router';
|
import { Router, NavigationEnd, RouteConfigLoadStart, RouteConfigLoadEnd, ActivatedRoute, PRIMARY_OUTLET } from '@angular/router';
|
||||||
import { Meta, Title, DOCUMENT, MetaDefinition } from '@angular/platform-browser';
|
import { Meta, Title, MetaDefinition } from '@angular/platform-browser';import { DOCUMENT } from "@angular/common";
|
||||||
import { Subscription , Observable } from 'rxjs';
|
import { Subscription , Observable } from 'rxjs';
|
||||||
import { Store, Action } from '@ngrx/store';
|
import { Store, Action } from '@ngrx/store';
|
||||||
|
|
||||||
@@ -77,6 +77,10 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
action = new commonActions.TaskErrorEvent(event.itemCode, event.attributes);
|
action = new commonActions.TaskErrorEvent(event.itemCode, event.attributes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "deviceUpdate": {
|
||||||
|
action = new commonActions.DeviceUpdateEvent(event.itemCode, event.attributes);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header p-3 bg-primary text-white">
|
<div class="card-header p-3 bg-primary text-white">
|
||||||
<span *ngIf="uploadService.isUploading">Uploading files (<span>{{uploadService.totalProgress}}</span> %)</span>
|
<span *ngIf="uploadService.isUploading">Uploading files (<span>{{uploadService.totalProgress | number:'1.1-1'}}</span> %)</span>
|
||||||
<span *ngIf="uploadService.isUploading == false">Uploaded <span>{{uploadService.files.length}}</span> files</span>
|
<span *ngIf="uploadService.isUploading == false">Uploaded <span>{{uploadService.files.length}}</span> files</span>
|
||||||
<span title="Cancel" class="fa fa-times pull-right" (click)="uploadService.close()"></span><span title="Minimize" class="fa fa-chevron-down pull-right" (click)="uploadService.toggleMinimize()" [ngClass]="{'fa-chevron-down': uploadService.isMinimized == false, 'fa-chevron-up':uploadService.isMinimized}"></span>
|
<span title="Cancel" class="fa fa-times pull-right" (click)="uploadService.close()"></span><span title="Minimize" class="fa fa-chevron-down pull-right" (click)="uploadService.toggleMinimize()" [ngClass]="{'fa-chevron-down': uploadService.isMinimized == false, 'fa-chevron-up':uploadService.isMinimized}"></span>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -12,7 +12,7 @@ export class SidePanelComponent implements OnChanges {
|
|||||||
@Input() public collapsed: boolean;
|
@Input() public collapsed: boolean;
|
||||||
@Input() public collapsable: boolean;
|
@Input() public collapsable: boolean;
|
||||||
@Input() public resizeable: boolean = false;
|
@Input() public resizeable: boolean = false;
|
||||||
@ViewChild("resizeGrip") elementView: ElementRef;
|
@ViewChild("resizeGrip", { static: false }) elementView: ElementRef;
|
||||||
public mobile:boolean = true;
|
public mobile:boolean = true;
|
||||||
private parentHeight:number = 0;
|
private parentHeight:number = 0;
|
||||||
public top = "100%";
|
public top = "100%";
|
||||||
|
@@ -19,7 +19,7 @@ import { TypeaheadService } from '../../services/typeahead.service';
|
|||||||
|
|
||||||
export class TagInputComponent implements ControlValueAccessor {
|
export class TagInputComponent implements ControlValueAccessor {
|
||||||
@Input() tags: string[]
|
@Input() tags: string[]
|
||||||
@ViewChild('taginput') tagInputElement: ElementRef;
|
@ViewChild('taginput', { static: true }) tagInputElement: ElementRef;
|
||||||
public tag: string;
|
public tag: string;
|
||||||
searching = false;
|
searching = false;
|
||||||
searchFailed = false;
|
searchFailed = false;
|
||||||
|
@@ -34,9 +34,9 @@ export class TimespanComponent implements OnInit, OnChanges {
|
|||||||
elementWidth:number;
|
elementWidth:number;
|
||||||
elementHeight:number;
|
elementHeight:number;
|
||||||
lastOffsetInPixels:number=0;
|
lastOffsetInPixels:number=0;
|
||||||
@ViewChild('timeLine') canvasRef;
|
@ViewChild('timeLine', { static: true }) canvasRef;
|
||||||
@ViewChild('popoverStart') public popoverStart:NgbPopover;
|
@ViewChild('popoverStart', { static: true }) public popoverStart:NgbPopover;
|
||||||
@ViewChild('popoverEnd') public popoverEnd:NgbPopover;
|
@ViewChild('popoverEnd', { static: true }) public popoverEnd:NgbPopover;
|
||||||
@Input() collapsed: boolean = true;
|
@Input() collapsed: boolean = true;
|
||||||
@Input() startDate: Date = new Date(2018,1,3);
|
@Input() startDate: Date = new Date(2018,1,3);
|
||||||
@Input() endDate: Date = new Date(2018,1,5);
|
@Input() endDate: Date = new Date(2018,1,5);
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
|
|
@@ -75,7 +75,7 @@ export class ItemService {
|
|||||||
params = params.append("df", JSON.stringify(dataFilter));
|
params = params.append("df", JSON.stringify(dataFilter));
|
||||||
}
|
}
|
||||||
params = params.append("lvl", level.toString());
|
params = params.append("lvl", level.toString());
|
||||||
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
|
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params }).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||||
}
|
}
|
||||||
|
|
||||||
getChildItemListByExtent(parentcode: string, itemType: string, extent: number[], crs: string, dataFilter?: any, level: number = 1): Observable<IItem[]> {
|
getChildItemListByExtent(parentcode: string, itemType: string, extent: number[], crs: string, dataFilter?: any, level: number = 1): Observable<IItem[]> {
|
||||||
@@ -87,13 +87,15 @@ export class ItemService {
|
|||||||
params = params.append("df", JSON.stringify(dataFilter));
|
params = params.append("df", JSON.stringify(dataFilter));
|
||||||
}
|
}
|
||||||
params = params.append("lvl", level.toString());
|
params = params.append("lvl", level.toString());
|
||||||
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
|
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params }).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||||
}
|
}
|
||||||
|
|
||||||
getItemFeatures(code: string, extent: number[], crs: string, layerIndex?:number): Observable<any> {
|
getItemFeatures(code: string, extent: number[], crs: string, layerIndex?:number): Observable<any> {
|
||||||
var params = new HttpParams();
|
var params = new HttpParams();
|
||||||
params = params.append("bbox", extent.join(","));
|
|
||||||
params = params.append("crs", crs);
|
params = params.append("crs", crs);
|
||||||
|
if(extent != null) {
|
||||||
|
params = params.append("bbox", extent.join(","));
|
||||||
|
}
|
||||||
if(layerIndex!=null)
|
if(layerIndex!=null)
|
||||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${code}/features/layer/${layerIndex}`, { params: params });
|
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${code}/features/layer/${layerIndex}`, { params: params });
|
||||||
else
|
else
|
||||||
|
@@ -2,22 +2,10 @@ import { Injector } from '@angular/core';
|
|||||||
import { Router,UrlSerializer } from '@angular/router';
|
import { Router,UrlSerializer } from '@angular/router';
|
||||||
import { AuthConfig, OAuthService, JwksValidationHandler, OAuthErrorEvent } from 'angular-oauth2-oidc';
|
import { AuthConfig, OAuthService, JwksValidationHandler, OAuthErrorEvent } from 'angular-oauth2-oidc';
|
||||||
import { AppConfig } from "./app.config";
|
import { AppConfig } from "./app.config";
|
||||||
|
import { IAuthconfigFactory } from './authconfigFactory';
|
||||||
|
|
||||||
function getAuthConfig(appConfig: AppConfig): AuthConfig {
|
|
||||||
let authConfig: AuthConfig = new AuthConfig();
|
|
||||||
authConfig.issuer = appConfig.getConfig("issuer");
|
|
||||||
authConfig.redirectUri = window.location.origin + "/cb";
|
|
||||||
authConfig.silentRefreshRedirectUri = window.location.origin + "/silent-refresh.html";
|
|
||||||
authConfig.clientId = appConfig.getConfig("clientId");
|
|
||||||
authConfig.customQueryParams = { audience: appConfig.getConfig("audience") };
|
|
||||||
authConfig.scope = "openid profile email";
|
|
||||||
authConfig.oidc = true;
|
|
||||||
authConfig.disableAtHashCheck = true;
|
|
||||||
authConfig.requireHttps = appConfig.getConfig("requireHttps");
|
|
||||||
return authConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthService: OAuthService): () => Promise<any> {
|
export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthService: OAuthService, authconfigFactory:IAuthconfigFactory): () => Promise<any> {
|
||||||
return (): Promise<any> => {
|
return (): Promise<any> => {
|
||||||
return appConfig.load().then(() => {
|
return appConfig.load().then(() => {
|
||||||
oauthService.events.subscribe((event) => {
|
oauthService.events.subscribe((event) => {
|
||||||
@@ -32,7 +20,7 @@ export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
oauthService.configure(getAuthConfig(appConfig));
|
oauthService.configure(authconfigFactory.getAuthConfig(appConfig));
|
||||||
oauthService.tokenValidationHandler = new JwksValidationHandler();
|
oauthService.tokenValidationHandler = new JwksValidationHandler();
|
||||||
oauthService.tokenValidationHandler.validateAtHash = function () {
|
oauthService.tokenValidationHandler.validateAtHash = function () {
|
||||||
return new Promise<boolean>((res) => { res(true); })
|
return new Promise<boolean>((res) => { res(true); })
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import {Inject, Injectable} from '@angular/core';
|
import {Inject, Injectable} from '@angular/core';
|
||||||
|
import { Location,PathLocationStrategy,LocationStrategy } from '@angular/common';
|
||||||
import {HttpClient, HttpXhrBackend} from '@angular/common/http';
|
import {HttpClient, HttpXhrBackend} from '@angular/common/http';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
|
|
||||||
@@ -8,7 +9,7 @@ export class AppConfig {
|
|||||||
private config: Object = null;
|
private config: Object = null;
|
||||||
private httpClient: HttpClient;
|
private httpClient: HttpClient;
|
||||||
|
|
||||||
constructor(xhrBackend: HttpXhrBackend) {
|
constructor(xhrBackend: HttpXhrBackend,private location:Location) {
|
||||||
this.httpClient = new HttpClient(xhrBackend);
|
this.httpClient = new HttpClient(xhrBackend);
|
||||||
this.config = null;
|
this.config = null;
|
||||||
}
|
}
|
||||||
@@ -21,7 +22,9 @@ export class AppConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public load(): Promise<any> {
|
public load(): Promise<any> {
|
||||||
return this.httpClient.get('/configuration.json')
|
var url = this.location.prepareExternalUrl('/configuration.json');
|
||||||
|
if(url.startsWith("#")) url='file:///android_asset/www/configuration.json'; // hack for cordova
|
||||||
|
return this.httpClient.get(url)
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then(data => {
|
.then(data => {
|
||||||
this.config = data;
|
this.config = data;
|
||||||
|
22
projects/common/src/fm/shared/authconfigFactory.ts
Normal file
22
projects/common/src/fm/shared/authconfigFactory.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { AuthConfig } from 'angular-oauth2-oidc';
|
||||||
|
import {AppConfig} from './app.config';
|
||||||
|
|
||||||
|
export interface IAuthconfigFactory {
|
||||||
|
getAuthConfig(appConfig: AppConfig): AuthConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AuthConfigFactory implements IAuthconfigFactory {
|
||||||
|
getAuthConfig(appConfig: AppConfig): AuthConfig {
|
||||||
|
let authConfig: AuthConfig = new AuthConfig();
|
||||||
|
authConfig.issuer = appConfig.getConfig("issuer");
|
||||||
|
authConfig.redirectUri = window.location.origin + "/cb";
|
||||||
|
authConfig.silentRefreshRedirectUri = window.location.origin + "/silent-refresh.html";
|
||||||
|
authConfig.clientId = appConfig.getConfig("clientId");
|
||||||
|
authConfig.customQueryParams = { audience: appConfig.getConfig("audience") };
|
||||||
|
authConfig.scope = "openid profile email";
|
||||||
|
authConfig.oidc = true;
|
||||||
|
authConfig.disableAtHashCheck = true;
|
||||||
|
authConfig.requireHttps = appConfig.getConfig("requireHttps");
|
||||||
|
return authConfig;
|
||||||
|
}
|
||||||
|
}
|
@@ -3,3 +3,4 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './fm/common.module';
|
export * from './fm/common.module';
|
||||||
|
export * from './fm/common-service.module';
|
||||||
|
@@ -1,31 +0,0 @@
|
|||||||
import { TestBed, async } from '@angular/core/testing';
|
|
||||||
import { AppComponent } from './app.component';
|
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
|
||||||
beforeEach(async(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [
|
|
||||||
AppComponent
|
|
||||||
],
|
|
||||||
}).compileComponents();
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('should create the app', () => {
|
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
|
||||||
const app = fixture.debugElement.componentInstance;
|
|
||||||
expect(app).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`should have as title 'farmmaps-lib-app'`, () => {
|
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
|
||||||
const app = fixture.debugElement.componentInstance;
|
|
||||||
expect(app.title).toEqual('farmmaps-lib-app');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should render title in a h1 tag', () => {
|
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
|
||||||
fixture.detectChanges();
|
|
||||||
const compiled = fixture.debugElement.nativeElement;
|
|
||||||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to farmmaps-lib-app!');
|
|
||||||
});
|
|
||||||
});
|
|
@@ -6,7 +6,7 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
|
||||||
import { AppCommonModule, } from '@farmmaps/common';
|
import { AppCommonModule,AppCommonServiceModule,AuthConfigFactory } from '@farmmaps/common';
|
||||||
import { AppCommonMapModule} from '@farmmaps/common-map';
|
import { AppCommonMapModule} from '@farmmaps/common-map';
|
||||||
|
|
||||||
import {AppRootComponent} from './app.component';
|
import {AppRootComponent} from './app.component';
|
||||||
@@ -18,6 +18,8 @@ import { StoreRouterConnectingModule} from '@ngrx/router-store';
|
|||||||
import {AppRoutingModule} from './app-routing.module';
|
import {AppRoutingModule} from './app-routing.module';
|
||||||
import { LogoComponent } from './logo/logo.component';
|
import { LogoComponent } from './logo/logo.component';
|
||||||
import { MenuComponent } from './menu/menu.component';
|
import { MenuComponent } from './menu/menu.component';
|
||||||
|
import { LocalAuthconfigFactory} from './localAuthconfigFactory';
|
||||||
|
import { AuthConfig } from 'angular-oauth2-oidc';
|
||||||
|
|
||||||
export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects');
|
export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects');
|
||||||
|
|
||||||
@@ -52,13 +54,20 @@ export function provideBootstrapEffects(effects: Type<any>[]) {
|
|||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
AppCommonModule.forRoot() ,
|
AppCommonModule,
|
||||||
|
AppCommonServiceModule.forRoot(),
|
||||||
AppCommonMapModule.forRoot(),
|
AppCommonMapModule.forRoot(),
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
StoreModule.forRoot({}),
|
StoreModule.forRoot({}),
|
||||||
EffectsModule.forRoot([])
|
EffectsModule.forRoot([])
|
||||||
],
|
],
|
||||||
providers: [],
|
providers: [
|
||||||
|
AuthConfigFactory
|
||||||
|
// {
|
||||||
|
// provide:AuthConfigFactory,
|
||||||
|
// useClass:LocalAuthconfigFactory
|
||||||
|
// }
|
||||||
|
],
|
||||||
bootstrap: [AppRootComponent]
|
bootstrap: [AppRootComponent]
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
22
src/app/localAuthconfigFactory.ts
Normal file
22
src/app/localAuthconfigFactory.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import {IAuthconfigFactory,AppConfig} from '@farmmaps/common';
|
||||||
|
import {AuthConfig} from 'angular-oauth2-oidc';
|
||||||
|
|
||||||
|
export class LocalAuthconfigFactory implements IAuthconfigFactory {
|
||||||
|
getAuthConfig(appConfig:AppConfig): AuthConfig {
|
||||||
|
let authConfig: AuthConfig = new AuthConfig();
|
||||||
|
authConfig.issuer = appConfig.getConfig("issuer");
|
||||||
|
authConfig.redirectUri = window.location.origin + "/cb";
|
||||||
|
authConfig.silentRefreshRedirectUri = window.location.origin + "/silent-refresh.html";
|
||||||
|
authConfig.clientId = appConfig.getConfig("clientId");
|
||||||
|
authConfig.customQueryParams = { audience: appConfig.getConfig("audience") };
|
||||||
|
authConfig.scope = "openid profile email";
|
||||||
|
authConfig.oidc = true;
|
||||||
|
authConfig.disableAtHashCheck = true;
|
||||||
|
authConfig.openUri = uri => {
|
||||||
|
window.alert("OK "+uri);
|
||||||
|
}
|
||||||
|
authConfig.requireHttps = appConfig.getConfig("requireHttps");
|
||||||
|
return authConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -43,7 +43,7 @@
|
|||||||
*
|
*
|
||||||
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
||||||
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
||||||
* (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
||||||
*
|
*
|
||||||
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
||||||
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
||||||
|
@@ -2,15 +2,16 @@
|
|||||||
"compileOnSave": false,
|
"compileOnSave": false,
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
|
"downlevelIteration": true,
|
||||||
"outDir": "./dist/out-tsc",
|
"outDir": "./dist/out-tsc",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
"module": "es2015",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"node_modules/@types"
|
"node_modules/@types"
|
||||||
],
|
],
|
||||||
|
@@ -62,12 +62,12 @@
|
|||||||
],
|
],
|
||||||
"trailing-comma": false,
|
"trailing-comma": false,
|
||||||
"no-output-on-prefix": true,
|
"no-output-on-prefix": true,
|
||||||
"use-input-property-decorator": true,
|
"no-inputs-metadata-property": true,
|
||||||
"use-output-property-decorator": true,
|
"no-outputs-metadata-property": true,
|
||||||
"use-host-property-decorator": true,
|
"no-host-metadata-property": true,
|
||||||
"no-input-rename": true,
|
"no-input-rename": true,
|
||||||
"no-output-rename": true,
|
"no-output-rename": true,
|
||||||
"use-life-cycle-interface": true,
|
"use-lifecycle-interface": true,
|
||||||
"use-pipe-transform-interface": true,
|
"use-pipe-transform-interface": true,
|
||||||
"component-class-suffix": true,
|
"component-class-suffix": true,
|
||||||
"directive-class-suffix": true
|
"directive-class-suffix": true
|
||||||
|
Reference in New Issue
Block a user