added back "reanalyse" button when automatic analysis is disabled
This commit is contained in:
parent
71ed8c23b1
commit
dc5d898ec9
@ -114,7 +114,7 @@ export class DossierOverviewBulkActionsComponent implements OnChanges {
|
|||||||
action: () => this._bulkActionsService.reanalyse(this.selectedFiles),
|
action: () => this._bulkActionsService.reanalyse(this.selectedFiles),
|
||||||
tooltip: _('dossier-overview.bulk.reanalyse'),
|
tooltip: _('dossier-overview.bulk.reanalyse'),
|
||||||
icon: 'iqser:refresh',
|
icon: 'iqser:refresh',
|
||||||
show: this.canReanalyse && this.analysisForced,
|
show: this.canReanalyse && (this.analysisForced || this.canEnableAutoAnalysis),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: ActionTypes.circleBtn,
|
type: ActionTypes.circleBtn,
|
||||||
@ -165,9 +165,9 @@ export class DossierOverviewBulkActionsComponent implements OnChanges {
|
|||||||
|
|
||||||
this.canReanalyse = this._permissionsService.canReanalyseFile(this.selectedFiles);
|
this.canReanalyse = this._permissionsService.canReanalyseFile(this.selectedFiles);
|
||||||
|
|
||||||
this.canDisableAutoAnalysis = this._permissionsService.canDisableAutoAnalysis(this.selectedFiles);
|
this.canDisableAutoAnalysis = this._permissionsService.canEnableDisableAutoAnalysis(this.selectedFiles, 'disable');
|
||||||
|
|
||||||
this.canEnableAutoAnalysis = this._permissionsService.canEnableAutoAnalysis(this.selectedFiles);
|
this.canEnableAutoAnalysis = this._permissionsService.canEnableDisableAutoAnalysis(this.selectedFiles, 'enable');
|
||||||
|
|
||||||
this.canOcr = this.selectedFiles.reduce((acc, file) => acc && file.canBeOCRed, true);
|
this.canOcr = this.selectedFiles.reduce((acc, file) => acc && file.canBeOCRed, true);
|
||||||
|
|
||||||
|
|||||||
@ -372,8 +372,8 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
|||||||
this.showDelete = this._permissionsService.canDeleteFile(this.file);
|
this.showDelete = this._permissionsService.canDeleteFile(this.file);
|
||||||
this.showOCR = this.file.canBeOCRed;
|
this.showOCR = this.file.canBeOCRed;
|
||||||
this.canReanalyse = this._permissionsService.canReanalyseFile(this.file);
|
this.canReanalyse = this._permissionsService.canReanalyseFile(this.file);
|
||||||
this.canDisableAutoAnalysis = this._permissionsService.canDisableAutoAnalysis(this.file);
|
this.canDisableAutoAnalysis = this._permissionsService.canEnableDisableAutoAnalysis(this.file, 'disable');
|
||||||
this.canEnableAutoAnalysis = this._permissionsService.canEnableAutoAnalysis(this.file);
|
this.canEnableAutoAnalysis = this._permissionsService.canEnableDisableAutoAnalysis(this.file, 'enable');
|
||||||
|
|
||||||
this.showStatusBar = !this.file.isError && !this.file.isPending && this.isDossierOverviewList;
|
this.showStatusBar = !this.file.isError && !this.file.isPending && this.isDossierOverviewList;
|
||||||
|
|
||||||
@ -382,8 +382,9 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
|||||||
(this._permissionsService.canAssignUser(this.file) || this._permissionsService.canUnassignUser(this.file)) &&
|
(this._permissionsService.canAssignUser(this.file) || this._permissionsService.canUnassignUser(this.file)) &&
|
||||||
this.isDossierOverview;
|
this.isDossierOverview;
|
||||||
|
|
||||||
this.showReanalyseFilePreview = this.canReanalyse && this.isFilePreview && this.analysisForced;
|
this.showReanalyseFilePreview = this.canReanalyse && this.isFilePreview && (this.analysisForced || this.canEnableAutoAnalysis);
|
||||||
this.showReanalyseDossierOverview = this.canReanalyse && this.isDossierOverview && this.analysisForced;
|
this.showReanalyseDossierOverview =
|
||||||
|
this.canReanalyse && this.isDossierOverview && (this.analysisForced || this.canEnableAutoAnalysis);
|
||||||
|
|
||||||
this.buttons = this._buttons;
|
this.buttons = this._buttons;
|
||||||
|
|
||||||
|
|||||||
@ -32,14 +32,9 @@ export class PermissionsService {
|
|||||||
return files.reduce((acc, _file) => this._canReanalyseFile(_file) && acc, true);
|
return files.reduce((acc, _file) => this._canReanalyseFile(_file) && acc, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
canDisableAutoAnalysis(file: File | File[]): boolean {
|
canEnableDisableAutoAnalysis(file: File | File[], value: 'enable' | 'disable'): boolean {
|
||||||
const files = file instanceof File ? [file] : file;
|
const files = file instanceof File ? [file] : file;
|
||||||
return files.reduce((acc, _file) => this._canDisableAutoAnalysis(_file) && acc, true);
|
return files.reduce((acc, _file) => this._canEnableDisableAutoAnalysis(_file, value) && acc, true);
|
||||||
}
|
|
||||||
|
|
||||||
canEnableAutoAnalysis(file: File | File[]): boolean {
|
|
||||||
const files = file instanceof File ? [file] : file;
|
|
||||||
return files.reduce((acc, _file) => this._canEnableAutoAnalysis(_file) && acc, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isFileAssignee(file: File): boolean {
|
isFileAssignee(file: File): boolean {
|
||||||
@ -168,12 +163,9 @@ export class PermissionsService {
|
|||||||
return this.isReviewerOrApprover(file) || file.isNew || (file.isError && file.isNew);
|
return this.isReviewerOrApprover(file) || file.isNew || (file.isError && file.isNew);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _canDisableAutoAnalysis(file: File): boolean {
|
private _canEnableDisableAutoAnalysis(file: File, value: 'enable' | 'disable'): boolean {
|
||||||
return !file.excludedFromAutomaticAnalysis && file.assignee === this._userService.currentUser.id;
|
const enableOrDisable = value === 'enable' ? file.excludedFromAutomaticAnalysis : !file.excludedFromAutomaticAnalysis;
|
||||||
}
|
return enableOrDisable && file.assignee === this._userService.currentUser.id;
|
||||||
|
|
||||||
private _canEnableAutoAnalysis(file: File): boolean {
|
|
||||||
return file.excludedFromAutomaticAnalysis && file.assignee === this._userService.currentUser.id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _canAssignToSelf(file: File, dossier: Dossier): boolean {
|
private _canAssignToSelf(file: File, dossier: Dossier): boolean {
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 31b60ff117a8d8ecb9617be3b0c9e1822d437034
|
Subproject commit b808e4661e56aa93baca96c57f910443437112d4
|
||||||
@ -69,7 +69,7 @@ export class File extends Entity<IFile> implements IFile {
|
|||||||
this.dossierDictionaryVersion = file.dossierDictionaryVersion;
|
this.dossierDictionaryVersion = file.dossierDictionaryVersion;
|
||||||
this.dossierId = file.dossierId;
|
this.dossierId = file.dossierId;
|
||||||
this.excluded = !!file.excluded;
|
this.excluded = !!file.excluded;
|
||||||
this.excludedFromAutomaticAnalysis = Math.random() < 0.5; //!!file.excludedFromAutomaticAnalysis;
|
this.excludedFromAutomaticAnalysis = !!file.excludedFromAutomaticAnalysis;
|
||||||
this.fileAttributes = file.fileAttributes;
|
this.fileAttributes = file.fileAttributes;
|
||||||
this.fileId = file.fileId;
|
this.fileId = file.fileId;
|
||||||
this.filename = file.filename;
|
this.filename = file.filename;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user