mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-10777] Move services from Core in Content the right place (#8242)
Clean core services and directive
This commit is contained in:
@@ -16,9 +16,8 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { NodesApiService } from '@alfresco/adf-core';
|
||||
import { PresetConfig, NodesApiService } from '@alfresco/adf-content-services';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { PresetConfig } from '@alfresco/adf-content-services';
|
||||
|
||||
/* eslint-disable @angular-eslint/component-selector */
|
||||
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
NodesApiService,
|
||||
setupTestBed
|
||||
} from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -25,7 +24,7 @@ import { PropertiesViewerWrapperComponent } from './properties-viewer-wrapper.co
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../../testing/process-service-cloud.testing.module';
|
||||
import { of } from 'rxjs';
|
||||
import { fakeNodeWithProperties } from '../../../../mocks/attach-file-cloud-widget.mock';
|
||||
import { BasicPropertiesService } from '@alfresco/adf-content-services';
|
||||
import { NodesApiService, BasicPropertiesService } from '@alfresco/adf-content-services';
|
||||
|
||||
describe('PropertiesViewerWidgetComponent', () => {
|
||||
let component: PropertiesViewerWrapperComponent;
|
||||
|
@@ -19,7 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
FormFieldModel,
|
||||
FormModel,
|
||||
NodesApiService,
|
||||
setupTestBed
|
||||
} from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -27,7 +26,7 @@ import { PropertiesViewerWidgetComponent } from './properties-viewer.widget';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module';
|
||||
import { fakeNodeWithProperties } from '../../../mocks/attach-file-cloud-widget.mock';
|
||||
import { PropertiesViewerWrapperComponent } from './properties-viewer-wrapper/properties-viewer-wrapper.component';
|
||||
import { BasicPropertiesService } from '@alfresco/adf-content-services';
|
||||
import { NodesApiService, BasicPropertiesService } from '@alfresco/adf-content-services';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
describe('PropertiesViewerWidgetComponent', () => {
|
||||
|
@@ -21,9 +21,9 @@ import { catchError, map } from 'rxjs/operators';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
LogService,
|
||||
ContentService,
|
||||
DownloadService
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentService, NodesApiService } from '@alfresco/adf-content-services';
|
||||
import { AuthenticationApi, Node, UploadApi } from '@alfresco/js-api';
|
||||
|
||||
@Injectable({
|
||||
@@ -46,7 +46,8 @@ export class ProcessCloudContentService {
|
||||
constructor(
|
||||
private apiService: AlfrescoApiService,
|
||||
private logService: LogService,
|
||||
public contentService: ContentService,
|
||||
private nodesApiService: NodesApiService,
|
||||
private contentService: ContentService,
|
||||
private downloadService: DownloadService
|
||||
) {
|
||||
}
|
||||
@@ -57,7 +58,7 @@ export class ProcessCloudContentService {
|
||||
): Observable<Node> {
|
||||
|
||||
return from(
|
||||
this.uploadApi.uploadFile(file, '', nodeId, '', { overwrite: true })
|
||||
this.uploadApi.uploadFile(file, '', nodeId, '', {overwrite: true})
|
||||
).pipe(
|
||||
map((res: any) => ({
|
||||
...res.entry,
|
||||
@@ -68,11 +69,11 @@ export class ProcessCloudContentService {
|
||||
}
|
||||
|
||||
getRawContentNode(nodeId: string): Observable<Blob> {
|
||||
return this.contentService.getNodeContent(nodeId);
|
||||
return this.nodesApiService.getNodeContent(nodeId);
|
||||
}
|
||||
|
||||
downloadNodeContent(blob: Blob, fileName: string): void {
|
||||
this.contentService.downloadBlob(blob, fileName);
|
||||
this.downloadService.downloadBlob(blob, fileName);
|
||||
}
|
||||
|
||||
async downloadFile(nodeId: string) {
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Component, SimpleChange, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AppConfigService, setupTestBed, DataRowEvent, ObjectDataRow, EcmUserModel } from '@alfresco/adf-core';
|
||||
import { AppConfigService, setupTestBed, DataRowEvent, ObjectDataRow, User } from '@alfresco/adf-core';
|
||||
import { ServiceTaskListCloudComponent } from './service-task-list-cloud.component';
|
||||
import { fakeServiceTask, fakeCustomSchema } from '../mock/fake-task-response.mock';
|
||||
import { of } from 'rxjs';
|
||||
@@ -41,7 +41,7 @@ class CustomTaskListComponent {
|
||||
@ViewChild(ServiceTaskListCloudComponent)
|
||||
taskList: ServiceTaskListCloudComponent;
|
||||
|
||||
getFullName(person: EcmUserModel): string {
|
||||
getFullName(person: User): string {
|
||||
return `${person.firstName} ${person.lastName}`;
|
||||
}
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Component, SimpleChange, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, fakeAsync } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AppConfigService, setupTestBed, DataRowEvent, ObjectDataRow, EcmUserModel, DataColumn, ColumnsSelectorComponent } from '@alfresco/adf-core';
|
||||
import { AppConfigService, setupTestBed, DataRowEvent, ObjectDataRow, User, DataColumn, ColumnsSelectorComponent } from '@alfresco/adf-core';
|
||||
import { TaskListCloudService } from '../services/task-list-cloud.service';
|
||||
import { TaskListCloudComponent } from './task-list-cloud.component';
|
||||
import { fakeGlobalTasks, fakeCustomSchema, fakeGlobalTask } from '../mock/fake-task-response.mock';
|
||||
@@ -48,7 +48,7 @@ class CustomTaskListComponent {
|
||||
@ViewChild(TaskListCloudComponent)
|
||||
taskList: TaskListCloudComponent;
|
||||
|
||||
getFullName(person: EcmUserModel): string {
|
||||
getFullName(person: User): string {
|
||||
return `${person.firstName} ${person.lastName}`;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user