mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
chore: eslint fixes for @typescript-eslint/no-explicit-any (#11672)
This commit is contained in:
@@ -18,10 +18,16 @@
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { from, Observable, throwError, Subject } from 'rxjs';
|
||||
import { catchError, map, switchMap, filter, take } from 'rxjs/operators';
|
||||
import { RepositoryInfo, SystemPropertiesRepresentation, DiscoveryApi, AboutApi, SystemPropertiesApi } from '@alfresco/js-api';
|
||||
|
||||
import {
|
||||
RepositoryInfo,
|
||||
SystemPropertiesRepresentation,
|
||||
DiscoveryApi,
|
||||
AboutApi,
|
||||
SystemPropertiesApi,
|
||||
BpmProductVersionModel
|
||||
} from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { BpmProductVersionModel, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { AuthenticationService } from '@alfresco/adf-core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -66,24 +72,21 @@ export class DiscoveryApiService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 8.3.0 this method is no longer used, and will be removed in the next major release.
|
||||
* Gets product information for Process Services.
|
||||
*
|
||||
* @returns ProductVersionModel containing product details
|
||||
*/
|
||||
getBpmProductInfo(): Observable<BpmProductVersionModel> {
|
||||
const aboutApi = new AboutApi(this.alfrescoApiService.getInstance());
|
||||
|
||||
return from(aboutApi.getAppVersion()).pipe(
|
||||
map((res) => new BpmProductVersionModel(res)),
|
||||
catchError((err) => throwError(err))
|
||||
);
|
||||
return from(aboutApi.getAppVersion());
|
||||
}
|
||||
|
||||
getBPMSystemProperties(): Observable<SystemPropertiesRepresentation> {
|
||||
const systemPropertiesApi = new SystemPropertiesApi(this.alfrescoApiService.getInstance());
|
||||
|
||||
return from(systemPropertiesApi.getProperties()).pipe(
|
||||
map((res: any) => {
|
||||
map((res) => {
|
||||
if ('string' === typeof res) {
|
||||
throw new Error('Not valid response');
|
||||
}
|
||||
|
||||
@@ -207,7 +207,6 @@ describe('BaseQueryBuilderService', () => {
|
||||
expect(service.getUserFacetBuckets('field1').length).toBe(0);
|
||||
expect(service.getUserFacetBuckets('field2').length).toBe(0);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('buildQuery', () => {
|
||||
@@ -332,12 +331,12 @@ describe('BaseQueryBuilderService', () => {
|
||||
|
||||
expect(errorSpy).toHaveBeenCalledWith(mockError);
|
||||
expect(executedSpy).toHaveBeenCalledWith(
|
||||
jasmine.objectContaining({
|
||||
list: jasmine.objectContaining({
|
||||
pagination: { totalItems: 0 },
|
||||
entries: []
|
||||
})
|
||||
})
|
||||
jasmine.objectContaining({
|
||||
list: jasmine.objectContaining({
|
||||
pagination: { totalItems: 0 },
|
||||
entries: []
|
||||
})
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -423,9 +422,7 @@ describe('BaseQueryBuilderService', () => {
|
||||
spyOn(router, 'navigate').and.returnValue(Promise.resolve(true));
|
||||
spyOn(service.searchApi, 'search').and.returnValue(Promise.resolve({ list: { entries: [] } } as ResultSetPaging));
|
||||
|
||||
let callCount = 0;
|
||||
service.searchForms.pipe(skip(1)).subscribe((forms) => {
|
||||
callCount++;
|
||||
expect(forms[1].selected).toBe(true);
|
||||
expect(forms[0].selected).toBe(false);
|
||||
done();
|
||||
@@ -446,7 +443,7 @@ describe('BaseQueryBuilderService', () => {
|
||||
it('should call execute when updating configuration', async () => {
|
||||
spyOn(router, 'navigate').and.returnValue(Promise.resolve(true));
|
||||
spyOn(service.searchApi, 'search').and.returnValue(Promise.resolve({ list: { entries: [] } } as ResultSetPaging));
|
||||
spyOn(service, 'execute')
|
||||
spyOn(service, 'execute');
|
||||
service.userQuery = 'test';
|
||||
|
||||
service.updateSelectedConfiguration('config-2');
|
||||
|
||||
Reference in New Issue
Block a user