[angular-16-irish-monitor | DONE | CHANGED]: searchHelperClasses.class.ts: In Filter class renamed field "isOpen" to "isViewAllOpen" | searchResearchResults.component.ts * searchProjects.component.ts & searchOrganizations.component.ts & searchDataProviders.component.ts & searchFilter.component: Use renamed filter field (isViewAllOpen) | searchFilter.component.html: Capitalize value names of filters.
This commit is contained in:
parent
51dbad03d7
commit
1853b1cf57
|
@ -368,7 +368,7 @@ export class SearchDataProvidersComponent {
|
|||
}
|
||||
|
||||
let index: number = this.filters.findIndex((fltr: Filter) => fltr.filterId == filter.filterId);
|
||||
filter.isOpen = true;
|
||||
filter.isViewAllOpen = true;
|
||||
this.filters[index] = filter;
|
||||
this.cdr.detectChanges();
|
||||
},
|
||||
|
|
|
@ -347,7 +347,7 @@ export class SearchOrganizationsComponent {
|
|||
}
|
||||
|
||||
let index: number = this.filters.findIndex((fltr: Filter) => fltr.filterId == filter.filterId);
|
||||
filter.isOpen = true;
|
||||
filter.isViewAllOpen = true;
|
||||
this.filters[index] = filter;
|
||||
this.cdr.detectChanges();
|
||||
},
|
||||
|
|
|
@ -376,7 +376,7 @@ export class SearchProjectsComponent {
|
|||
}
|
||||
|
||||
let index: number = this.filters.findIndex((fltr: Filter) => fltr.filterId == filter.filterId);
|
||||
filter.isOpen = true;
|
||||
filter.isViewAllOpen = true;
|
||||
this.filters[index] = filter;
|
||||
this.cdr.detectChanges();
|
||||
},
|
||||
|
|
|
@ -535,7 +535,7 @@ export class SearchResearchResultsComponent {
|
|||
}
|
||||
|
||||
let index: number = this.filters.findIndex((fltr: Filter) => fltr.filterId == filter.filterId);
|
||||
filter.isOpen = true;
|
||||
filter.isViewAllOpen = true;
|
||||
filter.countSelectedValues = oldFilter.countSelectedValues;
|
||||
filter.radioValue = oldFilter.radioValue;
|
||||
this.filters[index] = filter;
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
</div>
|
||||
<div *ngIf="addShowMore && hasMoreValues">
|
||||
<a *ngIf="filterValuesNum > 0 " class="uk-text-small view-more-less-link uk-margin-small-top" [ngClass]="((isDisabled)?'uk-disabled uk-link-muted ':'')" (click)="toggle($event)">
|
||||
<span *ngIf="!filter.isOpen">View all</span>
|
||||
<span *ngIf="filter.isOpen">View less </span>
|
||||
<span *ngIf="!filter.isViewAllOpen">View all</span>
|
||||
<span *ngIf="filter.isViewAllOpen">View less </span>
|
||||
</a>
|
||||
<div *ngIf="filter.isOpen" class="uk-text-small uk-margin-small-top uk-margin-small-bottom">
|
||||
<div *ngIf="filter.isViewAllOpen" class="uk-text-small uk-margin-small-top uk-margin-small-bottom">
|
||||
<div *ngIf="filter.countAllValues == -1">
|
||||
<loading class="uk-height-small uk-display-block" size="medium"></loading>
|
||||
</div>
|
||||
|
@ -65,7 +65,7 @@
|
|||
{{value.name=='true'?'Yes':'No'}}
|
||||
</span>
|
||||
<ng-template #noboolean>
|
||||
{{_formatName(value)}}
|
||||
<span class="uk-text-capitalize">{{_formatName(value)}} </span>
|
||||
</ng-template>
|
||||
|
||||
<span *ngIf="showResultCount">({{value.number|number}})</span>
|
||||
|
|
|
@ -43,7 +43,7 @@ export class SearchFilterComponent implements OnInit, OnChanges {
|
|||
@Input() actionRoute: boolean = false;
|
||||
@Input() quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string };
|
||||
sub;
|
||||
@Input() isOpen: boolean = false;
|
||||
// @Input() isViewAllOpen: boolean = false;
|
||||
sortedValues;
|
||||
hasMatch: boolean = false;
|
||||
|
||||
|
@ -60,11 +60,11 @@ export class SearchFilterComponent implements OnInit, OnChanges {
|
|||
|
||||
ngOnInit() {
|
||||
if(this.filterValuesNum == 0){
|
||||
this.filter.isOpen = true;
|
||||
this.filter.isViewAllOpen = true;
|
||||
this.sortBy = "num";
|
||||
}
|
||||
// else{
|
||||
// this.filter.isOpen = false;
|
||||
// this.filter.isViewAllOpen = false;
|
||||
// }
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.queryParams = Object.assign({}, params);
|
||||
|
@ -272,7 +272,7 @@ export class SearchFilterComponent implements OnInit, OnChanges {
|
|||
}
|
||||
|
||||
toggle(event) {
|
||||
this.filter.isOpen = !this.filter.isOpen;
|
||||
this.filter.isViewAllOpen = !this.filter.isViewAllOpen;
|
||||
event.stopPropagation();
|
||||
this.toggleWithoutUpdate();
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ export class SearchFilterComponent implements OnInit, OnChanges {
|
|||
if(this.filter.countAllValues == 0) {
|
||||
this.filter.countAllValues = -1; // if request failed, try again automatically if toggled again
|
||||
}
|
||||
if(this.filter.isOpen && this.filter.countAllValues < 0) {
|
||||
if(this.filter.isViewAllOpen && this.filter.countAllValues < 0) {
|
||||
this.onFilterToggle.emit(this.filter);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@ export class Filter{
|
|||
public radioValue?: string = "";
|
||||
// public uniqueValueIdSelected: string;
|
||||
public countAllValues?: number = -1; // -1: not yet requested, 0: request failed, >0 OK
|
||||
public isOpen?: boolean = false;
|
||||
// public isOpen?: boolean = false;
|
||||
public isViewAllOpen?: boolean = false;
|
||||
}
|
||||
|
||||
export class Value{
|
||||
|
|
Loading…
Reference in New Issue