RED-3332 -> if file requires analysis, updated approve action to display warning „Analysis required to detect new redactions.
This commit is contained in:
parent
32553250d1
commit
9144041d1f
@ -23,7 +23,7 @@
|
||||
|
||||
<iqser-circle-button
|
||||
(action)="reanalyseDossier()"
|
||||
*ngIf="permissionsService.displayReanalyseBtn(dossier) && analysisForced"
|
||||
*ngIf="permissionsService.displayReanalyseBtn(dossier)"
|
||||
[disabled]="listingService.areSomeSelected$ | async"
|
||||
[tooltipClass]="'small warn'"
|
||||
[tooltip]="'dossier-overview.new-rule.toast.actions.reanalyse-all' | translate"
|
||||
|
||||
@ -30,7 +30,6 @@ import { PrimaryFileAttributeService } from '../../../../../../services/primary-
|
||||
})
|
||||
export class ScreenHeaderComponent implements OnInit {
|
||||
@Input() @Required() dossier: Dossier;
|
||||
@Input() @Required() analysisForced: boolean;
|
||||
@Output() @Required() readonly upload = new EventEmitter<void>();
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
actionConfigs: List<ActionConfig>;
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
<ng-container *ngIf="dossier$ | async as dossier">
|
||||
<section (longPress)="forceReanalysisAction($event)" redactionLongPress>
|
||||
<redaction-screen-header
|
||||
(upload)="fileInput.click()"
|
||||
[analysisForced]="analysisForced"
|
||||
[dossier]="dossier"
|
||||
></redaction-screen-header>
|
||||
<section>
|
||||
<redaction-screen-header (upload)="fileInput.click()" [dossier]="dossier"></redaction-screen-header>
|
||||
|
||||
<div class="overlay-shadow"></div>
|
||||
|
||||
|
||||
@ -40,7 +40,6 @@ import { FileAttributesService } from '@services/entity-services/file-attributes
|
||||
import { ConfigService } from '../config.service';
|
||||
import { DossiersService } from '@services/entity-services/dossiers.service';
|
||||
import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service';
|
||||
import { LongPressEvent } from '@shared/directives/long-press.directive';
|
||||
import { UserPreferenceService } from '@services/user-preference.service';
|
||||
import { FilesMapService } from '@services/entity-services/files-map.service';
|
||||
import { FilesService } from '@services/entity-services/files.service';
|
||||
@ -60,7 +59,6 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
collapsedDetails = false;
|
||||
dossierAttributes: DossierAttributeWithValue[] = [];
|
||||
tableColumnConfigs: readonly TableColumnConfig<File>[];
|
||||
analysisForced: boolean;
|
||||
displayedInFileListAttributes: IFileAttributeConfig[] = [];
|
||||
displayedAttributes: IFileAttributeConfig[] = [];
|
||||
readonly workflowConfig: WorkflowConfig<File, WorkflowFileStatus> = this.configService.workflowConfig;
|
||||
@ -170,10 +168,6 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
this._tableComponent?.scrollToLastIndex();
|
||||
}
|
||||
|
||||
forceReanalysisAction($event: LongPressEvent) {
|
||||
this.analysisForced = !$event.touchEnd && this._userPreferenceService.areDevFeaturesEnabled;
|
||||
}
|
||||
|
||||
@HostListener('drop', ['$event'])
|
||||
onDrop(event: DragEvent): void {
|
||||
const currentDossier = this._dossiersService.find(this.dossierId);
|
||||
|
||||
@ -115,14 +115,23 @@ export class BulkActionsService {
|
||||
}
|
||||
|
||||
async approve(files: File[]): Promise<void> {
|
||||
const foundAnalysisRequiredFile = files.find(file => file.analysisRequired);
|
||||
const foundUpdatedFile = files.find(file => file.hasUpdates);
|
||||
if (foundUpdatedFile) {
|
||||
if (foundAnalysisRequiredFile || foundUpdatedFile) {
|
||||
this._dialogService.openDialog(
|
||||
'confirm',
|
||||
null,
|
||||
new ConfirmationDialogInput({
|
||||
title: _('confirmation-dialog.approve-multiple-files.title'),
|
||||
question: _('confirmation-dialog.approve-multiple-files.question'),
|
||||
title: foundAnalysisRequiredFile
|
||||
? _('confirmation-dialog.approve-multiple-files-without-analysis.title')
|
||||
: _('confirmation-dialog.approve-multiple-files.title'),
|
||||
question: foundAnalysisRequiredFile
|
||||
? _('confirmation-dialog.approve-multiple-files-without-analysis.question')
|
||||
: _('confirmation-dialog.approve-multiple-files.question'),
|
||||
confirmationText: foundAnalysisRequiredFile
|
||||
? _('confirmation-dialog.approve-multiple-files-without-analysis.confirmationText')
|
||||
: null,
|
||||
denyText: foundAnalysisRequiredFile ? _('confirmation-dialog.approve-multiple-files-without-analysis.denyText') : null,
|
||||
}),
|
||||
async () => {
|
||||
this._loadingService.start();
|
||||
|
||||
@ -37,12 +37,6 @@
|
||||
<span class="read-only-text" translate="readonly"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="file.excludedFromAutomaticAnalysis" class="justify-center banner disabled-auto-analysis d-flex">
|
||||
<div class="flex-center">
|
||||
<mat-icon class="primary-white" svgIcon="red:denied"></mat-icon>
|
||||
<span class="disabled-auto-analysis-text" translate="disabled-auto-analysis"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="multiSelectActive$ | async" class="multi-select">
|
||||
<div class="selected-wrapper">
|
||||
|
||||
@ -205,10 +205,19 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
icon: 'red:stop',
|
||||
show: this.canDisableAutoAnalysis,
|
||||
},
|
||||
{
|
||||
type: ActionTypes.circleBtn,
|
||||
action: $event => this._reanalyseFile($event),
|
||||
tooltip: _('file-preview.reanalyse-notification'),
|
||||
tooltipClass: 'warn small',
|
||||
icon: 'iqser:refresh',
|
||||
show: this.showReanalyseFilePreview,
|
||||
},
|
||||
{
|
||||
type: ActionTypes.circleBtn,
|
||||
action: $event => this.toggleAutomaticAnalysis($event),
|
||||
tooltip: _('dossier-overview.enable-auto-analysis'),
|
||||
buttonType: this.isFilePreview ? CircleButtonTypes.warn : CircleButtonTypes.default,
|
||||
icon: 'red:play',
|
||||
show: this.canEnableAutoAnalysis,
|
||||
},
|
||||
@ -226,15 +235,6 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
icon: 'iqser:ocr',
|
||||
show: this.showOCR,
|
||||
},
|
||||
{
|
||||
type: ActionTypes.circleBtn,
|
||||
action: $event => this._reanalyseFile($event),
|
||||
tooltip: _('file-preview.reanalyse-notification'),
|
||||
buttonType: CircleButtonTypes.warn,
|
||||
tooltipClass: 'warn small',
|
||||
icon: 'iqser:refresh',
|
||||
show: this.showReanalyseFilePreview,
|
||||
},
|
||||
{
|
||||
type: ActionTypes.circleBtn,
|
||||
action: $event => this._reanalyseFile($event),
|
||||
@ -267,7 +267,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
|
||||
async setFileApproved($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
if (!this.file.hasUpdates) {
|
||||
if (!this.file.analysisRequired && !this.file.hasUpdates) {
|
||||
await this._setFileApproved();
|
||||
return;
|
||||
}
|
||||
@ -276,8 +276,16 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
'confirm',
|
||||
$event,
|
||||
new ConfirmationDialogInput({
|
||||
title: _('confirmation-dialog.approve-file.title'),
|
||||
question: _('confirmation-dialog.approve-file.question'),
|
||||
title: this.file.analysisRequired
|
||||
? _('confirmation-dialog.approve-file-without-analysis.title')
|
||||
: _('confirmation-dialog.approve-file.title'),
|
||||
question: this.file.analysisRequired
|
||||
? _('confirmation-dialog.approve-file-without-analysis.question')
|
||||
: _('confirmation-dialog.approve-file.question'),
|
||||
confirmationText: this.file.analysisRequired
|
||||
? _('confirmation-dialog.approve-file-without-analysis.confirmationText')
|
||||
: null,
|
||||
denyText: this.file.analysisRequired ? _('confirmation-dialog.approve-file-without-analysis.denyText') : null,
|
||||
}),
|
||||
async () => {
|
||||
await this._setFileApproved();
|
||||
@ -417,7 +425,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnDestroy,
|
||||
|
||||
this.showImportRedactions = this._permissionsService.canImportRedactions(this.file);
|
||||
|
||||
const showReanalyse = (this.canReanalyse && this.file.excludedFromAutomaticAnalysis) || this.analysisForced;
|
||||
const showReanalyse = this.canReanalyse || this.file.excludedFromAutomaticAnalysis || this.analysisForced;
|
||||
|
||||
this.showReanalyseFilePreview = showReanalyse && this.isFilePreview;
|
||||
this.showReanalyseDossierOverview = showReanalyse && this.isDossierOverview;
|
||||
|
||||
@ -421,10 +421,22 @@
|
||||
"warning": "Achtung: Diese Aktion kann nicht rückgängig gemacht werden!"
|
||||
},
|
||||
"confirmation-dialog": {
|
||||
"approve-file-without-analysis": {
|
||||
"confirmationText": "",
|
||||
"denyText": "",
|
||||
"question": "",
|
||||
"title": ""
|
||||
},
|
||||
"approve-file": {
|
||||
"question": "Dieses Dokument enthält ungesehene Änderungen. Möchten Sie es trotzdem genehmigen?",
|
||||
"title": "Warnung!"
|
||||
},
|
||||
"approve-multiple-files-without-analysis": {
|
||||
"confirmationText": "",
|
||||
"denyText": "",
|
||||
"question": "",
|
||||
"title": ""
|
||||
},
|
||||
"approve-multiple-files": {
|
||||
"question": "Mindestens eine der ausgewählten Dateien enthält ungesehene Änderungen. Möchten Sie sie trotzdem genehmigen?",
|
||||
"title": "Warnung!"
|
||||
@ -599,7 +611,6 @@
|
||||
"placeholder": "Begründung"
|
||||
}
|
||||
},
|
||||
"disabled-auto-analysis": "",
|
||||
"document-info": {
|
||||
"save": "Dokumenteninformation speichern",
|
||||
"title": "Datei-Attribute anlegen"
|
||||
|
||||
@ -442,10 +442,22 @@
|
||||
"warning": "Warning: this cannot be undone!"
|
||||
},
|
||||
"confirmation-dialog": {
|
||||
"approve-file-without-analysis": {
|
||||
"confirmationText": "Approve without analysis",
|
||||
"denyText": "Cancel",
|
||||
"question": "Analysis required to detect new redactions.",
|
||||
"title": "Warning!"
|
||||
},
|
||||
"approve-file": {
|
||||
"question": "This document has unseen changes, do you wish to approve it anyway?",
|
||||
"title": "Warning!"
|
||||
},
|
||||
"approve-multiple-files-without-analysis": {
|
||||
"confirmationText": "Approve without analysis",
|
||||
"denyText": "Cancel",
|
||||
"question": "Analysis required to detect new redactions for at least one file.",
|
||||
"title": "Warning"
|
||||
},
|
||||
"approve-multiple-files": {
|
||||
"question": "At least one of the files you selected has unseen changes, do you wish to approve them anyway?",
|
||||
"title": "Warning!"
|
||||
@ -627,7 +639,6 @@
|
||||
"placeholder": "Reason"
|
||||
}
|
||||
},
|
||||
"disabled-auto-analysis": "Automatic analysys is disabled",
|
||||
"document-info": {
|
||||
"save": "Save Document Info",
|
||||
"title": "Introduce File Attributes"
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit b4460732f80c3c7036ffca6aa5a876a3a91b56eb
|
||||
Subproject commit e2f85365512c68b927465ee5fe4c0d8e3d5dfe1a
|
||||
@ -107,7 +107,7 @@ export class File extends Entity<IFile> implements IFile {
|
||||
this.isNew = this.workflowStatus === WorkflowFileStatuses.NEW;
|
||||
this.isUnderReview = this.workflowStatus === WorkflowFileStatuses.UNDER_REVIEW;
|
||||
this.isUnderApproval = this.workflowStatus === WorkflowFileStatuses.UNDER_APPROVAL;
|
||||
this.canBeApproved = !this.analysisRequired && !this.hasSuggestions && !this.isProcessing && !this.isError;
|
||||
this.canBeApproved = !this.hasSuggestions && !this.isProcessing && !this.isError;
|
||||
this.canBeOpened = !this.isError && !this.isUnprocessed && this.numberOfAnalyses > 0;
|
||||
this.canBeOCRed = !this.excluded && !this.lastOCRTime && (this.isNew || this.isUnderReview || this.isUnderApproval);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user