From 26e28bdda8aea15311bb9b5394338bad916f098a Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Fri, 18 Sep 2020 14:29:50 +0200 Subject: [PATCH] Revert changes --- .../selected-item-cropfield.component.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/projects/common-map/src/fm-map/components/selected-item-cropfield/selected-item-cropfield.component.ts b/projects/common-map/src/fm-map/components/selected-item-cropfield/selected-item-cropfield.component.ts index 79f17f4..c6da727 100644 --- a/projects/common-map/src/fm-map/components/selected-item-cropfield/selected-item-cropfield.component.ts +++ b/projects/common-map/src/fm-map/components/selected-item-cropfield/selected-item-cropfield.component.ts @@ -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 { Feature } from 'ol'; import { Store } from '@ngrx/store'; @@ -11,7 +11,6 @@ import { Observable,of } from 'rxjs'; import {GeoJSON} from 'ol/format'; import {getArea} from 'ol/sphere'; import { withLatestFrom,switchMap,combineLatest } from 'rxjs/operators'; -import { AbstractItemListItemComponent, ItemListItemComponent } from '../item-list-item/item-list-item.component'; @ForItemType("vnd.farmmaps.itemtype.cropfield") @@ -25,8 +24,7 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen public items: Observable; - constructor(store: Store, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService, - private componentFactoryResolver: ComponentFactoryResolver, @Inject(AbstractItemListItemComponent) public itemComponentList: AbstractItemListItemComponent[] ) { + constructor(store: Store, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) { super(store, itemTypeService,location,router); } @@ -41,7 +39,6 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen } ngOnInit() { - var componentFactory: ComponentFactory = this.componentFactoryResolver.resolveComponentFactory(ItemListItemComponent); // default var childItems = this.folderService$.getItems(this.item.code, 0, 1000); var atLocationItems = this.itemService$.getItemList(null,null,null,this.item.code,true); this.items = childItems.pipe( @@ -50,12 +47,8 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen let retVal:IListItem[] = []; let codes = {}; ci.forEach((listItem) => { - if (this.itemComponentList.findIndex(i => - i.item['forItemType'].indexOf(this.item.itemType) >= 0 && - i.item['forSourceTask'].indexOf(this.item.sourceTask) >= 0) >= 0) { - retVal.push(listItem); - codes[listItem.code]=listItem; - } + retVal.push(listItem); + codes[listItem.code]=listItem; }); ali.forEach((atlocationitem) => { let listItem = atlocationitem as IListItem;