Removed set under review / approve methods from file action service
This commit is contained in:
parent
4fde66ae89
commit
ea0eaab218
@ -12,6 +12,7 @@ import { LongPressEvent } from '@shared/directives/long-press.directive';
|
||||
import { UserPreferenceService } from '@services/user-preference.service';
|
||||
import { FileManagementService } from '../../../../shared/services/file-management.service';
|
||||
import { ReanalysisService } from '@services/reanalysis.service';
|
||||
import { FilesService } from '@services/entity-services/files.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossier-overview-bulk-actions',
|
||||
@ -38,6 +39,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
private readonly _translateService: TranslateService,
|
||||
readonly listingService: ListingService<File>,
|
||||
private readonly _userPreferenceService: UserPreferenceService,
|
||||
private readonly _filesService: FilesService,
|
||||
) {}
|
||||
|
||||
get selectedFiles(): File[] {
|
||||
@ -159,7 +161,12 @@ export class DossierOverviewBulkActionsComponent {
|
||||
}
|
||||
|
||||
setToUnderReview() {
|
||||
this._performBulkAction(this._fileActionService.setFilesUnderReview(this.selectedFiles));
|
||||
this._performBulkAction(
|
||||
this._filesService.setUnderReviewFor(
|
||||
this.selectedFiles.map(f => f.id),
|
||||
this.dossier.id,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
approveDocuments() {
|
||||
@ -173,11 +180,21 @@ export class DossierOverviewBulkActionsComponent {
|
||||
question: _('confirmation-dialog.approve-multiple-files.question'),
|
||||
}),
|
||||
() => {
|
||||
this._performBulkAction(this._fileActionService.setFilesApproved(this.selectedFiles));
|
||||
this._performBulkAction(
|
||||
this._filesService.setApprovedFor(
|
||||
this.selectedFiles.map(f => f.id),
|
||||
this.dossier.id,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
this._performBulkAction(this._fileActionService.setFilesApproved(this.selectedFiles));
|
||||
this._performBulkAction(
|
||||
this._filesService.setApprovedFor(
|
||||
this.selectedFiles.map(f => f.id),
|
||||
this.dossier.id,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -391,7 +391,7 @@ export class ConfigService {
|
||||
|
||||
private _approveFn = (reloadDossiers: () => Promise<void>) => async (file: File) => {
|
||||
this._loadingService.start();
|
||||
await this._fileActionService.setFilesApproved([file]).toPromise();
|
||||
await this._filesService.setApprovedFor([file.id], file.dossierId).toPromise();
|
||||
await reloadDossiers();
|
||||
this._loadingService.stop();
|
||||
};
|
||||
|
||||
@ -251,7 +251,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
}
|
||||
|
||||
private async _setFileApproved() {
|
||||
await this._fileActionService.setFilesApproved([this.file]).toPromise();
|
||||
await this._filesService.setApprovedFor([this.file.id], this.file.dossierId).toPromise();
|
||||
this.reloadFiles('set-approved');
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,20 +52,6 @@ export class FileActionService {
|
||||
);
|
||||
}
|
||||
|
||||
setFilesApproved(files: File[]) {
|
||||
return this._filesService.setApprovedFor(
|
||||
files.map(f => f.fileId),
|
||||
files[0].dossierId,
|
||||
);
|
||||
}
|
||||
|
||||
setFilesUnderReview(files: File[]) {
|
||||
return this._filesService.setUnderReviewFor(
|
||||
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