mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
fixed an issue where the server-side would crash if the page contained nouislider
This commit is contained in:
@@ -16,8 +16,11 @@
|
||||
</div>
|
||||
<input type="submit" class="d-none"/>
|
||||
</form>
|
||||
|
||||
<ng-container *ngIf="shouldShowSlider()">
|
||||
<nouislider [connect]="true" [min]="min" [max]="max" [step]="1"
|
||||
[(ngModel)]="range" (mouseup)="onSubmit(form.value)" ngDefaultControl></nouislider>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngFor="let page of (filterValues$ | async)">
|
||||
<ng-container *ngFor="let value of (page | async)?.payload.page">
|
||||
@@ -32,4 +35,4 @@
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { isPlatformBrowser } from '@angular/common';
|
||||
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
|
||||
import { FilterType } from '../../../search-service/filter-type.model';
|
||||
import { renderFacetFor } from '../search-filter-type-decorator';
|
||||
import { SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component';
|
||||
@@ -36,6 +37,7 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple
|
||||
protected router: Router,
|
||||
@Inject(FILTER_CONFIG) public filterConfig: SearchFilterConfig,
|
||||
@Inject(SELECTED_VALUES) public selectedValues: string[],
|
||||
@Inject(PLATFORM_ID) private platformId: any,
|
||||
private route: ActivatedRoute) {
|
||||
super(searchService, filterService, router, filterConfig, selectedValues);
|
||||
}
|
||||
@@ -83,4 +85,11 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent imple
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO when upgrading nouislider, verify that this check is still needed.
|
||||
*/
|
||||
shouldShowSlider(): boolean {
|
||||
return isPlatformBrowser(this.platformId);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user