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