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

Merge branch 'dev' into implementation/42160-add-download-file-direct-action-to-hover-menu

Eric Schubert9e7a2ea41500
diff --cc frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.component.ts
index e7455a68acc,2112ecd15d1..41fdbc36ea6
--- 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,12 -37,8 +37,13 @@@ import
Output,
ViewChild,
} from '@angular/core';
-import { HalResource } from 'core-app/features/hal/resources/hal-resource';
+
+import { I18nService } from 'core-app/core/i18n/i18n.service';
+import { TimezoneService } from 'core-app/core/datetime/timezone.service';
+import { IFileIcon } from 'core-app/shared/components/file-links/file-link-icons/icon-mappings';
import { IFileLink, IFileLinkOriginData } from 'core-app/core/state/file-links/file-link.model';
++import { fileLinkViewAllowed } from 'core-app/shared/components/file-links/file-links-constants.const';
+import { PrincipalRendererService } from 'core-app/shared/components/principal/principal-renderer.service';
import {
getIconForMimeType,
} from 'core-app/shared/components/file-links/file-link-icons/file-link-list-item-icon.factory';
@@@ -73,8 -78,10 +76,11 @@@ export class FileLinkListItemComponent
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: '',
},
+ floatingText: {
+ noViewPermission: this.i18n.t('js.label_file_link_no_permission'),
+ },
};
constructor(
@@@ -94,7 -101,7 +100,8 @@@
this.fileLinkIcon = getIconForMimeType(this.originData.mimeType);
+ this.text.title.downloadFileLink = this.i18n.t('js.label_download_file', { fileName: this.fileLink.originData.name });
+ this.showFloatingActions = this.fileLink._links.permission.href === fileLinkViewAllowed;
}
ngAfterViewInit():void {
diff --cc frontend/src/app/shared/components/file-links/file-link-list-item/file-link-list-item.html
index 54aaac30dd4,f9f2c43c63f..cbcb44a02e6
--- 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
@@@ -25,14 -25,10 +25,17 @@@
class="op-files-tab--file-list-item-avatar"
></div>
</a>
- <div class="spot-list--item-floating-actions op-files-tab--file-list-item-floating-actions">
+ <div
+ *ngIf="showFloatingActions"
+ class="spot-list--item-floating-actions op-files-tab--file-list-item-floating-actions"
+ >
+ <a
+ class="spot-link"
+ [title]="text.title.downloadFileLink"
+ [href]="fileLink._links.staticOriginDownload.href"
+ >
+ <span class="spot-icon spot-icon_download"></span>
+ </a>
<a
class="spot-link"
[title]="text.title.openFileLocation"
diff --cc frontend/src/app/shared/components/file-links/openproject-file-links.module.ts
index f619537458e,9d3339ec9fc..90f011a38e5
--- a/frontend/src/app/shared/components/file-links/openproject-file-links.module.ts
+++ b/frontend/src/app/shared/components/file-links/openproject-file-links.module.ts
@@@ -28,6 -28,6 +28,8 @@@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
++import { CookieService } from 'ngx-cookie-service';
++
import { IconModule } from 'core-app/shared/components/icon/icon.module';
import { FileLinkListComponent } from 'core-app/shared/components/file-links/file-link-list/file-link-list.component';
@@@ -50,8 -51,10 +52,9 @@@ import
],
exports: [
FileLinkListComponent,
- FileLinkListItemComponent,
+ ],
+ providers: [
+ CookieService,
],
})
--export class OpenprojectFileLinksModule {
--}
++export class OpenprojectFileLinksModule {}