Commit dc01e602 authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

Order results alphabeticaly for rendertron

parent 8bc4a519
import { geosource } from '../../../i18n/traductions';
import { scopesResearch } from '../../shared/variables';
import { scopesResearch, isRentertron } from '../../shared/variables';
import { Filter } from './filter.model';
import { ISortOption } from './sort-option.model';
......@@ -69,10 +69,13 @@ export class ElasticsearchOptions {
value: (data && data.searchString != null) ? 'relevance' : 'date',
order: 'desc',
};
if (data && data.sortOptions != null) {
this._sortOptions.value = data.sortOptions.value;
this._sortOptions.order = data.sortOptions.order;
if (isRentertron) {
this._sortOptions = {
value: 'alphabetical',
order: 'asc',
};
}
this._filters = (data && data.filters != null) ? data.filters : [
new Filter({
field: 'metadata-fr.category',
......@@ -156,6 +159,10 @@ export class ElasticsearchOptions {
this._sortOptions.value = data.sortOptions.value;
this._sortOptions.order = data.sortOptions.order;
}
if (data && data.sortOptions != null) {
this._sortOptions.value = data.sortOptions.value;
this._sortOptions.order = data.sortOptions.order;
}
}
// Known licences
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment