AW-784 Reapply from Farmmaps commits
- a4bb051a: AW-738 fixed bug
This commit is contained in:
parent
e1ff44ed3c
commit
2059b48abb
@ -20,19 +20,21 @@ export class SelectedItemContainerComponent {
|
|||||||
|
|
||||||
loadComponent() {
|
loadComponent() {
|
||||||
let componentFactory: ComponentFactory<AbstractSelectedItemComponent> = this.componentFactoryResolver.resolveComponentFactory(SelectedItemComponent); // default
|
let componentFactory: ComponentFactory<AbstractSelectedItemComponent> = this.componentFactoryResolver.resolveComponentFactory(SelectedItemComponent); // default
|
||||||
for (let i = 0; i < this.selectedItemComponents.length; i++) {
|
let firstComponentWithTypeAndTask = this.selectedItemComponents
|
||||||
let hasSourceTask = this.selectedItemComponents[i]['forSourceTask'] != null &&
|
.find(value => value['forSourceTask'] == this.item.sourceTask &&
|
||||||
this.selectedItemComponents[i]['forSourceTask'] != undefined;
|
value['forItemType'] == this.item.itemType
|
||||||
|
);
|
||||||
|
|
||||||
if (this.selectedItemComponents[i]['forItemType'] == this.item.itemType &&
|
if (firstComponentWithTypeAndTask) {
|
||||||
hasSourceTask && this.selectedItemComponents[i]['forSourceTask'] == this.item.sourceTask) {
|
componentFactory = this.componentFactoryResolver.resolveComponentFactory(firstComponentWithTypeAndTask['constructor'] as any);
|
||||||
|
} else {
|
||||||
|
let firstComponentWithType = this.selectedItemComponents
|
||||||
|
.find(value => value['forItemType'] == this.item.itemType);
|
||||||
|
|
||||||
componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.selectedItemComponents[i]['constructor'] as any);
|
if (firstComponentWithType) {
|
||||||
break;
|
componentFactory = this.componentFactoryResolver.resolveComponentFactory(firstComponentWithType['constructor'] as any);
|
||||||
} else if (this.selectedItemComponents[i]['forItemType'] == this.item.itemType) {
|
|
||||||
componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.selectedItemComponents[i]['constructor'] as any);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const viewContainerRef = this.widgetHost.viewContainerRef;
|
const viewContainerRef = this.widgetHost.viewContainerRef;
|
||||||
viewContainerRef.clear();
|
viewContainerRef.clear();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user