add platform search service
This commit is contained in:
parent
6106c2dfe4
commit
d9f5e10b7d
@ -39,6 +39,7 @@ import { AnnotationsListComponent } from './components/file-workload/components/
|
||||
import { AnnotationSourceComponent } from './components/file-workload/components/annotation-source/annotation-source.component';
|
||||
import { OverlayModule } from '@angular/cdk/overlay';
|
||||
import { SharedDossiersModule } from './shared/shared-dossiers.module';
|
||||
import { PlatformSearchService } from './shared/services/platform-search.service';
|
||||
|
||||
const screens = [FilePreviewScreenComponent, SearchScreenComponent];
|
||||
|
||||
@ -84,6 +85,7 @@ const services = [
|
||||
PdfViewerDataService,
|
||||
AnnotationDrawService,
|
||||
AnnotationProcessingService,
|
||||
PlatformSearchService,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
SearchPositions,
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { List, MatchedDocument, SearchControllerService, SearchResult } from '@redaction/red-ui-http';
|
||||
import { List, MatchedDocument, SearchResult } from '@redaction/red-ui-http';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { debounceTime, map, skip, switchMap, tap } from 'rxjs/operators';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@ -18,6 +18,7 @@ import { fileStatusTranslations } from '../../translations/file-status-translati
|
||||
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';
|
||||
|
||||
interface ListItem extends IListable {
|
||||
readonly dossierId: string;
|
||||
@ -69,7 +70,7 @@ export class SearchScreenComponent extends ListingComponent<ListItem> implements
|
||||
private readonly _dossiersService: DossiersService,
|
||||
readonly routerHistoryService: RouterHistoryService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _searchControllerService: SearchControllerService,
|
||||
private readonly _platformSearchService: PlatformSearchService,
|
||||
) {
|
||||
super(_injector);
|
||||
this.searchService.skip = true;
|
||||
@ -108,7 +109,7 @@ export class SearchScreenComponent extends ListingComponent<ListItem> implements
|
||||
}
|
||||
|
||||
private _search(searchInput: SearchInput): Observable<SearchResult> {
|
||||
return this._searchControllerService.search({
|
||||
return this._platformSearchService.search({
|
||||
dossierIds: [...searchInput.dossierIds],
|
||||
queryString: searchInput.query ?? '',
|
||||
page: 1,
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { GenericService } from '@iqser/common-ui';
|
||||
import { SearchRequest, SearchResult } from '@redaction/red-ui-http';
|
||||
|
||||
@Injectable()
|
||||
export class PlatformSearchService extends GenericService<SearchResult> {
|
||||
constructor(protected readonly _injector: Injector) {
|
||||
super(_injector, 'search');
|
||||
}
|
||||
|
||||
search(body: SearchRequest) {
|
||||
return this._post(body);
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,13 @@
|
||||
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
|
||||
import { Configuration } from './configuration';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { SearchControllerService } from './api/searchController.service';
|
||||
import { NotificationControllerService } from './api/notificationController.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [],
|
||||
declarations: [],
|
||||
exports: [],
|
||||
providers: [SearchControllerService, NotificationControllerService],
|
||||
providers: [NotificationControllerService],
|
||||
})
|
||||
export class ApiModule {
|
||||
constructor(@Optional() @SkipSelf() parentModule: ApiModule, @Optional() http: HttpClient) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user