Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme

This commit is contained in:
Konstantinos Triantafyllou 2022-05-06 14:02:51 +03:00
commit e39491e61e
2 changed files with 5 additions and 4 deletions

View File

@ -20,7 +20,8 @@
<div class="uk-text-meta">Top 100 values are shown in the filters</div>
<div class="uk-flex uk-flex-bottom uk-margin-top">
<div input class="uk-width-1-2@m uk-margin-right" [placeholder]="{label: 'Search', static: true}" inputClass="inner small" [(value)]="keyword"></div>
<div *ngIf="showResultCount === true" input type="select" class="uk-width-expand" placeholder="Sort by" inputClass="border-bottom" [(value)]="sortBy" [options]="sortByOptions"></div>
<div *ngIf="showResultCount === true" input type="select" class="uk-width-expand" placeholder="Sort by"
inputClass="border-bottom" [(value)]="sortBy" [options]="sortByOptions" (valueChange)="sort()"></div>
</div>
</div>
<div class="uk-overflow-auto uk-height-max-small uk-margin-small-left uk-margin-small-right uk-margin-top">

View File

@ -63,7 +63,7 @@ export class SearchFilterComponent implements OnInit, OnChanges {
this.paramPosition = SearchFields.getParameterOrder(this.filter.filterId, this.getEntries(params));
});
this.filter.values = this.filter.values.filter(value => !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available'));
this.sort(this.filter.values);
this.sort();
if (this.filter.filterType == "radio") {
this.filter.radioValue = "";
this.filter.values.forEach(value => {
@ -229,8 +229,8 @@ export class SearchFilterComponent implements OnInit, OnChanges {
return notSselected;
}
sort(values: Value[]) {
let sorted: Value[] = values.slice();
sort() {
let sorted: Value[] = this.filter.values.slice();
if (this.sortBy == "name") {
sorted.sort((n1, n2) => {
if (this.filter.filterId === "sdg") {