From 2a45c1e7a34c6913316eb8f2e4c530bdc51fbaaf Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Sat, 28 Jan 2023 17:17:09 +0000 Subject: [PATCH] fix the private access to the service variables (#8202) * fix the private access to the service variables * fix issues with unit tests --- .../services/aspect-list.service.ts | 2 +- .../services/dialog-aspect-list.service.ts | 4 +- .../src/lib/audit/audit.service.ts | 2 +- .../common/services/favorites-api.service.ts | 2 +- .../services/property-descriptors.service.ts | 2 +- .../lib/content-type/content-type.service.ts | 2 +- .../src/lib/group/services/group.service.ts | 2 +- .../new-version-uploader.service.ts | 2 +- .../services/node-permission.service.ts | 2 +- .../services/base-query-builder.service.ts | 2 +- .../services/search-configuration.service.ts | 3 -- .../src/lib/social/services/rating.service.ts | 2 +- .../src/lib/tag/services/tag.service.spec.ts | 42 ++++++++++--------- .../src/lib/tag/services/tag.service.ts | 9 ++-- lib/core/src/lib/services/content.service.ts | 4 +- .../lib/services/deleted-nodes-api.service.ts | 4 +- .../src/lib/services/discovery-api.service.ts | 2 +- lib/core/src/lib/services/ecm-user.service.ts | 2 +- .../src/lib/services/nodes-api.service.ts | 4 +- .../lib/services/people-process.service.ts | 6 +-- .../src/lib/services/thumbnail.service.ts | 2 +- .../lib/viewer/services/view-util.service.ts | 6 +-- .../lib/diagram/services/diagrams.service.ts | 2 +- .../lib/form/services/form-cloud.service.ts | 2 +- .../services/process-cloud-content.service.ts | 4 +- .../app-list/services/apps-process.service.ts | 2 +- .../services/activiti-alfresco.service.ts | 4 +- .../lib/form/services/ecm-model.service.ts | 2 +- .../src/lib/form/services/editor.service.ts | 2 +- .../src/lib/form/services/model.service.ts | 2 +- .../form/services/process-content.service.ts | 2 +- .../services/process-definition.service.ts | 2 +- .../lib/form/services/task-form.service.ts | 2 +- .../src/lib/form/services/task.service.ts | 2 +- .../services/comment-process.service.ts | 2 +- .../services/process-upload.service.ts | 2 +- .../task-list/services/task-upload.service.ts | 2 +- 37 files changed, 72 insertions(+), 70 deletions(-) diff --git a/lib/content-services/src/lib/aspect-list/services/aspect-list.service.ts b/lib/content-services/src/lib/aspect-list/services/aspect-list.service.ts index 60d63545f9f..729eeb61f22 100644 --- a/lib/content-services/src/lib/aspect-list/services/aspect-list.service.ts +++ b/lib/content-services/src/lib/aspect-list/services/aspect-list.service.ts @@ -26,7 +26,7 @@ import { AspectEntry, AspectPaging, AspectsApi } from '@alfresco/js-api'; }) export class AspectListService { - _aspectsApi: AspectsApi; + private _aspectsApi: AspectsApi; get aspectsApi(): AspectsApi { this._aspectsApi = this._aspectsApi ?? new AspectsApi(this.alfrescoApiService.getInstance()); return this._aspectsApi; diff --git a/lib/content-services/src/lib/aspect-list/services/dialog-aspect-list.service.ts b/lib/content-services/src/lib/aspect-list/services/dialog-aspect-list.service.ts index 50fd5a7be02..24d67f7dd60 100644 --- a/lib/content-services/src/lib/aspect-list/services/dialog-aspect-list.service.ts +++ b/lib/content-services/src/lib/aspect-list/services/dialog-aspect-list.service.ts @@ -56,7 +56,7 @@ export class DialogAspectListService { width, role: 'dialog', disableClose: true - }).afterClosed().subscribe(() => DialogAspectListService.focusOnClose(selectorAutoFocusedOnClose)); + }).afterClosed().subscribe(() => this.focusOnClose(selectorAutoFocusedOnClose)); this.overlayContainer.getContainerElement().setAttribute('role', 'main'); } @@ -65,7 +65,7 @@ export class DialogAspectListService { this.overlayContainer.getContainerElement().setAttribute('role', 'region'); } - private static focusOnClose(selectorAutoFocusedOnClose: string): void { + private focusOnClose(selectorAutoFocusedOnClose: string): void { if (selectorAutoFocusedOnClose) { document.querySelector(selectorAutoFocusedOnClose).focus(); } diff --git a/lib/content-services/src/lib/audit/audit.service.ts b/lib/content-services/src/lib/audit/audit.service.ts index b8f631bcdbb..c8ea4e3cc71 100644 --- a/lib/content-services/src/lib/audit/audit.service.ts +++ b/lib/content-services/src/lib/audit/audit.service.ts @@ -34,7 +34,7 @@ import { catchError } from 'rxjs/operators'; }) export class AuditService { - _auditApi: AuditApi; + private _auditApi: AuditApi; get auditApi(): AuditApi { this._auditApi = this._auditApi ?? new AuditApi(this.apiService.getInstance()); return this._auditApi; diff --git a/lib/content-services/src/lib/common/services/favorites-api.service.ts b/lib/content-services/src/lib/common/services/favorites-api.service.ts index ab9a6855393..d9a2dc1538e 100644 --- a/lib/content-services/src/lib/common/services/favorites-api.service.ts +++ b/lib/content-services/src/lib/common/services/favorites-api.service.ts @@ -26,7 +26,7 @@ import { catchError } from 'rxjs/operators'; }) export class FavoritesApiService { - _favoritesApi: FavoritesApi; + private _favoritesApi: FavoritesApi; get favoritesApi(): FavoritesApi { this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.apiService.getInstance()); return this._favoritesApi; diff --git a/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.ts b/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.ts index 4efe8d501a1..0fba333da62 100644 --- a/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.ts +++ b/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.ts @@ -27,7 +27,7 @@ import { ClassesApi } from '@alfresco/js-api'; }) export class PropertyDescriptorsService { - private _classesApi; + private _classesApi: ClassesApi; get classesApi(): ClassesApi { this._classesApi = this._classesApi ?? new ClassesApi(this.alfrescoApiService.getInstance()); return this._classesApi; diff --git a/lib/content-services/src/lib/content-type/content-type.service.ts b/lib/content-services/src/lib/content-type/content-type.service.ts index 5c3913717f1..ac9e46ba292 100644 --- a/lib/content-services/src/lib/content-type/content-type.service.ts +++ b/lib/content-services/src/lib/content-type/content-type.service.ts @@ -25,7 +25,7 @@ import { map } from 'rxjs/operators'; }) export class ContentTypeService { - _typesApi: TypesApi; + private _typesApi: TypesApi; get typesApi(): TypesApi { this._typesApi = this._typesApi ?? new TypesApi(this.alfrescoApiService.getInstance()); return this._typesApi; diff --git a/lib/content-services/src/lib/group/services/group.service.ts b/lib/content-services/src/lib/group/services/group.service.ts index 8ad083f2cf9..2836cfb7005 100644 --- a/lib/content-services/src/lib/group/services/group.service.ts +++ b/lib/content-services/src/lib/group/services/group.service.ts @@ -24,7 +24,7 @@ import { AlfrescoApiService } from '@alfresco/adf-core'; }) export class GroupService { - _groupsApi: GroupsApi; + private _groupsApi: GroupsApi; get groupsApi(): GroupsApi { this._groupsApi = this._groupsApi ?? new GroupsApi(this.alfrescoApiService.getInstance()); return this._groupsApi; diff --git a/lib/content-services/src/lib/new-version-uploader/new-version-uploader.service.ts b/lib/content-services/src/lib/new-version-uploader/new-version-uploader.service.ts index c5b3d36656d..be38657997f 100644 --- a/lib/content-services/src/lib/new-version-uploader/new-version-uploader.service.ts +++ b/lib/content-services/src/lib/new-version-uploader/new-version-uploader.service.ts @@ -30,7 +30,7 @@ import { OverlayContainer } from '@angular/cdk/overlay'; }) export class NewVersionUploaderService { - _versionsApi: VersionsApi; + private _versionsApi: VersionsApi; get versionsApi(): VersionsApi { this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance()); return this._versionsApi; diff --git a/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts b/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts index 62c929613d4..534dbf85501 100644 --- a/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts +++ b/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts @@ -42,7 +42,7 @@ import { RoleModel } from '../models/role.model'; }) export class NodePermissionService { - _groupsApi: GroupsApi; + private _groupsApi: GroupsApi; get groupsApi(): GroupsApi { this._groupsApi = this._groupsApi ?? new GroupsApi(this.apiService.getInstance()); return this._groupsApi; diff --git a/lib/content-services/src/lib/search/services/base-query-builder.service.ts b/lib/content-services/src/lib/search/services/base-query-builder.service.ts index cccbb8dd642..8d160d61b75 100644 --- a/lib/content-services/src/lib/search/services/base-query-builder.service.ts +++ b/lib/content-services/src/lib/search/services/base-query-builder.service.ts @@ -42,7 +42,7 @@ import { SearchForm } from '../models/search-form.interface'; }) export abstract class BaseQueryBuilderService { - _searchApi: SearchApi; + private _searchApi: SearchApi; get searchApi(): SearchApi { this._searchApi = this._searchApi ?? new SearchApi(this.alfrescoApiService.getInstance()); return this._searchApi; diff --git a/lib/content-services/src/lib/search/services/search-configuration.service.ts b/lib/content-services/src/lib/search/services/search-configuration.service.ts index c50efacf130..3ecb9da930d 100644 --- a/lib/content-services/src/lib/search/services/search-configuration.service.ts +++ b/lib/content-services/src/lib/search/services/search-configuration.service.ts @@ -24,9 +24,6 @@ import { SearchConfigurationInterface } from '@alfresco/adf-core'; }) export class SearchConfigurationService implements SearchConfigurationInterface { - constructor() { - } - /** * Generates a QueryBody object with custom search parameters. * diff --git a/lib/content-services/src/lib/social/services/rating.service.ts b/lib/content-services/src/lib/social/services/rating.service.ts index 52884ba547f..04e93287f7f 100644 --- a/lib/content-services/src/lib/social/services/rating.service.ts +++ b/lib/content-services/src/lib/social/services/rating.service.ts @@ -27,7 +27,7 @@ import { RatingServiceInterface } from './rating.service.interface'; }) export class RatingService implements RatingServiceInterface { - _ratingsApi: RatingsApi; + private _ratingsApi: RatingsApi; get ratingsApi(): RatingsApi { this._ratingsApi = this._ratingsApi ?? new RatingsApi(this.apiService.getInstance()); return this._ratingsApi; diff --git a/lib/content-services/src/lib/tag/services/tag.service.spec.ts b/lib/content-services/src/lib/tag/services/tag.service.spec.ts index 24479a4ecc0..1b1efa9c514 100644 --- a/lib/content-services/src/lib/tag/services/tag.service.spec.ts +++ b/lib/content-services/src/lib/tag/services/tag.service.spec.ts @@ -25,8 +25,6 @@ import { RequestQuery, RequestSortDefinitionInner, ResultSetPaging, - SearchApi, - SearchRequest, TagBody, TagEntry } from '@alfresco/js-api'; @@ -34,6 +32,8 @@ import { describe('TagService', () => { let service: TagService; + let logService: LogService; + let userPreferencesService: UserPreferencesService; setupTestBed({ imports: [ @@ -44,10 +44,13 @@ describe('TagService', () => { beforeEach(() => { 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({}) ); - spyOn(service['tagsApi'], 'createTagForNode').and.returnValue( + spyOn(service.tagsApi, 'createTagForNode').and.returnValue( Promise.resolve(new TagEntry({})) ); }); @@ -82,11 +85,11 @@ describe('TagService', () => { describe('createTags', () => { it('should call createTags on tagsApi', () => { spyOn(service.tagsApi, 'createTags').and.returnValue(Promise.resolve([])); - const tag1: TagBody = new TagBody(); + const tag1 = new TagBody(); tag1.tag = 'Some tag 1'; - const tag2: TagBody = new TagBody(); + const tag2 = new TagBody(); tag2.tag = 'Some tag 2'; - const tags: TagBody[] = [tag1, tag2]; + const tags = [tag1, tag2]; service.createTags(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(() => { - const logService: LogService = TestBed.inject(LogService); spyOn(logService, 'error'); - const error: string = 'Some error'; + const error = 'Some error'; spyOn(service.tagsApi, 'createTags').and.returnValue(Promise.reject(error)); service.createTags([]); tick(); @@ -124,15 +126,16 @@ describe('TagService', () => { }); it('should call search on searchApi with correct parameters', () => { - const searchSpy: jasmine.Spy<(queryBody: SearchRequest) => Promise> = - spyOn(SearchApi.prototype, 'search').and.returnValue(Promise.resolve(result)); - const name: string = 'test'; - const sortingByName: RequestSortDefinitionInner = new RequestSortDefinitionInner(); - const maxItems: number = 25; - spyOnProperty(TestBed.inject(UserPreferencesService), 'paginationSize').and.returnValue(maxItems); + const searchSpy = spyOn(service.searchApi, 'search').and.returnValue(Promise.resolve(result)); + const name = 'test'; + const maxItems = 25; + spyOnProperty(userPreferencesService, 'paginationSize').and.returnValue(maxItems); + + const sortingByName = new RequestSortDefinitionInner(); sortingByName.field = 'cm:name'; sortingByName.ascending = true; sortingByName.type = RequestSortDefinitionInner.TypeEnum.FIELD; + service.searchTags(name); expect(searchSpy).toHaveBeenCalledWith({ query: { @@ -148,7 +151,8 @@ describe('TagService', () => { }); 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) => { expect(tagsResult).toBe(result); done(); @@ -156,10 +160,9 @@ describe('TagService', () => { }); 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'); 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({ 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(() => { - const logService: LogService = TestBed.inject(LogService); spyOn(logService, 'error'); - const error: string = 'Some error'; + const error = 'Some error'; spyOn(service.tagsApi, 'updateTag').and.returnValue(Promise.reject(error)); service.updateTag(tag.entry.id, tagBody); tick(); diff --git a/lib/content-services/src/lib/tag/services/tag.service.ts b/lib/content-services/src/lib/tag/services/tag.service.ts index 4c98aea67ed..cf82da85249 100644 --- a/lib/content-services/src/lib/tag/services/tag.service.ts +++ b/lib/content-services/src/lib/tag/services/tag.service.ts @@ -33,16 +33,19 @@ import { @Injectable({ providedIn: 'root' }) -// eslint-disable-next-line @angular-eslint/directive-class-suffix export class TagService { - _tagsApi: TagsApi; + private _tagsApi: TagsApi; get tagsApi(): TagsApi { this._tagsApi = this._tagsApi ?? new TagsApi(this.apiService.getInstance()); 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. */ @Output() diff --git a/lib/core/src/lib/services/content.service.ts b/lib/core/src/lib/services/content.service.ts index f3aa18d9c84..65401ab78a2 100644 --- a/lib/core/src/lib/services/content.service.ts +++ b/lib/core/src/lib/services/content.service.ts @@ -38,13 +38,13 @@ export class ContentService { folderCreate: Subject = new Subject(); folderEdit: Subject = new Subject(); - _contentApi: ContentApi; + private _contentApi: ContentApi; get contentApi(): ContentApi { this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance()); return this._contentApi; } - _nodesApi: NodesApi; + private _nodesApi: NodesApi; get nodesApi(): NodesApi { this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance()); return this._nodesApi; diff --git a/lib/core/src/lib/services/deleted-nodes-api.service.ts b/lib/core/src/lib/services/deleted-nodes-api.service.ts index 6900a02b2fa..fdda3a5c883 100644 --- a/lib/core/src/lib/services/deleted-nodes-api.service.ts +++ b/lib/core/src/lib/services/deleted-nodes-api.service.ts @@ -28,13 +28,13 @@ import { catchError } from 'rxjs/operators'; }) export class DeletedNodesApiService { - _nodesApi: NodesApi; + private _nodesApi: NodesApi; get nodesApi(): NodesApi { this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance()); return this._nodesApi; } - _trashcanApi: TrashcanApi; + private _trashcanApi: TrashcanApi; get trashcanApi(): TrashcanApi { this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance()); return this._trashcanApi; diff --git a/lib/core/src/lib/services/discovery-api.service.ts b/lib/core/src/lib/services/discovery-api.service.ts index 841023f561d..d102ea74ee3 100644 --- a/lib/core/src/lib/services/discovery-api.service.ts +++ b/lib/core/src/lib/services/discovery-api.service.ts @@ -85,7 +85,7 @@ export class DiscoveryApiService { return from(systemPropertiesApi.getProperties()) .pipe( - map((res) => { + map((res: any) => { if ('string' === typeof (res)) { throw new Error('Not valid response'); } diff --git a/lib/core/src/lib/services/ecm-user.service.ts b/lib/core/src/lib/services/ecm-user.service.ts index a4ca40c9576..d7672efb1ee 100644 --- a/lib/core/src/lib/services/ecm-user.service.ts +++ b/lib/core/src/lib/services/ecm-user.service.ts @@ -28,7 +28,7 @@ import { PeopleApi } from '@alfresco/js-api'; }) export class EcmUserService { - _peopleApi: PeopleApi; + private _peopleApi: PeopleApi; get peopleApi(): PeopleApi { this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance()); return this._peopleApi; diff --git a/lib/core/src/lib/services/nodes-api.service.ts b/lib/core/src/lib/services/nodes-api.service.ts index 7da81f80012..0a374388131 100644 --- a/lib/core/src/lib/services/nodes-api.service.ts +++ b/lib/core/src/lib/services/nodes-api.service.ts @@ -33,13 +33,13 @@ export class NodesApiService { */ nodeUpdated = new Subject(); - _trashcanApi: TrashcanApi; + private _trashcanApi: TrashcanApi; get trashcanApi(): TrashcanApi { this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance()); return this._trashcanApi; } - _nodesApi: NodesApi; + private _nodesApi: NodesApi; get nodesApi(): NodesApi { this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance()); return this._nodesApi; diff --git a/lib/core/src/lib/services/people-process.service.ts b/lib/core/src/lib/services/people-process.service.ts index e909e37c942..5ac4e974a39 100644 --- a/lib/core/src/lib/services/people-process.service.ts +++ b/lib/core/src/lib/services/people-process.service.ts @@ -33,19 +33,19 @@ import { GroupModel } from '../form'; }) export class PeopleProcessService { - _taskActionsApi: TaskActionsApi; + private _taskActionsApi: TaskActionsApi; get taskActionsApi(): TaskActionsApi { this._taskActionsApi = this._taskActionsApi ?? new TaskActionsApi(this.apiService.getInstance()); return this._taskActionsApi; } - _userApi: UsersApi; + private _userApi: UsersApi; get userApi(): UsersApi { this._userApi = this._userApi ?? new UsersApi(this.apiService.getInstance()); return this._userApi; } - _groupsApi: ActivitiGroupsApi; + private _groupsApi: ActivitiGroupsApi; get groupsApi(): ActivitiGroupsApi { this._groupsApi = this._groupsApi ?? new ActivitiGroupsApi(this.apiService.getInstance()); return this._groupsApi; diff --git a/lib/core/src/lib/services/thumbnail.service.ts b/lib/core/src/lib/services/thumbnail.service.ts index 4203f28177b..1a6be529023 100644 --- a/lib/core/src/lib/services/thumbnail.service.ts +++ b/lib/core/src/lib/services/thumbnail.service.ts @@ -164,7 +164,7 @@ export class ThumbnailService { 'multipart/related': './assets/images/ft_ic_website.svg' }; - _contentApi: ContentApi; + private _contentApi: ContentApi; get contentApi(): ContentApi { this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance()); return this._contentApi; diff --git a/lib/core/src/lib/viewer/services/view-util.service.ts b/lib/core/src/lib/viewer/services/view-util.service.ts index b5977e1641c..248077b84c6 100644 --- a/lib/core/src/lib/viewer/services/view-util.service.ts +++ b/lib/core/src/lib/viewer/services/view-util.service.ts @@ -72,19 +72,19 @@ export class ViewUtilService { viewerTypeChange: Subject = new Subject(); urlFileContentChange: Subject = new Subject(); - _renditionsApi: RenditionsApi; + private _renditionsApi: RenditionsApi; get renditionsApi(): RenditionsApi { this._renditionsApi = this._renditionsApi ?? new RenditionsApi(this.apiService.getInstance()); return this._renditionsApi; } - _contentApi: ContentApi; + private _contentApi: ContentApi; get contentApi(): ContentApi { this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance()); return this._contentApi; } - _versionsApi: VersionsApi; + private _versionsApi: VersionsApi; get versionsApi(): VersionsApi { this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance()); return this._versionsApi; diff --git a/lib/insights/src/lib/diagram/services/diagrams.service.ts b/lib/insights/src/lib/diagram/services/diagrams.service.ts index cda71f842ea..95d364760cd 100644 --- a/lib/insights/src/lib/diagram/services/diagrams.service.ts +++ b/lib/insights/src/lib/diagram/services/diagrams.service.ts @@ -24,7 +24,7 @@ import { ModelJsonBpmnApi } from '@alfresco/js-api'; @Injectable({ providedIn: 'root' }) export class DiagramsService { - _modelJsonBpmnApi: ModelJsonBpmnApi; + private _modelJsonBpmnApi: ModelJsonBpmnApi; get modelJsonBpmnApi(): ModelJsonBpmnApi { this._modelJsonBpmnApi = this._modelJsonBpmnApi ?? new ModelJsonBpmnApi(this.apiService.getInstance()); return this._modelJsonBpmnApi; diff --git a/lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts b/lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts index 6d08d89325a..7a8a64f993e 100644 --- a/lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts @@ -37,7 +37,7 @@ import { FormCloudServiceInterface } from './form-cloud.service.interface'; }) export class FormCloudService extends BaseCloudService implements FormCloudServiceInterface { - private _uploadApi; + private _uploadApi: UploadApi; get uploadApi(): UploadApi { this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance()); return this._uploadApi; diff --git a/lib/process-services-cloud/src/lib/form/services/process-cloud-content.service.ts b/lib/process-services-cloud/src/lib/form/services/process-cloud-content.service.ts index b931de71c90..f605df154e3 100644 --- a/lib/process-services-cloud/src/lib/form/services/process-cloud-content.service.ts +++ b/lib/process-services-cloud/src/lib/form/services/process-cloud-content.service.ts @@ -31,13 +31,13 @@ import { AuthenticationApi, Node, UploadApi } from '@alfresco/js-api'; }) export class ProcessCloudContentService { - private _uploadApi; + private _uploadApi: UploadApi; get uploadApi(): UploadApi { this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance()); return this._uploadApi; } - private _authenticationApi; + private _authenticationApi: AuthenticationApi; get authenticationApi(): AuthenticationApi { this._authenticationApi = this._authenticationApi ?? new AuthenticationApi(this.apiService.getInstance()); return this._authenticationApi; diff --git a/lib/process-services/src/lib/app-list/services/apps-process.service.ts b/lib/process-services/src/lib/app-list/services/apps-process.service.ts index efc1ad2582b..2b070bd38be 100644 --- a/lib/process-services/src/lib/app-list/services/apps-process.service.ts +++ b/lib/process-services/src/lib/app-list/services/apps-process.service.ts @@ -26,7 +26,7 @@ import { map, catchError } from 'rxjs/operators'; }) export class AppsProcessService { - _appsApi: RuntimeAppDefinitionsApi; + private _appsApi: RuntimeAppDefinitionsApi; get appsApi(): RuntimeAppDefinitionsApi { this._appsApi = this._appsApi ?? new RuntimeAppDefinitionsApi(this.apiService.getInstance()); return this._appsApi; diff --git a/lib/process-services/src/lib/form/services/activiti-alfresco.service.ts b/lib/process-services/src/lib/form/services/activiti-alfresco.service.ts index 93e90bb2015..62c64e5799e 100644 --- a/lib/process-services/src/lib/form/services/activiti-alfresco.service.ts +++ b/lib/process-services/src/lib/form/services/activiti-alfresco.service.ts @@ -35,13 +35,13 @@ export class ActivitiContentService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; - _integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi; + private _integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi; get integrationAlfrescoOnPremiseApi(): IntegrationAlfrescoOnPremiseApi { this._integrationAlfrescoOnPremiseApi = this._integrationAlfrescoOnPremiseApi ?? new IntegrationAlfrescoOnPremiseApi(this.apiService.getInstance()); return this._integrationAlfrescoOnPremiseApi; } - _contentApi: ActivitiContentApi; + private _contentApi: ActivitiContentApi; get contentApi(): ActivitiContentApi { this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance()); return this._contentApi; diff --git a/lib/process-services/src/lib/form/services/ecm-model.service.ts b/lib/process-services/src/lib/form/services/ecm-model.service.ts index 11139b5585d..79ca9707451 100644 --- a/lib/process-services/src/lib/form/services/ecm-model.service.ts +++ b/lib/process-services/src/lib/form/services/ecm-model.service.ts @@ -30,7 +30,7 @@ export class EcmModelService { public static MODEL_NAME: string = 'activitiFormsModel'; public static TYPE_MODEL: string = 'cm:folder'; - _customModelApi: CustomModelApi; + private _customModelApi: CustomModelApi; get customModelApi(): CustomModelApi { this._customModelApi = this._customModelApi ?? new CustomModelApi(this.apiService.getInstance()); return this._customModelApi; diff --git a/lib/process-services/src/lib/form/services/editor.service.ts b/lib/process-services/src/lib/form/services/editor.service.ts index 85fe62511ed..6a38560f54d 100644 --- a/lib/process-services/src/lib/form/services/editor.service.ts +++ b/lib/process-services/src/lib/form/services/editor.service.ts @@ -29,7 +29,7 @@ export class EditorService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; - _editorApi: FormModelsApi; + private _editorApi: FormModelsApi; get editorApi(): FormModelsApi { this._editorApi = this._editorApi ?? new FormModelsApi(this.apiService.getInstance()); return this._editorApi; diff --git a/lib/process-services/src/lib/form/services/model.service.ts b/lib/process-services/src/lib/form/services/model.service.ts index 12ecba939b9..5b8f440800c 100644 --- a/lib/process-services/src/lib/form/services/model.service.ts +++ b/lib/process-services/src/lib/form/services/model.service.ts @@ -29,7 +29,7 @@ export class ModelService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; - _modelsApi: ModelsApi; + private _modelsApi: ModelsApi; get modelsApi(): ModelsApi { this._modelsApi = this._modelsApi ?? new ModelsApi(this.apiService.getInstance()); return this._modelsApi; diff --git a/lib/process-services/src/lib/form/services/process-content.service.ts b/lib/process-services/src/lib/form/services/process-content.service.ts index 9929850c921..4023fdbe950 100644 --- a/lib/process-services/src/lib/form/services/process-content.service.ts +++ b/lib/process-services/src/lib/form/services/process-content.service.ts @@ -29,7 +29,7 @@ export class ProcessContentService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; - _contentApi: ActivitiContentApi; + private _contentApi: ActivitiContentApi; get contentApi(): ActivitiContentApi { this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance()); return this._contentApi; diff --git a/lib/process-services/src/lib/form/services/process-definition.service.ts b/lib/process-services/src/lib/form/services/process-definition.service.ts index 82ae8f11f71..73c49737769 100644 --- a/lib/process-services/src/lib/form/services/process-definition.service.ts +++ b/lib/process-services/src/lib/form/services/process-definition.service.ts @@ -29,7 +29,7 @@ export class ProcessDefinitionService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; - _processDefinitionsApi: ProcessDefinitionsApi; + private _processDefinitionsApi: ProcessDefinitionsApi; get processDefinitionsApi(): ProcessDefinitionsApi { this._processDefinitionsApi = this._processDefinitionsApi ?? new ProcessDefinitionsApi(this.apiService.getInstance()); return this._processDefinitionsApi; diff --git a/lib/process-services/src/lib/form/services/task-form.service.ts b/lib/process-services/src/lib/form/services/task-form.service.ts index e4745062409..ca215ddf2d8 100644 --- a/lib/process-services/src/lib/form/services/task-form.service.ts +++ b/lib/process-services/src/lib/form/services/task-form.service.ts @@ -29,7 +29,7 @@ export class TaskFormService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; - _taskFormsApi: TaskFormsApi; + private _taskFormsApi: TaskFormsApi; get taskFormsApi(): TaskFormsApi { this._taskFormsApi = this._taskFormsApi ?? new TaskFormsApi(this.apiService.getInstance()); return this._taskFormsApi; diff --git a/lib/process-services/src/lib/form/services/task.service.ts b/lib/process-services/src/lib/form/services/task.service.ts index 22ade5934e7..2738239e136 100644 --- a/lib/process-services/src/lib/form/services/task.service.ts +++ b/lib/process-services/src/lib/form/services/task.service.ts @@ -29,7 +29,7 @@ export class TaskService { static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error'; static GENERIC_ERROR_MESSAGE: string = 'Server error'; - _taskApi: TasksApi; + private _taskApi: TasksApi; get taskApi(): TasksApi { this._taskApi = this._taskApi ?? new TasksApi(this.apiService.getInstance()); return this._taskApi; diff --git a/lib/process-services/src/lib/process-comments/services/comment-process.service.ts b/lib/process-services/src/lib/process-comments/services/comment-process.service.ts index 7fc842a381b..02cc90b4db3 100644 --- a/lib/process-services/src/lib/process-comments/services/comment-process.service.ts +++ b/lib/process-services/src/lib/process-comments/services/comment-process.service.ts @@ -27,7 +27,7 @@ import { CommentProcessServiceInterface } from '../interfaces/comment-process.se }) export class CommentProcessService implements CommentProcessServiceInterface { - _commentsApi: ActivitiCommentsApi; + private _commentsApi: ActivitiCommentsApi; get commentsApi(): ActivitiCommentsApi { this._commentsApi = this._commentsApi ?? new ActivitiCommentsApi(this.apiService.getInstance()); return this._commentsApi; diff --git a/lib/process-services/src/lib/task-list/services/process-upload.service.ts b/lib/process-services/src/lib/task-list/services/process-upload.service.ts index e8795428c29..ff8653a3430 100644 --- a/lib/process-services/src/lib/task-list/services/process-upload.service.ts +++ b/lib/process-services/src/lib/task-list/services/process-upload.service.ts @@ -25,7 +25,7 @@ import { throwError } from 'rxjs'; }) export class ProcessUploadService extends UploadService { - private _contentApi; + private _contentApi: ActivitiContentApi; get contentApi(): ActivitiContentApi { this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance()); return this._contentApi; diff --git a/lib/process-services/src/lib/task-list/services/task-upload.service.ts b/lib/process-services/src/lib/task-list/services/task-upload.service.ts index 8ef0e50b4ab..5d353c828a0 100644 --- a/lib/process-services/src/lib/task-list/services/task-upload.service.ts +++ b/lib/process-services/src/lib/task-list/services/task-upload.service.ts @@ -25,7 +25,7 @@ import { ActivitiContentApi } from '@alfresco/js-api'; }) export class TaskUploadService extends UploadService { - private _contentApi; + private _contentApi: ActivitiContentApi; get contentApi(): ActivitiContentApi { this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance()); return this._contentApi;