mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-11205] Add LazyApi decorator (#11711)
* [ACS-11205] Add LazyApi decorator * [ACS-11205] Add unit tests and CR fixes * [ACS-11259] Storybook build fix
This commit is contained in:
@@ -24,7 +24,8 @@ import {
|
||||
RelatedContentRepresentation,
|
||||
ActivitiContentApi,
|
||||
AlfrescoEndpointRepresentation,
|
||||
AlfrescoContentRepresentation
|
||||
AlfrescoContentRepresentation,
|
||||
LazyApi
|
||||
} from '@alfresco/js-api';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
@@ -39,18 +40,11 @@ export class ActivitiContentService {
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||
|
||||
private _integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi;
|
||||
get integrationAlfrescoOnPremiseApi(): IntegrationAlfrescoOnPremiseApi {
|
||||
this._integrationAlfrescoOnPremiseApi =
|
||||
this._integrationAlfrescoOnPremiseApi ?? new IntegrationAlfrescoOnPremiseApi(this.apiService.getInstance());
|
||||
return this._integrationAlfrescoOnPremiseApi;
|
||||
}
|
||||
@LazyApi((self: ActivitiContentService) => new IntegrationAlfrescoOnPremiseApi(self.apiService.getInstance()))
|
||||
declare readonly integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi;
|
||||
|
||||
private _contentApi: ActivitiContentApi;
|
||||
get contentApi(): ActivitiContentApi {
|
||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
||||
return this._contentApi;
|
||||
}
|
||||
@LazyApi((self: ActivitiContentService) => new ActivitiContentApi(self.apiService.getInstance()))
|
||||
declare readonly contentApi: ActivitiContentApi;
|
||||
|
||||
/**
|
||||
* Returns a list of child nodes below the specified folder
|
||||
|
||||
@@ -20,7 +20,7 @@ import { FormModel } from '@alfresco/adf-core';
|
||||
import { EventEmitter, Injectable, inject } from '@angular/core';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { CustomModelApi } from '@alfresco/js-api';
|
||||
import { CustomModelApi, LazyApi } from '@alfresco/js-api';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -34,11 +34,8 @@ export class EcmModelService {
|
||||
|
||||
error = new EventEmitter<any>();
|
||||
|
||||
private _customModelApi: CustomModelApi;
|
||||
get customModelApi(): CustomModelApi {
|
||||
this._customModelApi = this._customModelApi ?? new CustomModelApi(this.apiService.getInstance());
|
||||
return this._customModelApi;
|
||||
}
|
||||
@LazyApi((self: EcmModelService) => new CustomModelApi(self.apiService.getInstance()))
|
||||
declare readonly customModelApi: CustomModelApi;
|
||||
|
||||
public createEcmTypeForActivitiForm(formName: string, form: FormModel): Observable<any> {
|
||||
return new Observable((observer) => {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { FormModelsApi, FormRepresentation } from '@alfresco/js-api';
|
||||
import { FormModelsApi, FormRepresentation, LazyApi } from '@alfresco/js-api';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { FormDefinitionModel } from '../model/form-definition.model';
|
||||
|
||||
@@ -31,11 +31,8 @@ export class EditorService {
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||
|
||||
private _editorApi: FormModelsApi;
|
||||
get editorApi(): FormModelsApi {
|
||||
this._editorApi = this._editorApi ?? new FormModelsApi(this.apiService.getInstance());
|
||||
return this._editorApi;
|
||||
}
|
||||
@LazyApi((self: EditorService) => new FormModelsApi(self.apiService.getInstance()))
|
||||
declare readonly editorApi: FormModelsApi;
|
||||
|
||||
/**
|
||||
* Saves a form.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { ModelsApi } from '@alfresco/js-api';
|
||||
import { LazyApi, ModelsApi } from '@alfresco/js-api';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
@@ -30,11 +30,8 @@ export class ModelService {
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||
|
||||
private _modelsApi: ModelsApi;
|
||||
get modelsApi(): ModelsApi {
|
||||
this._modelsApi = this._modelsApi ?? new ModelsApi(this.apiService.getInstance());
|
||||
return this._modelsApi;
|
||||
}
|
||||
@LazyApi((self: ModelService) => new ModelsApi(self.apiService.getInstance()))
|
||||
declare readonly modelsApi: ModelsApi;
|
||||
|
||||
/**
|
||||
* Create a Form.
|
||||
|
||||
@@ -21,7 +21,8 @@ import {
|
||||
ActivitiContentApi,
|
||||
RelatedContentRepresentation,
|
||||
ResultListDataRepresentationRelatedProcessTask,
|
||||
ResultListDataRepresentationRelatedContentRepresentation
|
||||
ResultListDataRepresentationRelatedContentRepresentation,
|
||||
LazyApi
|
||||
} from '@alfresco/js-api';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -35,11 +36,8 @@ export class ProcessContentService {
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||
|
||||
private _contentApi: ActivitiContentApi;
|
||||
get contentApi(): ActivitiContentApi {
|
||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
||||
return this._contentApi;
|
||||
}
|
||||
@LazyApi((self: ProcessContentService) => new ActivitiContentApi(self.apiService.getInstance()))
|
||||
declare readonly contentApi: ActivitiContentApi;
|
||||
|
||||
/**
|
||||
* Create temporary related content from an uploaded file.
|
||||
|
||||
@@ -19,7 +19,7 @@ import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { FormFieldOption } from '@alfresco/adf-core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { ProcessDefinitionsApi } from '@alfresco/js-api';
|
||||
import { LazyApi, ProcessDefinitionsApi } from '@alfresco/js-api';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { DynamicTableColumnOption } from '../widgets/dynamic-table/editors/models/dynamic-table-column-option.model';
|
||||
|
||||
@@ -32,11 +32,8 @@ export class ProcessDefinitionService {
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||
|
||||
private _processDefinitionsApi: ProcessDefinitionsApi;
|
||||
get processDefinitionsApi(): ProcessDefinitionsApi {
|
||||
this._processDefinitionsApi = this._processDefinitionsApi ?? new ProcessDefinitionsApi(this.apiService.getInstance());
|
||||
return this._processDefinitionsApi;
|
||||
}
|
||||
@LazyApi((self: ProcessDefinitionService) => new ProcessDefinitionsApi(self.apiService.getInstance()))
|
||||
declare readonly processDefinitionsApi: ProcessDefinitionsApi;
|
||||
|
||||
/**
|
||||
* Gets values of fields populated by a REST backend using a process ID.
|
||||
|
||||
@@ -19,7 +19,7 @@ import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { FormFieldOption, FormValues, TaskProcessVariableModel } from '@alfresco/adf-core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { from, Observable, throwError } from 'rxjs';
|
||||
import { CompleteFormRepresentation, SaveFormRepresentation, TaskFormsApi } from '@alfresco/js-api';
|
||||
import { CompleteFormRepresentation, LazyApi, SaveFormRepresentation, TaskFormsApi } from '@alfresco/js-api';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { DynamicTableColumnOption } from '../widgets/dynamic-table/editors/models/dynamic-table-column-option.model';
|
||||
|
||||
@@ -32,11 +32,8 @@ export class TaskFormService {
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||
|
||||
private _taskFormsApi: TaskFormsApi;
|
||||
get taskFormsApi(): TaskFormsApi {
|
||||
this._taskFormsApi = this._taskFormsApi ?? new TaskFormsApi(this.apiService.getInstance());
|
||||
return this._taskFormsApi;
|
||||
}
|
||||
@LazyApi((self: TaskFormService) => new TaskFormsApi(self.apiService.getInstance()))
|
||||
declare readonly taskFormsApi: TaskFormsApi;
|
||||
|
||||
/**
|
||||
* Saves a task form.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { TaskRepresentation, TasksApi } from '@alfresco/js-api';
|
||||
import { LazyApi, TaskRepresentation, TasksApi } from '@alfresco/js-api';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
@@ -30,11 +30,8 @@ export class TaskService {
|
||||
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||
|
||||
private _taskApi: TasksApi;
|
||||
get taskApi(): TasksApi {
|
||||
this._taskApi = this._taskApi ?? new TasksApi(this.apiService.getInstance());
|
||||
return this._taskApi;
|
||||
}
|
||||
@LazyApi((self: TaskService) => new TasksApi(self.apiService.getInstance()))
|
||||
declare readonly taskApi: TasksApi;
|
||||
|
||||
/**
|
||||
* Gets a task.
|
||||
|
||||
@@ -20,7 +20,7 @@ import { Injectable, inject } from '@angular/core';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { CommentModel, CommentsService, User } from '@alfresco/adf-core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ActivitiCommentsApi } from '@alfresco/js-api';
|
||||
import { ActivitiCommentsApi, LazyApi } from '@alfresco/js-api';
|
||||
import { PeopleProcessService } from '../../services/people-process.service';
|
||||
|
||||
@Injectable({
|
||||
@@ -30,11 +30,8 @@ export class CommentProcessService implements CommentsService {
|
||||
private readonly apiService = inject(AlfrescoApiService);
|
||||
private readonly peopleProcessService = inject(PeopleProcessService);
|
||||
|
||||
private _commentsApi: ActivitiCommentsApi;
|
||||
get commentsApi(): ActivitiCommentsApi {
|
||||
this._commentsApi = this._commentsApi ?? new ActivitiCommentsApi(this.apiService.getInstance());
|
||||
return this._commentsApi;
|
||||
}
|
||||
@LazyApi((self: CommentProcessService) => new ActivitiCommentsApi(self.apiService.getInstance()))
|
||||
declare readonly commentsApi: ActivitiCommentsApi;
|
||||
|
||||
/**
|
||||
* Gets all comments that have been added to a process instance.
|
||||
|
||||
@@ -20,6 +20,7 @@ import { Injectable, inject } from '@angular/core';
|
||||
import { Observable, from, forkJoin } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import {
|
||||
LazyApi,
|
||||
ResultListDataRepresentationUserProcessInstanceFilterRepresentation,
|
||||
UserFiltersApi,
|
||||
UserProcessInstanceFilterRepresentation
|
||||
@@ -31,11 +32,8 @@ import {
|
||||
export class ProcessFilterService {
|
||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||
|
||||
private _userFiltersApi: UserFiltersApi;
|
||||
get userFiltersApi(): UserFiltersApi {
|
||||
this._userFiltersApi = this._userFiltersApi ?? new UserFiltersApi(this.alfrescoApiService.getInstance());
|
||||
return this._userFiltersApi;
|
||||
}
|
||||
@LazyApi((self: ProcessFilterService) => new UserFiltersApi(self.alfrescoApiService.getInstance()))
|
||||
declare readonly userFiltersApi: UserFiltersApi;
|
||||
|
||||
/**
|
||||
* Gets all filters defined for a Process App.
|
||||
|
||||
@@ -29,7 +29,8 @@ import {
|
||||
ResultListDataRepresentationProcessInstanceRepresentation,
|
||||
TasksApi,
|
||||
ProcessDefinitionRepresentation,
|
||||
TaskRepresentation
|
||||
TaskRepresentation,
|
||||
LazyApi
|
||||
} from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { from, Observable } from 'rxjs';
|
||||
@@ -42,25 +43,17 @@ import { DatePipe } from '@angular/common';
|
||||
export class ProcessService {
|
||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||
|
||||
private _tasksApi: TasksApi;
|
||||
get tasksApi(): TasksApi {
|
||||
return (this._tasksApi ||= new TasksApi(this.alfrescoApiService.getInstance()));
|
||||
}
|
||||
@LazyApi((self: ProcessService) => new TasksApi(self.alfrescoApiService.getInstance()))
|
||||
declare readonly tasksApi: TasksApi;
|
||||
|
||||
private _processDefinitionsApi: ProcessDefinitionsApi;
|
||||
get processDefinitionsApi(): ProcessDefinitionsApi {
|
||||
return (this._processDefinitionsApi ||= new ProcessDefinitionsApi(this.alfrescoApiService.getInstance()));
|
||||
}
|
||||
@LazyApi((self: ProcessService) => new ProcessDefinitionsApi(self.alfrescoApiService.getInstance()))
|
||||
declare readonly processDefinitionsApi: ProcessDefinitionsApi;
|
||||
|
||||
private _processInstancesApi: ProcessInstancesApi;
|
||||
get processInstancesApi(): ProcessInstancesApi {
|
||||
return (this._processInstancesApi ||= new ProcessInstancesApi(this.alfrescoApiService.getInstance()));
|
||||
}
|
||||
@LazyApi((self: ProcessService) => new ProcessInstancesApi(self.alfrescoApiService.getInstance()))
|
||||
declare readonly processInstancesApi: ProcessInstancesApi;
|
||||
|
||||
private _processInstanceVariablesApi: ProcessInstanceVariablesApi;
|
||||
get processInstanceVariablesApi(): ProcessInstanceVariablesApi {
|
||||
return (this._processInstanceVariablesApi ||= new ProcessInstanceVariablesApi(this.alfrescoApiService.getInstance()));
|
||||
}
|
||||
@LazyApi((self: ProcessService) => new ProcessInstanceVariablesApi(self.alfrescoApiService.getInstance()))
|
||||
declare readonly processInstanceVariablesApi: ProcessInstanceVariablesApi;
|
||||
|
||||
/**
|
||||
* Gets process instances for a filter and optionally a process definition.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { RuntimeAppDefinitionsApi, AppDefinitionRepresentation } from '@alfresco/js-api';
|
||||
import { RuntimeAppDefinitionsApi, AppDefinitionRepresentation, LazyApi } from '@alfresco/js-api';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { map } from 'rxjs/operators';
|
||||
@@ -27,11 +27,8 @@ import { map } from 'rxjs/operators';
|
||||
export class AppsProcessService {
|
||||
private readonly apiService = inject(AlfrescoApiService);
|
||||
|
||||
private _appsApi: RuntimeAppDefinitionsApi;
|
||||
get appsApi(): RuntimeAppDefinitionsApi {
|
||||
this._appsApi = this._appsApi ?? new RuntimeAppDefinitionsApi(this.apiService.getInstance());
|
||||
return this._appsApi;
|
||||
}
|
||||
@LazyApi((self: AppsProcessService) => new RuntimeAppDefinitionsApi(self.apiService.getInstance()))
|
||||
declare readonly appsApi: RuntimeAppDefinitionsApi;
|
||||
|
||||
/**
|
||||
* Gets a list of deployed apps for this user.
|
||||
|
||||
@@ -20,7 +20,7 @@ import { Observable, from } from 'rxjs';
|
||||
import { GroupModel } from '@alfresco/adf-core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { TaskActionsApi, UsersApi, ActivitiGroupsApi, UserProfileApi, UserRepresentation, LightUserRepresentation } from '@alfresco/js-api';
|
||||
import { TaskActionsApi, UsersApi, ActivitiGroupsApi, UserProfileApi, UserRepresentation, LightUserRepresentation, LazyApi } from '@alfresco/js-api';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -28,29 +28,17 @@ import { TaskActionsApi, UsersApi, ActivitiGroupsApi, UserProfileApi, UserRepres
|
||||
export class PeopleProcessService {
|
||||
private readonly apiService = inject(AlfrescoApiService);
|
||||
|
||||
private _taskActionsApi: TaskActionsApi;
|
||||
get taskActionsApi(): TaskActionsApi {
|
||||
this._taskActionsApi = this._taskActionsApi ?? new TaskActionsApi(this.apiService.getInstance());
|
||||
return this._taskActionsApi;
|
||||
}
|
||||
@LazyApi((self: PeopleProcessService) => new TaskActionsApi(self.apiService.getInstance()))
|
||||
declare readonly taskActionsApi: TaskActionsApi;
|
||||
|
||||
private _userApi: UsersApi;
|
||||
get userApi(): UsersApi {
|
||||
this._userApi = this._userApi ?? new UsersApi(this.apiService.getInstance());
|
||||
return this._userApi;
|
||||
}
|
||||
@LazyApi((self: PeopleProcessService) => new UsersApi(self.apiService.getInstance()))
|
||||
declare readonly userApi: UsersApi;
|
||||
|
||||
private _groupsApi: ActivitiGroupsApi;
|
||||
get groupsApi(): ActivitiGroupsApi {
|
||||
this._groupsApi = this._groupsApi ?? new ActivitiGroupsApi(this.apiService.getInstance());
|
||||
return this._groupsApi;
|
||||
}
|
||||
@LazyApi((self: PeopleProcessService) => new ActivitiGroupsApi(self.apiService.getInstance()))
|
||||
declare readonly groupsApi: ActivitiGroupsApi;
|
||||
|
||||
private _profileApi: UserProfileApi;
|
||||
get profileApi(): UserProfileApi {
|
||||
this._profileApi = this._profileApi ?? new UserProfileApi(this.apiService.getInstance());
|
||||
return this._profileApi;
|
||||
}
|
||||
@LazyApi((self: PeopleProcessService) => new UserProfileApi(self.apiService.getInstance()))
|
||||
declare readonly profileApi: UserProfileApi;
|
||||
|
||||
/**
|
||||
* Gets information about the current user.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { CommentModel, CommentsService } from '@alfresco/adf-core';
|
||||
import { ActivitiCommentsApi } from '@alfresco/js-api';
|
||||
import { ActivitiCommentsApi, LazyApi } from '@alfresco/js-api';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { from, Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
@@ -27,11 +27,8 @@ import { PeopleProcessService } from './people-process.service';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskCommentsService implements CommentsService {
|
||||
private _commentsApi: ActivitiCommentsApi;
|
||||
get commentsApi(): ActivitiCommentsApi {
|
||||
this._commentsApi = this._commentsApi ?? new ActivitiCommentsApi(this.apiService.getInstance());
|
||||
return this._commentsApi;
|
||||
}
|
||||
@LazyApi((self: TaskCommentsService) => new ActivitiCommentsApi(self.apiService.getInstance()))
|
||||
declare readonly commentsApi: ActivitiCommentsApi;
|
||||
|
||||
protected apiService = inject(AlfrescoApiService);
|
||||
protected peopleProcessService = inject(PeopleProcessService);
|
||||
|
||||
@@ -16,18 +16,15 @@
|
||||
*/
|
||||
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { ActivitiContentApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { ActivitiContentApi, LazyApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProcessUploadService extends UploadService {
|
||||
private _contentApi: ActivitiContentApi;
|
||||
get contentApi(): ActivitiContentApi {
|
||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
||||
return this._contentApi;
|
||||
}
|
||||
@LazyApi((self: ProcessUploadService) => new ActivitiContentApi(self.apiService.getInstance()))
|
||||
declare readonly contentApi: ActivitiContentApi;
|
||||
|
||||
getUploadPromise(file: any): Promise<RelatedContentRepresentation> {
|
||||
const opts = {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable, forkJoin, from } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { UserFiltersApi, UserTaskFilterRepresentation } from '@alfresco/js-api';
|
||||
import { LazyApi, UserFiltersApi, UserTaskFilterRepresentation } from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
|
||||
@Injectable({
|
||||
@@ -27,11 +27,8 @@ import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
export class TaskFilterService {
|
||||
protected apiService = inject(AlfrescoApiService);
|
||||
|
||||
private _userFiltersApi: UserFiltersApi;
|
||||
get userFiltersApi(): UserFiltersApi {
|
||||
this._userFiltersApi = this._userFiltersApi ?? new UserFiltersApi(this.apiService.getInstance());
|
||||
return this._userFiltersApi;
|
||||
}
|
||||
@LazyApi((self: TaskFilterService) => new UserFiltersApi(self.apiService.getInstance()))
|
||||
declare readonly userFiltersApi: UserFiltersApi;
|
||||
|
||||
/**
|
||||
* Creates and returns the default filters for a process app.
|
||||
|
||||
@@ -17,17 +17,14 @@
|
||||
|
||||
import { UploadService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivitiContentApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { ActivitiContentApi, LazyApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskUploadService extends UploadService {
|
||||
private _contentApi: ActivitiContentApi;
|
||||
get contentApi(): ActivitiContentApi {
|
||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
||||
return this._contentApi;
|
||||
}
|
||||
@LazyApi((self: TaskUploadService) => new ActivitiContentApi(self.apiService.getInstance()))
|
||||
declare readonly contentApi: ActivitiContentApi;
|
||||
|
||||
getUploadPromise(file: any): Promise<RelatedContentRepresentation> {
|
||||
const opts = {
|
||||
|
||||
@@ -28,7 +28,8 @@ import {
|
||||
ResultListDataRepresentationTaskRepresentation,
|
||||
TaskQueryRepresentation,
|
||||
UserTaskFilterRepresentation,
|
||||
TaskRepresentation
|
||||
TaskRepresentation,
|
||||
LazyApi
|
||||
} from '@alfresco/js-api';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
|
||||
@@ -38,29 +39,17 @@ import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
export class TaskListService {
|
||||
protected apiService = inject(AlfrescoApiService);
|
||||
|
||||
private _modelsApi: ModelsApi;
|
||||
get modelsApi(): ModelsApi {
|
||||
this._modelsApi = this._modelsApi ?? new ModelsApi(this.apiService.getInstance());
|
||||
return this._modelsApi;
|
||||
}
|
||||
@LazyApi((self: TaskListService) => new ModelsApi(self.apiService.getInstance()))
|
||||
declare readonly modelsApi: ModelsApi;
|
||||
|
||||
private _tasksApi: TasksApi;
|
||||
get tasksApi(): TasksApi {
|
||||
this._tasksApi = this._tasksApi ?? new TasksApi(this.apiService.getInstance());
|
||||
return this._tasksApi;
|
||||
}
|
||||
@LazyApi((self: TaskListService) => new TasksApi(self.apiService.getInstance()))
|
||||
declare readonly tasksApi: TasksApi;
|
||||
|
||||
private _taskActionsApi: TaskActionsApi;
|
||||
get taskActionsApi(): TaskActionsApi {
|
||||
this._taskActionsApi = this._taskActionsApi ?? new TaskActionsApi(this.apiService.getInstance());
|
||||
return this._taskActionsApi;
|
||||
}
|
||||
@LazyApi((self: TaskListService) => new TaskActionsApi(self.apiService.getInstance()))
|
||||
declare readonly taskActionsApi: TaskActionsApi;
|
||||
|
||||
private _checklistsApi: ChecklistsApi;
|
||||
get checklistsApi(): ChecklistsApi {
|
||||
this._checklistsApi = this._checklistsApi ?? new ChecklistsApi(this.apiService.getInstance());
|
||||
return this._checklistsApi;
|
||||
}
|
||||
@LazyApi((self: TaskListService) => new ChecklistsApi(self.apiService.getInstance()))
|
||||
declare readonly checklistsApi: ChecklistsApi;
|
||||
|
||||
/**
|
||||
* Gets all the filters in the list that belong to a task.
|
||||
|
||||
Reference in New Issue
Block a user