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

[#43696] add different tooltip for directories

Eric Schuberte5bbfa7c02bf
diff --git a/frontend/src/app/shared/components/file-links/storage-file-list-item/storage-file-list-item.component.ts b/frontend/src/app/shared/components/file-links/storage-file-list-item/storage-file-list-item.component.ts
index b14c4e5b4ba..916393c9e6a 100644
--- a/frontend/src/app/shared/components/file-links/storage-file-list-item/storage-file-list-item.component.ts
+++ b/frontend/src/app/shared/components/file-links/storage-file-list-item/storage-file-list-item.component.ts
@@ -62,7 +62,8 @@ export class StorageFileListItemComponent implements OnInit {
showDetails:boolean;
text = {
- tooltip: this.i18n.t('js.storages.file_links.already_linked'),
+ alreadyLinkedFile: this.i18n.t('js.storages.file_links.already_linked_file'),
+ alreadyLinkedDirectory: this.i18n.t('js.storages.file_links.already_linked_directory'),
};
get principal():PrincipalLike {
@@ -77,6 +78,10 @@ export class StorageFileListItemComponent implements OnInit {
};
}
+ get tooltip():string {
+ return isDirectory(this.fileListItemContent.mimeType) ? this.text.alreadyLinkedDirectory : this.text.alreadyLinkedFile;
+ }
+
get getTooltipAlignment():SpotDropAlignmentOption {
if (this.fileListItemContent.isFirst) {
return SpotDropAlignmentOption.BottomLeft;
diff --git a/frontend/src/app/shared/components/file-links/storage-file-list-item/storage-file-list-item.html b/frontend/src/app/shared/components/file-links/storage-file-list-item/storage-file-list-item.html
index a49ee9cb2af..05234b94fe5 100644
--- a/frontend/src/app/shared/components/file-links/storage-file-list-item/storage-file-list-item.html
+++ b/frontend/src/app/shared/components/file-links/storage-file-list-item/storage-file-list-item.html
@@ -5,7 +5,7 @@
<p
slot="body"
class="spot-body-small"
- >{{text.tooltip}}</p>
+ >{{tooltip}}</p>
<label
slot="trigger"
diff --git a/modules/storages/config/locales/js-en.yml b/modules/storages/config/locales/js-en.yml
index 071ce44d6c3..ce94fe7ce59 100644
--- a/modules/storages/config/locales/js-en.yml
+++ b/modules/storages/config/locales/js-en.yml
@@ -37,4 +37,5 @@ en:
selection_none: "Select files to link"
selection_any: "Link %{number} files"
not_allowed_tooltip: "Please log in to Nextcloud to access this file"
- already_linked: "This file is already linked to this work package."
+ already_linked_file: "This file is already linked to this work package."
+ already_linked_directory: "This directory is already linked to this work package."