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;
|
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;
|
const files = file instanceof File ? [file] : file;
|
||||||
return (
|
return (
|
||||||
this._iqserPermissionsService.has(Roles.files.reanalyze) &&
|
this._iqserPermissionsService.has(Roles.files.reanalyze) &&
|
||||||
@ -119,11 +119,12 @@ export class PermissionsService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
canEnableAutoAnalysis(files: File[], dossier: Dossier): boolean {
|
canEnableAutoAnalysis(files: File[], dossier: Dossier) {
|
||||||
return (
|
if (!this._iqserPermissionsService.has(Roles.files.reanalyze)) {
|
||||||
this._iqserPermissionsService.has(Roles.files.reanalyze) &&
|
return false;
|
||||||
files.reduce((acc, _file) => this.#canEnableAutoAnalysis(_file, dossier) && acc, true)
|
}
|
||||||
);
|
|
||||||
|
return files.reduce((acc, _file) => this.#canEnableAutoAnalysis(_file, dossier) && acc, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
canDisableAutoAnalysis(files: File[], dossier: Dossier): boolean {
|
canDisableAutoAnalysis(files: File[], dossier: Dossier): boolean {
|
||||||
@ -408,12 +409,15 @@ export class PermissionsService {
|
|||||||
|
|
||||||
#canEnableAutoAnalysis(file: File, dossier: Dossier): boolean {
|
#canEnableAutoAnalysis(file: File, dossier: Dossier): boolean {
|
||||||
const canEnable = dossier.isActive && this.isFileAssignee(file) && !file.isApproved && !!file.lastProcessed;
|
const canEnable = dossier.isActive && this.isFileAssignee(file) && !file.isApproved && !!file.lastProcessed;
|
||||||
|
if (!canEnable) {
|
||||||
if (this.#isDocumine) {
|
return false;
|
||||||
return canEnable && file.processingStatus === ProcessingFileStatuses.ERROR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return canEnable && file.excludedFromAutomaticAnalysis;
|
if (this.#isDocumine) {
|
||||||
|
return file.excludedFromAutomaticAnalysis || file.processingStatus === ProcessingFileStatuses.ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return file.excludedFromAutomaticAnalysis;
|
||||||
}
|
}
|
||||||
|
|
||||||
#canDisableAutoAnalysis(file: File, dossier: Dossier): boolean {
|
#canDisableAutoAnalysis(file: File, dossier: Dossier): boolean {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user