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

[#42160] added new floating action for download

Eric Schubert3b1b3c68b3ce
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index a405a6f0001..06791b58710 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -379,6 +379,7 @@ en:
label_description: "Description"
label_details: "Details"
label_display: "Display"
+ label_download_file: "Download %{fileName}"
label_cancel_comment: "Cancel comment"
label_closed_work_packages: "closed"
label_collapse: "Collapse"
diff --git a/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts b/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts
index 445ce915ed5..f0815fcdf76 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts
+++ b/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts
@@ -37,7 +37,6 @@ import {
Output,
ViewChild,
} from '@angular/core';
-import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { IFileLink, IFileLinkOriginData } from 'core-app/core/state/file-links/file-link.model';
import {
getIconForMimeType,
@@ -54,8 +53,6 @@ import { IFileIcon } from 'core-app/shared/components/file-links/file-link-icons
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FileLinkListItemComponent implements OnInit, AfterViewInit {
- @Input() public resource:HalResource;
-
@Input() public fileLink:IFileLink;
@Input() public index:number;
@@ -75,6 +72,7 @@ export class FileLinkListItemComponent implements OnInit, AfterViewInit {
openFile: this.i18n.t('js.label_open_file_link'),
openFileLocation: this.i18n.t('js.label_open_file_link_location'),
removeFileLink: this.i18n.t('js.label_remove_file_link'),
+ downloadFileLink: '',
},
};
@@ -94,6 +92,8 @@ export class FileLinkListItemComponent implements OnInit, AfterViewInit {
}
this.fileLinkIcon = getIconForMimeType(this.originData.mimeType);
+
+ this.text.title.downloadFileLink = this.i18n.t('js.label_download_file', { fileName: this.fileLink.originData.name });
}
ngAfterViewInit():void {
diff --git a/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html b/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html
index 2c76141a7b3..5e14eee0807 100644
--- a/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html
+++ b/frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html
@@ -26,6 +26,12 @@
></div>
</a>
<div class="spot-list--item-floating-actions op-files-tab--file-list-item-floating-actions">
+ <button
+ class="spot-link"
+ [title]="text.title.downloadFileLink"
+ >
+ <span class="spot-icon spot-icon_download"></span>
+ </button>
<a
class="spot-link"
[title]="text.title.openFileLocation"