mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
49440: date widget progress
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
<form #form="ngForm" (ngSubmit)="onSubmit(form.value)" class="add-filter row"
|
||||
[action]="getCurrentUrl()">
|
||||
<div class="col-6">
|
||||
<input type="text" [(ngModel)]="min" [name]="min"
|
||||
<input type="text" [ngModel]="min" [name]="filterConfig.paramName + '.min'"
|
||||
class="form-control"
|
||||
aria-label="Mininum value"
|
||||
[placeholder]="'search.filters.filter.' + filterConfig.name + '.min.placeholder'| translate"/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<input type="text" [(ngModel)]="max" [name]="max"
|
||||
<input type="text" [ngModel]="max" [name]="filterConfig.paramName + '.max'"
|
||||
class="form-control"
|
||||
aria-label="Maximum value"
|
||||
[placeholder]="'search.filters.filter.' + filterConfig.name + '.max.placeholder'| translate"/>
|
||||
@@ -18,14 +18,9 @@
|
||||
</form>
|
||||
<nouislider [connect]="true" [min]="rangeMin" [max]="rangeMax" [step]="1"
|
||||
[(ngModel)]="range"></nouislider>
|
||||
<!--<a *ngFor="let value of selectedValues" class="d-block clearfix"-->
|
||||
<!--[routerLink]="[getSearchLink()]"-->
|
||||
<!--[queryParams]="getAddParams(value.value)" queryParamsHandling="merge" >-->
|
||||
<!--<input type="checkbox" [checked]="true"/>-->
|
||||
<!--<span class="filter-value">{{value}}</span>-->
|
||||
<!--</a>-->
|
||||
|
||||
<ng-container *ngFor="let page of (filterValues$ | async)">
|
||||
<ng-container *ngFor="let value of (page | async)?.payload.page; let i=index">
|
||||
<ng-container *ngFor="let value of (page | async)?.payload.page">
|
||||
<a *ngIf="!selectedValues.includes(value.value)" class="d-block clearfix"
|
||||
[routerLink]="[getSearchLink()]"
|
||||
[queryParams]="getAddParams(value.value)" queryParamsHandling="merge">
|
||||
|
@@ -1,7 +1,8 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, OnInit } 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';
|
||||
import { isNotEmpty } from '../../../../shared/empty.util';
|
||||
|
||||
/**
|
||||
* This component renders a simple item page.
|
||||
@@ -16,13 +17,16 @@ import { SearchFacetFilterComponent } from '../search-facet-filter/search-facet-
|
||||
})
|
||||
|
||||
@renderFacetFor(FilterType.range)
|
||||
export class SearchRangeFilterComponent extends SearchFacetFilterComponent {
|
||||
export class SearchRangeFilterComponent extends SearchFacetFilterComponent implements OnInit {
|
||||
rangeDelimiter = '-';
|
||||
min = 1950;
|
||||
max = 1960;
|
||||
rangeMin = 1900; // calculate using available values
|
||||
rangeMax = 2000;
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
}
|
||||
get range() {
|
||||
return [this.min, this.max];
|
||||
}
|
||||
@@ -50,4 +54,17 @@ export class SearchRangeFilterComponent extends SearchFacetFilterComponent {
|
||||
page: 1
|
||||
};
|
||||
}
|
||||
|
||||
onSubmit(data: any) {
|
||||
if (isNotEmpty(data)) {
|
||||
this.router.navigate([this.getSearchLink()], {
|
||||
queryParams:
|
||||
{ [this.filterConfig.paramName + '.min']: [data[this.filterConfig.paramName + '.min']],
|
||||
[this.filterConfig.paramName + '.max']: [data[this.filterConfig.paramName + '.max']]},
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
this.filter = '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user