Fix template selection
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -29,14 +29,21 @@ export class SelectedItemContainerComponent {
|
||||
let showItem = true;
|
||||
for (let i = 0; i < this.selectedItemComponents.length; i++) {
|
||||
let matches=0;
|
||||
if (this.selectedItemComponents[i]['forItemType'] && this.selectedItemComponents[i]['forItemType'].indexOf(this.item.itemType) >= 0) {
|
||||
matches++;
|
||||
let criteria=0;
|
||||
if (this.selectedItemComponents[i]['forItemType'] ) {
|
||||
criteria++;
|
||||
if(this.selectedItemComponents[i]['forItemType'].indexOf(this.item.itemType) >= 0) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
if (this.selectedItemComponents[i]['forSourceTask'] && this.selectedItemComponents[i]['forSourceTask'].indexOf(this.item.sourceTask) >= 0) {
|
||||
matches++;
|
||||
if (this.selectedItemComponents[i]['forSourceTask']) {
|
||||
criteria++;
|
||||
if( this.selectedItemComponents[i]['forSourceTask'].indexOf(this.item.sourceTask) >= 0) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
|
||||
if(matches > maxMatches) {
|
||||
if(criteria==matches && matches > maxMatches) {
|
||||
selected=i;
|
||||
maxMatches = matches;
|
||||
}
|
||||
|
Reference in New Issue
Block a user