mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix the private access to the service variables (#8202)
* fix the private access to the service variables * fix issues with unit tests
This commit is contained in:
@@ -26,7 +26,7 @@ import { AspectEntry, AspectPaging, AspectsApi } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class AspectListService {
|
export class AspectListService {
|
||||||
|
|
||||||
_aspectsApi: AspectsApi;
|
private _aspectsApi: AspectsApi;
|
||||||
get aspectsApi(): AspectsApi {
|
get aspectsApi(): AspectsApi {
|
||||||
this._aspectsApi = this._aspectsApi ?? new AspectsApi(this.alfrescoApiService.getInstance());
|
this._aspectsApi = this._aspectsApi ?? new AspectsApi(this.alfrescoApiService.getInstance());
|
||||||
return this._aspectsApi;
|
return this._aspectsApi;
|
||||||
|
@@ -56,7 +56,7 @@ export class DialogAspectListService {
|
|||||||
width,
|
width,
|
||||||
role: 'dialog',
|
role: 'dialog',
|
||||||
disableClose: true
|
disableClose: true
|
||||||
}).afterClosed().subscribe(() => DialogAspectListService.focusOnClose(selectorAutoFocusedOnClose));
|
}).afterClosed().subscribe(() => this.focusOnClose(selectorAutoFocusedOnClose));
|
||||||
this.overlayContainer.getContainerElement().setAttribute('role', 'main');
|
this.overlayContainer.getContainerElement().setAttribute('role', 'main');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ export class DialogAspectListService {
|
|||||||
this.overlayContainer.getContainerElement().setAttribute('role', 'region');
|
this.overlayContainer.getContainerElement().setAttribute('role', 'region');
|
||||||
}
|
}
|
||||||
|
|
||||||
private static focusOnClose(selectorAutoFocusedOnClose: string): void {
|
private focusOnClose(selectorAutoFocusedOnClose: string): void {
|
||||||
if (selectorAutoFocusedOnClose) {
|
if (selectorAutoFocusedOnClose) {
|
||||||
document.querySelector<HTMLElement>(selectorAutoFocusedOnClose).focus();
|
document.querySelector<HTMLElement>(selectorAutoFocusedOnClose).focus();
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ import { catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class AuditService {
|
export class AuditService {
|
||||||
|
|
||||||
_auditApi: AuditApi;
|
private _auditApi: AuditApi;
|
||||||
get auditApi(): AuditApi {
|
get auditApi(): AuditApi {
|
||||||
this._auditApi = this._auditApi ?? new AuditApi(this.apiService.getInstance());
|
this._auditApi = this._auditApi ?? new AuditApi(this.apiService.getInstance());
|
||||||
return this._auditApi;
|
return this._auditApi;
|
||||||
|
@@ -26,7 +26,7 @@ import { catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class FavoritesApiService {
|
export class FavoritesApiService {
|
||||||
|
|
||||||
_favoritesApi: FavoritesApi;
|
private _favoritesApi: FavoritesApi;
|
||||||
get favoritesApi(): FavoritesApi {
|
get favoritesApi(): FavoritesApi {
|
||||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.apiService.getInstance());
|
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.apiService.getInstance());
|
||||||
return this._favoritesApi;
|
return this._favoritesApi;
|
||||||
|
@@ -27,7 +27,7 @@ import { ClassesApi } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class PropertyDescriptorsService {
|
export class PropertyDescriptorsService {
|
||||||
|
|
||||||
private _classesApi;
|
private _classesApi: ClassesApi;
|
||||||
get classesApi(): ClassesApi {
|
get classesApi(): ClassesApi {
|
||||||
this._classesApi = this._classesApi ?? new ClassesApi(this.alfrescoApiService.getInstance());
|
this._classesApi = this._classesApi ?? new ClassesApi(this.alfrescoApiService.getInstance());
|
||||||
return this._classesApi;
|
return this._classesApi;
|
||||||
|
@@ -25,7 +25,7 @@ import { map } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class ContentTypeService {
|
export class ContentTypeService {
|
||||||
|
|
||||||
_typesApi: TypesApi;
|
private _typesApi: TypesApi;
|
||||||
get typesApi(): TypesApi {
|
get typesApi(): TypesApi {
|
||||||
this._typesApi = this._typesApi ?? new TypesApi(this.alfrescoApiService.getInstance());
|
this._typesApi = this._typesApi ?? new TypesApi(this.alfrescoApiService.getInstance());
|
||||||
return this._typesApi;
|
return this._typesApi;
|
||||||
|
@@ -24,7 +24,7 @@ import { AlfrescoApiService } from '@alfresco/adf-core';
|
|||||||
})
|
})
|
||||||
export class GroupService {
|
export class GroupService {
|
||||||
|
|
||||||
_groupsApi: GroupsApi;
|
private _groupsApi: GroupsApi;
|
||||||
get groupsApi(): GroupsApi {
|
get groupsApi(): GroupsApi {
|
||||||
this._groupsApi = this._groupsApi ?? new GroupsApi(this.alfrescoApiService.getInstance());
|
this._groupsApi = this._groupsApi ?? new GroupsApi(this.alfrescoApiService.getInstance());
|
||||||
return this._groupsApi;
|
return this._groupsApi;
|
||||||
|
@@ -30,7 +30,7 @@ import { OverlayContainer } from '@angular/cdk/overlay';
|
|||||||
})
|
})
|
||||||
export class NewVersionUploaderService {
|
export class NewVersionUploaderService {
|
||||||
|
|
||||||
_versionsApi: VersionsApi;
|
private _versionsApi: VersionsApi;
|
||||||
get versionsApi(): VersionsApi {
|
get versionsApi(): VersionsApi {
|
||||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
||||||
return this._versionsApi;
|
return this._versionsApi;
|
||||||
|
@@ -42,7 +42,7 @@ import { RoleModel } from '../models/role.model';
|
|||||||
})
|
})
|
||||||
export class NodePermissionService {
|
export class NodePermissionService {
|
||||||
|
|
||||||
_groupsApi: GroupsApi;
|
private _groupsApi: GroupsApi;
|
||||||
get groupsApi(): GroupsApi {
|
get groupsApi(): GroupsApi {
|
||||||
this._groupsApi = this._groupsApi ?? new GroupsApi(this.apiService.getInstance());
|
this._groupsApi = this._groupsApi ?? new GroupsApi(this.apiService.getInstance());
|
||||||
return this._groupsApi;
|
return this._groupsApi;
|
||||||
|
@@ -42,7 +42,7 @@ import { SearchForm } from '../models/search-form.interface';
|
|||||||
})
|
})
|
||||||
export abstract class BaseQueryBuilderService {
|
export abstract class BaseQueryBuilderService {
|
||||||
|
|
||||||
_searchApi: SearchApi;
|
private _searchApi: SearchApi;
|
||||||
get searchApi(): SearchApi {
|
get searchApi(): SearchApi {
|
||||||
this._searchApi = this._searchApi ?? new SearchApi(this.alfrescoApiService.getInstance());
|
this._searchApi = this._searchApi ?? new SearchApi(this.alfrescoApiService.getInstance());
|
||||||
return this._searchApi;
|
return this._searchApi;
|
||||||
|
@@ -24,9 +24,6 @@ import { SearchConfigurationInterface } from '@alfresco/adf-core';
|
|||||||
})
|
})
|
||||||
export class SearchConfigurationService implements SearchConfigurationInterface {
|
export class SearchConfigurationService implements SearchConfigurationInterface {
|
||||||
|
|
||||||
constructor() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a QueryBody object with custom search parameters.
|
* Generates a QueryBody object with custom search parameters.
|
||||||
*
|
*
|
||||||
|
@@ -27,7 +27,7 @@ import { RatingServiceInterface } from './rating.service.interface';
|
|||||||
})
|
})
|
||||||
export class RatingService implements RatingServiceInterface {
|
export class RatingService implements RatingServiceInterface {
|
||||||
|
|
||||||
_ratingsApi: RatingsApi;
|
private _ratingsApi: RatingsApi;
|
||||||
get ratingsApi(): RatingsApi {
|
get ratingsApi(): RatingsApi {
|
||||||
this._ratingsApi = this._ratingsApi ?? new RatingsApi(this.apiService.getInstance());
|
this._ratingsApi = this._ratingsApi ?? new RatingsApi(this.apiService.getInstance());
|
||||||
return this._ratingsApi;
|
return this._ratingsApi;
|
||||||
|
@@ -25,8 +25,6 @@ import {
|
|||||||
RequestQuery,
|
RequestQuery,
|
||||||
RequestSortDefinitionInner,
|
RequestSortDefinitionInner,
|
||||||
ResultSetPaging,
|
ResultSetPaging,
|
||||||
SearchApi,
|
|
||||||
SearchRequest,
|
|
||||||
TagBody,
|
TagBody,
|
||||||
TagEntry
|
TagEntry
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
@@ -34,6 +32,8 @@ import {
|
|||||||
describe('TagService', () => {
|
describe('TagService', () => {
|
||||||
|
|
||||||
let service: TagService;
|
let service: TagService;
|
||||||
|
let logService: LogService;
|
||||||
|
let userPreferencesService: UserPreferencesService;
|
||||||
|
|
||||||
setupTestBed({
|
setupTestBed({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -44,10 +44,13 @@ describe('TagService', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
service = TestBed.inject(TagService);
|
service = TestBed.inject(TagService);
|
||||||
spyOn(service['tagsApi'], 'deleteTagFromNode').and.returnValue(
|
logService = TestBed.inject(LogService);
|
||||||
|
userPreferencesService = TestBed.inject(UserPreferencesService);
|
||||||
|
|
||||||
|
spyOn(service.tagsApi, 'deleteTagFromNode').and.returnValue(
|
||||||
Promise.resolve({})
|
Promise.resolve({})
|
||||||
);
|
);
|
||||||
spyOn(service['tagsApi'], 'createTagForNode').and.returnValue(
|
spyOn(service.tagsApi, 'createTagForNode').and.returnValue(
|
||||||
Promise.resolve(new TagEntry({}))
|
Promise.resolve(new TagEntry({}))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -82,11 +85,11 @@ describe('TagService', () => {
|
|||||||
describe('createTags', () => {
|
describe('createTags', () => {
|
||||||
it('should call createTags on tagsApi', () => {
|
it('should call createTags on tagsApi', () => {
|
||||||
spyOn(service.tagsApi, 'createTags').and.returnValue(Promise.resolve([]));
|
spyOn(service.tagsApi, 'createTags').and.returnValue(Promise.resolve([]));
|
||||||
const tag1: TagBody = new TagBody();
|
const tag1 = new TagBody();
|
||||||
tag1.tag = 'Some tag 1';
|
tag1.tag = 'Some tag 1';
|
||||||
const tag2: TagBody = new TagBody();
|
const tag2 = new TagBody();
|
||||||
tag2.tag = 'Some tag 2';
|
tag2.tag = 'Some tag 2';
|
||||||
const tags: TagBody[] = [tag1, tag2];
|
const tags = [tag1, tag2];
|
||||||
service.createTags(tags);
|
service.createTags(tags);
|
||||||
expect(service.tagsApi.createTags).toHaveBeenCalledWith(tags);
|
expect(service.tagsApi.createTags).toHaveBeenCalledWith(tags);
|
||||||
});
|
});
|
||||||
@@ -106,9 +109,8 @@ describe('TagService', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should call error on logService when error occurs during tags creation', fakeAsync(() => {
|
it('should call error on logService when error occurs during tags creation', fakeAsync(() => {
|
||||||
const logService: LogService = TestBed.inject(LogService);
|
|
||||||
spyOn(logService, 'error');
|
spyOn(logService, 'error');
|
||||||
const error: string = 'Some error';
|
const error = 'Some error';
|
||||||
spyOn(service.tagsApi, 'createTags').and.returnValue(Promise.reject(error));
|
spyOn(service.tagsApi, 'createTags').and.returnValue(Promise.reject(error));
|
||||||
service.createTags([]);
|
service.createTags([]);
|
||||||
tick();
|
tick();
|
||||||
@@ -124,15 +126,16 @@ describe('TagService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should call search on searchApi with correct parameters', () => {
|
it('should call search on searchApi with correct parameters', () => {
|
||||||
const searchSpy: jasmine.Spy<(queryBody: SearchRequest) => Promise<ResultSetPaging>> =
|
const searchSpy = spyOn(service.searchApi, 'search').and.returnValue(Promise.resolve(result));
|
||||||
spyOn(SearchApi.prototype, 'search').and.returnValue(Promise.resolve(result));
|
const name = 'test';
|
||||||
const name: string = 'test';
|
const maxItems = 25;
|
||||||
const sortingByName: RequestSortDefinitionInner = new RequestSortDefinitionInner();
|
spyOnProperty(userPreferencesService, 'paginationSize').and.returnValue(maxItems);
|
||||||
const maxItems: number = 25;
|
|
||||||
spyOnProperty(TestBed.inject(UserPreferencesService), 'paginationSize').and.returnValue(maxItems);
|
const sortingByName = new RequestSortDefinitionInner();
|
||||||
sortingByName.field = 'cm:name';
|
sortingByName.field = 'cm:name';
|
||||||
sortingByName.ascending = true;
|
sortingByName.ascending = true;
|
||||||
sortingByName.type = RequestSortDefinitionInner.TypeEnum.FIELD;
|
sortingByName.type = RequestSortDefinitionInner.TypeEnum.FIELD;
|
||||||
|
|
||||||
service.searchTags(name);
|
service.searchTags(name);
|
||||||
expect(searchSpy).toHaveBeenCalledWith({
|
expect(searchSpy).toHaveBeenCalledWith({
|
||||||
query: {
|
query: {
|
||||||
@@ -148,7 +151,8 @@ describe('TagService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return observable which emits paging object for tags', (done) => {
|
it('should return observable which emits paging object for tags', (done) => {
|
||||||
spyOn(SearchApi.prototype, 'search').and.returnValue(Promise.resolve(result));
|
spyOn(service.searchApi, 'search').and.returnValue(Promise.resolve(result));
|
||||||
|
|
||||||
service.searchTags('test').subscribe((tagsResult) => {
|
service.searchTags('test').subscribe((tagsResult) => {
|
||||||
expect(tagsResult).toBe(result);
|
expect(tagsResult).toBe(result);
|
||||||
done();
|
done();
|
||||||
@@ -156,10 +160,9 @@ describe('TagService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should call error on logService when error occurs during fetching paging object for tags', fakeAsync(() => {
|
it('should call error on logService when error occurs during fetching paging object for tags', fakeAsync(() => {
|
||||||
const logService: LogService = TestBed.inject(LogService);
|
|
||||||
spyOn(logService, 'error');
|
spyOn(logService, 'error');
|
||||||
const error: string = 'Some error';
|
const error: string = 'Some error';
|
||||||
spyOn(SearchApi.prototype, 'search').and.returnValue(Promise.reject(error));
|
spyOn(service.searchApi, 'search').and.returnValue(Promise.reject(error));
|
||||||
service.searchTags('test').subscribe({
|
service.searchTags('test').subscribe({
|
||||||
error: () => {
|
error: () => {
|
||||||
expect(logService.error).toHaveBeenCalledWith(error);
|
expect(logService.error).toHaveBeenCalledWith(error);
|
||||||
@@ -200,9 +203,8 @@ describe('TagService', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
it('should call error on logService when error occurs during tag update', fakeAsync(() => {
|
it('should call error on logService when error occurs during tag update', fakeAsync(() => {
|
||||||
const logService: LogService = TestBed.inject(LogService);
|
|
||||||
spyOn(logService, 'error');
|
spyOn(logService, 'error');
|
||||||
const error: string = 'Some error';
|
const error = 'Some error';
|
||||||
spyOn(service.tagsApi, 'updateTag').and.returnValue(Promise.reject(error));
|
spyOn(service.tagsApi, 'updateTag').and.returnValue(Promise.reject(error));
|
||||||
service.updateTag(tag.entry.id, tagBody);
|
service.updateTag(tag.entry.id, tagBody);
|
||||||
tick();
|
tick();
|
||||||
|
@@ -33,16 +33,19 @@ import {
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
||||||
export class TagService {
|
export class TagService {
|
||||||
|
|
||||||
_tagsApi: TagsApi;
|
private _tagsApi: TagsApi;
|
||||||
get tagsApi(): TagsApi {
|
get tagsApi(): TagsApi {
|
||||||
this._tagsApi = this._tagsApi ?? new TagsApi(this.apiService.getInstance());
|
this._tagsApi = this._tagsApi ?? new TagsApi(this.apiService.getInstance());
|
||||||
return this._tagsApi;
|
return this._tagsApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
private searchApi: SearchApi = new SearchApi(this.apiService.getInstance());
|
private _searchApi: SearchApi;
|
||||||
|
get searchApi(): SearchApi {
|
||||||
|
this._searchApi = this._searchApi ?? new SearchApi(this.apiService.getInstance());
|
||||||
|
return this._searchApi;
|
||||||
|
}
|
||||||
|
|
||||||
/** Emitted when tag information is updated. */
|
/** Emitted when tag information is updated. */
|
||||||
@Output()
|
@Output()
|
||||||
|
@@ -38,13 +38,13 @@ export class ContentService {
|
|||||||
folderCreate: Subject<MinimalNode> = new Subject<MinimalNode>();
|
folderCreate: Subject<MinimalNode> = new Subject<MinimalNode>();
|
||||||
folderEdit: Subject<MinimalNode> = new Subject<MinimalNode>();
|
folderEdit: Subject<MinimalNode> = new Subject<MinimalNode>();
|
||||||
|
|
||||||
_contentApi: ContentApi;
|
private _contentApi: ContentApi;
|
||||||
get contentApi(): ContentApi {
|
get contentApi(): ContentApi {
|
||||||
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
||||||
return this._contentApi;
|
return this._contentApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_nodesApi: NodesApi;
|
private _nodesApi: NodesApi;
|
||||||
get nodesApi(): NodesApi {
|
get nodesApi(): NodesApi {
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||||
return this._nodesApi;
|
return this._nodesApi;
|
||||||
|
@@ -28,13 +28,13 @@ import { catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class DeletedNodesApiService {
|
export class DeletedNodesApiService {
|
||||||
|
|
||||||
_nodesApi: NodesApi;
|
private _nodesApi: NodesApi;
|
||||||
get nodesApi(): NodesApi {
|
get nodesApi(): NodesApi {
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||||
return this._nodesApi;
|
return this._nodesApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_trashcanApi: TrashcanApi;
|
private _trashcanApi: TrashcanApi;
|
||||||
get trashcanApi(): TrashcanApi {
|
get trashcanApi(): TrashcanApi {
|
||||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
|
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
|
||||||
return this._trashcanApi;
|
return this._trashcanApi;
|
||||||
|
@@ -85,7 +85,7 @@ export class DiscoveryApiService {
|
|||||||
|
|
||||||
return from(systemPropertiesApi.getProperties())
|
return from(systemPropertiesApi.getProperties())
|
||||||
.pipe(
|
.pipe(
|
||||||
map((res) => {
|
map((res: any) => {
|
||||||
if ('string' === typeof (res)) {
|
if ('string' === typeof (res)) {
|
||||||
throw new Error('Not valid response');
|
throw new Error('Not valid response');
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ import { PeopleApi } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class EcmUserService {
|
export class EcmUserService {
|
||||||
|
|
||||||
_peopleApi: PeopleApi;
|
private _peopleApi: PeopleApi;
|
||||||
get peopleApi(): PeopleApi {
|
get peopleApi(): PeopleApi {
|
||||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance());
|
this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance());
|
||||||
return this._peopleApi;
|
return this._peopleApi;
|
||||||
|
@@ -33,13 +33,13 @@ export class NodesApiService {
|
|||||||
*/
|
*/
|
||||||
nodeUpdated = new Subject<Node>();
|
nodeUpdated = new Subject<Node>();
|
||||||
|
|
||||||
_trashcanApi: TrashcanApi;
|
private _trashcanApi: TrashcanApi;
|
||||||
get trashcanApi(): TrashcanApi {
|
get trashcanApi(): TrashcanApi {
|
||||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
|
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
|
||||||
return this._trashcanApi;
|
return this._trashcanApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_nodesApi: NodesApi;
|
private _nodesApi: NodesApi;
|
||||||
get nodesApi(): NodesApi {
|
get nodesApi(): NodesApi {
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||||
return this._nodesApi;
|
return this._nodesApi;
|
||||||
|
@@ -33,19 +33,19 @@ import { GroupModel } from '../form';
|
|||||||
})
|
})
|
||||||
export class PeopleProcessService {
|
export class PeopleProcessService {
|
||||||
|
|
||||||
_taskActionsApi: TaskActionsApi;
|
private _taskActionsApi: TaskActionsApi;
|
||||||
get taskActionsApi(): TaskActionsApi {
|
get taskActionsApi(): TaskActionsApi {
|
||||||
this._taskActionsApi = this._taskActionsApi ?? new TaskActionsApi(this.apiService.getInstance());
|
this._taskActionsApi = this._taskActionsApi ?? new TaskActionsApi(this.apiService.getInstance());
|
||||||
return this._taskActionsApi;
|
return this._taskActionsApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_userApi: UsersApi;
|
private _userApi: UsersApi;
|
||||||
get userApi(): UsersApi {
|
get userApi(): UsersApi {
|
||||||
this._userApi = this._userApi ?? new UsersApi(this.apiService.getInstance());
|
this._userApi = this._userApi ?? new UsersApi(this.apiService.getInstance());
|
||||||
return this._userApi;
|
return this._userApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_groupsApi: ActivitiGroupsApi;
|
private _groupsApi: ActivitiGroupsApi;
|
||||||
get groupsApi(): ActivitiGroupsApi {
|
get groupsApi(): ActivitiGroupsApi {
|
||||||
this._groupsApi = this._groupsApi ?? new ActivitiGroupsApi(this.apiService.getInstance());
|
this._groupsApi = this._groupsApi ?? new ActivitiGroupsApi(this.apiService.getInstance());
|
||||||
return this._groupsApi;
|
return this._groupsApi;
|
||||||
|
@@ -164,7 +164,7 @@ export class ThumbnailService {
|
|||||||
'multipart/related': './assets/images/ft_ic_website.svg'
|
'multipart/related': './assets/images/ft_ic_website.svg'
|
||||||
};
|
};
|
||||||
|
|
||||||
_contentApi: ContentApi;
|
private _contentApi: ContentApi;
|
||||||
get contentApi(): ContentApi {
|
get contentApi(): ContentApi {
|
||||||
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
||||||
return this._contentApi;
|
return this._contentApi;
|
||||||
|
@@ -72,19 +72,19 @@ export class ViewUtilService {
|
|||||||
viewerTypeChange: Subject<string> = new Subject<string>();
|
viewerTypeChange: Subject<string> = new Subject<string>();
|
||||||
urlFileContentChange: Subject<string> = new Subject<string>();
|
urlFileContentChange: Subject<string> = new Subject<string>();
|
||||||
|
|
||||||
_renditionsApi: RenditionsApi;
|
private _renditionsApi: RenditionsApi;
|
||||||
get renditionsApi(): RenditionsApi {
|
get renditionsApi(): RenditionsApi {
|
||||||
this._renditionsApi = this._renditionsApi ?? new RenditionsApi(this.apiService.getInstance());
|
this._renditionsApi = this._renditionsApi ?? new RenditionsApi(this.apiService.getInstance());
|
||||||
return this._renditionsApi;
|
return this._renditionsApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_contentApi: ContentApi;
|
private _contentApi: ContentApi;
|
||||||
get contentApi(): ContentApi {
|
get contentApi(): ContentApi {
|
||||||
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
||||||
return this._contentApi;
|
return this._contentApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_versionsApi: VersionsApi;
|
private _versionsApi: VersionsApi;
|
||||||
get versionsApi(): VersionsApi {
|
get versionsApi(): VersionsApi {
|
||||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
||||||
return this._versionsApi;
|
return this._versionsApi;
|
||||||
|
@@ -24,7 +24,7 @@ import { ModelJsonBpmnApi } from '@alfresco/js-api';
|
|||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DiagramsService {
|
export class DiagramsService {
|
||||||
|
|
||||||
_modelJsonBpmnApi: ModelJsonBpmnApi;
|
private _modelJsonBpmnApi: ModelJsonBpmnApi;
|
||||||
get modelJsonBpmnApi(): ModelJsonBpmnApi {
|
get modelJsonBpmnApi(): ModelJsonBpmnApi {
|
||||||
this._modelJsonBpmnApi = this._modelJsonBpmnApi ?? new ModelJsonBpmnApi(this.apiService.getInstance());
|
this._modelJsonBpmnApi = this._modelJsonBpmnApi ?? new ModelJsonBpmnApi(this.apiService.getInstance());
|
||||||
return this._modelJsonBpmnApi;
|
return this._modelJsonBpmnApi;
|
||||||
|
@@ -37,7 +37,7 @@ import { FormCloudServiceInterface } from './form-cloud.service.interface';
|
|||||||
})
|
})
|
||||||
export class FormCloudService extends BaseCloudService implements FormCloudServiceInterface {
|
export class FormCloudService extends BaseCloudService implements FormCloudServiceInterface {
|
||||||
|
|
||||||
private _uploadApi;
|
private _uploadApi: UploadApi;
|
||||||
get uploadApi(): UploadApi {
|
get uploadApi(): UploadApi {
|
||||||
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
|
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
|
||||||
return this._uploadApi;
|
return this._uploadApi;
|
||||||
|
@@ -31,13 +31,13 @@ import { AuthenticationApi, Node, UploadApi } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class ProcessCloudContentService {
|
export class ProcessCloudContentService {
|
||||||
|
|
||||||
private _uploadApi;
|
private _uploadApi: UploadApi;
|
||||||
get uploadApi(): UploadApi {
|
get uploadApi(): UploadApi {
|
||||||
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
|
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
|
||||||
return this._uploadApi;
|
return this._uploadApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _authenticationApi;
|
private _authenticationApi: AuthenticationApi;
|
||||||
get authenticationApi(): AuthenticationApi {
|
get authenticationApi(): AuthenticationApi {
|
||||||
this._authenticationApi = this._authenticationApi ?? new AuthenticationApi(this.apiService.getInstance());
|
this._authenticationApi = this._authenticationApi ?? new AuthenticationApi(this.apiService.getInstance());
|
||||||
return this._authenticationApi;
|
return this._authenticationApi;
|
||||||
|
@@ -26,7 +26,7 @@ import { map, catchError } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class AppsProcessService {
|
export class AppsProcessService {
|
||||||
|
|
||||||
_appsApi: RuntimeAppDefinitionsApi;
|
private _appsApi: RuntimeAppDefinitionsApi;
|
||||||
get appsApi(): RuntimeAppDefinitionsApi {
|
get appsApi(): RuntimeAppDefinitionsApi {
|
||||||
this._appsApi = this._appsApi ?? new RuntimeAppDefinitionsApi(this.apiService.getInstance());
|
this._appsApi = this._appsApi ?? new RuntimeAppDefinitionsApi(this.apiService.getInstance());
|
||||||
return this._appsApi;
|
return this._appsApi;
|
||||||
|
@@ -35,13 +35,13 @@ export class ActivitiContentService {
|
|||||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
_integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi;
|
private _integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi;
|
||||||
get integrationAlfrescoOnPremiseApi(): IntegrationAlfrescoOnPremiseApi {
|
get integrationAlfrescoOnPremiseApi(): IntegrationAlfrescoOnPremiseApi {
|
||||||
this._integrationAlfrescoOnPremiseApi = this._integrationAlfrescoOnPremiseApi ?? new IntegrationAlfrescoOnPremiseApi(this.apiService.getInstance());
|
this._integrationAlfrescoOnPremiseApi = this._integrationAlfrescoOnPremiseApi ?? new IntegrationAlfrescoOnPremiseApi(this.apiService.getInstance());
|
||||||
return this._integrationAlfrescoOnPremiseApi;
|
return this._integrationAlfrescoOnPremiseApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_contentApi: ActivitiContentApi;
|
private _contentApi: ActivitiContentApi;
|
||||||
get contentApi(): ActivitiContentApi {
|
get contentApi(): ActivitiContentApi {
|
||||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
||||||
return this._contentApi;
|
return this._contentApi;
|
||||||
|
@@ -30,7 +30,7 @@ export class EcmModelService {
|
|||||||
public static MODEL_NAME: string = 'activitiFormsModel';
|
public static MODEL_NAME: string = 'activitiFormsModel';
|
||||||
public static TYPE_MODEL: string = 'cm:folder';
|
public static TYPE_MODEL: string = 'cm:folder';
|
||||||
|
|
||||||
_customModelApi: CustomModelApi;
|
private _customModelApi: CustomModelApi;
|
||||||
get customModelApi(): CustomModelApi {
|
get customModelApi(): CustomModelApi {
|
||||||
this._customModelApi = this._customModelApi ?? new CustomModelApi(this.apiService.getInstance());
|
this._customModelApi = this._customModelApi ?? new CustomModelApi(this.apiService.getInstance());
|
||||||
return this._customModelApi;
|
return this._customModelApi;
|
||||||
|
@@ -29,7 +29,7 @@ export class EditorService {
|
|||||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
_editorApi: FormModelsApi;
|
private _editorApi: FormModelsApi;
|
||||||
get editorApi(): FormModelsApi {
|
get editorApi(): FormModelsApi {
|
||||||
this._editorApi = this._editorApi ?? new FormModelsApi(this.apiService.getInstance());
|
this._editorApi = this._editorApi ?? new FormModelsApi(this.apiService.getInstance());
|
||||||
return this._editorApi;
|
return this._editorApi;
|
||||||
|
@@ -29,7 +29,7 @@ export class ModelService {
|
|||||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
_modelsApi: ModelsApi;
|
private _modelsApi: ModelsApi;
|
||||||
get modelsApi(): ModelsApi {
|
get modelsApi(): ModelsApi {
|
||||||
this._modelsApi = this._modelsApi ?? new ModelsApi(this.apiService.getInstance());
|
this._modelsApi = this._modelsApi ?? new ModelsApi(this.apiService.getInstance());
|
||||||
return this._modelsApi;
|
return this._modelsApi;
|
||||||
|
@@ -29,7 +29,7 @@ export class ProcessContentService {
|
|||||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
_contentApi: ActivitiContentApi;
|
private _contentApi: ActivitiContentApi;
|
||||||
get contentApi(): ActivitiContentApi {
|
get contentApi(): ActivitiContentApi {
|
||||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
||||||
return this._contentApi;
|
return this._contentApi;
|
||||||
|
@@ -29,7 +29,7 @@ export class ProcessDefinitionService {
|
|||||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
_processDefinitionsApi: ProcessDefinitionsApi;
|
private _processDefinitionsApi: ProcessDefinitionsApi;
|
||||||
get processDefinitionsApi(): ProcessDefinitionsApi {
|
get processDefinitionsApi(): ProcessDefinitionsApi {
|
||||||
this._processDefinitionsApi = this._processDefinitionsApi ?? new ProcessDefinitionsApi(this.apiService.getInstance());
|
this._processDefinitionsApi = this._processDefinitionsApi ?? new ProcessDefinitionsApi(this.apiService.getInstance());
|
||||||
return this._processDefinitionsApi;
|
return this._processDefinitionsApi;
|
||||||
|
@@ -29,7 +29,7 @@ export class TaskFormService {
|
|||||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
_taskFormsApi: TaskFormsApi;
|
private _taskFormsApi: TaskFormsApi;
|
||||||
get taskFormsApi(): TaskFormsApi {
|
get taskFormsApi(): TaskFormsApi {
|
||||||
this._taskFormsApi = this._taskFormsApi ?? new TaskFormsApi(this.apiService.getInstance());
|
this._taskFormsApi = this._taskFormsApi ?? new TaskFormsApi(this.apiService.getInstance());
|
||||||
return this._taskFormsApi;
|
return this._taskFormsApi;
|
||||||
|
@@ -29,7 +29,7 @@ export class TaskService {
|
|||||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
_taskApi: TasksApi;
|
private _taskApi: TasksApi;
|
||||||
get taskApi(): TasksApi {
|
get taskApi(): TasksApi {
|
||||||
this._taskApi = this._taskApi ?? new TasksApi(this.apiService.getInstance());
|
this._taskApi = this._taskApi ?? new TasksApi(this.apiService.getInstance());
|
||||||
return this._taskApi;
|
return this._taskApi;
|
||||||
|
@@ -27,7 +27,7 @@ import { CommentProcessServiceInterface } from '../interfaces/comment-process.se
|
|||||||
})
|
})
|
||||||
export class CommentProcessService implements CommentProcessServiceInterface {
|
export class CommentProcessService implements CommentProcessServiceInterface {
|
||||||
|
|
||||||
_commentsApi: ActivitiCommentsApi;
|
private _commentsApi: ActivitiCommentsApi;
|
||||||
get commentsApi(): ActivitiCommentsApi {
|
get commentsApi(): ActivitiCommentsApi {
|
||||||
this._commentsApi = this._commentsApi ?? new ActivitiCommentsApi(this.apiService.getInstance());
|
this._commentsApi = this._commentsApi ?? new ActivitiCommentsApi(this.apiService.getInstance());
|
||||||
return this._commentsApi;
|
return this._commentsApi;
|
||||||
|
@@ -25,7 +25,7 @@ import { throwError } from 'rxjs';
|
|||||||
})
|
})
|
||||||
export class ProcessUploadService extends UploadService {
|
export class ProcessUploadService extends UploadService {
|
||||||
|
|
||||||
private _contentApi;
|
private _contentApi: ActivitiContentApi;
|
||||||
get contentApi(): ActivitiContentApi {
|
get contentApi(): ActivitiContentApi {
|
||||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
||||||
return this._contentApi;
|
return this._contentApi;
|
||||||
|
@@ -25,7 +25,7 @@ import { ActivitiContentApi } from '@alfresco/js-api';
|
|||||||
})
|
})
|
||||||
export class TaskUploadService extends UploadService {
|
export class TaskUploadService extends UploadService {
|
||||||
|
|
||||||
private _contentApi;
|
private _contentApi: ActivitiContentApi;
|
||||||
get contentApi(): ActivitiContentApi {
|
get contentApi(): ActivitiContentApi {
|
||||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
||||||
return this._contentApi;
|
return this._contentApi;
|
||||||
|
Reference in New Issue
Block a user