mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[AAE-12501] Replace oauth2Auth with alfrescoApi
This commit is contained in:
@@ -31,9 +31,7 @@ describe('AppsProcessCloudService', () => {
|
|||||||
let apiService: AlfrescoApiService;
|
let apiService: AlfrescoApiService;
|
||||||
|
|
||||||
const apiMock: any = {
|
const apiMock: any = {
|
||||||
oauth2Auth: {
|
callCustomApiWithoutAuth: () => Promise.resolve({list : { entries: [ {entry: fakeApplicationInstance[0]}, {entry: fakeApplicationInstance[1]}] }}),
|
||||||
callCustomApi: () => Promise.resolve({list : { entries: [ {entry: fakeApplicationInstance[0]}, {entry: fakeApplicationInstance[1]}] }})
|
|
||||||
},
|
|
||||||
isEcmLoggedIn: () => false,
|
isEcmLoggedIn: () => false,
|
||||||
reply: jasmine.createSpy('reply')
|
reply: jasmine.createSpy('reply')
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Observable, from, throwError, of } from 'rxjs';
|
import { Observable, from, throwError, of } from 'rxjs';
|
||||||
import { map, catchError } from 'rxjs/operators';
|
import { map, catchError } from 'rxjs/operators';
|
||||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
||||||
import { Oauth2Auth } from '@alfresco/js-api';
|
import { AlfrescoApi } from '@alfresco/js-api';
|
||||||
import { ApplicationInstanceModel } from '../models/application-instance.model';
|
import { ApplicationInstanceModel } from '../models/application-instance.model';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@@ -62,7 +62,7 @@ export class AppsProcessCloudService {
|
|||||||
if (status === '') {
|
if (status === '') {
|
||||||
return of([]);
|
return of([]);
|
||||||
}
|
}
|
||||||
const api: Oauth2Auth = this.apiService.getInstance().oauth2Auth;
|
const api: AlfrescoApi = this.apiService.getInstance();
|
||||||
const path = this.getApplicationUrl();
|
const path = this.getApplicationUrl();
|
||||||
const pathParams = {};
|
const pathParams = {};
|
||||||
const queryParams = { status, roles : role, sort: 'name' };
|
const queryParams = { status, roles : role, sort: 'name' };
|
||||||
@@ -72,7 +72,7 @@ export class AppsProcessCloudService {
|
|||||||
const contentTypes = ['application/json'];
|
const contentTypes = ['application/json'];
|
||||||
const accepts = ['application/json'];
|
const accepts = ['application/json'];
|
||||||
|
|
||||||
return from(api.callCustomApi(path, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
|
return from(api.callCustomApiWithoutAuth(path, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||||
contentTypes, accepts))
|
contentTypes, accepts))
|
||||||
.pipe(
|
.pipe(
|
||||||
map((applications: any) => applications.list.entries.map((application) => application.entry)),
|
map((applications: any) => applications.list.entries.map((application) => application.entry)),
|
||||||
|
|||||||
Reference in New Issue
Block a user