Compare commits
41 Commits
f880623337
...
2022.01
Author | SHA1 | Date | |
---|---|---|---|
|
b191751e02 | ||
66e492d2f8 | |||
e944064053 | |||
a1a4fc14ab | |||
122563a0bd | |||
33f322424e | |||
519b81d1fd | |||
b7c80dfdd8 | |||
d89670f669 | |||
d025e2e3f6 | |||
|
57407d83d3 | ||
|
f83549b5af | ||
|
132556da81 | ||
|
c2350eec52 | ||
|
c6d14e6c9c | ||
|
8e4364bd08 | ||
|
af3340ed70 | ||
|
ff19d830a7 | ||
|
29914cfb1b | ||
|
7bca0a57c4 | ||
|
fdba357e9c | ||
|
b5d00f5619 | ||
|
89a0fb13a5 | ||
|
2861ba220e | ||
|
45e0d5e836 | ||
|
312611cdc1 | ||
|
54b8a3bf24 | ||
4c1d4137ea | |||
a454f2306d | |||
|
52a72b042c | ||
|
c0c9864b07 | ||
|
e0f36b043f | ||
|
b52bfd4f57 | ||
|
6ff3c0ec96 | ||
|
eb1157d608 | ||
|
1daa8e257f | ||
|
5db24cc63d | ||
ff018d9db1 | |||
8c49965df8 | |||
9c19595597 | |||
ea1b22ed41 |
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -8,13 +8,13 @@ pipeline {
|
||||
stage('npm install'){
|
||||
steps {
|
||||
sh '''rm -rf node_modules/
|
||||
npm install
|
||||
npm install --legacy-peer-deps
|
||||
cd projects/common
|
||||
npm install
|
||||
npm install --legacy-peer-deps
|
||||
cd ../common-map
|
||||
npm install
|
||||
npm install --legacy-peer-deps
|
||||
cd ../common-map3d
|
||||
npm install
|
||||
npm install --legacy-peer-deps
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
20
package-lock.json
generated
20
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "farmmaps-lib-app",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.13",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -4079,25 +4079,25 @@
|
||||
"dev": true
|
||||
},
|
||||
"@farmmaps/common": {
|
||||
"version": "1.1.1-prerelease.2031",
|
||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-1.1.1-prerelease.2031.tgz",
|
||||
"integrity": "sha512-lSmTd2D1/PqzaXBjjY4X6UTYA5joZndXyZpUkFNm/Z0TTFmzFKmiIyGRA9AHX4StdQXC7QsCNfalYN31tnwtuQ==",
|
||||
"version": "1.1.12",
|
||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-1.1.12.tgz",
|
||||
"integrity": "sha512-TqPyPv35wK4bM1D/ZnT7zmno12pIlmBVesMKMJF7VtddZUm9mZe890ZQv7JJrbgURhU1o4mBs2ytmW0dGhDArw==",
|
||||
"requires": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@farmmaps/common-map": {
|
||||
"version": "1.1.1-prerelease.2031",
|
||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-1.1.1-prerelease.2031.tgz",
|
||||
"integrity": "sha512-BQ2bvNohPth0+oxoSoh+WWLJ/mP2CGW4Qf4xqgC3tgfW+UZfD0dBPl7IT2piuvOuUQzlSVloinCJ4ciZGyZRXg==",
|
||||
"version": "1.1.12",
|
||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-1.1.12.tgz",
|
||||
"integrity": "sha512-mu2AaIrGEbfj7gzJZLwLwBawOWwz4cJXDxcrsZQRzTb8Z9BA3ZV+9w1XkGU7Q0CgYLPuGaWMFF6AHqzTPARj/g==",
|
||||
"requires": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@farmmaps/common-map3d": {
|
||||
"version": "1.1.1-prerelease.2031",
|
||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map3d/-/common-map3d-1.1.1-prerelease.2031.tgz",
|
||||
"integrity": "sha512-2M5wv5sFwlVwPGlN1b1AGM3Dh/DJFS7+L3b6e6ir2+ASoyy7xhZ67IWS2du8B7y7/xVsgxCJcJp1EJezbSCMAA==",
|
||||
"version": "1.1.12",
|
||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map3d/-/common-map3d-1.1.12.tgz",
|
||||
"integrity": "sha512-yHRrL97GQZj0m4AlhsNrnKL6aujCBr5qgbp7uiUqsSQXp2dpJXbUFZpPnPKvOrFDUNJl8gqsbo5cvsvHucqCYg==",
|
||||
"requires": {
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "farmmaps-lib-app",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.13",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
@@ -19,9 +19,9 @@
|
||||
"@angular/platform-browser": "~11.2.14",
|
||||
"@angular/platform-browser-dynamic": "~11.2.14",
|
||||
"@angular/router": "~11.2.14",
|
||||
"@farmmaps/common": "1.1.1-prerelease.2031",
|
||||
"@farmmaps/common-map": "1.1.1-prerelease.2031",
|
||||
"@farmmaps/common-map3d": "1.1.1-prerelease.2031",
|
||||
"@farmmaps/common": "1.1.12",
|
||||
"@farmmaps/common-map": "1.1.12",
|
||||
"@farmmaps/common-map3d": "1.1.12",
|
||||
"@microsoft/signalr": "^3.1.16",
|
||||
"@ng-bootstrap/ng-bootstrap": "^9.0",
|
||||
"@ngrx/effects": "^11.0",
|
||||
|
@@ -6,12 +6,14 @@ import { ILayervalue } from '../models/layer.value';
|
||||
import { IQueryState } from '@farmmaps/common';
|
||||
import { IItem } from '@farmmaps/common';
|
||||
import { Feature,Style } from 'ol';
|
||||
import { IPeriodState } from '../models/period.state';
|
||||
|
||||
export const SETSTATE = '[Map] SetState';
|
||||
export const SETMAPSTATE = '[Map] MapState';
|
||||
export const SETVIEWEXTENT = '[Map] SetViewExtent';
|
||||
export const INIT = '[Map] Init';
|
||||
export const SETPARENT = '[Map] SetParent';
|
||||
export const SETPERIOD = '[Map] SetPeriod';
|
||||
export const STARTSEARCH = '[Map] StartSearch';
|
||||
export const STARTSEARCHSUCCESS = '[Map] StartSearchSuccess';
|
||||
export const SELECTFEATURE = '[Map] SelectFeature';
|
||||
@@ -86,6 +88,12 @@ export class SetParent implements Action {
|
||||
constructor(public parentCode:string) { }
|
||||
}
|
||||
|
||||
export class SetPeriod implements Action {
|
||||
readonly type = SETPERIOD;
|
||||
|
||||
constructor(public period:IPeriodState) { }
|
||||
}
|
||||
|
||||
export class StartSearch implements Action {
|
||||
readonly type = STARTSEARCH;
|
||||
|
||||
@@ -348,5 +356,6 @@ export type Actions = SetMapState
|
||||
| SetLayerValuesLocation
|
||||
| ToggleLayerValuesEnabled
|
||||
| GetLayerValueSuccess
|
||||
| GetLayerValue;
|
||||
| GetLayerValue
|
||||
| SetPeriod;
|
||||
|
||||
|
@@ -19,6 +19,7 @@ import * as mapEffects from './effects/map.effects';
|
||||
import { IMapState} from './models/map.state';
|
||||
import { ISelectedFeatures } from './models/selected.features';
|
||||
import { IItemLayer,ItemLayer,ITemporalItemLayer,TemporalItemLayer } from './models/item.layer';
|
||||
import { IClickedFeature } from './models/clicked.feature';
|
||||
import { IPeriodState } from './models/period.state';
|
||||
|
||||
// components
|
||||
@@ -82,9 +83,17 @@ export function LocalStorageSync(reducer: ActionReducer<any>): ActionReducer<any
|
||||
if(ms) {
|
||||
r2["mapState"] = JSON.parse(ms);
|
||||
}
|
||||
let sp = window.localStorage.getItem(MODULE_NAME+"_searchPeriod");
|
||||
if(sp) {
|
||||
let p = JSON.parse(sp);
|
||||
r2["period"] = { startDate: new Date(Date.parse(p.startDate)),endDate:new Date(Date.parse(p.endDate))};
|
||||
}
|
||||
}
|
||||
if(action.type == "[Map] MapState" || action.type == "[Map] SetState") {
|
||||
window.localStorage.setItem(MODULE_NAME + "_mapState",JSON.stringify(r2["mapState"]));
|
||||
window.localStorage.setItem(MODULE_NAME + "_mapState",JSON.stringify(r2["mapState"]));
|
||||
}
|
||||
if(action.type == "[Map] SetPeriod" ) {
|
||||
window.localStorage.setItem(MODULE_NAME + "_searchPeriod",JSON.stringify(r2["period"]));
|
||||
}
|
||||
|
||||
return r2;
|
||||
@@ -155,7 +164,9 @@ export {
|
||||
ITemporalItemLayer,
|
||||
TemporalItemLayer,
|
||||
ifZoomToShowDirective,
|
||||
ZoomToShowAlert
|
||||
ZoomToShowAlert,
|
||||
IClickedFeature,
|
||||
GeometryThumbnailComponent
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
@@ -265,7 +276,8 @@ export {
|
||||
FeatureListFeatureContainerComponent,
|
||||
ZoomToExtentComponent,
|
||||
ifZoomToShowDirective,
|
||||
ZoomToShowAlert
|
||||
ZoomToShowAlert,
|
||||
GeometryThumbnailComponent
|
||||
],
|
||||
providers: [
|
||||
FeatureIconService,
|
||||
@@ -288,5 +300,5 @@ export {
|
||||
})
|
||||
|
||||
|
||||
export class AppCommonMapModule {
|
||||
export class AppCommonMapModule {
|
||||
}
|
||||
|
@@ -112,17 +112,18 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
||||
this.host.instance.setSource(this.instance);
|
||||
|
||||
this.host.instance.setStyle((feature) => {
|
||||
var key = feature.get('itemType') + (this.selectedItem?"_I":"");
|
||||
var itemType = feature.get('itemType');
|
||||
var key = itemType + (this.selectedItem?"_I":"");
|
||||
if (!this.stylesCache[key]) {
|
||||
if (this.itemTypeService.itemTypes[key]) {
|
||||
let itemType = this.itemTypeService.itemTypes[key];
|
||||
let fillColor = color.asArray(itemType.iconColor);
|
||||
if (this.itemTypeService.itemTypes[itemType]) {
|
||||
let itemTypeEntry = this.itemTypeService.itemTypes[itemType];
|
||||
let fillColor = color.asArray(itemTypeEntry.iconColor);
|
||||
fillColor[3] = 0;
|
||||
this.stylesCache[key] = new style.Style({
|
||||
image: itemType.icon ? new style.Icon({
|
||||
image: itemTypeEntry.icon ? new style.Icon({
|
||||
anchor: [0.5, 1],
|
||||
scale: 0.05,
|
||||
src: this.featureIconService$.getIconImageDataUrl(itemType.icon)
|
||||
src: this.featureIconService$.getIconImageDataUrl(itemTypeEntry.icon)
|
||||
}):null,
|
||||
stroke: new style.Stroke({
|
||||
color: 'red',
|
||||
|
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div *ngIf="itemLayer.legendVisible">
|
||||
<div class="card legend">
|
||||
<fm-map-layer-legend [layer]="firstLayer(itemLayer)" (click)="handleLegendClick($event,itemLayer);"></fm-map-layer-legend>
|
||||
<fm-map-layer-legend [layer]="firstLayer(itemLayer)" (click)="handleLegendClick($event,itemLayer);" [histogramenabled]="true"></fm-map-layer-legend>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<li class="border-top pt-1 pb-1 value" *ngFor="let layerValue of layers">
|
||||
<div>{{layerValue.layerName}}</div>
|
||||
<div>{{layerValue.date|date}}</div>
|
||||
<div><span class="mr-1">{{layerValue.quantity}}</span> <span class="mr-1 font-weight-bold">{{layerValue.value}}</span><span>{{layerValue.unit}}</span></div>
|
||||
<div><span *ngIf="layerValue.quantity"><span class="mr-1">{{layerValue.quantity}}</span> </span><span class="mr-1 font-weight-bold">{{layerValue.value}}</span><span>{{layerValue.unit}}</span></div>
|
||||
</li>
|
||||
</ul>
|
||||
<ng-template #no_data>
|
||||
|
@@ -38,7 +38,7 @@ export class FeatureListContainerComponent {
|
||||
let criteria=0;
|
||||
if (this.featureLists[i]['forItemType']) {
|
||||
criteria++;
|
||||
if( this.featureLists[i]['forItemType'].indexOf(queryState.itemType) >= 0) {
|
||||
if( this.featureLists[i]['forItemType'].split(",").filter(part => part == queryState.itemType).length == 1) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ export class FeatureListFeatureContainerComponent {
|
||||
let criteria=0;
|
||||
if (this.featureLists[i]['forItemType']) {
|
||||
criteria++;
|
||||
if(this.featureLists[i]['forItemType'].indexOf(this.feature.get("itemType")) >= 0) {
|
||||
if(this.featureLists[i]['forItemType'].split(",").filter(part => part == this.feature.get("itemType")).length == 1) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Component, Input, OnInit,ViewChild } from '@angular/core';
|
||||
import { Component, Input, AfterViewInit, ViewChild } from '@angular/core';
|
||||
import { Feature} from 'ol';
|
||||
import { Geometry } from 'ol/geom';
|
||||
import * as extent from 'ol/extent';
|
||||
@@ -10,51 +10,86 @@ import * as style from 'ol/style';
|
||||
templateUrl: './feature-thumbnail.component.html',
|
||||
styleUrls: ['./feature-thumbnail.component.scss']
|
||||
})
|
||||
export class GeometryThumbnailComponent implements OnInit {
|
||||
export class GeometryThumbnailComponent implements AfterViewInit {
|
||||
|
||||
|
||||
constructor() { }
|
||||
|
||||
@ViewChild('canvas') canvas;
|
||||
@ViewChild('container') container;
|
||||
@Input('feature') feature:Feature;
|
||||
|
||||
ngOnInit(): void {
|
||||
private geometry:Geometry = null;
|
||||
@Input() set feature(value:Feature) {
|
||||
if(value) {
|
||||
this.geometry = value.getGeometry();
|
||||
} else {
|
||||
this.geometry = null;
|
||||
}
|
||||
this.render(this.canvas,
|
||||
this.geometryStyle,
|
||||
this.geometry,
|
||||
this.width,
|
||||
this.height);
|
||||
};
|
||||
|
||||
private defaultStyle:style.Style = new style.Style({
|
||||
stroke: new style.Stroke({ color: 'black',width:1.5 })
|
||||
});
|
||||
private geometryStyle:style.Style = this.defaultStyle;
|
||||
@Input() set fillColor(value:string) {
|
||||
if(style) {
|
||||
this.geometryStyle = new style.Style({
|
||||
stroke: new style.Stroke({ color: 'black',width:1.5 }),
|
||||
fill: new style.Fill({color: value})
|
||||
});
|
||||
} else {
|
||||
this.geometryStyle = this.defaultStyle
|
||||
}
|
||||
this.render(this.canvas,
|
||||
this.geometryStyle,
|
||||
this.geometry,
|
||||
this.width,
|
||||
this.height);
|
||||
}
|
||||
|
||||
render(canvas,width,height,geometry:Geometry) {
|
||||
let renderContext = render.toContext(canvas.getContext( '2d'),{ size: [width, height] });
|
||||
|
||||
let strokeStyle = new style.Style({
|
||||
stroke: new style.Stroke({ color: 'black',width:1.5 })
|
||||
});
|
||||
private width:number = 0;
|
||||
private height:number = 0;
|
||||
|
||||
let geom = geometry.clone(),
|
||||
line = geom.getCoordinates()[0],
|
||||
e = extent.boundingExtent( line );
|
||||
render(canvas,style:style.Style,geometry:Geometry,width:number,height:number) {
|
||||
if(canvas && canvas.nativeElement && geometry && style) {
|
||||
let renderContext = render.toContext(canvas.nativeElement.getContext( '2d'),{ size: [width, height] });
|
||||
|
||||
let dxy = extent.getCenter(e),
|
||||
sxy = [
|
||||
(width - 2 ) / extent.getWidth(e),
|
||||
(height - 2 ) / extent.getHeight(e)
|
||||
];
|
||||
|
||||
let dx = dxy[0],
|
||||
dy = dxy[1],
|
||||
sx = sxy[0],
|
||||
sy = sxy[1];
|
||||
|
||||
geom.translate( -dx, -dy );
|
||||
geom.scale( Math.min(sx, sy), -Math.min(sx, sy));
|
||||
geom.translate( width / 2, height / 2 );
|
||||
|
||||
renderContext.setStyle( strokeStyle );
|
||||
renderContext.drawGeometry( geom );
|
||||
let geom = geometry.clone(),
|
||||
line = geom.getCoordinates()[0],
|
||||
e = extent.boundingExtent( line );
|
||||
|
||||
let dxy = extent.getCenter(e),
|
||||
sxy = [
|
||||
(width - 2 ) / extent.getWidth(e),
|
||||
(height - 2 ) / extent.getHeight(e)
|
||||
];
|
||||
|
||||
let dx = dxy[0],
|
||||
dy = dxy[1],
|
||||
sx = sxy[0],
|
||||
sy = sxy[1];
|
||||
|
||||
geom.translate( -dx, -dy );
|
||||
geom.scale( Math.min(sx, sy), -Math.min(sx, sy));
|
||||
geom.translate(width / 2,height / 2 );
|
||||
renderContext.setStyle( style );
|
||||
renderContext.drawGeometry( geom );
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.render(this.canvas.nativeElement,
|
||||
this.container.nativeElement.offsetWidth,
|
||||
this.container.nativeElement.offsetHeight,
|
||||
this.feature.getGeometry());
|
||||
this.width = this.container.nativeElement.offsetWidth;
|
||||
this.height = this.container.nativeElement.offsetHeight;
|
||||
this.render(this.canvas,
|
||||
this.geometryStyle,
|
||||
this.geometry,
|
||||
this.width,
|
||||
this.height);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -33,13 +33,13 @@ export class ItemListItemContainerComponent {
|
||||
let criteria=0;
|
||||
if (this.itemComponentList[i]['forItemType']) {
|
||||
criteria++;
|
||||
if(this.itemComponentList[i]['forItemType'].indexOf(this.item.itemType) >= 0) {
|
||||
if(this.itemComponentList[i]['forItemType'].split(",").filter(part => part ==this.item.itemType).length == 1) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
if (this.itemComponentList[i]['forSourceTask']) {
|
||||
criteria++;
|
||||
if(this.itemComponentList[i]['forSourceTask'].indexOf(this.item.sourceTask) >= 0) {
|
||||
if(this.itemComponentList[i]['forSourceTask'].split(",").filter(part => part ==this.item.sourceTask).length ==1) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ export class LegendComponent implements OnInit,AfterViewInit {
|
||||
}
|
||||
|
||||
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";
|
||||
return this.histogramenabled && this.layer.renderer.band.histogram.entries && this.layer.renderer.band.histogram.entries.length > 0 && this.layer.renderer.band.histogram.entries.length == this.layer.renderer.colorMap.entries.length;
|
||||
}
|
||||
|
||||
bandContainsStatistics(): boolean {
|
||||
|
@@ -33,4 +33,4 @@
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
</div>
|
||||
<fm-map-select-period-modal [modalState]="openedModalName" (onCloseModal)="handleCloseModal()" (onSelect)="handleSelectPeriod($event)" [startDate]="startDate" [endDate]="endDate"></fm-map-select-period-modal>
|
||||
<fm-map-select-period-modal [modalState]="openedModalName" (onCloseModal)="handleCloseModal()" (onSelect)="handleSelectPeriod($event)" [startDate]="periodLocal.startDate" [endDate]="periodLocal.endDate"></fm-map-select-period-modal>
|
||||
|
@@ -22,7 +22,10 @@ export class MapSearchComponent {
|
||||
@Input() set searchMinified(minified: boolean) {
|
||||
this.searchMinifiedLocal = minified;
|
||||
}
|
||||
@Input() period: IPeriodState
|
||||
@Input() set period(period:IPeriodState) {
|
||||
this.periodLocal = tassign(this.periodLocal,{startDate: period.startDate,endDate:period.endDate});
|
||||
this.startEndCaption = this.timespanService.getCaption(period.startDate, period.endDate, 4)
|
||||
}
|
||||
@Output() onSearch = new EventEmitter<IQueryState>();
|
||||
@Output() onClear = new EventEmitter<any>();
|
||||
@Output() onSearchCollapse = new EventEmitter<any>();
|
||||
@@ -30,6 +33,7 @@ export class MapSearchComponent {
|
||||
@Output() onToggleMenu = new EventEmitter<any>();
|
||||
@Output() onOpenModal = new EventEmitter<string>();
|
||||
@Output() onCloseModal = new EventEmitter<any>();
|
||||
@Output() onPeriodChange = new EventEmitter<IPeriodState>();
|
||||
@Input() openedModalName: string;
|
||||
@Input() set filterOptions(filterOptions: IQueryState) {
|
||||
if (filterOptions && filterOptions.query && filterOptions.query.length > 0) {
|
||||
@@ -42,23 +46,18 @@ export class MapSearchComponent {
|
||||
this.searchTextLocal = { name: filterOptions.tags };
|
||||
} else {
|
||||
this.searchTextLocal = { name: filterOptions.query };
|
||||
}
|
||||
if (this.dateFilter) {
|
||||
this.filterOptionsLocal.startDate = this.startDate;
|
||||
this.filterOptionsLocal.endDate = this.endDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public collapsedLocal: boolean = true;
|
||||
public searchMinifiedLocal: boolean = false;
|
||||
public periodLocal: IPeriodState = { startDate:new Date(new Date(Date.now()).getFullYear(), new Date(Date.now()).getMonth() - 3, 1), endDate:new Date(Date.now())};
|
||||
public filterOptionsLocal: IQueryState;
|
||||
private extent: number[];
|
||||
public searchTextLocal: any;
|
||||
public searchTextLocalOutput: string;
|
||||
public dateFilter: boolean = true;
|
||||
public startDate: Date = new Date(new Date(Date.now()).getFullYear(), new Date(Date.now()).getMonth() - 3, 1);
|
||||
public endDate: Date = new Date(Date.now());
|
||||
public startEndCaption: string = this.timespanService.getCaption(this.startDate, this.endDate, 4);
|
||||
public dateFilter: boolean = true;
|
||||
public startEndCaption: string = this.timespanService.getCaption(this.periodLocal.startDate, this.periodLocal.endDate, 4);
|
||||
|
||||
searching = false;
|
||||
searchFailed = false;
|
||||
@@ -94,8 +93,8 @@ export class MapSearchComponent {
|
||||
this.filterOptionsLocal.parentCode = null;
|
||||
this.filterOptionsLocal.query = this.searchTextLocalOutput;
|
||||
if (this.dateFilter) {
|
||||
this.filterOptionsLocal.startDate = this.startDate;
|
||||
this.filterOptionsLocal.endDate = this.endDate;
|
||||
this.filterOptionsLocal.startDate = this.periodLocal.startDate;
|
||||
this.filterOptionsLocal.endDate = this.periodLocal.endDate;
|
||||
}
|
||||
this.onSearch.emit(this.filterOptionsLocal);
|
||||
}
|
||||
@@ -117,26 +116,30 @@ export class MapSearchComponent {
|
||||
this.filterOptionsLocal.parentCode = null;
|
||||
this.filterOptionsLocal.tags = event.item.name;
|
||||
if (this.dateFilter) {
|
||||
this.filterOptionsLocal.startDate = this.startDate;
|
||||
this.filterOptionsLocal.endDate = this.endDate;
|
||||
this.filterOptionsLocal.startDate = this.periodLocal.startDate;
|
||||
this.filterOptionsLocal.endDate = this.periodLocal.endDate;
|
||||
}
|
||||
this.onSearch.emit(this.filterOptionsLocal);
|
||||
this.searchTextLocal = { name: this.filterOptionsLocal.tags };
|
||||
}
|
||||
|
||||
handleSelectPeriod(event: { startDate: Date, endDate: Date }) {
|
||||
this.startDate = event.startDate;
|
||||
this.endDate = event.endDate;
|
||||
this.handleCloseModal();
|
||||
this.periodLocal = { startDate: event.startDate, endDate: event.endDate}
|
||||
this.onPeriodChange.emit(this.periodLocal);
|
||||
this.startEndCaption = this.timespanService.getCaption(event.startDate, event.endDate, 4);
|
||||
this.onSearch.emit(this.filterOptionsLocal);
|
||||
if(this.dateFilter) {
|
||||
this.filterOptionsLocal.startDate =event.startDate;
|
||||
this.filterOptionsLocal.endDate = event.endDate;
|
||||
this.onSearch.emit(this.filterOptionsLocal);
|
||||
}
|
||||
this.handleCloseModal();
|
||||
}
|
||||
|
||||
handleChangeEnableDateFilter(enabled) {
|
||||
this.dateFilter = enabled;
|
||||
if (enabled) {
|
||||
this.filterOptionsLocal.startDate = this.startDate;
|
||||
this.filterOptionsLocal.endDate = this.endDate;
|
||||
this.filterOptionsLocal.startDate = this.periodLocal.startDate;
|
||||
this.filterOptionsLocal.endDate = this.periodLocal.endDate;
|
||||
} else {
|
||||
this.filterOptionsLocal.startDate = null;
|
||||
this.filterOptionsLocal.endDate = null;
|
||||
|
@@ -50,7 +50,7 @@
|
||||
<fm-map-file-drop-target [parentCode]="state.parentCode" (onFileDropped)="handleFileDropped($event)"></fm-map-file-drop-target>
|
||||
|
||||
<div *ngIf="noContent">
|
||||
<fm-map-map-search #mapSearch [openedModalName]="state.openedModalName" (onOpenModal)="handleOpenModal($event)" (onCloseModal)="handleCloseModal()" [ngClass]="{'menuVisible':state.menuVisible}" (onToggleMenu)="handleToggleMenu($event)" (onSearchCollapse)="handleSearchCollapse($event)" (onSearchExpand)="handleSearchExpand($event)" [collapsed]="state.searchCollapsed" [searchMinified]="state.searchMinified" (onSearch)="handleSearch($event)" (onClear)="handleClearSearch($event)" [filterOptions]="state.queryState" [clearEnabled]="state.clearEnabled" [period]="state.period"></fm-map-map-search>
|
||||
<fm-map-map-search #mapSearch [openedModalName]="state.openedModalName" (onOpenModal)="handleOpenModal($event)" (onCloseModal)="handleCloseModal()" [ngClass]="{'menuVisible':state.menuVisible}" (onToggleMenu)="handleToggleMenu($event)" (onSearchCollapse)="handleSearchCollapse($event)" (onSearchExpand)="handleSearchExpand($event)" [collapsed]="state.searchCollapsed" [searchMinified]="state.searchMinified" (onSearch)="handleSearch($event)" (onClear)="handleClearSearch($event)" [filterOptions]="state.queryState" [clearEnabled]="state.clearEnabled" [period]="state.period" (onPeriodChange)="handlePeriodChange($event)"></fm-map-map-search>
|
||||
</div>
|
||||
<div class="side-panel-container">
|
||||
<fm-side-panel [resizeable]="true" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false">
|
||||
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
</fm-side-panel>
|
||||
<fm-side-panel [resizeable]="true" [visible]="!noContent">
|
||||
<router-outlet></router-outlet>
|
||||
<router-outlet (activate)="handleSidepaneloutletActivate($event)" (deactivate)="handleSidepaneloutletDeactivate($event)"></router-outlet>
|
||||
</fm-side-panel>
|
||||
</div>
|
||||
</aol-map>
|
||||
|
@@ -11,6 +11,7 @@ import { DeviceService } from '@farmmaps/common';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
import { IMapState} from '../../models/map.state';
|
||||
import { IClickedFeature} from '../../models/clicked.feature';
|
||||
import { IQuery } from '../../reducers/map.reducer'
|
||||
import { ISelectedFeatures } from '../../models/selected.features';
|
||||
import { IItemLayer } from '../../models/item.layer';
|
||||
@@ -175,6 +176,18 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
this.store.dispatch(new mapActions.DoQuery(queryState));
|
||||
}
|
||||
|
||||
handleSidepaneloutletActivate(component:any) {
|
||||
if(component && component.hasOwnProperty('clickedFeature')) {
|
||||
(component as IClickedFeature).clickedFeature = this.clickedFeature;
|
||||
}
|
||||
}
|
||||
|
||||
handleSidepaneloutletDeactivate(component:any) {
|
||||
if(component && component.hasOwnProperty('clickedFeature')) {
|
||||
(component as IClickedFeature).clickedFeature = null;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.initialized = false;
|
||||
console.debug("Init");
|
||||
@@ -434,6 +447,10 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
this.store.dispatch(new mapActions.SelectOverlayLayer(itemLayer));
|
||||
}
|
||||
|
||||
handlePeriodChange(period:IPeriodState) {
|
||||
this.store.dispatch(new mapActions.SetPeriod(period));
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if (this.paramSub) this.paramSub.unsubscribe();
|
||||
if (this.itemTypeSub) this.itemTypeSub.unsubscribe();
|
||||
|
@@ -34,13 +34,13 @@ export class SelectedItemContainerComponent {
|
||||
let criteria=0;
|
||||
if (this.selectedItemComponents[i]['forItemType'] ) {
|
||||
criteria++;
|
||||
if(this.selectedItemComponents[i]['forItemType'].indexOf(this.item.itemType) >= 0) {
|
||||
if(this.selectedItemComponents[i]['forItemType'].split(",").filter(part => part ==this.item.itemType).length == 1) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
if (this.selectedItemComponents[i]['forSourceTask']) {
|
||||
criteria++;
|
||||
if( this.selectedItemComponents[i]['forSourceTask'].indexOf(this.item.sourceTask) >= 0) {
|
||||
if( this.selectedItemComponents[i]['forSourceTask'].split(",").filter(part => part ==this.item.sourceTask).length == 1) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
@@ -50,15 +50,16 @@ export class MapEffects {
|
||||
private _wktFormat: WKT;
|
||||
private overrideSelectedItemLayer: boolean = false;
|
||||
|
||||
private toPointFeature(updateEvent:commonActions.DeviceUpdateEvent): Feature {
|
||||
private updateFeatureGeometry(feature:Feature, updateEvent:commonActions.DeviceUpdateEvent): Feature {
|
||||
let newFeature = feature.clone();
|
||||
var f = this._wktFormat.readFeature(updateEvent.attributes["geometry"],{
|
||||
dataProjection: 'EPSG:4326',
|
||||
featureProjection: 'EPSG:3857'
|
||||
});
|
||||
f.setId(updateEvent.itemCode);
|
||||
var centroid = getCenter(f.getGeometry().getExtent());
|
||||
f.setGeometry(new Point(centroid));
|
||||
return f;
|
||||
newFeature.setId(feature.getId());
|
||||
newFeature.setGeometry(new Point(centroid));
|
||||
return newFeature;
|
||||
}
|
||||
|
||||
init$ = createEffect(() => this.actions$.pipe(
|
||||
@@ -263,7 +264,7 @@ export class MapEffects {
|
||||
}
|
||||
}
|
||||
if (feature) {
|
||||
return of(new mapActions.UpdateFeatureSuccess(this.toPointFeature(deviceUpdateEventAction)));
|
||||
return of(new mapActions.UpdateFeatureSuccess(this.updateFeatureGeometry(feature,deviceUpdateEventAction)));
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
@@ -316,7 +317,7 @@ export class MapEffects {
|
||||
if(v !== null) {
|
||||
if(l.renderer && l.renderer.colorMap && l.renderer.colorMap.colormapType == "manual") {
|
||||
l.renderer.colorMap.entries.forEach((e) => {
|
||||
if(e.value == v) {
|
||||
if(e.value == v && e.label) {
|
||||
v=e.label;
|
||||
return;
|
||||
}
|
||||
|
10
projects/common-map/src/fm-map/models/clicked.feature.ts
Normal file
10
projects/common-map/src/fm-map/models/clicked.feature.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import {Feature} from 'ol';
|
||||
import {Geometry} from 'ol/geom';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @deprecated This interface will be removed soon
|
||||
*/
|
||||
export interface IClickedFeature {
|
||||
clickedFeature: Observable<Feature<Geometry>>
|
||||
}
|
@@ -3,7 +3,7 @@ import { IItem,Item } from '@farmmaps/common';
|
||||
import { IItemLayer,ItemLayer,ITemporalItemLayer,TemporalItemLayer} from '../models/item.layer';
|
||||
import { IMapState} from '../models/map.state';
|
||||
import { IQueryState} from '@farmmaps/common';
|
||||
import { IPeriodState} from '../models/period.state';
|
||||
import { IPeriodState } from '../models/period.state';
|
||||
import { IStyles} from '../models/style.cache';
|
||||
import { ILayervalue } from '../models/layer.value';
|
||||
import * as mapActions from '../actions/map.actions';
|
||||
@@ -304,10 +304,14 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
return tassign(state, {
|
||||
query: tassign(state.query,
|
||||
{
|
||||
querystate: tassign(a.query, { bbox: a.query.bboxFilter ? state.viewExtent : [] }),
|
||||
querystate: tassign(a.query, { bbox: a.query.bboxFilter ? state.viewExtent : [] }),
|
||||
replace:a.replace
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
case mapActions.SETPERIOD: {
|
||||
return tassign(state,{ period: action.period});
|
||||
}
|
||||
|
||||
case mapActions.ADDFEATURESUCCESS: {
|
||||
|
@@ -17,6 +17,7 @@ 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 { GeolocatorService } from './services/geolocator.service';
|
||||
import { WeatherService} from './services/weather.service';
|
||||
import { AppConfig } from './shared/app.config';
|
||||
import { AccessTokenInterceptor } from "./shared/accesstoken.interceptor";
|
||||
@@ -44,6 +45,7 @@ export {
|
||||
TypeaheadService,
|
||||
UserService,
|
||||
ImageService,
|
||||
GeolocatorService,
|
||||
WeatherService,
|
||||
AppConfig,
|
||||
AccessTokenInterceptor,
|
||||
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AppMenuComponent } from './app-menu.component';
|
||||
|
||||
describe('AppMenuComponent', () => {
|
||||
let component: AppMenuComponent;
|
||||
let fixture: ComponentFixture<AppMenuComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ AppMenuComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AppMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AvatarComponent } from './avatar.component';
|
||||
|
||||
describe('AvatarComponent', () => {
|
||||
let component: AvatarComponent;
|
||||
let fixture: ComponentFixture<AvatarComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ AvatarComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AvatarComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditImageModalComponent } from './edit-image-modal.component';
|
||||
|
||||
describe('EditImageModalComponent', () => {
|
||||
let component: EditImageModalComponent;
|
||||
let fixture: ComponentFixture<EditImageModalComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ EditImageModalComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditImageModalComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { GradientSelectComponent } from './gradient-select.component';
|
||||
|
||||
describe('GradientSelectComponent', () => {
|
||||
let component: GradientSelectComponent;
|
||||
let fixture: ComponentFixture<GradientSelectComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ GradientSelectComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(GradientSelectComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { GradientComponent } from './gradient.component';
|
||||
|
||||
describe('GradientComponent', () => {
|
||||
let component: GradientComponent;
|
||||
let fixture: ComponentFixture<GradientComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ GradientComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(GradientComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,61 +1,61 @@
|
||||
import { Directive, ViewContainerRef,TemplateRef,OnInit,Input,OnDestroy } from '@angular/core';
|
||||
import { Store} from '@ngrx/store';
|
||||
import * as appCommonReducer from '../../reducers/app-common.reducer'
|
||||
import { IPackages } from '../../models/package';
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
import {AfterViewInit, Directive, Input, OnDestroy, TemplateRef, ViewContainerRef} from '@angular/core';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {PackageService} from '../../services/package.service';
|
||||
import * as appCommonReducer from '../../reducers/app-common.reducer';
|
||||
import {Store} from '@ngrx/store';
|
||||
|
||||
@Directive({
|
||||
selector: '[fmHasPackage]',
|
||||
})
|
||||
export class HasPackageDirective implements OnDestroy{
|
||||
export class HasPackageDirective implements OnDestroy, AfterViewInit {
|
||||
|
||||
@Input()
|
||||
set fmHasPackage(packageIdentifier:string) {
|
||||
this.packageIdentifier$ = packageIdentifier;
|
||||
this.updateView();
|
||||
set fmHasPackage(packageIdentifier: string) {
|
||||
this.packageIdentifier = packageIdentifier;
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
@Input()
|
||||
set fmHasPackageThen(thenTemplate:TemplateRef<any>) {
|
||||
this.thenTemplate$ = thenTemplate;
|
||||
this.updateView();
|
||||
set fmHasPackageThen(thenTemplate: TemplateRef<any>) {
|
||||
this.thenTemplate = thenTemplate;
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
@Input()
|
||||
set fmHasPackageElse(thenTemplate:TemplateRef<any>) {
|
||||
this.elseTemplate$ = thenTemplate;
|
||||
this.updateView();
|
||||
set fmHasPackageElse(thenTemplate: TemplateRef<any>) {
|
||||
this.elseTemplate = thenTemplate;
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
private packageIdentifier$:string;
|
||||
private thenTemplate$:TemplateRef<any>;
|
||||
private elseTemplate$:TemplateRef<any>;
|
||||
private packages$:any = {};
|
||||
private packagesObservable$:Observable<IPackages> = this.store$.select(appCommonReducer.SelectGetUserPackages);
|
||||
private packSub:Subscription;
|
||||
private packageIdentifier: string;
|
||||
private thenTemplate: TemplateRef<any>;
|
||||
private elseTemplate: TemplateRef<any>;
|
||||
private packSub: Subscription;
|
||||
|
||||
constructor(private templateRef$: TemplateRef<any>,private viewContainerRef$: ViewContainerRef,private store$: Store<appCommonReducer.State>) {
|
||||
this.thenTemplate$=templateRef$;
|
||||
this.packSub = this.store$.select(appCommonReducer.SelectGetUserPackages).subscribe((packages) => {
|
||||
this.packages$ = packages;
|
||||
this.updateView();
|
||||
constructor(private hostTemplateRef: TemplateRef<any>, private viewContainerRef: ViewContainerRef,
|
||||
private store: Store<appCommonReducer.State>, private packageService: PackageService) {
|
||||
this.thenTemplate = hostTemplateRef;
|
||||
this.packSub = this.store.select(appCommonReducer.SelectGetValidUserPackages).subscribe((_) => {
|
||||
this.updateView();
|
||||
});
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.updateView();
|
||||
}
|
||||
|
||||
updateView() {
|
||||
this.viewContainerRef$.clear();
|
||||
const today = new Date(new Date(Date.now()).toUTCString()).setHours(0, 0, 0, 0);
|
||||
if (this.packages$[this.packageIdentifier$] &&
|
||||
(this.packages$[this.packageIdentifier$].dataDate && new Date(this.packages$[this.packageIdentifier$].dataDate).setHours(0, 0, 0, 0) <= today) &&
|
||||
(this.packages$[this.packageIdentifier$].dataEndDate == null || new Date(this.packages$[this.packageIdentifier$].dataEndDate).setHours(0, 0, 0, 0) >= today)) {
|
||||
this.viewContainerRef$.createEmbeddedView(this.thenTemplate$);
|
||||
} else if (this.elseTemplate$) {
|
||||
this.viewContainerRef$.createEmbeddedView(this.elseTemplate$);
|
||||
}
|
||||
this.viewContainerRef.clear();
|
||||
if (this.packageService.hasPackage(this.packageIdentifier)) {
|
||||
this.viewContainerRef.createEmbeddedView(this.thenTemplate);
|
||||
} else if (this.elseTemplate) {
|
||||
this.viewContainerRef.createEmbeddedView(this.elseTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if(this.packSub) this.packSub.unsubscribe();
|
||||
if (this.packSub) {
|
||||
this.packSub.unsubscribe();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<div>
|
||||
<div class="mobile-hide">
|
||||
<div (click)="toggle($event)" class="rounded-circle menu-button hidden" [ngClass]="{'hidden':!user || noContent}">
|
||||
<span i18n-title title="Help"><i class="fas fa-question" aria-hidden="true"></i></span>
|
||||
<div class="menu hidden" [ngClass]="{'hidden':!showMenu}">
|
||||
|
@@ -68,6 +68,16 @@ div.menu-button > span {
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-hide {
|
||||
display: inherit;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.mobile-hide {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.unread {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HelpMenuComponent } from './help-menu.component';
|
||||
|
||||
describe('HelpMenuComponent', () => {
|
||||
let component: HelpMenuComponent;
|
||||
let fixture: ComponentFixture<HelpMenuComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ HelpMenuComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HelpMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NotificationMenuComponent } from './notification-menu.component';
|
||||
|
||||
describe('NotificationMenuComponent', () => {
|
||||
let component: NotificationMenuComponent;
|
||||
let fixture: ComponentFixture<NotificationMenuComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ NotificationMenuComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(NotificationMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,9 +1,9 @@
|
||||
<div #thumbnail class="thumbnail" [style.background-color]="itemTypeService.getColor(item.itemType)" >
|
||||
<div class="content">
|
||||
<img *ngIf="item.thumbnail" class="card-img-top" [src]="getThumbnailUrl(item)" />
|
||||
<div *ngIf="!item.thumbnail" class="large-icon" [style.font-size]="getFontSize()" [style.line-height]="getLineHeight()"><i [ngClass]="itemTypeService.getIcon(item.itemType)"></i></div>
|
||||
<img *ngIf="hasThumbnail()" class="card-img-top" [src]="getThumbnailUrl(item)" />
|
||||
<div *ngIf="!hasThumbnail()" class="large-icon" [style.font-size]="getFontSize()" [style.line-height]="getLineHeight()"><i [ngClass]="itemTypeService.getIcon(item.itemType)"></i></div>
|
||||
<div *ngIf="canEdit()" class="edit btn btn-secondary rounded-circle" (click)="onEditClick()"><i class="fal fa-camera"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fm-edit-image-modal #modal (changed)="onChanged()"></fm-edit-image-modal>
|
||||
<fm-edit-image-modal #modal (changed)="onChanged($event)"></fm-edit-image-modal>
|
||||
|
@@ -1,7 +1,8 @@
|
||||
import { Component,Input ,ViewChild,ElementRef,ChangeDetectorRef} from '@angular/core';
|
||||
import { Component,Input ,ViewChild,ElementRef,ChangeDetectorRef, Output,EventEmitter} from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { IListItem } from '../../models/list.item';
|
||||
import { ImageService } from '../../services/image.service';
|
||||
import { commonReducers,ItemTypeService } from '../../../public-api'
|
||||
import { EditImageModalComponent} from '../edit-image-modal/edit-image-modal.component';
|
||||
import { AppConfig } from "../../shared/app.config";
|
||||
@@ -16,14 +17,25 @@ import { AppConfig } from "../../shared/app.config";
|
||||
export class ThumbnailComponent {
|
||||
@Input() public item: IListItem;
|
||||
@Input() public edit: boolean = false;
|
||||
@Input() public save: boolean = true;
|
||||
@Output() changed = new EventEmitter();
|
||||
@ViewChild('thumbnail') el:ElementRef;
|
||||
@ViewChild('modal') modal:EditImageModalComponent;
|
||||
|
||||
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService,public appConfig: AppConfig,private changeDetector:ChangeDetectorRef) {
|
||||
public image = null;
|
||||
private endpoint = "";
|
||||
public thumnailUrl = "";
|
||||
|
||||
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService,public appConfig: AppConfig,private changeDetector:ChangeDetectorRef,public imageService:ImageService) {
|
||||
}
|
||||
|
||||
getThumbnailUrl(item:IListItem):string {
|
||||
return this.appConfig.getConfig("apiEndPoint")+item.url+'/thumbnail?v=' + Date.parse(item.updated);
|
||||
if(this.image == null && this.item.thumbnail) {
|
||||
this.thumnailUrl = this.appConfig.getConfig("apiEndPoint")+item.url+'/thumbnail?v=' + Date.parse(item.updated);
|
||||
} else if (this.image == null) {
|
||||
this.thumnailUrl = "";
|
||||
}
|
||||
return this.thumnailUrl;
|
||||
}
|
||||
|
||||
getFontSize():string {
|
||||
@@ -47,15 +59,28 @@ import { AppConfig } from "../../shared/app.config";
|
||||
return this.edit && this.item != null;
|
||||
}
|
||||
|
||||
onEditClick() {
|
||||
var endpoint = `${this.appConfig.getConfig("apiEndPoint")}/api/v1/items/${this.item.code}/thumbnail`;
|
||||
this.modal.open(endpoint,4/3);
|
||||
hasThumbnail():boolean {
|
||||
return (this.item && this.item.thumbnail) || this.image != null;
|
||||
}
|
||||
|
||||
onChanged() {
|
||||
if(this.item) {
|
||||
this.item.updated = new Date(new Date().getTime()).toISOString();
|
||||
this.changeDetector.detectChanges();
|
||||
}
|
||||
onEditClick() {
|
||||
this.endpoint = `${this.appConfig.getConfig("apiEndPoint")}/api/v1/items/${this.item.code}/thumbnail`;
|
||||
this.modal.open(this.endpoint,4/3,false,200,false);
|
||||
}
|
||||
|
||||
onChanged(event:any) {
|
||||
this.image = event.croppedImage;
|
||||
this.imageService.blobToDataUrl(event.croppedImage).then(url => {
|
||||
this.thumnailUrl = url
|
||||
this.changeDetector.detectChanges();
|
||||
if(this.save) this.saveImage();
|
||||
this.changed.emit(event.croppedImage);
|
||||
});
|
||||
}
|
||||
|
||||
saveImage() {
|
||||
if(this.image) {
|
||||
this.imageService.putImage(this.endpoint,this.image).subscribe(() => {});
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UserMenuComponent } from './user-menu.component';
|
||||
|
||||
describe('UserMenuComponent', () => {
|
||||
let component: UserMenuComponent;
|
||||
let fixture: ComponentFixture<UserMenuComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UserMenuComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(UserMenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -7,5 +7,5 @@ export interface IPackage {
|
||||
}
|
||||
|
||||
export interface IPackages {
|
||||
[id: string]: IPackage;
|
||||
}
|
||||
[id: string]: IPackage[];
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ import { createSelector, createFeatureSelector, ActionReducerMap } from '@ngrx/s
|
||||
|
||||
import { MODULE_NAME } from '../module-name';
|
||||
import { IItem } from '../models/item';
|
||||
import {getValidPackages, isValidPackage} from '../services/package.service';
|
||||
|
||||
export interface State {
|
||||
openedModalName: string,
|
||||
@@ -66,7 +67,7 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
|
||||
name:a.userinfo["name"],
|
||||
claims:claims,
|
||||
searchable: false
|
||||
};
|
||||
};
|
||||
return tassign(state, { user: user });
|
||||
}
|
||||
case appCommonActions.INITROOTSUCCESS: {
|
||||
@@ -75,10 +76,10 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
|
||||
}
|
||||
case appCommonActions.OPENMODAL: {
|
||||
return tassign(state, { openedModalName: action.modalName });
|
||||
}
|
||||
}
|
||||
case appCommonActions.CLOSEMODAL: {
|
||||
return tassign(state, { openedModalName: null });
|
||||
}
|
||||
}
|
||||
case appCommonActions.LOADITEMTYPESSUCCESS: {
|
||||
let a = action as appCommonActions.LoadItemTypesSuccess;
|
||||
return tassign(state, { itemTypes: a.itemTypes });
|
||||
@@ -131,7 +132,10 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
|
||||
a.items.forEach((item) => {
|
||||
item.data.dataDate = item.dataDate;
|
||||
item.data.dataEndDate = item.dataEndDate;
|
||||
packages[item.data.id]=item.data;
|
||||
if (!packages[item.data.id]) {
|
||||
packages[item.data.id] = [];
|
||||
}
|
||||
packages[item.data.id].push(item.data);
|
||||
});
|
||||
|
||||
return tassign(state,{userPackages:packages});
|
||||
@@ -203,6 +207,9 @@ export const selectGetRouteLoading = createSelector(selectAppCommonState, getRou
|
||||
export const SelectGetMenuVisible = createSelector(selectAppCommonState,getMenuVisible);
|
||||
export const SelectGetUser = createSelector(selectAppCommonState,getUser);
|
||||
export const SelectGetUserPackages = createSelector(selectAppCommonState,getUserPackages);
|
||||
export const SelectGetValidUserPackages = createSelector(SelectGetUserPackages, (packageMap) => {
|
||||
return getValidPackages(packageMap);
|
||||
});
|
||||
export const SelectGetUserSettingsRoot = createSelector(selectAppCommonState,getUserSettingsRoot);
|
||||
export const SelectGetAccountMenuVisible = createSelector(selectAppCommonState,getAccountMenuVisible);
|
||||
export const SelectGetAppMenuVisible = createSelector(selectAppCommonState,getAppMenuVisible);
|
||||
@@ -213,3 +220,4 @@ export const SelectgetUnreadNotifications = createSelector(selectAppCommonState,
|
||||
export const SelectGetIsOnline = createSelector(selectAppCommonState,getIsOnline);
|
||||
export const SelectGetIsPageMode = createSelector(selectAppCommonState,getIsPageMode);
|
||||
|
||||
|
||||
|
21
projects/common/src/fm/services/geolocator.service.ts
Normal file
21
projects/common/src/fm/services/geolocator.service.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { IUser } from '../models/user';
|
||||
import { HttpClient,HttpHeaders } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class GeolocatorService {
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
}
|
||||
|
||||
ApiEndpoint() {
|
||||
return this.appConfig.getConfig("apiEndPoint");
|
||||
}
|
||||
|
||||
geocode(address:string): Observable<any> {
|
||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/service/geocode?address=${address}`)
|
||||
}
|
||||
}
|
@@ -48,4 +48,18 @@ export class ImageService {
|
||||
blobToFile(blob:Blob, filename:string):File {
|
||||
return new File([blob],filename,{type:blob.type});
|
||||
}
|
||||
|
||||
blobToDataUrl(blob:File):Promise<string> {
|
||||
|
||||
return new Promise<string>((resolve) => {
|
||||
let reader = new FileReader();
|
||||
reader.addEventListener('error', () => {
|
||||
resolve("");
|
||||
});
|
||||
reader.addEventListener("load", function () {
|
||||
resolve(reader.result as string);
|
||||
}, false);
|
||||
reader.readAsDataURL(blob);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
122
projects/common/src/fm/services/package.service.spec.ts
Normal file
122
projects/common/src/fm/services/package.service.spec.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
import {getValidPackages, isValidPackage, PackageService} from './package.service';
|
||||
import {MockStore, provideMockStore} from '@ngrx/store/testing';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import * as appCommonReducer from '../reducers/app-common.reducer';
|
||||
import {reducer, State} from '../reducers/app-common.reducer';
|
||||
import * as appCommonActions from '../actions/app-common.actions';
|
||||
import {IItem} from '../models/item';
|
||||
import {IPackage} from '../models/package';
|
||||
|
||||
describe('PackageService', () => {
|
||||
const initialState = {userPackages: {}} as State;
|
||||
let serviceUnderTest: PackageService;
|
||||
let items;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
provideMockStore({
|
||||
initialState,
|
||||
selectors: [
|
||||
{
|
||||
selector: appCommonReducer.SelectGetValidUserPackages,
|
||||
value: {
|
||||
'vnd.farmmaps.package.zoning': {
|
||||
id: 'vnd.farmmaps.package.zoning',
|
||||
name: 'zoning package',
|
||||
dataDate: '2022-01-25T00:00:00.000000Z'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}),
|
||||
]
|
||||
});
|
||||
|
||||
const store = TestBed.inject(MockStore);
|
||||
serviceUnderTest = new PackageService(store, null, null);
|
||||
|
||||
items = [
|
||||
{
|
||||
code: '123132',
|
||||
dataDate: '2021-01-25T00:00:00Z',
|
||||
dataEndDate: '2021-05-25T00:00:00Z',
|
||||
data: {
|
||||
id: 'vnd.farmmaps.package.zoning'
|
||||
}
|
||||
} as IItem,
|
||||
{
|
||||
code: '1231325',
|
||||
dataDate: '2021-01-25T00:00:00Z',
|
||||
dataEndDate: null,
|
||||
data: {
|
||||
id: 'vnd.farmmaps.package.zoning'
|
||||
}
|
||||
} as IItem,
|
||||
{
|
||||
code: '1231325',
|
||||
dataDate: '2022-01-25T00:00:00Z',
|
||||
dataEndDate: '2022-05-25T00:00:00Z',
|
||||
data: {
|
||||
id: 'vnd.farmmaps.package.tipstar'
|
||||
}
|
||||
} as IItem,
|
||||
{
|
||||
code: '1231325',
|
||||
dataDate: '2022-01-25T00:00:00Z',
|
||||
dataEndDate: null,
|
||||
data: {
|
||||
id: 'vnd.farmmaps.package.weather'
|
||||
}
|
||||
} as IItem
|
||||
];
|
||||
});
|
||||
|
||||
it('Does not have a tipstar package', () => {
|
||||
const hasPackage = serviceUnderTest.hasPackage('vnd.farmmaps.package.tipstar');
|
||||
expect(hasPackage).toBe(false);
|
||||
});
|
||||
|
||||
it('Does have a zoning package', () => {
|
||||
const hasPackage = serviceUnderTest.hasPackage('vnd.farmmaps.package.zoning');
|
||||
expect(hasPackage).toBe(true);
|
||||
});
|
||||
|
||||
it('reducer.INITUSERPACKAGESSUCCESS alter state correctly', () => {
|
||||
const action = new appCommonActions.InitUserPackagesSuccess(items);
|
||||
|
||||
expect(Object.keys(initialState.userPackages).length).toBe(0);
|
||||
const state = reducer(initialState, action);
|
||||
expect(Object.keys(state.userPackages).length).toBe(3);
|
||||
expect(state.userPackages['vnd.farmmaps.package.zoning'].length).toBe(2);
|
||||
expect(state.userPackages['vnd.farmmaps.package.tipstar'].length).toBe(1);
|
||||
expect(state.userPackages['vnd.farmmaps.package.weather'].length).toBe(1);
|
||||
});
|
||||
|
||||
it('to validatePackage', () => {
|
||||
const action = new appCommonActions.InitUserPackagesSuccess(items);
|
||||
const state = reducer(initialState, action);
|
||||
|
||||
expect(isValidPackage(null)).toBe(false);
|
||||
expect(isValidPackage(state.userPackages['vnd.farmmaps.package.tipstar'][0])).toBe(true);
|
||||
expect(isValidPackage(state.userPackages['vnd.farmmaps.package.zoning'][0])).toBe(false);
|
||||
expect(isValidPackage(state.userPackages['vnd.farmmaps.package.zoning'][1])).toBe(true);
|
||||
expect(isValidPackage(state.userPackages['vnd.farmmaps.package.weather'][0])).toBe(true);
|
||||
});
|
||||
|
||||
it('to getValidPackages', () => {
|
||||
const action = new appCommonActions.InitUserPackagesSuccess(items);
|
||||
const state = reducer(initialState, action);
|
||||
|
||||
const validPackages = getValidPackages(state.userPackages);
|
||||
|
||||
expect(Object.keys(validPackages).length).toBe(3);
|
||||
|
||||
// today is 27-01-2022, so the below package is not valid
|
||||
expect(validPackages['vnd.farmmaps.package.zoning']).not.toEqual({
|
||||
id: 'vnd.farmmaps.package.zoning',
|
||||
dataDate: '2021-01-25T00:00:00Z',
|
||||
dataEndDate: '2021-05-25T00:00:00Z'
|
||||
} as unknown as IPackage);
|
||||
});
|
||||
});
|
@@ -1,37 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store} from '@ngrx/store';
|
||||
import * as appCommonReducer from '../reducers/app-common.reducer'
|
||||
import { IPackages } from '../models/package';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Store} from '@ngrx/store';
|
||||
import * as appCommonReducer from '../reducers/app-common.reducer';
|
||||
import {IPackage, IPackages} from '../models/package';
|
||||
|
||||
import { IItem } from '../models/item';
|
||||
import { IItemTask } from '../models/itemTask';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { AppConfig } from "../shared/app.config";
|
||||
import { Observable } from 'rxjs';
|
||||
import {IItem} from '../models/item';
|
||||
import {IItemTask} from '../models/itemTask';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {AppConfig} from '../shared/app.config';
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
|
||||
export class PackageService {
|
||||
private packages$:IPackages = {};
|
||||
private packages: { [key: string]: IPackage } = {};
|
||||
|
||||
constructor(private store$: Store<appCommonReducer.State>, public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
store$.select(appCommonReducer.SelectGetUserPackages).subscribe((packages) => {
|
||||
this.packages$ = packages;
|
||||
})
|
||||
}
|
||||
constructor(private store$: Store<appCommonReducer.State>, public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
store$.select(appCommonReducer.SelectGetValidUserPackages).subscribe((packages) => {
|
||||
this.packages = packages;
|
||||
});
|
||||
}
|
||||
|
||||
ApiEndpoint() {
|
||||
return this.appConfig.getConfig("apiEndPoint");
|
||||
}
|
||||
|
||||
hasPackage(id:string):boolean {
|
||||
if(!this.packages$[id]) return false;
|
||||
return this.packages$[id].enabled == true;
|
||||
}
|
||||
ApiEndpoint() {
|
||||
return this.appConfig.getConfig('apiEndPoint');
|
||||
}
|
||||
|
||||
postItemPackageTask(item: IItem, task: IItemTask): Observable<IItemTask> {
|
||||
return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/packagetasks`, task);
|
||||
}
|
||||
}
|
||||
hasPackage(id: string): boolean {
|
||||
return id in this.packages;
|
||||
}
|
||||
|
||||
postItemPackageTask(item: IItem, task: IItemTask): Observable<IItemTask> {
|
||||
return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/packagetasks`, task);
|
||||
}
|
||||
}
|
||||
|
||||
export function getValidPackages(packageMap: IPackages): {[key: string]: IPackage} {
|
||||
const keys = Object.keys(packageMap);
|
||||
return keys.filter(k => {
|
||||
const packages = packageMap[k]
|
||||
.filter((p) => isValidPackage(p));
|
||||
|
||||
return packages.length > 0;
|
||||
}).reduce((map, key) => {
|
||||
const packages = packageMap[key];
|
||||
const newMap = {...map};
|
||||
newMap[key] = packages.find(p => isValidPackage(p));
|
||||
return newMap;
|
||||
}, {});
|
||||
}
|
||||
|
||||
export function isValidPackage(pack: IPackage): boolean {
|
||||
const now = new Date(Date.now());
|
||||
const utcToday = Date.UTC(now.getUTCFullYear(),now.getUTCMonth(),now.getUTCDate());
|
||||
return pack !== null && new Date(pack.dataDate).getTime() <= utcToday
|
||||
&& (!pack.dataEndDate || new Date(pack.dataEndDate).getTime() >= utcToday);
|
||||
}
|
||||
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TestComponent } from './landingpage.component';
|
||||
|
||||
describe('TestComponent', () => {
|
||||
let component: TestComponent;
|
||||
let fixture: ComponentFixture<TestComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ TestComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,25 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MenuComponent } from './menu.component';
|
||||
|
||||
describe('MenuComponent', () => {
|
||||
let component: MenuComponent;
|
||||
let fixture: ComponentFixture<MenuComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MenuComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MenuComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,25 +0,0 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TestComponent } from './test.component';
|
||||
|
||||
describe('TestComponent', () => {
|
||||
let component: TestComponent;
|
||||
let fixture: ComponentFixture<TestComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ TestComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"issuer": "https://accounts.test.farmmaps.eu",
|
||||
"issuer": "http://localhost:8094",
|
||||
"clientId": "farmmapsdev",
|
||||
"audience": "http://localhost:8082",
|
||||
"requireHttps": true,
|
||||
"audience": "http://localhost:8082/",
|
||||
"requireHttps": false,
|
||||
"apiEndPoint": "http://localhost:8082",
|
||||
"grantType":"code"
|
||||
}
|
||||
|
Reference in New Issue
Block a user