RED-9772: delete saved entity log on file overwrite.

This commit is contained in:
Nicoleta Panaghiu 2024-08-01 11:55:54 +03:00
parent 613a7429b8
commit 35342707f0

View File

@ -15,6 +15,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { HeadersConfiguration } from '@iqser/common-ui/lib/utils';
import { LicenseService } from '@services/license.service';
import { LicenseFeatures } from '../../admin/screens/license/utils/constants';
import { TenantsService } from '@common-ui/tenants';
export interface ActiveUpload {
subscription: Subscription;
@ -43,6 +44,7 @@ export class FileUploadService extends GenericService<IFileUploadResult> impleme
private readonly _errorMessageService: ErrorMessageService,
private readonly _licenseService: LicenseService,
private readonly _toaster: Toaster,
private readonly _tenantsService: TenantsService,
) {
super();
const fileFetch$ = this.#fetchFiles$.pipe(
@ -109,6 +111,11 @@ export class FileUploadService extends GenericService<IFileUploadResult> impleme
option = res.applyToAllFiles ? currentOption : undefined;
}
const existingFile = dossierFiles.find(pf => pf.filename === file.file.name);
if (OverwriteFileOptions.FULL_OVERWRITE === currentOption || OverwriteFileOptions.PARTIAL_OVERWRITE === currentOption) {
localStorage.removeItem(`${this._tenantsService.activeTenantId}-annotations-${existingFile.id}`);
}
if (currentOption === OverwriteFileOptions.PARTIAL_OVERWRITE) {
file.keepManualRedactions = true;
}