Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#43172] hide link files action if list is empty

Eric Schubert4747edfcffb0
diff --git a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
index d53ac6a19a6..6a3073d4f3c 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
+++ b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
@@ -76,6 +76,8 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
storageInformation = new BehaviorSubject<StorageInformationBox[]>([]);
+ showLinkFilesAction = new BehaviorSubject<boolean>(false);
+
private readonly storageTypeMap:Record<string, string> = {};
text = {
@@ -126,6 +128,7 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
}
this.storageInformation.next(this.instantiateStorageInformation(fileLinks));
+ this.showLinkFilesAction.next(!this.disabled && fileLinks.length > 0);
});
this.currentUserService
diff --git a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html
index f9b1fce3a4f..381255275b4 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html
+++ b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list.html
@@ -25,7 +25,7 @@
</ul>
<p
- *ngIf="!disabled"
+ *ngIf="showLinkFilesAction | async"
class="spot-body-small"
>
<a