Aw4751 eslint fixes
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
2023-03-06 14:04:14 +01:00
parent 945c641503
commit 6555e68145
78 changed files with 655 additions and 655 deletions

View File

@@ -31,28 +31,28 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen
areaInHa(item:IItem):number {
if(!item) return 0;
// get area from faeture if 0 calculate from polygon
let a = item.data.area;
const a = item.data.area;
if(a) return a;
let format = new GeoJSON();
let polygon = format.readGeometry(item.geometry);
const format = new GeoJSON();
const polygon = format.readGeometry(item.geometry);
return getArea(polygon,{projection:"EPSG:4326"}) / 10000;
}
ngOnInit() {
var childItems = this.folderService$.getItems(this.item.code, 0, 1000);
var atLocationItems = this.itemService$.getItemList(null,null,null,this.item.code,true);
const childItems = this.folderService$.getItems(this.item.code, 0, 1000);
const atLocationItems = this.itemService$.getItemList(null,null,null,this.item.code,true);
this.items = childItems.pipe(
combineLatest(atLocationItems),
switchMap(([ci,ali]) => {
let retVal:IListItem[] = [];
let codes = {};
const retVal:IListItem[] = [];
const codes = {};
ci.forEach((listItem) => {
retVal.push(listItem);
codes[listItem.code]=listItem;
});
ali.forEach((atlocationitem) => {
let listItem = atlocationitem as IListItem;
let allowedItemTypes = "vnd.farmmaps.itemtype.device.senml"; // this is a hack
const listItem = atlocationitem as IListItem;
const allowedItemTypes = "vnd.farmmaps.itemtype.device.senml"; // this is a hack
if(!codes[listItem.code] && allowedItemTypes.indexOf(listItem.itemType) >= 0) {
retVal.push(listItem);
}