RED-4467: Don't show overwrite files dialog on empty dossiers
This commit is contained in:
parent
aafa0690cd
commit
ccd86a1dfd
@ -11,6 +11,7 @@ import { FilesMapService } from '@services/files/files-map.service';
|
||||
import { switchMap, tap, throttleTime } from 'rxjs/operators';
|
||||
import { FilesService } from '@services/files/files.service';
|
||||
import { UploadDownloadDialogService } from './upload-download-dialog.service';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
|
||||
export interface ActiveUpload {
|
||||
subscription: Subscription;
|
||||
@ -37,6 +38,7 @@ export class FileUploadService extends GenericService<IFileUploadResult> impleme
|
||||
private readonly _configService: ConfigService,
|
||||
private readonly _dialogService: UploadDownloadDialogService,
|
||||
private readonly _errorMessageService: ErrorMessageService,
|
||||
private readonly _activeDossiersService: ActiveDossiersService,
|
||||
protected readonly _injector: Injector,
|
||||
) {
|
||||
super(_injector, 'upload');
|
||||
@ -76,15 +78,17 @@ export class FileUploadService extends GenericService<IFileUploadResult> impleme
|
||||
let currentOption = option;
|
||||
|
||||
if (isZip(file)) {
|
||||
const res = await this._dialogService.openOverwriteFileDialog(null);
|
||||
if (res.cancel) {
|
||||
return;
|
||||
}
|
||||
if (res.option === OverwriteFileOptions.PARTIAL_OVERWRITE) {
|
||||
file.keepManualRedactions = true;
|
||||
}
|
||||
if (res.option === OverwriteFileOptions.SKIP) {
|
||||
files = [];
|
||||
if (dossierFiles.length > 0) {
|
||||
const res = await this._dialogService.openOverwriteFileDialog(null);
|
||||
if (res.cancel) {
|
||||
return;
|
||||
}
|
||||
if (res.option === OverwriteFileOptions.PARTIAL_OVERWRITE) {
|
||||
file.keepManualRedactions = true;
|
||||
}
|
||||
if (res.option === OverwriteFileOptions.SKIP) {
|
||||
files = [];
|
||||
}
|
||||
}
|
||||
} else if (dossierFiles.find(pf => pf.filename === file.file.name)) {
|
||||
if (!option) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user