diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/screen-header/screen-header.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/screen-header/screen-header.component.html index 9ca29d0ab..9242c472e 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/screen-header/screen-header.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/screen-header/screen-header.component.html @@ -23,7 +23,7 @@ (); readonly circleButtonTypes = CircleButtonTypes; actionConfigs: List; diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.html index 7074f226c..760f1aff3 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.html @@ -1,10 +1,6 @@ -
- +
+
diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.ts index 00cb0711f..131c51dde 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/screen/dossier-overview-screen.component.ts @@ -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 imple collapsedDetails = false; dossierAttributes: DossierAttributeWithValue[] = []; tableColumnConfigs: readonly TableColumnConfig[]; - analysisForced: boolean; displayedInFileListAttributes: IFileAttributeConfig[] = []; displayedAttributes: IFileAttributeConfig[] = []; readonly workflowConfig: WorkflowConfig = this.configService.workflowConfig; @@ -170,10 +168,6 @@ export class DossierOverviewScreenComponent extends ListingComponent 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); diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/services/bulk-actions.service.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/services/bulk-actions.service.ts index d7bbdd4a5..36f14f739 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/services/bulk-actions.service.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/services/bulk-actions.service.ts @@ -115,14 +115,23 @@ export class BulkActionsService { } async approve(files: File[]): Promise { + 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(); diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html index cd75fe63c..a39979f30 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/file-workload/file-workload.component.html @@ -37,12 +37,6 @@ -
diff --git a/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts index edfe8b159..829c33302 100644 --- a/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/dossier/shared/components/file-actions/file-actions.component.ts @@ -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; diff --git a/apps/red-ui/src/assets/i18n/de.json b/apps/red-ui/src/assets/i18n/de.json index b228549e1..64e622c8a 100644 --- a/apps/red-ui/src/assets/i18n/de.json +++ b/apps/red-ui/src/assets/i18n/de.json @@ -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" diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 1f5f5db61..086f554f0 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -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" diff --git a/libs/common-ui b/libs/common-ui index b4460732f..e2f853655 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit b4460732f80c3c7036ffca6aa5a876a3a91b56eb +Subproject commit e2f85365512c68b927465ee5fe4c0d8e3d5dfe1a diff --git a/libs/red-domain/src/lib/files/file.model.ts b/libs/red-domain/src/lib/files/file.model.ts index 2c4f19da3..b5930769c 100644 --- a/libs/red-domain/src/lib/files/file.model.ts +++ b/libs/red-domain/src/lib/files/file.model.ts @@ -107,7 +107,7 @@ export class File extends Entity 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);