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:
Denys Vuika
2023-01-28 17:17:09 +00:00
committed by GitHub
parent b503773475
commit 2a45c1e7a3
37 changed files with 72 additions and 70 deletions

View File

@@ -38,13 +38,13 @@ export class ContentService {
folderCreate: Subject<MinimalNode> = new Subject<MinimalNode>();
folderEdit: Subject<MinimalNode> = new Subject<MinimalNode>();
_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;

View File

@@ -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;

View File

@@ -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');
}

View File

@@ -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;

View File

@@ -33,13 +33,13 @@ export class NodesApiService {
*/
nodeUpdated = new Subject<Node>();
_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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -72,19 +72,19 @@ export class ViewUtilService {
viewerTypeChange: Subject<string> = new Subject<string>();
urlFileContentChange: Subject<string> = new Subject<string>();
_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;