RED-8187: removed buttons for non-dossier members.

This commit is contained in:
Nicoleta Panaghiu 2024-02-13 13:32:26 +01:00
parent 5be95976d6
commit bdbdb4d2b0

View File

@ -50,6 +50,7 @@ export class FileActionsComponent implements OnChanges {
readonly currentUser = getCurrentUser<User>(); readonly currentUser = getCurrentUser<User>();
toggleTooltip?: string; toggleTooltip?: string;
assignTooltip?: string; assignTooltip?: string;
showDownload = false;
showSetToNew = false; showSetToNew = false;
showUndoApproval = false; showUndoApproval = false;
showAssignToSelf = false; showAssignToSelf = false;
@ -73,7 +74,7 @@ export class FileActionsComponent implements OnChanges {
isDossierOverviewList = false; isDossierOverviewList = false;
isDossierOverviewWorkflow = false; isDossierOverviewWorkflow = false;
isFilePreview = false; isFilePreview = false;
canAnalyzeFile = false; isDossierMember = false;
tooltipPosition = IqserTooltipPositions.above; tooltipPosition = IqserTooltipPositions.above;
buttons: Action[]; buttons: Action[];
@ViewChild(ExpandableFileActionsComponent) @ViewChild(ExpandableFileActionsComponent)
@ -156,7 +157,7 @@ export class FileActionsComponent implements OnChanges {
files: [this.file], files: [this.file],
dossier: this.dossier, dossier: this.dossier,
tooltipClass: 'small', tooltipClass: 'small',
show: this._permissionsService.canDownloadRedactedFile() && !!this.file.lastProcessed, show: this.showDownload,
disabled: this.file.processingStatus === ProcessingFileStatuses.ERROR, disabled: this.file.processingStatus === ProcessingFileStatuses.ERROR,
helpModeKey: 'download', helpModeKey: 'download',
}, },
@ -235,7 +236,7 @@ export class FileActionsComponent implements OnChanges {
tooltipClass: 'small', tooltipClass: 'small',
icon: 'iqser:refresh', icon: 'iqser:refresh',
show: this.showReanalyseFilePreview, show: this.showReanalyseFilePreview,
disabled: this.file.isProcessing || !this.canAnalyzeFile, disabled: this.file.isProcessing,
helpModeKey: 'stop_analysis', helpModeKey: 'stop_analysis',
}, },
{ {
@ -273,7 +274,6 @@ export class FileActionsComponent implements OnChanges {
icon: 'iqser:refresh', icon: 'iqser:refresh',
show: this.showReanalyseDossierOverview, show: this.showReanalyseDossierOverview,
helpModeKey: 'stop_analysis', helpModeKey: 'stop_analysis',
disabled: !this.canAnalyzeFile,
}, },
{ {
id: 'toggle-analysis-btn', id: 'toggle-analysis-btn',
@ -283,7 +283,7 @@ export class FileActionsComponent implements OnChanges {
tooltip: this.toggleTooltip, tooltip: this.toggleTooltip,
class: { 'mr-24': this.isDossierOverviewList }, class: { 'mr-24': this.isDossierOverviewList },
checked: !this.file.excluded, checked: !this.file.excluded,
show: this.showToggleAnalysis, show: this.showToggleAnalysis && this.isDossierMember,
helpModeKey: 'disable_extraction', helpModeKey: 'disable_extraction',
}, },
]; ];
@ -445,7 +445,7 @@ export class FileActionsComponent implements OnChanges {
this.canToggleAnalysis = this._permissionsService.canToggleAnalysis(this.file, this.dossier); this.canToggleAnalysis = this._permissionsService.canToggleAnalysis(this.file, this.dossier);
this.showToggleAnalysis = !!this.file.lastProcessed && this._permissionsService.showToggleAnalysis(this.dossier); this.showToggleAnalysis = !!this.file.lastProcessed && this._permissionsService.showToggleAnalysis(this.dossier);
this.toggleTooltip = this._toggleTooltip; 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.showDelete = this._permissionsService.canSoftDeleteFile(this.file, this.dossier);
this.showOCR = this._permissionsService.canOcrFile(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; const showReanalyse = this.canReanalyse || this.file.excludedFromAutomaticAnalysis || this.analysisForced;
this.showReanalyseFilePreview = showReanalyse && this.isFilePreview && !this.file.isApproved; this.showReanalyseFilePreview = showReanalyse && this.isFilePreview && !this.file.isApproved && this.isDossierMember;
this.showReanalyseDossierOverview = showReanalyse && this.isDossierOverview && !this.file.isApproved; 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.buttons = this._buttons;
this._changeRef.markForCheck(); this._changeRef.markForCheck();