DM-388 display enable auto analysis in DM
This commit is contained in:
parent
5c1e0f1d60
commit
b33a5fb355
@ -111,7 +111,7 @@ export class PermissionsService {
|
||||
return this._iqserPermissionsService.has(Roles.excludeIncludeFile) && dossier.isActive;
|
||||
}
|
||||
|
||||
canReanalyseFile(file: File | File[], dossier: Dossier): boolean {
|
||||
canReanalyseFile(file: File | File[], dossier: Dossier) {
|
||||
const files = file instanceof File ? [file] : file;
|
||||
return (
|
||||
this._iqserPermissionsService.has(Roles.files.reanalyze) &&
|
||||
@ -119,11 +119,12 @@ export class PermissionsService {
|
||||
);
|
||||
}
|
||||
|
||||
canEnableAutoAnalysis(files: File[], dossier: Dossier): boolean {
|
||||
return (
|
||||
this._iqserPermissionsService.has(Roles.files.reanalyze) &&
|
||||
files.reduce((acc, _file) => this.#canEnableAutoAnalysis(_file, dossier) && acc, true)
|
||||
);
|
||||
canEnableAutoAnalysis(files: File[], dossier: Dossier) {
|
||||
if (!this._iqserPermissionsService.has(Roles.files.reanalyze)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return files.reduce((acc, _file) => this.#canEnableAutoAnalysis(_file, dossier) && acc, true);
|
||||
}
|
||||
|
||||
canDisableAutoAnalysis(files: File[], dossier: Dossier): boolean {
|
||||
@ -408,12 +409,15 @@ export class PermissionsService {
|
||||
|
||||
#canEnableAutoAnalysis(file: File, dossier: Dossier): boolean {
|
||||
const canEnable = dossier.isActive && this.isFileAssignee(file) && !file.isApproved && !!file.lastProcessed;
|
||||
|
||||
if (this.#isDocumine) {
|
||||
return canEnable && file.processingStatus === ProcessingFileStatuses.ERROR;
|
||||
if (!canEnable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return canEnable && file.excludedFromAutomaticAnalysis;
|
||||
if (this.#isDocumine) {
|
||||
return file.excludedFromAutomaticAnalysis || file.processingStatus === ProcessingFileStatuses.ERROR;
|
||||
}
|
||||
|
||||
return file.excludedFromAutomaticAnalysis;
|
||||
}
|
||||
|
||||
#canDisableAutoAnalysis(file: File, dossier: Dossier): boolean {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user