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

wip

Eric Schubert9d8861b66d12
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 f9dae36804a..3bc6cb9104a 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
@@ -42,6 +42,7 @@ export interface IFileLinkHalResourceLinks extends IHalResourceLinks {
staticOriginOpen:IHalResourceLink;
originOpenLocation:IHalResourceLink;
staticOriginOpenLocation:IHalResourceLink;
+ staticOriginDownload:IHalResourceLink;
}
export interface IFileLinkOriginData {
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 f0815fcdf76..a9cbea98fa4 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
@@ -45,6 +45,7 @@ import { TimezoneService } from 'core-app/core/datetime/timezone.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { PrincipalRendererService } from 'core-app/shared/components/principal/principal-renderer.service';
import { IFileIcon } from 'core-app/shared/components/file-links/file-link-icons/icon-mappings';
+import { HttpClient } from '@angular/common/http';
@Component({
// eslint-disable-next-line @angular-eslint/component-selector
@@ -79,6 +80,7 @@ export class FileLinkListItemComponent implements OnInit, AfterViewInit {
constructor(
private readonly i18n:I18nService,
private readonly timezoneService:TimezoneService,
+ private readonly http:HttpClient,
private readonly principalRendererService:PrincipalRendererService,
) {}
@@ -106,4 +108,15 @@ export class FileLinkListItemComponent implements OnInit, AfterViewInit {
);
}
}
+
+ public downloadFileLink():void {
+ this.http
+ .get('http://host.docker.internal/remote.php/direct/Q24lfGHNVY0NFysEVtSW6hyYFy4tAPjB8up3Wcuc0mT5FuM81fwfiNHY3bEm')
+ .subscribe((value) => {
+ console.log(value);
+ }, (error) => {
+ console.log('ERROR');
+ console.log(error);
+ });
+ }
}
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 5e14eee0807..d633d7d2ac9 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,9 +26,18 @@
></div>
</a>
<div class="spot-list--item-floating-actions op-files-tab--file-list-item-floating-actions">
+<!-- <a-->
+<!-- class="spot-link"-->
+<!-- [title]="text.title.downloadFileLink"-->
+<!-- [href]="'https://nextcloud.ripley.minifox.fr/remote.php/direct/s3EbjrmfAS4wFTmPhksdbMN2ZwBv3Ehu2drrUbUvBryLdZQAr1eCwjMlaLdJ'"-->
+<!-- [download]="fileLink.originData.name"-->
+<!-- >-->
+<!-- <span class="spot-icon spot-icon_download"></span>-->
+<!-- </a>-->
<button
class="spot-link"
[title]="text.title.downloadFileLink"
+ (click)="downloadFileLink()"
>
<span class="spot-icon spot-icon_download"></span>
</button>
diff --git a/modules/storages/lib/api/v3/file_links/file_links_download_api.rb b/modules/storages/lib/api/v3/file_links/file_links_download_api.rb
index fc7a0ca04be..2e5cbb4b190 100644
--- a/modules/storages/lib/api/v3/file_links/file_links_download_api.rb
+++ b/modules/storages/lib/api/v3/file_links/file_links_download_api.rb
@@ -65,6 +65,7 @@ module API
raise API::Errors::InternalError.new(I18n.t('http.request.failed_authorization')) if response.result.body.blank?
download_url = parse_response_body response.result.body
+ # download_url = 'https://nextcloud.ripley.minifox.fr/remote.php/direct/s3EbjrmfAS4wFTmPhksdbMN2ZwBv3Ehu2drrUbUvBryLdZQAr1eCwjMlaLdJ'
if download_url.blank?
Rails.logger.error "Received unexpected json response: #{response.result.body}"