[Trunk | Library]:
1. newSearchPage.component.html: Do not show "Filters" label when no results and no selected filters | [Bug fix] Check "filter.values" not "filter.values.lenght" - change detection error. 2. searchFilter.component.ts: [Bug fix] Set filter.radioValue also in ngOnChanges - filter value did not seem selected even if it was. 3. searchPageTableView.component.html: Show "Filters" label when there are filters (not only selected filters). git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59136 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
fd27e88386
commit
2163105f9a
|
@ -78,15 +78,19 @@
|
|||
</div>
|
||||
</ng-template>
|
||||
<ng-template #filters_column>
|
||||
<div class="uk-width-1-1 uk-margin-top uk-margin-medium-bottom ">
|
||||
<div class="uk-width-1-1 uk-margin-top">
|
||||
<div class="uk-grid uk-flex uk-flex-bottom">
|
||||
<h5 class="uk-text-bold">Filters</h5>
|
||||
<h5 *ngIf="(selectedRangeFilters+selectedFilters + selectedTypesNum > 0) || (filters.length > 0 && (results.length > 0 || disableForms))"
|
||||
class="uk-text-bold">
|
||||
Filters
|
||||
</h5>
|
||||
<a *ngIf="(selectedRangeFilters+selectedFilters + selectedTypesNum)>1" (click)="clearFilters()"
|
||||
[class]="((disableForms)?'uk-disabled uk-link-muted':'')+' portal-link ' + 'uk-width-1-2'">
|
||||
Clear All
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="selectedRangeFilters+selectedFilters + selectedTypesNum > 0" class="uk-margin-small-top">
|
||||
<div *ngIf="selectedRangeFilters+selectedFilters + selectedTypesNum > 0"
|
||||
class="uk-margin-small-top uk-margin-medium-bottom">
|
||||
<ng-container *ngTemplateOutlet="selected_filters_pills; context: {}"></ng-container>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -117,7 +121,7 @@
|
|||
</li>
|
||||
</ng-container>
|
||||
<ng-container *ngFor="let filter of filters ">
|
||||
<li *ngIf="filter.values.length >0 && filter.filterId != 'resultbestaccessright'">
|
||||
<li *ngIf="filter.values && filter.filterId != 'resultbestaccessright'">
|
||||
<search-filter [filterValuesNum]="filterValuesNum" [showMoreInline]="showMoreFilterValuesInline"
|
||||
[isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount
|
||||
(onFilterChange)="filterChanged($event)"></search-filter>
|
||||
|
|
|
@ -42,6 +42,7 @@ export class SearchFilterComponent implements OnInit, OnChanges{
|
|||
ngOnInit() {
|
||||
this.filter.values = this.filter.values.filter(value => !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available'));
|
||||
if(this.filter.filterType == "radio"){
|
||||
this.filter.radioValue = "";
|
||||
this.filter.values.forEach(value => {
|
||||
if(value.selected){
|
||||
this.filter.radioValue = value.id
|
||||
|
@ -53,6 +54,14 @@ export class SearchFilterComponent implements OnInit, OnChanges{
|
|||
ngOnChanges(changes: SimpleChanges) {
|
||||
if(changes.filter) {
|
||||
this.filter.values = this.filter.values.filter(value => !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available'));
|
||||
if(this.filter.filterType == "radio"){
|
||||
this.filter.radioValue = "";
|
||||
this.filter.values.forEach(value => {
|
||||
if(value.selected){
|
||||
this.filter.radioValue = value.id
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<ng-template #filters_column>
|
||||
<div *ngIf="filters.length > 0" class=" search-filters ">
|
||||
<div *ngIf="countFilters()>0" class=" uk-margin-medium-bottom">
|
||||
<div *ngIf="filters.length > 0">
|
||||
<div class="uk-grid uk-flex uk-flex-bottom">
|
||||
<h5 class="uk-text-bold">Filters</h5>
|
||||
<a *ngIf="countFilters()>1" (click)="clearFilters()"
|
||||
|
@ -8,7 +8,7 @@
|
|||
Clear All
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-grid uk-grid-small uk-text-small" uk-grid>
|
||||
<div *ngIf="countFilters()>0" class="uk-grid uk-grid-small uk-text-small uk-margin-medium-bottom" uk-grid>
|
||||
<ng-container *ngFor="let filter of filters " >
|
||||
<ng-container *ngIf = "filter.countSelectedValues > 0">
|
||||
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; "
|
||||
|
@ -30,7 +30,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
||||
<div class="uk-margin-top">
|
||||
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #paging>
|
||||
|
|
Loading…
Reference in New Issue