1
0

78991: Specify filter operator for (date) ranges

This commit is contained in:
Yura Bondarenko
2021-04-26 09:55:28 +02:00
parent 8433f49ed9
commit eb9a7a15d6
3 changed files with 9 additions and 3 deletions

View File

@@ -27,7 +27,10 @@ describe('MyDSpaceConfigurationService', () => {
scope: ''
});
const backendFilters = [new SearchFilter('f.namedresourcetype', ['another value']), new SearchFilter('f.dateSubmitted', ['[2013 TO 2018]'])];
const backendFilters = [
new SearchFilter('f.namedresourcetype', ['another value']),
new SearchFilter('f.dateSubmitted', ['[2013 TO 2018]'], 'equals')
];
const spy = jasmine.createSpyObj('RouteService', {
getQueryParameterValue: observableOf(value1),

View File

@@ -23,7 +23,10 @@ describe('SearchConfigurationService', () => {
scope: ''
});
const backendFilters = [new SearchFilter('f.author', ['another value']), new SearchFilter('f.date', ['[2013 TO 2018]'])];
const backendFilters = [
new SearchFilter('f.author', ['another value']),
new SearchFilter('f.date', ['[2013 TO 2018]'], 'equals')
];
const routeService = jasmine.createSpyObj('RouteService', {
getQueryParameterValue: observableOf(value1),

View File

@@ -168,7 +168,7 @@ export class SearchConfigurationService implements OnDestroy {
if (hasNoValue(filters.find((f) => f.key === realKey))) {
const min = filterParams[realKey + '.min'] ? filterParams[realKey + '.min'][0] : '*';
const max = filterParams[realKey + '.max'] ? filterParams[realKey + '.max'][0] : '*';
filters.push(new SearchFilter(realKey, ['[' + min + ' TO ' + max + ']']));
filters.push(new SearchFilter(realKey, ['[' + min + ' TO ' + max + ']'], 'equals'));
}
} else {
filters.push(new SearchFilter(key, filterParams[key]));