From bdbdb4d2b0352865d3ba79c013dd9ced3311c39c Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 13 Feb 2024 13:32:26 +0100 Subject: [PATCH] RED-8187: removed buttons for non-dossier members. --- .../file-actions/file-actions.component.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts index 9f9c97f09..2f2bbc284 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts @@ -50,6 +50,7 @@ export class FileActionsComponent implements OnChanges { readonly currentUser = getCurrentUser(); toggleTooltip?: string; assignTooltip?: string; + showDownload = false; showSetToNew = false; showUndoApproval = false; showAssignToSelf = false; @@ -73,7 +74,7 @@ export class FileActionsComponent implements OnChanges { isDossierOverviewList = false; isDossierOverviewWorkflow = false; isFilePreview = false; - canAnalyzeFile = false; + isDossierMember = false; tooltipPosition = IqserTooltipPositions.above; buttons: Action[]; @ViewChild(ExpandableFileActionsComponent) @@ -156,7 +157,7 @@ export class FileActionsComponent implements OnChanges { files: [this.file], dossier: this.dossier, tooltipClass: 'small', - show: this._permissionsService.canDownloadRedactedFile() && !!this.file.lastProcessed, + show: this.showDownload, disabled: this.file.processingStatus === ProcessingFileStatuses.ERROR, helpModeKey: 'download', }, @@ -235,7 +236,7 @@ export class FileActionsComponent implements OnChanges { tooltipClass: 'small', icon: 'iqser:refresh', show: this.showReanalyseFilePreview, - disabled: this.file.isProcessing || !this.canAnalyzeFile, + disabled: this.file.isProcessing, helpModeKey: 'stop_analysis', }, { @@ -273,7 +274,6 @@ export class FileActionsComponent implements OnChanges { icon: 'iqser:refresh', show: this.showReanalyseDossierOverview, helpModeKey: 'stop_analysis', - disabled: !this.canAnalyzeFile, }, { id: 'toggle-analysis-btn', @@ -283,7 +283,7 @@ export class FileActionsComponent implements OnChanges { tooltip: this.toggleTooltip, class: { 'mr-24': this.isDossierOverviewList }, checked: !this.file.excluded, - show: this.showToggleAnalysis, + show: this.showToggleAnalysis && this.isDossierMember, helpModeKey: 'disable_extraction', }, ]; @@ -445,7 +445,7 @@ export class FileActionsComponent implements OnChanges { this.canToggleAnalysis = this._permissionsService.canToggleAnalysis(this.file, this.dossier); this.showToggleAnalysis = !!this.file.lastProcessed && this._permissionsService.showToggleAnalysis(this.dossier); this.toggleTooltip = this._toggleTooltip; - this.canAnalyzeFile = this._permissionsService.isDossierMember(this.dossier); + this.isDossierMember = this._permissionsService.isDossierMember(this.dossier); this.showDelete = this._permissionsService.canSoftDeleteFile(this.file, this.dossier); this.showOCR = this._permissionsService.canOcrFile(this.file, this.dossier); @@ -457,9 +457,10 @@ export class FileActionsComponent implements OnChanges { const showReanalyse = this.canReanalyse || this.file.excludedFromAutomaticAnalysis || this.analysisForced; - this.showReanalyseFilePreview = showReanalyse && this.isFilePreview && !this.file.isApproved; - this.showReanalyseDossierOverview = showReanalyse && this.isDossierOverview && !this.file.isApproved; + this.showReanalyseFilePreview = showReanalyse && this.isFilePreview && !this.file.isApproved && this.isDossierMember; + this.showReanalyseDossierOverview = showReanalyse && this.isDossierOverview && !this.file.isApproved && this.isDossierMember; + this.showDownload = this._permissionsService.canDownloadRedactedFile() && !!this.file.lastProcessed && this.isDossierMember; this.buttons = this._buttons; this._changeRef.markForCheck();