Removed reanalysis methods from file action service
This commit is contained in:
parent
5fd4c395ed
commit
4fde66ae89
@ -150,7 +150,12 @@ export class DossierOverviewBulkActionsComponent {
|
||||
}
|
||||
|
||||
ocr() {
|
||||
this._performBulkAction(this._fileActionService.ocrFiles(this.selectedFiles));
|
||||
this._performBulkAction(
|
||||
this._reanalysisService.ocrFiles(
|
||||
this.selectedFiles.map(f => f.fileId),
|
||||
this.dossier.id,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
setToUnderReview() {
|
||||
|
||||
@ -21,6 +21,7 @@ import { FileActionService } from '../../services/file-action.service';
|
||||
import { DossiersService } from '@services/entity-services/dossiers.service';
|
||||
import { FileManagementService } from '../../services/file-management.service';
|
||||
import { FilesService } from '@services/entity-services/files.service';
|
||||
import { ReanalysisService } from '@services/reanalysis.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-file-actions',
|
||||
@ -75,6 +76,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _userPreferenceService: UserPreferenceService,
|
||||
private readonly _reanalysisService: ReanalysisService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@ -146,9 +148,11 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
if ($event) {
|
||||
$event.stopPropagation();
|
||||
}
|
||||
this.addSubscription = this._fileActionService.reanalyseFile(this.file).subscribe(() => {
|
||||
this.reloadFiles('reanalyse');
|
||||
});
|
||||
this.addSubscription = this._reanalysisService
|
||||
.reanalyzeFilesForDossier([this.file.fileId], this.file.dossierId, true)
|
||||
.subscribe(() => {
|
||||
this.reloadFiles('reanalyse');
|
||||
});
|
||||
}
|
||||
|
||||
async setFileUnderApproval($event: MouseEvent) {
|
||||
@ -184,7 +188,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
|
||||
async ocrFile($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
await this._fileActionService.ocrFiles([this.file]).toPromise();
|
||||
await this._reanalysisService.ocrFiles([this.file.fileId], this.file.dossierId).toPromise();
|
||||
this.reloadFiles('ocr-file');
|
||||
}
|
||||
|
||||
@ -202,7 +206,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
}
|
||||
|
||||
async toggleAnalysis() {
|
||||
await this._fileActionService.toggleAnalysis(this.file).toPromise();
|
||||
await this._reanalysisService.toggleAnalysis(this.file.dossierId, this.file.fileId, !this.file.excluded).toPromise();
|
||||
await this._filesService.loadAll(this.file.dossierId).toPromise();
|
||||
this.actionPerformed.emit(this.file?.excluded ? 'enable-analysis' : 'disable-analysis');
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { FilesService } from '@services/entity-services/files.service';
|
||||
import { ConfirmationDialogInput, Toaster } from '@iqser/common-ui';
|
||||
import { DossiersService } from '@services/entity-services/dossiers.service';
|
||||
import { ReanalysisService } from '@services/reanalysis.service';
|
||||
|
||||
@Injectable()
|
||||
export class FileActionService {
|
||||
@ -14,19 +13,10 @@ export class FileActionService {
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _filesService: FilesService,
|
||||
private readonly _reanalysisService: ReanalysisService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _toaster: Toaster,
|
||||
) {}
|
||||
|
||||
reanalyseFile(file: File) {
|
||||
return this._reanalysisService.reanalyzeFilesForDossier([file.fileId], file.dossierId, true);
|
||||
}
|
||||
|
||||
toggleAnalysis(file: File) {
|
||||
return this._reanalysisService.toggleAnalysis(file.dossierId, file.fileId, !file.excluded);
|
||||
}
|
||||
|
||||
async assignToMe(files: File[], callback?: Function) {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const atLeastOneFileHasReviewer = files.reduce((acc, fs) => acc || !!fs.currentReviewer, false);
|
||||
@ -76,13 +66,6 @@ export class FileActionService {
|
||||
);
|
||||
}
|
||||
|
||||
ocrFiles(files: File[]) {
|
||||
return this._reanalysisService.ocrFiles(
|
||||
files.map(f => f.fileId),
|
||||
files[0].dossierId,
|
||||
);
|
||||
}
|
||||
|
||||
assignFile(mode: 'reviewer' | 'approver', $event: MouseEvent, file: File, callback?: Function, ignoreChanged = false) {
|
||||
const dossier = this._dossiersService.find(file.dossierId);
|
||||
const userIds = this._getUserIds(mode, dossier);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user