Revert "AW-1426 Add extra check"
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit

This reverts commit a6fd052a4f.
This commit is contained in:
Peter Bastiani 2020-08-11 14:42:45 +02:00
parent d1d8723186
commit f4004cf2be

View File

@ -1,4 +1,4 @@
import { Component, Input, Injectable, OnInit, ComponentFactoryResolver, Inject, ComponentFactory } from '@angular/core'; import { Component, Input, Injectable, OnInit } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { Feature } from 'ol'; import { Feature } from 'ol';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
@ -11,7 +11,6 @@ import { Observable,of } from 'rxjs';
import {GeoJSON} from 'ol/format'; import {GeoJSON} from 'ol/format';
import {getArea} from 'ol/sphere'; import {getArea} from 'ol/sphere';
import { withLatestFrom,switchMap,combineLatest } from 'rxjs/operators'; import { withLatestFrom,switchMap,combineLatest } from 'rxjs/operators';
import { AbstractItemListItemComponent, ItemListItemComponent } from '../item-list-item/item-list-item.component';
@ForItemType("vnd.farmmaps.itemtype.cropfield") @ForItemType("vnd.farmmaps.itemtype.cropfield")
@ -25,8 +24,7 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen
public items: Observable<IListItem[]>; public items: Observable<IListItem[]>;
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService, constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
private componentFactoryResolver: ComponentFactoryResolver, @Inject(AbstractItemListItemComponent) public itemComponentList: AbstractItemListItemComponent[] ) {
super(store, itemTypeService,location,router); super(store, itemTypeService,location,router);
} }
@ -41,7 +39,6 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen
} }
ngOnInit() { ngOnInit() {
//var componentFactory: ComponentFactory<AbstractItemListItemComponent> = this.componentFactoryResolver.resolveComponentFactory(ItemListItemComponent); // default
var childItems = this.folderService$.getItems(this.item.code, 0, 1000); var childItems = this.folderService$.getItems(this.item.code, 0, 1000);
var atLocationItems = this.itemService$.getItemList(null,null,null,this.item.code,true); var atLocationItems = this.itemService$.getItemList(null,null,null,this.item.code,true);
this.items = childItems.pipe( this.items = childItems.pipe(
@ -50,12 +47,8 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen
let retVal:IListItem[] = []; let retVal:IListItem[] = [];
let codes = {}; let codes = {};
ci.forEach((listItem) => { ci.forEach((listItem) => {
if (this.itemComponentList.findIndex(i => retVal.push(listItem);
i.item['forItemType'].indexOf(this.item.itemType) >= 0 && codes[listItem.code]=listItem;
i.item['forSourceTask'].indexOf(this.item.sourceTask) >= 0) >= 0) {
retVal.push(listItem);
codes[listItem.code]=listItem;
}
}); });
ali.forEach((atlocationitem) => { ali.forEach((atlocationitem) => {
let listItem = atlocationitem as IListItem; let listItem = atlocationitem as IListItem;