mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[AAE-10777] Move services from Core in Content the right place (#8242)
Clean core services and directive
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContentService, LogService, ContentLinkModel, FormService } from '@alfresco/adf-core';
|
||||
import { UrlService, LogService, ContentLinkModel, FormService, DownloadService } from '@alfresco/adf-core';
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { ProcessContentService } from '../../services/process-content.service';
|
||||
@@ -56,7 +56,8 @@ export class ContentWidgetComponent implements OnChanges {
|
||||
|
||||
constructor(protected formService: FormService,
|
||||
private logService: LogService,
|
||||
private contentService: ContentService,
|
||||
private downloadService: DownloadService,
|
||||
private urlService: UrlService,
|
||||
private processContentService: ProcessContentService) {
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ export class ContentWidgetComponent implements OnChanges {
|
||||
if (observable) {
|
||||
observable.subscribe(
|
||||
(response: Blob) => {
|
||||
this.content.thumbnailUrl = this.contentService.createTrustedUrl(response);
|
||||
this.content.thumbnailUrl = this.urlService.createTrustedUrl(response);
|
||||
this.thumbnailLoaded.emit(this.content.thumbnailUrl);
|
||||
},
|
||||
(error) => {
|
||||
@@ -130,7 +131,7 @@ export class ContentWidgetComponent implements OnChanges {
|
||||
*/
|
||||
download(content: ContentLinkModel): void {
|
||||
this.processContentService.getFileRawContent(content.id).subscribe(
|
||||
(blob: Blob) => this.contentService.downloadBlob(blob, content.name),
|
||||
(blob: Blob) => this.downloadService.downloadBlob(blob, content.name),
|
||||
(error) => {
|
||||
this.error.emit(error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user