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:
@@ -34,13 +34,20 @@ export class FeatureListContainerComponent {
|
||||
let showItem = true;
|
||||
for (let i = 0; i < this.featureLists.length; i++) {
|
||||
let matches=0;
|
||||
if (this.featureLists[i]['forItemType'] && this.featureLists[i]['forItemType'].indexOf(queryState.itemType) >= 0) {
|
||||
matches++;
|
||||
let criteria=0;
|
||||
if (this.featureLists[i]['forItemType']) {
|
||||
criteria++;
|
||||
if( this.featureLists[i]['forItemType'].indexOf(queryState.itemType) >= 0) {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
if(this.featureLists[i]['forChild'] && queryState.parentCode && queryState.parentCode != "") {
|
||||
matches++;
|
||||
if(this.featureLists[i]['forChild'] ) {
|
||||
criteria++;
|
||||
if(queryState.parentCode && queryState.parentCode != "") {
|
||||
matches++;
|
||||
}
|
||||
}
|
||||
if(matches > maxMatches) {
|
||||
if(criteria == matches && matches > maxMatches) {
|
||||
selected=i;
|
||||
maxMatches = matches;
|
||||
}
|
||||
|
Reference in New Issue
Block a user