mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5426] Remove compatibility layer from Lib (#7110)
* remove compatibility step 1 * remove compatibility step 2 * remove compatibility step 3 * remove compatibility step 4 * remove compatibility step 5
This commit is contained in:
@@ -19,7 +19,7 @@ import { Directive, Input, HostListener } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { DownloadZipDialogComponent } from '../dialogs/download-zip/download-zip.dialog';
|
||||
import { NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||
import { ContentApi, NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||
import { DownloadService } from '../services/download.service';
|
||||
|
||||
/**
|
||||
@@ -31,6 +31,8 @@ import { DownloadService } from '../services/download.service';
|
||||
})
|
||||
export class NodeDownloadDirective {
|
||||
|
||||
private contentApi: ContentApi;
|
||||
|
||||
/** Nodes to download. */
|
||||
@Input('adfNodeDownload')
|
||||
nodes: NodeEntry | NodeEntry[];
|
||||
@@ -48,6 +50,7 @@ export class NodeDownloadDirective {
|
||||
private apiService: AlfrescoApiService,
|
||||
private downloadService: DownloadService,
|
||||
private dialog: MatDialog) {
|
||||
this.contentApi = new ContentApi(this.apiService.getInstance());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,16 +104,15 @@ export class NodeDownloadDirective {
|
||||
|
||||
private downloadFile(node: NodeEntry) {
|
||||
if (node && node.entry) {
|
||||
const contentApi = this.apiService.getInstance().content;
|
||||
// nodeId for Shared node
|
||||
const id = (<any> node.entry).nodeId || node.entry.id;
|
||||
|
||||
let url, fileName;
|
||||
if (this.version) {
|
||||
url = contentApi.getVersionContentUrl(id, this.version.entry.id, true);
|
||||
url = this.contentApi.getVersionContentUrl(id, this.version.entry.id, true);
|
||||
fileName = this.version.entry.name;
|
||||
} else {
|
||||
url = contentApi.getContentUrl(id, true);
|
||||
url = this.contentApi.getContentUrl(id, true);
|
||||
fileName = node.entry.name;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user