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

[#42158] added hover menu and file open actions

Eric Schubert444f687f0918
diff --git a/frontend/src/app/core/state/file-links/file-link.model.ts b/frontend/src/app/core/state/file-links/file-link.model.ts
index 965c8ac8cf2..6f52448f213 100644
--- a/frontend/src/app/core/state/file-links/file-link.model.ts
+++ b/frontend/src/app/core/state/file-links/file-link.model.ts
@@ -57,5 +57,5 @@ export interface IFileLink {
id:ID;
originData:IFileLinkOriginData;
- _links?:IFileLinkHalResourceLinks;
+ _links:IFileLinkHalResourceLinks;
}
diff --git a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list-item.component.ts b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list-item.component.ts
index 32780dc2a3c..20c3ed5f3f2 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list-item.component.ts
+++ b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list-item.component.ts
@@ -67,4 +67,13 @@ export class FileLinkListItemComponent implements OnInit {
this.fileLinkIcon = getIconForMimeType(this.fileLink.originData.mimeType);
}
+
+ public openLinkedFile(openInLocation:boolean):void {
+ let link = this.fileLink._links.staticOriginOpen.href;
+ if (openInLocation) {
+ link = this.fileLink._links.staticOriginOpenLocation.href;
+ }
+
+ window.open(link);
+ }
}
diff --git a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list-item.html b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list-item.html
index 510f56a3f0d..b2fe6dcd52a 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list/file-link-list-item.html
+++ b/frontend/src/app/shared/components/file-links/file-link-list/file-link-list-item.html
@@ -8,6 +8,7 @@
<a
[textContent]="fileLink.originData.name"
+ (click)="openLinkedFile(false)"
></a>
</div>
@@ -23,3 +24,16 @@
[textContent]="fileLink.originData.lastModifiedByName"
></span>
</div>
+
+<div
+ class="op-files-tab--file-list-item--content hover-menu"
+>
+ <button
+ class="spot-link"
+ (click)="openLinkedFile(true)"
+ >
+ <span
+ class="spot-icon spot-icon_folder-open"
+ ></span>
+ </button>
+</div>
diff --git a/frontend/src/global_styles/content/work_packages/tabs/_files.sass b/frontend/src/global_styles/content/work_packages/tabs/_files.sass
index 801ef4b6f8a..6cd4ad081d0 100644
--- a/frontend/src/global_styles/content/work_packages/tabs/_files.sass
+++ b/frontend/src/global_styles/content/work_packages/tabs/_files.sass
@@ -46,9 +46,28 @@
text-align: right
font-size: 12px
+ &.hover-menu
+ display: none
+ font-size: 14px
+ padding: 0 8px
+
+ // TODO: overwrites of design system components.
+ // Can be removed once design system contains components needed here
+ .spot-link
+ color: #878787
+ outline: none
+
&--file-info-timestamp
margin-right: 8px
+ &:hover
+ .hover-menu
+ display: flex
+ justify-content: end
+
+ .file-info
+ display: none
+
&--color
&-red
color: #B93A33