minor changes
This commit is contained in:
parent
e0937b0492
commit
7b9d5ac405
@ -1,8 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DatePipe } from '@shared/pipes/date.pipe';
|
||||
import { UserService } from '@services/user.service';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { NotificationsService } from '@services/notifications.service';
|
||||
import { Notification } from '@red/domain';
|
||||
import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||
@ -24,13 +21,7 @@ export class NotificationsComponent {
|
||||
readonly hasUnreadNotifications$: Observable<boolean>;
|
||||
readonly groupedNotifications$: Observable<NotificationsGroup[]>;
|
||||
|
||||
constructor(
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _notificationsService: NotificationsService,
|
||||
private readonly _activeDossiersService: ActiveDossiersService,
|
||||
private readonly _datePipe: DatePipe,
|
||||
) {
|
||||
constructor(private readonly _notificationsService: NotificationsService, private readonly _datePipe: DatePipe) {
|
||||
this.groupedNotifications$ = this._notificationsService.all$.pipe(map(notifications => this._groupNotifications(notifications)));
|
||||
this.hasUnreadNotifications$ = this._hasUnreadNotifications$;
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
}
|
||||
|
||||
async updateViewMode(): Promise<void> {
|
||||
this._logger.debug(`[PDF] Update ${this._viewModeService.viewMode} view mode`);
|
||||
this._logger.info(`[PDF] Update ${this._viewModeService.viewMode} view mode`);
|
||||
|
||||
const annotations = this.pdf.getAnnotations(a => a.getCustomData('redact-manager'));
|
||||
const redactions = annotations.filter(a => a.getCustomData('redaction'));
|
||||
@ -249,7 +249,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
),
|
||||
});
|
||||
|
||||
this._logger.debug(`[FILTERS] Rebuild time: ${new Date().getTime() - startTime} ms`);
|
||||
this._logger.info(`[FILTERS] Rebuild time: ${new Date().getTime() - startTime} ms`);
|
||||
}
|
||||
|
||||
async handleAnnotationSelected(annotationIds: string[]) {
|
||||
@ -290,7 +290,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
null,
|
||||
{ manualRedactionEntryWrapper, dossierId: this.dossierId },
|
||||
async ({ manualRedactionEntry }: ManualRedactionEntryWrapper) => {
|
||||
const addAnnotation$ = this._manualRedactionService.addAnnotation(manualRedactionEntry, this.dossierId, this.fileId);
|
||||
const addAnnotation$ = this._manualRedactionService.addAnnotation([manualRedactionEntry], this.dossierId, this.fileId);
|
||||
await firstValueFrom(addAnnotation$.pipe(catchError(() => of(undefined))));
|
||||
await this._fileDataService.loadAnnotations();
|
||||
},
|
||||
@ -417,7 +417,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
pairwise(),
|
||||
tap(annotations => this.deleteAnnotations(...annotations)),
|
||||
switchMap(annotations => this.drawChangedAnnotations(...annotations)),
|
||||
tap(() => this._logger.debug(`[ANNOTATIONS] Processing time: ${new Date().getTime() - start}`)),
|
||||
tap(() => this._logger.info(`[ANNOTATIONS] Processing time: ${new Date().getTime() - start}`)),
|
||||
tap(() => this.updateViewMode()),
|
||||
);
|
||||
}
|
||||
@ -429,7 +429,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
return;
|
||||
}
|
||||
|
||||
this._logger.debug('[ANNOTATIONS] To delete: ', annotationsToDelete);
|
||||
this._logger.info('[ANNOTATIONS] To delete: ', annotationsToDelete);
|
||||
this.pdf.deleteAnnotations(annotationsToDelete.map(annotation => annotation.id));
|
||||
}
|
||||
|
||||
@ -448,7 +448,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
return firstValueFrom(of({}));
|
||||
}
|
||||
|
||||
this._logger.debug('[ANNOTATIONS] To draw: ', annotationsToDraw);
|
||||
this._logger.info('[ANNOTATIONS] To draw: ', annotationsToDraw);
|
||||
const annotationsToDrawIds = annotationsToDraw.map(a => a.annotationId);
|
||||
this.pdf.deleteAnnotations(annotationsToDrawIds);
|
||||
return this._cleanupAndRedrawAnnotations(annotationsToDraw);
|
||||
@ -476,7 +476,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
const changed = JSON.stringify(oldAnnotation) !== JSON.stringify(newAnnotation);
|
||||
if (changed && this.userPreferenceService.areDevFeaturesEnabled) {
|
||||
import('@iqser/common-ui').then(commonUi => {
|
||||
this._logger.debug('[ANNOTATIONS] Changed annotation: ', {
|
||||
this._logger.info('[ANNOTATIONS] Changed annotation: ', {
|
||||
value: oldAnnotation.value,
|
||||
before: commonUi.deepDiffObj(newAnnotation, oldAnnotation),
|
||||
after: commonUi.deepDiffObj(oldAnnotation, newAnnotation),
|
||||
@ -626,7 +626,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
}
|
||||
|
||||
await this._annotationDrawService.drawAnnotations(newAnnotations);
|
||||
this._logger.debug(`[ANNOTATIONS] Redraw time: ${new Date().getTime() - startTime} ms for ${newAnnotations.length} annotations`);
|
||||
this._logger.info(`[ANNOTATIONS] Redraw time: ${new Date().getTime() - startTime} ms for ${newAnnotations.length} annotations`);
|
||||
}
|
||||
|
||||
private _handleDeltaAnnotationFilters(currentFilters: NestedFilter[], newAnnotations: AnnotationWrapper[]) {
|
||||
|
||||
@ -36,7 +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')),
|
||||
tap(() => this._logger.info('[FILE] Loaded')),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export interface IImageRecategorizationRequest {
|
||||
annotationId?: string;
|
||||
comment?: string;
|
||||
type?: string;
|
||||
readonly annotationId?: string;
|
||||
readonly comment?: string;
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user