mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
[ACA-2284] Shared Link - Error when trying to download a shared file (#1026)
* shared link content download action * use same action and effect * call appropriate api baes on location * remove unused property
This commit is contained in:
committed by
Suzana Dirla
parent
8819f97de1
commit
ba1c3c9e3b
@@ -214,6 +214,10 @@ export class ContentApiService {
|
|||||||
return from(this.api.sharedLinksApi.findSharedLinks(opts));
|
return from(this.api.sharedLinksApi.findSharedLinks(opts));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getSharedLinkContent(sharedId: string, attachment?: boolean): string {
|
||||||
|
return this.api.contentApi.getSharedLinkContentUrl(sharedId, attachment);
|
||||||
|
}
|
||||||
|
|
||||||
search(request: SearchRequest): Observable<ResultSetPaging> {
|
search(request: SearchRequest): Observable<ResultSetPaging> {
|
||||||
return from(this.api.searchApi.search(request));
|
return from(this.api.searchApi.search(request));
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,7 @@ export class DownloadEffects {
|
|||||||
const { id, nodeId, name, isFile, isFolder } = <any>node.entry;
|
const { id, nodeId, name, isFile, isFolder } = <any>node.entry;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: nodeId || id,
|
id: this.isSharedLinkPreview ? id : nodeId || id,
|
||||||
name,
|
name,
|
||||||
isFile,
|
isFile,
|
||||||
isFolder
|
isFolder
|
||||||
@@ -98,9 +98,16 @@ export class DownloadEffects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private downloadFile(node: NodeInfo) {
|
private downloadFile(node: NodeInfo) {
|
||||||
if (node) {
|
if (node && !this.isSharedLinkPreview) {
|
||||||
this.download(this.contentApi.getContentUrl(node.id, true), node.name);
|
this.download(this.contentApi.getContentUrl(node.id, true), node.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node && this.isSharedLinkPreview) {
|
||||||
|
this.download(
|
||||||
|
this.contentApi.getSharedLinkContent(node.id, false),
|
||||||
|
node.name
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private downloadZip(nodes: Array<NodeInfo>) {
|
private downloadZip(nodes: Array<NodeInfo>) {
|
||||||
@@ -130,4 +137,8 @@ export class DownloadEffects {
|
|||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private get isSharedLinkPreview() {
|
||||||
|
return location.href.includes('/preview/s/');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user