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 {
|
||||
|
||||
_aspectsApi: AspectsApi;
|
||||
private _aspectsApi: AspectsApi;
|
||||
get aspectsApi(): AspectsApi {
|
||||
this._aspectsApi = this._aspectsApi ?? new AspectsApi(this.alfrescoApiService.getInstance());
|
||||
return this._aspectsApi;
|
||||
|
@@ -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<HTMLElement>(selectorAutoFocusedOnClose).focus();
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -24,9 +24,6 @@ import { SearchConfigurationInterface } from '@alfresco/adf-core';
|
||||
})
|
||||
export class SearchConfigurationService implements SearchConfigurationInterface {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a QueryBody object with custom search parameters.
|
||||
*
|
||||
|
@@ -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;
|
||||
|
@@ -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<ResultSetPaging>> =
|
||||
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();
|
||||
|
@@ -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()
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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');
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user