fix RED-2675: sort results in descending order
This commit is contained in:
parent
aeca9efa18
commit
f631d60d9d
@ -1,12 +1,14 @@
|
||||
import { ChangeDetectionStrategy, Component, forwardRef, Injector, OnDestroy } from '@angular/core';
|
||||
import {
|
||||
DefaultListingServices,
|
||||
IFilterGroup,
|
||||
keyChecker,
|
||||
List,
|
||||
ListingComponent,
|
||||
LoadingService,
|
||||
NestedFilter,
|
||||
SearchPositions,
|
||||
SortingOrders,
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { merge, Observable } from 'rxjs';
|
||||
@ -18,7 +20,7 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
import { RouterHistoryService } from '@services/router-history.service';
|
||||
import { DossiersService } from '@services/entity-services/dossiers.service';
|
||||
import { PlatformSearchService } from '../../shared/services/platform-search.service';
|
||||
import { IMatchedDocument, ISearchInput, ISearchListItem, ISearchResponse } from '@red/domain';
|
||||
import { Dossier, IMatchedDocument, ISearchInput, ISearchListItem, ISearchResponse } from '@red/domain';
|
||||
|
||||
function toSearchInput(query: string, dossierIds: List | string): ISearchInput {
|
||||
return {
|
||||
@ -68,25 +70,22 @@ export class SearchScreenComponent extends ListingComponent<ISearchListItem> imp
|
||||
) {
|
||||
super(_injector);
|
||||
this.searchService.skip = true;
|
||||
this.sortingService.setSortingOption({ column: 'searchKey', order: SortingOrders.desc });
|
||||
|
||||
const dossierId = _activatedRoute.snapshot.queryParamMap.get('dossierId');
|
||||
this.filterService.addFilterGroups([
|
||||
{
|
||||
slug: 'dossiers',
|
||||
label: this._translateService.instant('search-screen.filters.by-dossier'),
|
||||
filterceptionPlaceholder: this._translateService.instant('search-screen.filters.search-placeholder'),
|
||||
icon: 'red:folder',
|
||||
filters: this._dossiersService.all.map(
|
||||
dossier =>
|
||||
new NestedFilter({
|
||||
id: dossier.id,
|
||||
label: dossier.dossierName,
|
||||
checked: dossier.id === dossierId,
|
||||
}),
|
||||
),
|
||||
checker: keyChecker('dossierId'),
|
||||
},
|
||||
]);
|
||||
const dossierToFilter = ({ dossierName, id }: Dossier) => {
|
||||
const checked = id === dossierId;
|
||||
return new NestedFilter({ id, label: dossierName, checked });
|
||||
};
|
||||
const dossierNameFilter: IFilterGroup = {
|
||||
slug: 'dossiers',
|
||||
label: this._translateService.instant('search-screen.filters.by-dossier'),
|
||||
filterceptionPlaceholder: this._translateService.instant('search-screen.filters.search-placeholder'),
|
||||
icon: 'red:folder',
|
||||
filters: this._dossiersService.all.map(dossierToFilter),
|
||||
checker: keyChecker('dossierId'),
|
||||
};
|
||||
this.filterService.addFilterGroups([dossierNameFilter]);
|
||||
}
|
||||
|
||||
private get _searchChanged$(): Observable<ISearchInput> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user