minor changes in autocomplete

This commit is contained in:
argirok 2022-06-09 17:30:51 +03:00
parent b451a2ea3a
commit 512d1401df
2 changed files with 8 additions and 6 deletions

View File

@ -32,15 +32,15 @@ import {StringUtils} from "../string-utils.class";
<div *ngIf="focus && showInput" class="uk-dropdown" aria-expanded="true" style="display:block" >
<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results" >
<li>
<span *ngIf="!_search.ready" class="uk-alert uk-alert-primary" data-uk-alert=""> <i class="uk-icon-spinner"></i> Loading..... </span>
<span *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning" data-uk-alert="">{{warningMessage}}</span>
<span *ngIf="!_search.ready" class="uk-padding-small"> Loading..... </span>
<span *ngIf="warningMessage.length > 0" class="uk-padding-small uk-text-warning">{{warningMessage}}</span>
<!--<span *ngIf="results > 0" > {{results | number}} results found:</span>-->
<!--span *ngIf="results == 0 && !showLoading" class="uk-alert uk-alert-primary" data-uk-alert=""> No results found</span-->
</li>
<li *ngFor=" let item of filtered | async">
<a *ngIf= "item.id !=-1 && item.id !=-2" (click)="select(item)" [title]="showItem(item)" style="text-overflow: ellipsis; ">{{showItem(item)}}</a>
<span *ngIf= "item.id ==-1" class="uk-alert uk-alert-primary" data-uk-alert=""> No results found</span>
<span *ngIf= "item.id ==-2" class="uk-alert uk-alert-warning" data-uk-alert=""> An error occured</span>
<span *ngIf= "item.id ==-1" class="uk-padding-small"> No results found</span>
<span *ngIf= "item.id ==-2" class="uk-padding-small uk-text-warning"> An error occured</span>
</li>
</ul>

View File

@ -27,9 +27,9 @@ import{EnvProperties} from '../../utils/properties/env-properties';
<div *ngIf="focus && showInput" class="uk-dropdown" aria-expanded="true" style="display:block" >
<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results" >
<li>
<span [style.display]="showLoading ? 'inline' : 'none'" class="uk-alert uk-alert-primary" data-uk-alert=""> <i class="uk-icon-spinner"></i> Loading... </span>
<span [style.display]="showLoading ? 'inline' : 'none'" class="uk-padding-small"> <i class="uk-icon-spinner"></i> Loading... </span>
<!--<span *ngIf="filtered.length > 0" > {{results | number}} results found:</span>-->
<span *ngIf="filtered.length == 0" class="uk-alert uk-alert-primary" data-uk-alert=""> No results found</span>
<span *ngIf="filtered.length == 0 && !showLoading" class=" uk-padding-small" > No results found</span>
</li>
<li *ngFor=" let item of filtered">
<a (click)="select(item)" [title]="showItem(item)" style="text-overflow: ellipsis; ">{{showItem(item)}}</a>
@ -106,6 +106,7 @@ export class StaticAutoCompleteComponent implements OnChanges{
} else {
this.handleError("Error getting vocabulary with id: "+this.vocabularyId+" for "+this.entityName);
this.warningMessage = "An Error occurred..."
this.showLoading = false;
}
}
);
@ -120,6 +121,7 @@ export class StaticAutoCompleteComponent implements OnChanges{
//console.log(err);
this.handleError("Error getting results for refine field: "+this.fieldName+" for "+this.entityName, err);
this.warningMessage = "An Error occured..."
this.showLoading = false;
}
);
}else{