RED-885: No report/download button for empty projects
This commit is contained in:
parent
5c17e7727e
commit
aefd8f30e3
@ -18,7 +18,8 @@
|
||||
>
|
||||
</redaction-circle-button>
|
||||
|
||||
<redaction-report-download-btn (menuStateChanged)="actionMenuOpen = $event === 'OPEN'" [project]="project"> </redaction-report-download-btn>
|
||||
<redaction-report-download-btn *ngIf="project.files.length > 0" (menuStateChanged)="actionMenuOpen = $event === 'OPEN'" [project]="project">
|
||||
</redaction-report-download-btn>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="openAssignProjectOwnerDialog($event, project)"
|
||||
|
||||
@ -61,7 +61,7 @@ export class ProjectListingActionsComponent implements OnInit {
|
||||
}
|
||||
|
||||
public canDownloadRedactedFiles(project: ProjectWrapper) {
|
||||
return project.files.reduce((acc, file) => acc && this.permissionsService.canDownloadRedactedFile(file), true);
|
||||
return project.files.length > 0 && project.files.reduce((acc, file) => acc && this.permissionsService.canDownloadRedactedFile(file), true);
|
||||
}
|
||||
|
||||
public getProjectStatusConfig(pw: ProjectWrapper) {
|
||||
|
||||
@ -58,7 +58,8 @@
|
||||
icon="red:assign"
|
||||
></redaction-circle-button>
|
||||
|
||||
<redaction-report-download-btn [project]="appStateService.activeProject"> </redaction-report-download-btn>
|
||||
<redaction-report-download-btn *ngIf="appStateService.activeProject.files.length > 0" [project]="appStateService.activeProject">
|
||||
</redaction-report-download-btn>
|
||||
|
||||
<redaction-circle-button
|
||||
(action)="downloadRedactedFiles()"
|
||||
|
||||
@ -344,6 +344,9 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
public get canDownloadRedactedFiles() {
|
||||
return this.appStateService.activeProject.files.reduce((acc, file) => acc && this.permissionsService.canDownloadRedactedFile(file), true);
|
||||
return (
|
||||
this.appStateService.activeProject.files.length > 0 &&
|
||||
this.appStateService.activeProject.files.reduce((acc, file) => acc && this.permissionsService.canDownloadRedactedFile(file), true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user