Merge branch 'RED-3462'

This commit is contained in:
Adina Țeudan 2022-03-24 19:25:05 +02:00
commit adb1a24bda
3 changed files with 7 additions and 5 deletions

View File

@ -299,11 +299,6 @@ export class AnnotationWrapper implements Record<string, unknown> {
}
private static _setSuperType(annotationWrapper: AnnotationWrapper, redactionLogEntryWrapper: RedactionLogEntry) {
if (redactionLogEntryWrapper.recommendation && !redactionLogEntryWrapper.redacted) {
annotationWrapper.superType = SuperTypes.Recommendation;
return;
}
if (redactionLogEntryWrapper.manualChanges?.length) {
const lastManualChange = redactionLogEntryWrapper.manualChanges[redactionLogEntryWrapper.manualChanges.length - 1];

View File

@ -28,6 +28,7 @@ import { ViewModeService } from './view-mode.service';
import { Core } from '@pdftron/webviewer';
import { Router } from '@angular/router';
import dayjs from 'dayjs';
import { NGXLogger } from 'ngx-logger';
import Annotation = Core.Annotations.Annotation;
const DELTA_VIEW_TIME = 10 * 60 * 1000; // 10 minutes;
@ -56,6 +57,7 @@ export class FileDataService {
private readonly _textHighlightsService: TextHighlightService,
private readonly _toaster: Toaster,
private readonly _router: Router,
private readonly _logger: NGXLogger,
) {
this.annotations$ = this.#annotations$;
this.visibleAnnotations$ = this._viewModeService.viewMode$.pipe(
@ -107,6 +109,8 @@ export class FileDataService {
return;
}
this._logger.debug('[ANNOTATIONS] Load annotations');
await this.loadViewedPages(file);
await this.loadRedactionLog();
}

View File

@ -6,6 +6,7 @@ import { UserService } from '../user.service';
import { FilesMapService } from '@services/entity-services/files-map.service';
import { map, mapTo, switchMap, tap } from 'rxjs/operators';
import { DossierStatsService } from '@services/dossiers/dossier-stats.service';
import { NGXLogger } from 'ngx-logger';
@Injectable({
providedIn: 'root',
@ -13,6 +14,7 @@ import { DossierStatsService } from '@services/dossiers/dossier-stats.service';
export class FilesService extends EntitiesService<File, IFile> {
constructor(
protected readonly _injector: Injector,
protected readonly _logger: NGXLogger,
private readonly _userService: UserService,
private readonly _filesMapService: FilesMapService,
private readonly _dossierStatsService: DossierStatsService,
@ -34,6 +36,7 @@ export class FilesService extends EntitiesService<File, IFile> {
map(_file => new File(_file, this._userService.getNameForId(_file.assignee), file.routerPath)),
switchMap(_file => this._dossierStatsService.getFor([dossierId]).pipe(mapTo(_file))),
map(_file => this._filesMapService.replace([_file])),
tap(() => this._logger.debug('[FILE] Loaded')),
);
}