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:
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Agent, AgentsApi } from '@alfresco/js-api';
|
import { Agent, AgentsApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { BehaviorSubject, from, Observable, of } from 'rxjs';
|
import { BehaviorSubject, from, Observable, of } from 'rxjs';
|
||||||
import { map, switchMap } from 'rxjs/operators';
|
import { map, switchMap } from 'rxjs/operators';
|
||||||
import { AlfrescoApiService } from '../../services';
|
import { AlfrescoApiService } from '../../services';
|
||||||
@@ -27,13 +27,10 @@ import { AlfrescoApiService } from '../../services';
|
|||||||
export class AgentService {
|
export class AgentService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _agentsApi: AgentsApi;
|
|
||||||
private readonly agents = new BehaviorSubject<Agent[]>([]);
|
private readonly agents = new BehaviorSubject<Agent[]>([]);
|
||||||
|
|
||||||
get agentsApi(): AgentsApi {
|
@LazyApi((self: AgentService) => new AgentsApi(self.apiService.getInstance()))
|
||||||
this._agentsApi = this._agentsApi ?? new AgentsApi(this.apiService.getInstance());
|
declare readonly agentsApi: AgentsApi;
|
||||||
return this._agentsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
agents$ = this.agents.asObservable();
|
agents$ = this.agents.asObservable();
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|||||||
import { AppConfigService } from '@alfresco/adf-core';
|
import { AppConfigService } from '@alfresco/adf-core';
|
||||||
import { from, Observable, of, zip } from 'rxjs';
|
import { from, Observable, of, zip } from 'rxjs';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { AspectEntry, AspectPaging, AspectsApi, ListAspectsOpts } from '@alfresco/js-api';
|
import { AspectEntry, AspectPaging, AspectsApi, LazyApi, ListAspectsOpts } from '@alfresco/js-api';
|
||||||
import { CustomAspectPaging } from '../interfaces/custom-aspect-paging.interface';
|
import { CustomAspectPaging } from '../interfaces/custom-aspect-paging.interface';
|
||||||
|
|
||||||
export const StandardAspectsWhere = `(modelId in ('cm:contentmodel', 'emailserver:emailserverModel', 'smf:smartFolder', 'app:applicationmodel' ))`;
|
export const StandardAspectsWhere = `(modelId in ('cm:contentmodel', 'emailserver:emailserverModel', 'smf:smartFolder', 'app:applicationmodel' ))`;
|
||||||
@@ -33,11 +33,8 @@ export class AspectListService {
|
|||||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||||
private readonly appConfigService = inject(AppConfigService);
|
private readonly appConfigService = inject(AppConfigService);
|
||||||
|
|
||||||
private _aspectsApi: AspectsApi;
|
@LazyApi((self: AspectListService) => new AspectsApi(self.alfrescoApiService.getInstance()))
|
||||||
get aspectsApi(): AspectsApi {
|
declare readonly aspectsApi: AspectsApi;
|
||||||
this._aspectsApi = this._aspectsApi ?? new AspectsApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._aspectsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
getAllAspects(standardOpts?: ListAspectsOpts, customOpts?: ListAspectsOpts): Observable<CustomAspectPaging> {
|
getAllAspects(standardOpts?: ListAspectsOpts, customOpts?: ListAspectsOpts): Observable<CustomAspectPaging> {
|
||||||
const visibleAspectList = this.getVisibleAspects();
|
const visibleAspectList = this.getVisibleAspects();
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ import {
|
|||||||
CategoryPaging,
|
CategoryPaging,
|
||||||
ResultSetPaging,
|
ResultSetPaging,
|
||||||
SearchApi,
|
SearchApi,
|
||||||
SEARCH_LANGUAGE
|
SEARCH_LANGUAGE,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
@@ -36,18 +37,11 @@ export class CategoryService {
|
|||||||
private readonly userPreferencesService = inject(UserPreferencesService);
|
private readonly userPreferencesService = inject(UserPreferencesService);
|
||||||
private readonly appConfigService = inject(AppConfigService);
|
private readonly appConfigService = inject(AppConfigService);
|
||||||
|
|
||||||
private _categoriesApi: CategoriesApi;
|
@LazyApi((self: CategoryService) => new CategoriesApi(self.apiService.getInstance()))
|
||||||
private _searchApi: SearchApi;
|
declare readonly categoriesApi: CategoriesApi;
|
||||||
|
|
||||||
get categoriesApi(): CategoriesApi {
|
@LazyApi((self: CategoryService) => new SearchApi(self.apiService.getInstance()))
|
||||||
this._categoriesApi = this._categoriesApi ?? new CategoriesApi(this.apiService.getInstance());
|
declare readonly searchApi: SearchApi;
|
||||||
return this._categoriesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
get searchApi(): SearchApi {
|
|
||||||
this._searchApi = this._searchApi ?? new SearchApi(this.apiService.getInstance());
|
|
||||||
return this._searchApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get subcategories of a given parent category
|
* Get subcategories of a given parent category
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { ContentApi, Node, NodeEntry } from '@alfresco/js-api';
|
import { ContentApi, LazyApi, Node, NodeEntry } from '@alfresco/js-api';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { AuthenticationService, ThumbnailService } from '@alfresco/adf-core';
|
import { AuthenticationService, ThumbnailService } from '@alfresco/adf-core';
|
||||||
import { PermissionsEnum } from '../models/permissions.enum';
|
import { PermissionsEnum } from '../models/permissions.enum';
|
||||||
@@ -42,11 +42,8 @@ export class ContentService {
|
|||||||
folderCreate = new Subject<Node>();
|
folderCreate = new Subject<Node>();
|
||||||
folderEdit = new Subject<Node>();
|
folderEdit = new Subject<Node>();
|
||||||
|
|
||||||
private _contentApi: ContentApi;
|
@LazyApi((self: ContentService) => new ContentApi(self.apiService.getInstance()))
|
||||||
get contentApi(): ContentApi {
|
declare readonly contentApi: ContentApi;
|
||||||
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a content URL for the given node.
|
* Gets a content URL for the given node.
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import {
|
|||||||
DiscoveryApi,
|
DiscoveryApi,
|
||||||
AboutApi,
|
AboutApi,
|
||||||
SystemPropertiesApi,
|
SystemPropertiesApi,
|
||||||
BpmProductVersionModel
|
BpmProductVersionModel,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
import { AuthenticationService } from '@alfresco/adf-core';
|
import { AuthenticationService } from '@alfresco/adf-core';
|
||||||
@@ -36,11 +37,14 @@ export class DiscoveryApiService {
|
|||||||
private readonly authenticationService = inject(AuthenticationService);
|
private readonly authenticationService = inject(AuthenticationService);
|
||||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _discoveryApi: DiscoveryApi;
|
@LazyApi((self: DiscoveryApiService) => new DiscoveryApi(self.alfrescoApiService.getInstance()))
|
||||||
get discoveryApi(): DiscoveryApi {
|
declare readonly discoveryApi: DiscoveryApi;
|
||||||
this._discoveryApi = this._discoveryApi ?? new DiscoveryApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._discoveryApi;
|
@LazyApi((self: DiscoveryApiService) => new AboutApi(self.alfrescoApiService.getInstance()))
|
||||||
}
|
declare readonly aboutApi: AboutApi;
|
||||||
|
|
||||||
|
@LazyApi((self: DiscoveryApiService) => new SystemPropertiesApi(self.alfrescoApiService.getInstance()))
|
||||||
|
declare readonly systemPropertiesApi: SystemPropertiesApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets product information for Content Services.
|
* Gets product information for Content Services.
|
||||||
@@ -78,14 +82,11 @@ export class DiscoveryApiService {
|
|||||||
* @returns ProductVersionModel containing product details
|
* @returns ProductVersionModel containing product details
|
||||||
*/
|
*/
|
||||||
getBpmProductInfo(): Observable<BpmProductVersionModel> {
|
getBpmProductInfo(): Observable<BpmProductVersionModel> {
|
||||||
const aboutApi = new AboutApi(this.alfrescoApiService.getInstance());
|
return from(this.aboutApi.getAppVersion());
|
||||||
return from(aboutApi.getAppVersion());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getBPMSystemProperties(): Observable<SystemPropertiesRepresentation> {
|
getBPMSystemProperties(): Observable<SystemPropertiesRepresentation> {
|
||||||
const systemPropertiesApi = new SystemPropertiesApi(this.alfrescoApiService.getInstance());
|
return from(this.systemPropertiesApi.getProperties()).pipe(
|
||||||
|
|
||||||
return from(systemPropertiesApi.getProperties()).pipe(
|
|
||||||
map((res) => {
|
map((res) => {
|
||||||
if ('string' === typeof res) {
|
if ('string' === typeof res) {
|
||||||
throw new Error('Not valid response');
|
throw new Error('Not valid response');
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { FavoritesApi, NodePaging, FavoritePaging } from '@alfresco/js-api';
|
import { FavoritesApi, NodePaging, FavoritePaging, LazyApi } from '@alfresco/js-api';
|
||||||
import { Observable, from, of } from 'rxjs';
|
import { Observable, from, of } from 'rxjs';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||||
@@ -29,11 +29,8 @@ export class FavoritesApiService {
|
|||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
private readonly preferences = inject(UserPreferencesService);
|
private readonly preferences = inject(UserPreferencesService);
|
||||||
|
|
||||||
private _favoritesApi: FavoritesApi;
|
@LazyApi((self: FavoritesApiService) => new FavoritesApi(self.apiService.getInstance()))
|
||||||
get favoritesApi(): FavoritesApi {
|
declare readonly favoritesApi: FavoritesApi;
|
||||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.apiService.getInstance());
|
|
||||||
return this._favoritesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
static remapEntry({ entry }: any): any {
|
static remapEntry({ entry }: any): any {
|
||||||
entry.properties = {
|
entry.properties = {
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ import {
|
|||||||
TrashcanApi,
|
TrashcanApi,
|
||||||
SizeDetailsEntry,
|
SizeDetailsEntry,
|
||||||
JobIdBodyEntry,
|
JobIdBodyEntry,
|
||||||
NodeAssociationPaging
|
NodeAssociationPaging,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { from, Observable, Subject, throwError } from 'rxjs';
|
import { from, Observable, Subject, throwError } from 'rxjs';
|
||||||
@@ -47,17 +48,11 @@ export class NodesApiService {
|
|||||||
*/
|
*/
|
||||||
nodeUpdated = new Subject<Node>();
|
nodeUpdated = new Subject<Node>();
|
||||||
|
|
||||||
private _trashcanApi: TrashcanApi;
|
@LazyApi((self: NodesApiService) => new TrashcanApi(self.apiService.getInstance()))
|
||||||
get trashcanApi(): TrashcanApi {
|
declare readonly trashcanApi: TrashcanApi;
|
||||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
|
|
||||||
return this._trashcanApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: NodesApiService) => new NodesApi(self.apiService.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private getEntryFromEntity(entity: NodeEntry): Node {
|
private getEntryFromEntity(entity: NodeEntry): Node {
|
||||||
return entity.entry;
|
return entity.entry;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { Injectable, inject } from '@angular/core';
|
|||||||
import { from, Observable, of } from 'rxjs';
|
import { from, Observable, of } from 'rxjs';
|
||||||
import { AuthenticationService } from '@alfresco/adf-core';
|
import { AuthenticationService } from '@alfresco/adf-core';
|
||||||
import { map, tap } from 'rxjs/operators';
|
import { map, tap } from 'rxjs/operators';
|
||||||
import { Pagination, PeopleApi, PersonBodyCreate, PersonBodyUpdate } from '@alfresco/js-api';
|
import { LazyApi, Pagination, PeopleApi, PersonBodyCreate, PersonBodyUpdate } from '@alfresco/js-api';
|
||||||
import { EcmUserModel } from '../models/ecm-user.model';
|
import { EcmUserModel } from '../models/ecm-user.model';
|
||||||
import { ContentService } from './content.service';
|
import { ContentService } from './content.service';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
@@ -49,11 +49,8 @@ export class PeopleContentService {
|
|||||||
|
|
||||||
private currentUser: EcmUserModel;
|
private currentUser: EcmUserModel;
|
||||||
|
|
||||||
private _peopleApi: PeopleApi;
|
@LazyApi((self: PeopleContentService) => new PeopleApi(self.apiService.getInstance()))
|
||||||
get peopleApi(): PeopleApi {
|
declare readonly peopleApi: PeopleApi;
|
||||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance());
|
|
||||||
return this._peopleApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
const authenticationService = inject(AuthenticationService);
|
const authenticationService = inject(AuthenticationService);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { ContentApi, RenditionEntry, RenditionPaging, RenditionsApi, VersionsApi } from '@alfresco/js-api';
|
import { ContentApi, LazyApi, RenditionEntry, RenditionPaging, RenditionsApi, VersionsApi } from '@alfresco/js-api';
|
||||||
import { Track, TranslationService, ViewUtilService } from '@alfresco/adf-core';
|
import { Track, TranslationService, ViewUtilService } from '@alfresco/adf-core';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
|
|
||||||
@@ -56,26 +56,16 @@ export class RenditionService {
|
|||||||
* Timeout used for setInterval.
|
* Timeout used for setInterval.
|
||||||
*/
|
*/
|
||||||
private readonly TRY_TIMEOUT: number = 10000;
|
private readonly TRY_TIMEOUT: number = 10000;
|
||||||
|
|
||||||
_renditionsApi: RenditionsApi;
|
|
||||||
get renditionsApi(): RenditionsApi {
|
|
||||||
this._renditionsApi = this._renditionsApi ?? new RenditionsApi(this.apiService.getInstance());
|
|
||||||
return this._renditionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
_contentApi: ContentApi;
|
|
||||||
get contentApi(): ContentApi {
|
|
||||||
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
_versionsApi: VersionsApi;
|
|
||||||
private readonly DEFAULT_RENDITION: string = 'imgpreview';
|
private readonly DEFAULT_RENDITION: string = 'imgpreview';
|
||||||
|
|
||||||
get versionsApi(): VersionsApi {
|
@LazyApi((self: RenditionService) => new RenditionsApi(self.apiService.getInstance()))
|
||||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
declare readonly renditionsApi: RenditionsApi;
|
||||||
return this._versionsApi;
|
|
||||||
}
|
@LazyApi((self: RenditionService) => new ContentApi(self.apiService.getInstance()))
|
||||||
|
declare readonly contentApi: ContentApi;
|
||||||
|
|
||||||
|
@LazyApi((self: RenditionService) => new VersionsApi(self.apiService.getInstance()))
|
||||||
|
declare readonly versionsApi: VersionsApi;
|
||||||
|
|
||||||
getRenditionUrl(nodeId: string, type: string, renditionExists: boolean): string {
|
getRenditionUrl(nodeId: string, type: string, renditionExists: boolean): string {
|
||||||
return renditionExists && type !== RenditionService.ContentGroup.IMAGE
|
return renditionExists && type !== RenditionService.ContentGroup.IMAGE
|
||||||
|
|||||||
@@ -19,14 +19,12 @@ import { inject, Injectable } from '@angular/core';
|
|||||||
import { SavedSearchStrategy } from '../interfaces/saved-searches-strategy.interface';
|
import { SavedSearchStrategy } from '../interfaces/saved-searches-strategy.interface';
|
||||||
import { AuthenticationService } from '@alfresco/adf-core';
|
import { AuthenticationService } from '@alfresco/adf-core';
|
||||||
import { ReplaySubject, Observable, catchError, switchMap, take, tap, throwError, map } from 'rxjs';
|
import { ReplaySubject, Observable, catchError, switchMap, take, tap, throwError, map } from 'rxjs';
|
||||||
import { NodeEntry, NodesApi } from '@alfresco/js-api';
|
import { LazyApi, NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||||
import { SavedSearch } from '../interfaces/saved-search.interface';
|
import { SavedSearch } from '../interfaces/saved-search.interface';
|
||||||
import { AlfrescoApiService } from '../../services';
|
import { AlfrescoApiService } from '../../services';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export abstract class SavedSearchesBaseService implements SavedSearchStrategy {
|
export abstract class SavedSearchesBaseService implements SavedSearchStrategy {
|
||||||
private _nodesApi: NodesApi;
|
|
||||||
|
|
||||||
private static readonly SAVE_MODE_THRESHOLD = 5;
|
private static readonly SAVE_MODE_THRESHOLD = 5;
|
||||||
|
|
||||||
protected readonly _savedSearches$ = new ReplaySubject<SavedSearch[]>(1);
|
protected readonly _savedSearches$ = new ReplaySubject<SavedSearch[]>(1);
|
||||||
@@ -35,10 +33,8 @@ export abstract class SavedSearchesBaseService implements SavedSearchStrategy {
|
|||||||
protected readonly apiService = inject(AlfrescoApiService);
|
protected readonly apiService = inject(AlfrescoApiService);
|
||||||
protected readonly authService = inject(AuthenticationService);
|
protected readonly authService = inject(AuthenticationService);
|
||||||
|
|
||||||
get nodesApi(): NodesApi {
|
@LazyApi((self: SavedSearchesBaseService) => new NodesApi(self.apiService.getInstance()))
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
declare readonly nodesApi: NodesApi;
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract fetchAllSavedSearches(): Observable<SavedSearch[]>;
|
protected abstract fetchAllSavedSearches(): Observable<SavedSearch[]>;
|
||||||
protected abstract updateSavedSearches(searches: SavedSearch[]): Observable<NodeEntry>;
|
protected abstract updateSavedSearches(searches: SavedSearch[]): Observable<NodeEntry>;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { NodeEntry, PreferencesApi, ContentFieldsQuery, PreferenceEntry } from '@alfresco/js-api';
|
import { NodeEntry, PreferencesApi, ContentFieldsQuery, PreferenceEntry, LazyApi } from '@alfresco/js-api';
|
||||||
import { Injectable, InjectionToken, inject } from '@angular/core';
|
import { Injectable, InjectionToken, inject } from '@angular/core';
|
||||||
import { Observable, of, from, throwError } from 'rxjs';
|
import { Observable, of, from, throwError } from 'rxjs';
|
||||||
import { catchError, concatMap, first, map, switchMap, take, tap } from 'rxjs/operators';
|
import { catchError, concatMap, first, map, switchMap, take, tap } from 'rxjs/operators';
|
||||||
@@ -34,18 +34,15 @@ export const SAVED_SEARCHES_SERVICE_PREFERENCES = new InjectionToken<SavedSearch
|
|||||||
})
|
})
|
||||||
export class SavedSearchesService extends SavedSearchesBaseService {
|
export class SavedSearchesService extends SavedSearchesBaseService {
|
||||||
private savedSearchFileNodeId: string;
|
private savedSearchFileNodeId: string;
|
||||||
private _preferencesApi: SavedSearchesPreferencesApiService;
|
|
||||||
private readonly preferencesService = inject(SAVED_SEARCHES_SERVICE_PREFERENCES, { optional: true });
|
private readonly preferencesService = inject(SAVED_SEARCHES_SERVICE_PREFERENCES, { optional: true });
|
||||||
|
|
||||||
get preferencesApi(): SavedSearchesPreferencesApiService {
|
@LazyApi((self: SavedSearchesService) => {
|
||||||
if (this.preferencesService) {
|
if (self.preferencesService) {
|
||||||
this._preferencesApi = this.preferencesService;
|
return self.preferencesService;
|
||||||
return this._preferencesApi;
|
|
||||||
}
|
}
|
||||||
|
return new PreferencesApi(self.apiService.getInstance());
|
||||||
this._preferencesApi = this._preferencesApi ?? new PreferencesApi(this.apiService.getInstance());
|
})
|
||||||
return this._preferencesApi;
|
declare readonly preferencesApi: SavedSearchesPreferencesApiService;
|
||||||
}
|
|
||||||
|
|
||||||
protected fetchAllSavedSearches(): Observable<SavedSearch[]> {
|
protected fetchAllSavedSearches(): Observable<SavedSearch[]> {
|
||||||
const savedSearchesMigrated = localStorage.getItem(this.getLocalStorageKey()) ?? '';
|
const savedSearchesMigrated = localStorage.getItem(this.getLocalStorageKey()) ?? '';
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ import {
|
|||||||
SiteMembershipBodyUpdate,
|
SiteMembershipBodyUpdate,
|
||||||
SiteMembershipRequestWithPersonPaging,
|
SiteMembershipRequestWithPersonPaging,
|
||||||
SitePaging,
|
SitePaging,
|
||||||
SitesApi
|
SitesApi,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
|
|
||||||
@@ -39,11 +40,8 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|||||||
export class SitesService {
|
export class SitesService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _sitesApi: SitesApi;
|
@LazyApi((self: SitesService) => new SitesApi(self.apiService.getInstance()))
|
||||||
get sitesApi(): SitesApi {
|
declare readonly sitesApi: SitesApi;
|
||||||
this._sitesApi = this._sitesApi ?? new SitesApi(this.apiService.getInstance());
|
|
||||||
return this._sitesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a site
|
* Create a site
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import { FileModel, FileUploadProgress, FileUploadStatus } from '../models/file.
|
|||||||
import { AppConfigService } from '@alfresco/adf-core';
|
import { AppConfigService } from '@alfresco/adf-core';
|
||||||
import { filter } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
import { DiscoveryApiService } from '../../common/services/discovery-api.service';
|
import { DiscoveryApiService } from '../../common/services/discovery-api.service';
|
||||||
import { NodeBodyCreate, NodesApi, UploadApi, VersionsApi } from '@alfresco/js-api';
|
import { LazyApi, NodeBodyCreate, NodesApi, UploadApi, VersionsApi } from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
|
|
||||||
const MIN_CANCELLABLE_FILE_SIZE = 1000000;
|
const MIN_CANCELLABLE_FILE_SIZE = 1000000;
|
||||||
@@ -56,23 +56,14 @@ export class UploadService {
|
|||||||
private abortedFile: string;
|
private abortedFile: string;
|
||||||
private isThumbnailGenerationEnabled: boolean;
|
private isThumbnailGenerationEnabled: boolean;
|
||||||
|
|
||||||
private _uploadApi: UploadApi;
|
@LazyApi((self: UploadService) => new UploadApi(self.apiService.getInstance()))
|
||||||
get uploadApi(): UploadApi {
|
declare readonly uploadApi: UploadApi;
|
||||||
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
|
|
||||||
return this._uploadApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: UploadService) => new NodesApi(self.apiService.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _versionsApi: VersionsApi;
|
@LazyApi((self: UploadService) => new VersionsApi(self.apiService.getInstance()))
|
||||||
get versionsApi(): VersionsApi {
|
declare readonly versionsApi: VersionsApi;
|
||||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
|
||||||
return this._versionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected apiService = inject(AlfrescoApiService);
|
protected apiService = inject(AlfrescoApiService);
|
||||||
protected appConfigService = inject(AppConfigService);
|
protected appConfigService = inject(AppConfigService);
|
||||||
|
|||||||
+3
-6
@@ -20,7 +20,7 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|||||||
import { Observable, defer, forkJoin } from 'rxjs';
|
import { Observable, defer, forkJoin } from 'rxjs';
|
||||||
import { PropertyGroup, PropertyGroupContainer } from '../interfaces/content-metadata.interfaces';
|
import { PropertyGroup, PropertyGroupContainer } from '../interfaces/content-metadata.interfaces';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { ClassesApi } from '@alfresco/js-api';
|
import { ClassesApi, LazyApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -28,11 +28,8 @@ import { ClassesApi } from '@alfresco/js-api';
|
|||||||
export class PropertyDescriptorsService {
|
export class PropertyDescriptorsService {
|
||||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _classesApi: ClassesApi;
|
@LazyApi((self: PropertyDescriptorsService) => new ClassesApi(self.alfrescoApiService.getInstance()))
|
||||||
get classesApi(): ClassesApi {
|
declare readonly classesApi: ClassesApi;
|
||||||
this._classesApi = this._classesApi ?? new ClassesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._classesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
load(groupNames: string[]): Observable<PropertyGroupContainer> {
|
load(groupNames: string[]): Observable<PropertyGroupContainer> {
|
||||||
const groupFetchStreams = groupNames
|
const groupFetchStreams = groupNames
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { DestroyRef, Directive, HostListener, inject, Input, NgZone, OnChanges } from '@angular/core';
|
import { DestroyRef, Directive, HostListener, inject, Input, NgZone, OnChanges } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { NodeEntry, NodesApi } from '@alfresco/js-api';
|
import { LazyApi, NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
import { ShareDialogComponent } from './content-node-share.dialog';
|
import { ShareDialogComponent } from './content-node-share.dialog';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
@@ -45,11 +45,8 @@ export class NodeSharedDirective implements OnChanges {
|
|||||||
@Input()
|
@Input()
|
||||||
baseShareUrl: string;
|
baseShareUrl: string;
|
||||||
|
|
||||||
_nodesApi: NodesApi;
|
@LazyApi((self: NodeSharedDirective) => new NodesApi(self.alfrescoApiService.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
shareNode(nodeEntry: NodeEntry) {
|
shareNode(nodeEntry: NodeEntry) {
|
||||||
|
|||||||
+3
-6
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { NodePaging, SharedLinkBodyCreate, SharedLinkEntry, SharedlinksApi } from '@alfresco/js-api';
|
import { LazyApi, NodePaging, SharedLinkBodyCreate, SharedLinkEntry, SharedlinksApi } from '@alfresco/js-api';
|
||||||
import { Observable, from, of, Subject } from 'rxjs';
|
import { Observable, from, of, Subject } from 'rxjs';
|
||||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
@@ -31,11 +31,8 @@ export class SharedLinksApiService {
|
|||||||
|
|
||||||
error = new Subject<{ statusCode: number; message: string }>();
|
error = new Subject<{ statusCode: number; message: string }>();
|
||||||
|
|
||||||
private _sharedLinksApi: SharedlinksApi;
|
@LazyApi((self: SharedLinksApiService) => new SharedlinksApi(self.apiService.getInstance()))
|
||||||
get sharedLinksApi(): SharedlinksApi {
|
declare readonly sharedLinksApi: SharedlinksApi;
|
||||||
this._sharedLinksApi = this._sharedLinksApi ?? new SharedlinksApi(this.apiService.getInstance());
|
|
||||||
return this._sharedLinksApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets shared links available to the current user.
|
* Gets shared links available to the current user.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { TypeEntry, TypePaging, TypesApi } from '@alfresco/js-api';
|
import { LazyApi, TypeEntry, TypePaging, TypesApi } from '@alfresco/js-api';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
@@ -27,11 +27,8 @@ import { map } from 'rxjs/operators';
|
|||||||
export class ContentTypeService {
|
export class ContentTypeService {
|
||||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _typesApi: TypesApi;
|
@LazyApi((self: ContentTypeService) => new TypesApi(self.alfrescoApiService.getInstance()))
|
||||||
get typesApi(): TypesApi {
|
declare readonly typesApi: TypesApi;
|
||||||
this._typesApi = this._typesApi ?? new TypesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._typesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
getContentTypeByPrefix(prefixedType: string): Observable<TypeEntry> {
|
getContentTypeByPrefix(prefixedType: string): Observable<TypeEntry> {
|
||||||
return from(this.typesApi.getType(prefixedType));
|
return from(this.typesApi.getType(prefixedType));
|
||||||
|
|||||||
@@ -62,11 +62,7 @@ class DownloadsApiMock extends DownloadsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class DownloadZipMockService extends DownloadZipService {
|
export class DownloadZipMockService extends DownloadZipService {
|
||||||
private _mockDownloadsApi: DownloadsApi;
|
override readonly downloadsApi: DownloadsApi = new DownloadsApiMock();
|
||||||
get downloadsApi(): DownloadsApi {
|
|
||||||
this._mockDownloadsApi = this._mockDownloadsApi ?? new DownloadsApiMock();
|
|
||||||
return this._mockDownloadsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
createDownload(payload: DownloadBodyCreate): Observable<DownloadEntry> {
|
createDownload(payload: DownloadBodyCreate): Observable<DownloadEntry> {
|
||||||
return from(this.downloadsApi.createDownload(payload)).pipe(catchError((err) => of(err)));
|
return from(this.downloadsApi.createDownload(payload)).pipe(catchError((err) => of(err)));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DownloadEntry, DownloadBodyCreate, DownloadsApi } from '@alfresco/js-api';
|
import { DownloadEntry, DownloadBodyCreate, DownloadsApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { AlfrescoApiService } from '../../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../../services/alfresco-api.service';
|
||||||
@@ -26,11 +26,8 @@ import { AlfrescoApiService } from '../../../services/alfresco-api.service';
|
|||||||
export class DownloadZipService {
|
export class DownloadZipService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _downloadsApi: DownloadsApi;
|
@LazyApi((self: DownloadZipService) => new DownloadsApi(self.apiService.getInstance()))
|
||||||
get downloadsApi(): DownloadsApi {
|
declare readonly downloadsApi: DownloadsApi;
|
||||||
this._downloadsApi = this._downloadsApi ?? new DownloadsApi(this.apiService.getInstance());
|
|
||||||
return this._downloadsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new download.
|
* Creates a new download.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
Validators
|
Validators
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
import { MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { QueriesApi, SiteBodyCreate, SiteEntry, SitePaging } from '@alfresco/js-api';
|
import { LazyApi, QueriesApi, SiteBodyCreate, SiteEntry, SitePaging } from '@alfresco/js-api';
|
||||||
import { NotificationService } from '@alfresco/adf-core';
|
import { NotificationService } from '@alfresco/adf-core';
|
||||||
import { debounceTime, finalize, map, mergeMap, take } from 'rxjs/operators';
|
import { debounceTime, finalize, map, mergeMap, take } from 'rxjs/operators';
|
||||||
import { SitesService } from '../../common/services/sites.service';
|
import { SitesService } from '../../common/services/sites.service';
|
||||||
@@ -101,11 +101,8 @@ export class LibraryDialogComponent implements OnInit {
|
|||||||
];
|
];
|
||||||
disableCreateButton = false;
|
disableCreateButton = false;
|
||||||
|
|
||||||
_queriesApi: QueriesApi;
|
@LazyApi((self: LibraryDialogComponent) => new QueriesApi(self.alfrescoApiService.getInstance()))
|
||||||
get queriesApi(): QueriesApi {
|
declare readonly queriesApi: QueriesApi;
|
||||||
this._queriesApi = this._queriesApi ?? new QueriesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._queriesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { Component, OnInit, ViewEncapsulation, inject } from '@angular/core';
|
|||||||
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||||
import { differenceInSeconds } from 'date-fns';
|
import { differenceInSeconds } from 'date-fns';
|
||||||
import { NodeBodyLock, Node, NodeEntry, NodesApi } from '@alfresco/js-api';
|
import { NodeBodyLock, Node, NodeEntry, NodesApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { TranslatePipe } from '@ngx-translate/core';
|
import { TranslatePipe } from '@ngx-translate/core';
|
||||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||||
@@ -55,11 +55,8 @@ export class NodeLockDialogComponent implements OnInit {
|
|||||||
node: Node = null;
|
node: Node = null;
|
||||||
nodeName: string;
|
nodeName: string;
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: NodeLockDialogComponent) => new NodesApi(self.alfrescoApi.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApi.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const { node } = this.data;
|
const { node } = this.data;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Directive, HostListener, Input, OnChanges, Output, EventEmitter, SimpleChanges, inject } from '@angular/core';
|
import { Directive, HostListener, Input, OnChanges, Output, EventEmitter, SimpleChanges, inject } from '@angular/core';
|
||||||
import { FavoriteBodyCreate, FavoritesApi } from '@alfresco/js-api';
|
import { FavoriteBodyCreate, FavoritesApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
import { LibraryEntity } from '../interfaces/library-entity.interface';
|
import { LibraryEntity } from '../interfaces/library-entity.interface';
|
||||||
import { NotificationService } from '@alfresco/adf-core';
|
import { NotificationService } from '@alfresco/adf-core';
|
||||||
@@ -39,11 +39,8 @@ export class LibraryFavoriteDirective implements OnChanges {
|
|||||||
|
|
||||||
private targetLibrary = null;
|
private targetLibrary = null;
|
||||||
|
|
||||||
private _favoritesApi: FavoritesApi;
|
@LazyApi((self: LibraryFavoriteDirective) => new FavoritesApi(self.alfrescoApiService.getInstance()))
|
||||||
get favoritesApi(): FavoritesApi {
|
declare readonly favoritesApi: FavoritesApi;
|
||||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._favoritesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
@HostListener('click')
|
@HostListener('click')
|
||||||
onClick() {
|
onClick() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core';
|
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core';
|
||||||
import { SiteEntry, SiteMembershipRequestBodyCreate, SiteMembershipRequestEntry, SitesApi } from '@alfresco/js-api';
|
import { LazyApi, SiteEntry, SiteMembershipRequestBodyCreate, SiteMembershipRequestEntry, SitesApi } from '@alfresco/js-api';
|
||||||
import { BehaviorSubject, from, Observable } from 'rxjs';
|
import { BehaviorSubject, from, Observable } from 'rxjs';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
import { LibraryMembershipToggleEvent } from '../interfaces/library-membership-toggle-event.interface';
|
import { LibraryMembershipToggleEvent } from '../interfaces/library-membership-toggle-event.interface';
|
||||||
@@ -38,11 +38,8 @@ export class LibraryMembershipDirective implements OnChanges {
|
|||||||
|
|
||||||
isJoinRequested: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
isJoinRequested: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||||
|
|
||||||
private _sitesApi: SitesApi;
|
@LazyApi((self: LibraryMembershipDirective) => new SitesApi(self.alfrescoApiService.getInstance()))
|
||||||
get sitesApi(): SitesApi {
|
declare readonly sitesApi: SitesApi;
|
||||||
this._sitesApi = this._sitesApi ?? new SitesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._sitesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Site for which to toggle the membership request. */
|
/** Site for which to toggle the membership request. */
|
||||||
@Input('adf-library-membership')
|
@Input('adf-library-membership')
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
/* eslint-disable @angular-eslint/no-input-rename */
|
/* eslint-disable @angular-eslint/no-input-rename */
|
||||||
|
|
||||||
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output, inject } from '@angular/core';
|
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output, inject } from '@angular/core';
|
||||||
import { NodeEntry, Node, DeletedNodeEntry, DeletedNode, TrashcanApi, NodesApi } from '@alfresco/js-api';
|
import { NodeEntry, Node, DeletedNodeEntry, DeletedNode, TrashcanApi, NodesApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { Observable, forkJoin, from, of } from 'rxjs';
|
import { Observable, forkJoin, from, of } from 'rxjs';
|
||||||
import { TranslationService } from '@alfresco/adf-core';
|
import { TranslationService } from '@alfresco/adf-core';
|
||||||
import { map, catchError, retry } from 'rxjs/operators';
|
import { map, catchError, retry } from 'rxjs/operators';
|
||||||
@@ -67,17 +67,11 @@ export class NodeDeleteDirective implements OnChanges {
|
|||||||
@Output()
|
@Output()
|
||||||
delete: EventEmitter<any> = new EventEmitter();
|
delete: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
private _trashcanApi: TrashcanApi;
|
@LazyApi((self: NodeDeleteDirective) => new TrashcanApi(self.alfrescoApiService.getInstance()))
|
||||||
get trashcanApi(): TrashcanApi {
|
declare readonly trashcanApi: TrashcanApi;
|
||||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._trashcanApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: NodeDeleteDirective) => new NodesApi(self.alfrescoApiService.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
@HostListener('click')
|
@HostListener('click')
|
||||||
onClick() {
|
onClick() {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { Directive, Input, HostListener, inject } from '@angular/core';
|
|||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { DownloadService } from '@alfresco/adf-core';
|
import { DownloadService } from '@alfresco/adf-core';
|
||||||
import { DownloadZipDialogComponent } from '../dialogs/download-zip/download-zip.dialog';
|
import { DownloadZipDialogComponent } from '../dialogs/download-zip/download-zip.dialog';
|
||||||
import { ContentApi, NodeEntry, VersionEntry } from '@alfresco/js-api';
|
import { ContentApi, LazyApi, NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,11 +35,8 @@ export class NodeDownloadDirective {
|
|||||||
private readonly downloadService = inject(DownloadService);
|
private readonly downloadService = inject(DownloadService);
|
||||||
private readonly dialog = inject(MatDialog);
|
private readonly dialog = inject(MatDialog);
|
||||||
|
|
||||||
private _contentApi: ContentApi;
|
@LazyApi((self: NodeDownloadDirective) => new ContentApi(self.apiService.getInstance()))
|
||||||
get contentApi(): ContentApi {
|
declare readonly contentApi: ContentApi;
|
||||||
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Nodes to download. */
|
/** Nodes to download. */
|
||||||
@Input('adfNodeDownload')
|
@Input('adfNodeDownload')
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
/* eslint-disable @angular-eslint/no-input-rename */
|
/* eslint-disable @angular-eslint/no-input-rename */
|
||||||
|
|
||||||
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core';
|
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core';
|
||||||
import { FavoriteBodyCreate, NodeEntry, SharedLinkEntry, Node, SharedLink, FavoritesApi } from '@alfresco/js-api';
|
import { FavoriteBodyCreate, NodeEntry, SharedLinkEntry, Node, SharedLink, FavoritesApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { Observable, from, forkJoin, of } from 'rxjs';
|
import { Observable, from, forkJoin, of } from 'rxjs';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
@@ -35,11 +35,8 @@ export class NodeFavoriteDirective implements OnChanges {
|
|||||||
|
|
||||||
favorites: any[] = [];
|
favorites: any[] = [];
|
||||||
|
|
||||||
private _favoritesApi: FavoritesApi;
|
@LazyApi((self: NodeFavoriteDirective) => new FavoritesApi(self.alfrescoApiService.getInstance()))
|
||||||
get favoritesApi(): FavoritesApi {
|
declare readonly favoritesApi: FavoritesApi;
|
||||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._favoritesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Array of nodes to toggle as favorites. */
|
/** Array of nodes to toggle as favorites. */
|
||||||
@Input('adf-node-favorite')
|
@Input('adf-node-favorite')
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
|
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
|
||||||
|
|
||||||
import { Directive, EventEmitter, HostListener, Input, Output, inject } from '@angular/core';
|
import { Directive, EventEmitter, HostListener, Input, Output, inject } from '@angular/core';
|
||||||
import { TrashcanApi, DeletedNodeEntry, DeletedNodesPaging } from '@alfresco/js-api';
|
import { TrashcanApi, DeletedNodeEntry, DeletedNodesPaging, LazyApi } from '@alfresco/js-api';
|
||||||
import { Observable, forkJoin, from, of } from 'rxjs';
|
import { Observable, forkJoin, from, of } from 'rxjs';
|
||||||
import { tap, mergeMap, map, catchError } from 'rxjs/operators';
|
import { tap, mergeMap, map, catchError } from 'rxjs/operators';
|
||||||
import { TranslationService } from '@alfresco/adf-core';
|
import { TranslationService } from '@alfresco/adf-core';
|
||||||
@@ -35,11 +35,8 @@ export class NodeRestoreDirective {
|
|||||||
|
|
||||||
private readonly restoreProcessStatus;
|
private readonly restoreProcessStatus;
|
||||||
|
|
||||||
private _trashcanApi: TrashcanApi;
|
@LazyApi((self: NodeRestoreDirective) => new TrashcanApi(self.alfrescoApiService.getInstance()))
|
||||||
get trashcanApi(): TrashcanApi {
|
declare readonly trashcanApi: TrashcanApi;
|
||||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._trashcanApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Array of deleted nodes to restore. */
|
/** Array of deleted nodes to restore. */
|
||||||
@Input('adf-restore')
|
@Input('adf-restore')
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ import {
|
|||||||
UserPreferencesService,
|
UserPreferencesService,
|
||||||
UserPreferenceValues
|
UserPreferenceValues
|
||||||
} from '@alfresco/adf-core';
|
} from '@alfresco/adf-core';
|
||||||
import { Node, NodeEntry, NodePaging, NodesApi, Pagination } from '@alfresco/js-api';
|
import { LazyApi, Node, NodeEntry, NodePaging, NodesApi, Pagination } from '@alfresco/js-api';
|
||||||
import {
|
import {
|
||||||
AfterContentInit,
|
AfterContentInit,
|
||||||
Component,
|
Component,
|
||||||
@@ -469,11 +469,8 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
|
|||||||
|
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: DocumentListComponent) => new NodesApi(self.alfrescoApiService.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
const appConfig = inject(AppConfigService);
|
const appConfig = inject(AppConfigService);
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ import {
|
|||||||
NodesApi,
|
NodesApi,
|
||||||
SitePaging,
|
SitePaging,
|
||||||
ResultSetPaging,
|
ResultSetPaging,
|
||||||
SEARCH_LANGUAGE
|
SEARCH_LANGUAGE,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from, of } from 'rxjs';
|
import { Observable, from, of } from 'rxjs';
|
||||||
@@ -45,47 +46,26 @@ const CREATE_PERMISSION: string = 'create';
|
|||||||
export class CustomResourcesService {
|
export class CustomResourcesService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _peopleApi: PeopleApi;
|
@LazyApi((self: CustomResourcesService) => new PeopleApi(self.apiService.getInstance()))
|
||||||
get peopleApi(): PeopleApi {
|
declare readonly peopleApi: PeopleApi;
|
||||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance());
|
|
||||||
return this._peopleApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _sitesApi: SitesApi;
|
@LazyApi((self: CustomResourcesService) => new SitesApi(self.apiService.getInstance()))
|
||||||
get sitesApi(): SitesApi {
|
declare readonly sitesApi: SitesApi;
|
||||||
this._sitesApi = this._sitesApi ?? new SitesApi(this.apiService.getInstance());
|
|
||||||
return this._sitesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _trashcanApi: TrashcanApi;
|
@LazyApi((self: CustomResourcesService) => new TrashcanApi(self.apiService.getInstance()))
|
||||||
get trashcanApi(): TrashcanApi {
|
declare readonly trashcanApi: TrashcanApi;
|
||||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
|
|
||||||
return this._trashcanApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _searchApi: SearchApi;
|
@LazyApi((self: CustomResourcesService) => new SearchApi(self.apiService.getInstance()))
|
||||||
get searchApi(): SearchApi {
|
declare readonly searchApi: SearchApi;
|
||||||
this._searchApi = this._searchApi ?? new SearchApi(this.apiService.getInstance());
|
|
||||||
return this._searchApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _sharedLinksApi: SharedlinksApi;
|
@LazyApi((self: CustomResourcesService) => new SharedlinksApi(self.apiService.getInstance()))
|
||||||
get sharedLinksApi(): SharedlinksApi {
|
declare readonly sharedLinksApi: SharedlinksApi;
|
||||||
this._sharedLinksApi = this._sharedLinksApi ?? new SharedlinksApi(this.apiService.getInstance());
|
|
||||||
return this._sharedLinksApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _favoritesApi: FavoritesApi;
|
@LazyApi((self: CustomResourcesService) => new FavoritesApi(self.apiService.getInstance()))
|
||||||
get favoritesApi(): FavoritesApi {
|
declare readonly favoritesApi: FavoritesApi;
|
||||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.apiService.getInstance());
|
|
||||||
return this._favoritesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: CustomResourcesService) => new NodesApi(self.apiService.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets files recently accessed by a user.
|
* Gets files recently accessed by a user.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import { PaginationModel } from '@alfresco/adf-core';
|
import { PaginationModel } from '@alfresco/adf-core';
|
||||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||||
import { inject, Injectable } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { Node, NodeEntry, NodePaging, NodesApi } from '@alfresco/js-api';
|
import { LazyApi, Node, NodeEntry, NodePaging, NodesApi } from '@alfresco/js-api';
|
||||||
import { DocumentLoaderNode } from '../models/document-folder.model';
|
import { DocumentLoaderNode } from '../models/document-folder.model';
|
||||||
import { Observable, from, forkJoin, Subject } from 'rxjs';
|
import { Observable, from, forkJoin, Subject } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
@@ -36,11 +36,8 @@ export class DocumentListService implements DocumentListLoader {
|
|||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
private readonly customResourcesService = inject(CustomResourcesService);
|
private readonly customResourcesService = inject(CustomResourcesService);
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: DocumentListService) => new NodesApi(self.apiService.getInstance()))
|
||||||
get nodes(): NodesApi {
|
declare readonly nodes: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly _reload = new Subject<void>();
|
private readonly _reload = new Subject<void>();
|
||||||
private readonly _resetSelection = new Subject<void>();
|
private readonly _resetSelection = new Subject<void>();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { ContentIncludeQuery, Group, GroupEntry, GroupsApi } from '@alfresco/js-api';
|
import { ContentIncludeQuery, Group, GroupEntry, GroupsApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
@@ -27,11 +27,8 @@ import { map } from 'rxjs/operators';
|
|||||||
export class GroupService {
|
export class GroupService {
|
||||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _groupsApi: GroupsApi;
|
@LazyApi((self: GroupService) => new GroupsApi(self.alfrescoApiService.getInstance()))
|
||||||
get groupsApi(): GroupsApi {
|
declare readonly groupsApi: GroupsApi;
|
||||||
this._groupsApi = this._groupsApi ?? new GroupsApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._groupsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
async listAllGroupMembershipsForPerson(personId: string, opts?: any, accumulator = []): Promise<GroupEntry[]> {
|
async listAllGroupMembershipsForPerson(personId: string, opts?: any, accumulator = []): Promise<GroupEntry[]> {
|
||||||
const groupsPaginated = await this.groupsApi.listGroupMembershipsForPerson(personId, opts);
|
const groupsPaginated = await this.groupsApi.listGroupMembershipsForPerson(personId, opts);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import {
|
|||||||
HoldBulkStatusEntry,
|
HoldBulkStatusEntry,
|
||||||
HoldEntry,
|
HoldEntry,
|
||||||
HoldPaging,
|
HoldPaging,
|
||||||
|
LazyApi,
|
||||||
LegalHoldApi,
|
LegalHoldApi,
|
||||||
RequestQuery
|
RequestQuery
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
@@ -37,11 +38,8 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|||||||
export class LegalHoldService {
|
export class LegalHoldService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _legalHoldApi: LegalHoldApi;
|
@LazyApi((self: LegalHoldService) => new LegalHoldApi(self.apiService.getInstance()))
|
||||||
get legalHoldApi(): LegalHoldApi {
|
declare readonly legalHoldApi: LegalHoldApi;
|
||||||
this._legalHoldApi = this._legalHoldApi ?? new LegalHoldApi(this.apiService.getInstance());
|
|
||||||
return this._legalHoldApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list of holds available in the file plan.
|
* Gets the list of holds available in the file plan.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
|||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
|
|
||||||
import { NewVersionUploaderDialogComponent } from './new-version-uploader.dialog';
|
import { NewVersionUploaderDialogComponent } from './new-version-uploader.dialog';
|
||||||
import { VersionsApi } from '@alfresco/js-api';
|
import { VersionsApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { NewVersionUploaderData, NewVersionUploaderDialogData } from './models';
|
import { NewVersionUploaderData, NewVersionUploaderDialogData } from './models';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||||
@@ -34,11 +34,8 @@ export class NewVersionUploaderService {
|
|||||||
private readonly dialog = inject(MatDialog);
|
private readonly dialog = inject(MatDialog);
|
||||||
private readonly overlayContainer = inject(OverlayContainer);
|
private readonly overlayContainer = inject(OverlayContainer);
|
||||||
|
|
||||||
private _versionsApi: VersionsApi;
|
@LazyApi((self: NewVersionUploaderService) => new VersionsApi(self.apiService.getInstance()))
|
||||||
get versionsApi(): VersionsApi {
|
declare readonly versionsApi: VersionsApi;
|
||||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
|
||||||
return this._versionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a dialog NewVersionUploaderDialogComponent to display:
|
* Open a dialog NewVersionUploaderDialogComponent to display:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { CommentModel, CommentsService, User } from '@alfresco/adf-core';
|
import { CommentModel, CommentsService, User } from '@alfresco/adf-core';
|
||||||
import { CommentEntry, CommentsApi, Comment, PeopleApi } from '@alfresco/js-api';
|
import { CommentEntry, CommentsApi, Comment, PeopleApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
@@ -28,17 +28,11 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|||||||
export class NodeCommentsService implements CommentsService {
|
export class NodeCommentsService implements CommentsService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _commentsApi: CommentsApi;
|
@LazyApi((self: NodeCommentsService) => new CommentsApi(self.apiService.getInstance()))
|
||||||
get commentsApi(): CommentsApi {
|
declare readonly commentsApi: CommentsApi;
|
||||||
this._commentsApi = this._commentsApi ?? new CommentsApi(this.apiService.getInstance());
|
|
||||||
return this._commentsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _peopleApi: PeopleApi;
|
@LazyApi((self: NodeCommentsService) => new PeopleApi(self.apiService.getInstance()))
|
||||||
get peopleApi(): PeopleApi {
|
declare readonly peopleApi: PeopleApi;
|
||||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance());
|
|
||||||
return this._peopleApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all comments that have been added to a task.
|
* Gets all comments that have been added to a task.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|||||||
import { TranslationService } from '@alfresco/adf-core';
|
import { TranslationService } from '@alfresco/adf-core';
|
||||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||||
import { EcmUserModel } from '../../common/models/ecm-user.model';
|
import { EcmUserModel } from '../../common/models/ecm-user.model';
|
||||||
import { Group, GroupMemberPaging, GroupsApi, Node, PathElement, PermissionElement, SearchRequest } from '@alfresco/js-api';
|
import { Group, GroupMemberPaging, GroupsApi, LazyApi, Node, PathElement, PermissionElement, SearchRequest } from '@alfresco/js-api';
|
||||||
import { SearchService } from '../../search/services/search.service';
|
import { SearchService } from '../../search/services/search.service';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { forkJoin, from, Observable, of, throwError } from 'rxjs';
|
import { forkJoin, from, Observable, of, throwError } from 'rxjs';
|
||||||
@@ -36,11 +36,8 @@ export class NodePermissionService {
|
|||||||
private readonly nodeService = inject(NodesApiService);
|
private readonly nodeService = inject(NodesApiService);
|
||||||
private readonly translation = inject(TranslationService);
|
private readonly translation = inject(TranslationService);
|
||||||
|
|
||||||
private _groupsApi: GroupsApi;
|
@LazyApi((self: NodePermissionService) => new GroupsApi(self.apiService.getInstance()))
|
||||||
get groupsApi(): GroupsApi {
|
declare readonly groupsApi: GroupsApi;
|
||||||
this._groupsApi = this._groupsApi ?? new GroupsApi(this.apiService.getInstance());
|
|
||||||
return this._groupsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of roles for the current node.
|
* Gets a list of roles for the current node.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { PredictionsApi, PredictionPaging, ReviewStatus } from '@alfresco/js-api';
|
import { PredictionsApi, PredictionPaging, ReviewStatus, LazyApi } from '@alfresco/js-api';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
|
|
||||||
@@ -24,12 +24,8 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|||||||
export class PredictionService {
|
export class PredictionService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _predictionsApi: PredictionsApi;
|
@LazyApi((self: PredictionService) => new PredictionsApi(self.apiService.getInstance()))
|
||||||
|
declare readonly predictionsApi: PredictionsApi;
|
||||||
get predictionsApi(): PredictionsApi {
|
|
||||||
this._predictionsApi = this._predictionsApi ?? new PredictionsApi(this.apiService.getInstance());
|
|
||||||
return this._predictionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get predictions for a given node
|
* Get predictions for a given node
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { AiAnswerEntry, KnowledgeRetrievalConfigEntry, QuestionModel, QuestionRequest, SearchAiApi } from '@alfresco/js-api';
|
import { AiAnswerEntry, KnowledgeRetrievalConfigEntry, LazyApi, QuestionModel, QuestionRequest, SearchAiApi } from '@alfresco/js-api';
|
||||||
import { BehaviorSubject, from, Observable } from 'rxjs';
|
import { BehaviorSubject, from, Observable } from 'rxjs';
|
||||||
import { SelectionState } from '@alfresco/adf-extensions';
|
import { SelectionState } from '@alfresco/adf-extensions';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
@@ -33,12 +33,9 @@ export class SearchAiService {
|
|||||||
private readonly toggleSearchAiInput = new BehaviorSubject<SearchAiInputState>({
|
private readonly toggleSearchAiInput = new BehaviorSubject<SearchAiInputState>({
|
||||||
active: false
|
active: false
|
||||||
});
|
});
|
||||||
private _searchAiApi: SearchAiApi;
|
|
||||||
|
|
||||||
get searchAiApi(): SearchAiApi {
|
@LazyApi((self: SearchAiService) => new SearchAiApi(self.apiService.getInstance()))
|
||||||
this._searchAiApi = this._searchAiApi ?? new SearchAiApi(this.apiService.getInstance());
|
declare readonly searchAiApi: SearchAiApi;
|
||||||
return this._searchAiApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleSearchAiInput$ = this.toggleSearchAiInput.asObservable();
|
toggleSearchAiInput$ = this.toggleSearchAiInput.asObservable();
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
import { BehaviorSubject, from, Observable, ReplaySubject, Subject } from 'rxjs';
|
import { BehaviorSubject, from, Observable, ReplaySubject, Subject } from 'rxjs';
|
||||||
import { AppConfigService } from '@alfresco/adf-core';
|
import { AppConfigService } from '@alfresco/adf-core';
|
||||||
import {
|
import {
|
||||||
|
LazyApi,
|
||||||
RequestFacetFields,
|
RequestFacetFields,
|
||||||
RequestHighlight,
|
RequestHighlight,
|
||||||
RequestScope,
|
RequestScope,
|
||||||
@@ -43,11 +44,9 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
export abstract class BaseQueryBuilderService {
|
export abstract class BaseQueryBuilderService {
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private readonly activatedRoute = inject(ActivatedRoute);
|
private readonly activatedRoute = inject(ActivatedRoute);
|
||||||
private _searchApi: SearchApi;
|
|
||||||
get searchApi(): SearchApi {
|
@LazyApi((self: BaseQueryBuilderService) => new SearchApi(self.alfrescoApiService.getInstance()))
|
||||||
this._searchApi = this._searchApi ?? new SearchApi(this.alfrescoApiService.getInstance());
|
declare readonly searchApi: SearchApi;
|
||||||
return this._searchApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Stream that emits the search configuration whenever the user change the search forms */
|
/* Stream that emits the search configuration whenever the user change the search forms */
|
||||||
configUpdated = new Subject<SearchConfiguration>();
|
configUpdated = new Subject<SearchConfiguration>();
|
||||||
@@ -693,7 +692,7 @@ export abstract class BaseQueryBuilderService {
|
|||||||
} else {
|
} else {
|
||||||
const configurations = this.loadConfiguration();
|
const configurations = this.loadConfiguration();
|
||||||
if (Array.isArray(configurations)) {
|
if (Array.isArray(configurations)) {
|
||||||
const defaultConfig = configurations.find(config => config.default);
|
const defaultConfig = configurations.find((config) => config.default);
|
||||||
if (defaultConfig && this.selectedConfigurationId !== defaultConfig.id) {
|
if (defaultConfig && this.selectedConfigurationId !== defaultConfig.id) {
|
||||||
this.setSelectedConfiguration(defaultConfig.id);
|
this.setSelectedConfiguration(defaultConfig.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { inject, Injectable } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { NodePaging, QueriesApi, SearchRequest, ResultSetPaging, SearchApi } from '@alfresco/js-api';
|
import { NodePaging, QueriesApi, SearchRequest, ResultSetPaging, SearchApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { Observable, Subject, from } from 'rxjs';
|
import { Observable, Subject, from } from 'rxjs';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
import { SearchConfigurationService } from './search-configuration.service';
|
import { SearchConfigurationService } from './search-configuration.service';
|
||||||
@@ -30,17 +30,11 @@ export class SearchService {
|
|||||||
|
|
||||||
dataLoaded = new Subject<ResultSetPaging>();
|
dataLoaded = new Subject<ResultSetPaging>();
|
||||||
|
|
||||||
private _queriesApi: QueriesApi;
|
@LazyApi((self: SearchService) => new QueriesApi(self.apiService.getInstance()))
|
||||||
get queriesApi(): QueriesApi {
|
declare readonly queriesApi: QueriesApi;
|
||||||
this._queriesApi = this._queriesApi ?? new QueriesApi(this.apiService.getInstance());
|
|
||||||
return this._queriesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _searchApi: SearchApi;
|
@LazyApi((self: SearchService) => new SearchApi(self.apiService.getInstance()))
|
||||||
get searchApi(): SearchApi {
|
declare readonly searchApi: SearchApi;
|
||||||
this._searchApi = this._searchApi ?? new SearchApi(this.apiService.getInstance());
|
|
||||||
return this._searchApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of nodes that match the given search criteria.
|
* Gets a list of nodes that match the given search criteria.
|
||||||
|
|||||||
+8
-18
@@ -30,7 +30,8 @@ import {
|
|||||||
AuthorityClearanceApi,
|
AuthorityClearanceApi,
|
||||||
AuthorityClearanceGroupPaging,
|
AuthorityClearanceGroupPaging,
|
||||||
NodeSecurityMarkBody,
|
NodeSecurityMarkBody,
|
||||||
GsGroupInclude
|
GsGroupInclude,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
import { UserPreferencesService } from '@alfresco/adf-core';
|
||||||
import { finalize } from 'rxjs/operators';
|
import { finalize } from 'rxjs/operators';
|
||||||
@@ -59,25 +60,14 @@ export class SecurityControlsService {
|
|||||||
private readonly loadingSource = new BehaviorSubject<boolean>(true);
|
private readonly loadingSource = new BehaviorSubject<boolean>(true);
|
||||||
loading$ = this.loadingSource.asObservable();
|
loading$ = this.loadingSource.asObservable();
|
||||||
|
|
||||||
private securityGroup: SecurityGroupsApi;
|
@LazyApi((self: SecurityControlsService) => new SecurityGroupsApi(self.apiService.getInstance()))
|
||||||
private securityMark: SecurityMarksApi;
|
declare readonly groupsApi: SecurityGroupsApi;
|
||||||
private authorityClearance: AuthorityClearanceApi;
|
|
||||||
|
|
||||||
get groupsApi(): SecurityGroupsApi {
|
@LazyApi((self: SecurityControlsService) => new SecurityMarksApi(self.apiService.getInstance()))
|
||||||
return this.securityGroup || (this.securityGroup = new SecurityGroupsApi(this.apiService.getInstance()));
|
declare readonly marksApi: SecurityMarksApi;
|
||||||
}
|
|
||||||
|
|
||||||
get marksApi(): SecurityMarksApi {
|
@LazyApi((self: SecurityControlsService) => new AuthorityClearanceApi(self.apiService.getInstance()))
|
||||||
return this.securityMark || (this.securityMark = new SecurityMarksApi(this.apiService.getInstance()));
|
declare readonly authorityClearanceApi: AuthorityClearanceApi;
|
||||||
}
|
|
||||||
|
|
||||||
get authorityClearanceApi(): AuthorityClearanceApi {
|
|
||||||
return this.authorityClearance || (this.authorityClearance = new AuthorityClearanceApi(this.apiService.getInstance()));
|
|
||||||
}
|
|
||||||
|
|
||||||
get reloadAuthorityClearance(): Subject<void> {
|
|
||||||
return this._reloadAuthorityClearance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get All security groups
|
* Get All security groups
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
|||||||
import { EventEmitter, Injectable, Output, inject } from '@angular/core';
|
import { EventEmitter, Injectable, Output, inject } from '@angular/core';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
import { map, tap } from 'rxjs/operators';
|
import { map, tap } from 'rxjs/operators';
|
||||||
import { TagBody, TagEntry, TagPaging, TagsApi } from '@alfresco/js-api';
|
import { LazyApi, TagBody, TagEntry, TagPaging, TagsApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -30,11 +30,8 @@ export class TagService {
|
|||||||
private readonly userPreferencesService = inject(UserPreferencesService);
|
private readonly userPreferencesService = inject(UserPreferencesService);
|
||||||
private readonly appConfigService = inject(AppConfigService);
|
private readonly appConfigService = inject(AppConfigService);
|
||||||
|
|
||||||
private _tagsApi: TagsApi;
|
@LazyApi((self: TagService) => new TagsApi(self.apiService.getInstance()))
|
||||||
get tagsApi(): TagsApi {
|
declare readonly tagsApi: TagsApi;
|
||||||
this._tagsApi = this._tagsApi ?? new TagsApi(this.apiService.getInstance());
|
|
||||||
return this._tagsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Emitted when tag information is updated. */
|
/** Emitted when tag information is updated. */
|
||||||
@Output()
|
@Output()
|
||||||
|
|||||||
@@ -17,21 +17,15 @@
|
|||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
import { ContentApi } from '@alfresco/js-api';
|
import { ContentApi, LazyApi } from '@alfresco/js-api';
|
||||||
import { Observable, of } from 'rxjs';
|
import { Observable, of } from 'rxjs';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ContentVersionService {
|
export class ContentVersionService {
|
||||||
private readonly alfrescoApi = inject(AlfrescoApiService);
|
private readonly alfrescoApi = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _contentApi: ContentApi;
|
@LazyApi((self: ContentVersionService) => new ContentApi(self.alfrescoApi.getInstance()))
|
||||||
|
declare readonly contentApi: ContentApi;
|
||||||
get contentApi(): ContentApi {
|
|
||||||
if (!this._contentApi) {
|
|
||||||
this._contentApi = new ContentApi(this.alfrescoApi.getInstance());
|
|
||||||
}
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get content URL for the given nodeId and specific version.
|
* Get content URL for the given nodeId and specific version.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import { ConfirmDialogComponent, IconModule } from '@alfresco/adf-core';
|
import { ConfirmDialogComponent, IconModule } from '@alfresco/adf-core';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
import { Component, DestroyRef, EventEmitter, inject, Input, OnChanges, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
import { Component, DestroyRef, EventEmitter, inject, Input, OnChanges, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||||
import { ContentApi, ContentPagingQuery, Node, NodeEntry, NodesApi, VersionEntry, VersionsApi } from '@alfresco/js-api';
|
import { ContentApi, ContentPagingQuery, LazyApi, Node, NodeEntry, NodesApi, VersionEntry, VersionsApi } from '@alfresco/js-api';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ContentVersionService } from './content-version.service';
|
import { ContentVersionService } from './content-version.service';
|
||||||
import { ContentService } from '../common';
|
import { ContentService } from '../common';
|
||||||
@@ -77,23 +77,14 @@ export class VersionListComponent implements OnChanges, OnInit {
|
|||||||
private readonly contentVersionService = inject(ContentVersionService);
|
private readonly contentVersionService = inject(ContentVersionService);
|
||||||
private readonly dialog = inject(MatDialog);
|
private readonly dialog = inject(MatDialog);
|
||||||
|
|
||||||
private _contentApi: ContentApi;
|
@LazyApi((self: VersionListComponent) => new ContentApi(self.alfrescoApi.getInstance()))
|
||||||
get contentApi(): ContentApi {
|
declare readonly contentApi: ContentApi;
|
||||||
this._contentApi = this._contentApi ?? new ContentApi(this.alfrescoApi.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _versionsApi: VersionsApi;
|
@LazyApi((self: VersionListComponent) => new VersionsApi(self.alfrescoApi.getInstance()))
|
||||||
get versionsApi(): VersionsApi {
|
declare readonly versionsApi: VersionsApi;
|
||||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.alfrescoApi.getInstance());
|
|
||||||
return this._versionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: VersionListComponent) => new NodesApi(self.alfrescoApi.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApi.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
versionsDataSource: VersionListDataSource;
|
versionsDataSource: VersionListDataSource;
|
||||||
latestVersion: VersionEntry;
|
latestVersion: VersionEntry;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import {
|
|||||||
ViewUtilService
|
ViewUtilService
|
||||||
} from '@alfresco/adf-core';
|
} from '@alfresco/adf-core';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
import { ContentApi, Node, NodeEntry, NodesApi, RenditionEntry, SharedlinksApi, Version, VersionEntry, VersionsApi } from '@alfresco/js-api';
|
import { ContentApi, LazyApi, Node, NodeEntry, NodesApi, RenditionEntry, SharedlinksApi, Version, VersionEntry, VersionsApi } from '@alfresco/js-api';
|
||||||
import { RenditionService } from '../../common/services/rendition.service';
|
import { RenditionService } from '../../common/services/rendition.service';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { filter } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
@@ -240,29 +240,17 @@ export class AlfrescoViewerComponent implements OnChanges, OnInit {
|
|||||||
sidebarRightTemplateContext: { node: Node } = { node: null };
|
sidebarRightTemplateContext: { node: Node } = { node: null };
|
||||||
sidebarLeftTemplateContext: { node: Node } = { node: null };
|
sidebarLeftTemplateContext: { node: Node } = { node: null };
|
||||||
|
|
||||||
private _sharedLinksApi: SharedlinksApi;
|
@LazyApi((self: AlfrescoViewerComponent) => new SharedlinksApi(self.apiService.getInstance()))
|
||||||
get sharedLinksApi(): SharedlinksApi {
|
declare readonly sharedLinksApi: SharedlinksApi;
|
||||||
this._sharedLinksApi = this._sharedLinksApi ?? new SharedlinksApi(this.apiService.getInstance());
|
|
||||||
return this._sharedLinksApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _versionsApi: VersionsApi;
|
@LazyApi((self: AlfrescoViewerComponent) => new VersionsApi(self.apiService.getInstance()))
|
||||||
get versionsApi(): VersionsApi {
|
declare readonly versionsApi: VersionsApi;
|
||||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
|
||||||
return this._versionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: AlfrescoViewerComponent) => new NodesApi(self.apiService.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _contentApi: ContentApi;
|
@LazyApi((self: AlfrescoViewerComponent) => new ContentApi(self.apiService.getInstance()))
|
||||||
get contentApi(): ContentApi {
|
declare readonly contentApi: ContentApi;
|
||||||
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import { MultiBarChart } from '../../diagram/models/chart/multi-bar-chart.model'
|
|||||||
import { PieChart } from '../../diagram/models/chart/pie-chart.model';
|
import { PieChart } from '../../diagram/models/chart/pie-chart.model';
|
||||||
import { TableChart } from '../../diagram/models/chart/table-chart.model';
|
import { TableChart } from '../../diagram/models/chart/table-chart.model';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { ProcessDefinitionsApi, ReportApi } from '@alfresco/js-api';
|
import { LazyApi, ProcessDefinitionsApi, ReportApi } from '@alfresco/js-api';
|
||||||
import { ReportQuery } from '../../diagram/models/report/report-query.model';
|
import { ReportQuery } from '../../diagram/models/report/report-query.model';
|
||||||
import { LineChart } from '../../diagram/models/chart/line-chart.model';
|
import { LineChart } from '../../diagram/models/chart/line-chart.model';
|
||||||
|
|
||||||
@@ -36,17 +36,11 @@ import { LineChart } from '../../diagram/models/chart/line-chart.model';
|
|||||||
export class AnalyticsService {
|
export class AnalyticsService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _reportApi: ReportApi;
|
@LazyApi((self: AnalyticsService) => new ReportApi(self.apiService.getInstance()))
|
||||||
get reportApi(): ReportApi {
|
declare readonly reportApi: ReportApi;
|
||||||
this._reportApi = this._reportApi ?? new ReportApi(this.apiService.getInstance());
|
|
||||||
return this._reportApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _processDefinitionsApi: ProcessDefinitionsApi;
|
@LazyApi((self: AnalyticsService) => new ProcessDefinitionsApi(self.apiService.getInstance()))
|
||||||
get processDefinitionsApi(): ProcessDefinitionsApi {
|
declare readonly processDefinitionsApi: ProcessDefinitionsApi;
|
||||||
this._processDefinitionsApi = this._processDefinitionsApi ?? new ProcessDefinitionsApi(this.apiService.getInstance());
|
|
||||||
return this._processDefinitionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve all the Deployed app
|
* Retrieve all the Deployed app
|
||||||
|
|||||||
@@ -18,17 +18,14 @@
|
|||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { ModelJsonBpmnApi } from '@alfresco/js-api';
|
import { LazyApi, ModelJsonBpmnApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DiagramsService {
|
export class DiagramsService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _modelJsonBpmnApi: ModelJsonBpmnApi;
|
@LazyApi((self: DiagramsService) => new ModelJsonBpmnApi(self.apiService.getInstance()))
|
||||||
get modelJsonBpmnApi(): ModelJsonBpmnApi {
|
declare readonly modelJsonBpmnApi: ModelJsonBpmnApi;
|
||||||
this._modelJsonBpmnApi = this._modelJsonBpmnApi ?? new ModelJsonBpmnApi(this.apiService.getInstance());
|
|
||||||
return this._modelJsonBpmnApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
getProcessDefinitionModel(processDefinitionId: string): Observable<any> {
|
getProcessDefinitionModel(processDefinitionId: string): Observable<any> {
|
||||||
return from(this.modelJsonBpmnApi.getModelJSON(processDefinitionId));
|
return from(this.modelJsonBpmnApi.getModelJSON(processDefinitionId));
|
||||||
|
|||||||
@@ -16,4 +16,5 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './is-browser';
|
export * from './is-browser';
|
||||||
|
export * from './lazy-api';
|
||||||
export * from './param-to-string';
|
export * from './param-to-string';
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LazyApi is a decorator that creates a lazy-loaded API instance.
|
||||||
|
* @param factory - A function that creates the API instance.
|
||||||
|
* @returns A decorator function that can be used to decorate a class property.
|
||||||
|
*/
|
||||||
|
export function LazyApi<T>(factory: (self: any) => T) {
|
||||||
|
return function (target: any, propertyKey: string) {
|
||||||
|
const cacheKey = `_${propertyKey}`;
|
||||||
|
Object.defineProperty(target, propertyKey, {
|
||||||
|
get() {
|
||||||
|
if (!this[cacheKey]) {
|
||||||
|
this[cacheKey] = factory(this);
|
||||||
|
}
|
||||||
|
return this[cacheKey];
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import assert from 'assert';
|
||||||
|
import { LazyApi } from '../src/utils/lazy-api';
|
||||||
|
|
||||||
|
describe('LazyApi', () => {
|
||||||
|
it('should create a lazy-loaded property on the target prototype', () => {
|
||||||
|
class TestApi {
|
||||||
|
@LazyApi(() => ({ value: 13 }))
|
||||||
|
api: { value: number };
|
||||||
|
}
|
||||||
|
|
||||||
|
const instance = new TestApi();
|
||||||
|
assert.deepStrictEqual(instance.api, { value: 13 });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should cache the instance of the property after first access', () => {
|
||||||
|
let accessCount = 0;
|
||||||
|
|
||||||
|
class TestApi {
|
||||||
|
@LazyApi(() => {
|
||||||
|
accessCount++;
|
||||||
|
return { value: 'cached' };
|
||||||
|
})
|
||||||
|
api: { value: string };
|
||||||
|
}
|
||||||
|
|
||||||
|
const instance = new TestApi();
|
||||||
|
const first = instance.api;
|
||||||
|
const second = instance.api;
|
||||||
|
|
||||||
|
assert.strictEqual(first, second);
|
||||||
|
assert.strictEqual(accessCount, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should pass the class instance as argument to the factory', () => {
|
||||||
|
let receivedSelf: any;
|
||||||
|
|
||||||
|
class TestApi {
|
||||||
|
config = 'test-config';
|
||||||
|
|
||||||
|
@LazyApi((self: any) => {
|
||||||
|
receivedSelf = self;
|
||||||
|
return { config: self.config };
|
||||||
|
})
|
||||||
|
api: { config: string };
|
||||||
|
}
|
||||||
|
|
||||||
|
const instance = new TestApi();
|
||||||
|
const result = instance.api;
|
||||||
|
|
||||||
|
assert.strictEqual(receivedSelf, instance);
|
||||||
|
assert.deepStrictEqual(result, { config: 'test-config' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create separate cached instances per class instance', () => {
|
||||||
|
let accessCount = 0;
|
||||||
|
|
||||||
|
class TestApi {
|
||||||
|
@LazyApi(() => {
|
||||||
|
accessCount++;
|
||||||
|
return { id: accessCount };
|
||||||
|
})
|
||||||
|
api: { id: number };
|
||||||
|
}
|
||||||
|
|
||||||
|
const instance1 = new TestApi();
|
||||||
|
const instance2 = new TestApi();
|
||||||
|
|
||||||
|
assert.strictEqual(instance1.api.id, 1);
|
||||||
|
assert.strictEqual(instance2.api.id, 2);
|
||||||
|
assert.strictEqual(accessCount, 2);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should define the property as enumerable and configurable', () => {
|
||||||
|
class TestApi {
|
||||||
|
@LazyApi(() => 'value')
|
||||||
|
api: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const descriptor = Object.getOwnPropertyDescriptor(TestApi.prototype, 'api');
|
||||||
|
assert.strictEqual(descriptor.enumerable, true);
|
||||||
|
assert.strictEqual(descriptor.configurable, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should support multiple decorated properties on the same class', () => {
|
||||||
|
class TestApi {
|
||||||
|
@LazyApi(() => 'first')
|
||||||
|
api1: string;
|
||||||
|
|
||||||
|
@LazyApi(() => 'second')
|
||||||
|
api2: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const instance = new TestApi();
|
||||||
|
assert.strictEqual(instance.api1, 'first');
|
||||||
|
assert.strictEqual(instance.api2, 'second');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should store cached value under _propertyKey on the instance', () => {
|
||||||
|
class TestApi {
|
||||||
|
@LazyApi(() => 'cached-value')
|
||||||
|
myApi: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const instance = new TestApi();
|
||||||
|
assert.strictEqual(instance['_myApi'], undefined);
|
||||||
|
|
||||||
|
instance.myApi;
|
||||||
|
|
||||||
|
assert.strictEqual(instance['_myApi'], 'cached-value');
|
||||||
|
});
|
||||||
|
});
|
||||||
+5
-6
@@ -27,7 +27,7 @@ import {
|
|||||||
ErrorWidgetComponent,
|
ErrorWidgetComponent,
|
||||||
IconModule
|
IconModule
|
||||||
} from '@alfresco/adf-core';
|
} from '@alfresco/adf-core';
|
||||||
import { Node, NodesApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
import { LazyApi, Node, NodesApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||||
import { ContentCloudNodeSelectorService } from '../../../services/content-cloud-node-selector.service';
|
import { ContentCloudNodeSelectorService } from '../../../services/content-cloud-node-selector.service';
|
||||||
import { UploadCloudWidgetComponent } from '../upload/upload-cloud.widget';
|
import { UploadCloudWidgetComponent } from '../upload/upload-cloud.widget';
|
||||||
import { DestinationFolderPathModel, DestinationFolderPathType } from '../../../models/form-cloud-representation.model';
|
import { DestinationFolderPathModel, DestinationFolderPathType } from '../../../models/form-cloud-representation.model';
|
||||||
@@ -72,11 +72,10 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i
|
|||||||
error = new EventEmitter<any>();
|
error = new EventEmitter<any>();
|
||||||
|
|
||||||
private previewState = false;
|
private previewState = false;
|
||||||
private _nodesApi: NodesApi;
|
|
||||||
get nodesApi(): NodesApi {
|
@LazyApi((self: AttachFileCloudWidgetComponent) => new NodesApi(self.apiService.getInstance()))
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
declare readonly nodesApi: NodesApi;
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
displayedColumns = ['icon', 'fileName', 'title', 'action'];
|
displayedColumns = ['icon', 'fileName', 'title', 'action'];
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
+3
-6
@@ -19,7 +19,7 @@ import { Injectable, inject } from '@angular/core';
|
|||||||
import { NotificationService } from '@alfresco/adf-core';
|
import { NotificationService } from '@alfresco/adf-core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ContentNodeSelectorComponent, ContentNodeSelectorComponentData, NodeAction, AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { ContentNodeSelectorComponent, ContentNodeSelectorComponentData, NodeAction, AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { Node, NodeEntry, NodesApi } from '@alfresco/js-api';
|
import { LazyApi, Node, NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||||
import { firstValueFrom, from, Observable, Subject, throwError } from 'rxjs';
|
import { firstValueFrom, from, Observable, Subject, throwError } from 'rxjs';
|
||||||
import { catchError, map, mapTo } from 'rxjs/operators';
|
import { catchError, map, mapTo } from 'rxjs/operators';
|
||||||
import { DestinationFolderPathModel } from '../models/form-cloud-representation.model';
|
import { DestinationFolderPathModel } from '../models/form-cloud-representation.model';
|
||||||
@@ -32,11 +32,8 @@ export class ContentCloudNodeSelectorService {
|
|||||||
private readonly notificationService = inject(NotificationService);
|
private readonly notificationService = inject(NotificationService);
|
||||||
private readonly dialog = inject(MatDialog);
|
private readonly dialog = inject(MatDialog);
|
||||||
|
|
||||||
private _nodesApi: NodesApi;
|
@LazyApi((self: ContentCloudNodeSelectorService) => new NodesApi(self.apiService.getInstance()))
|
||||||
get nodesApi(): NodesApi {
|
declare readonly nodesApi: NodesApi;
|
||||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
|
||||||
return this._nodesApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceNodeNotFound = false;
|
sourceNodeNotFound = false;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { FormValues, FormModel, FormFieldOption, FormFieldValidator, FormService
|
|||||||
import { Observable, from, EMPTY } from 'rxjs';
|
import { Observable, from, EMPTY } from 'rxjs';
|
||||||
import { expand, map, reduce, switchMap } from 'rxjs/operators';
|
import { expand, map, reduce, switchMap } from 'rxjs/operators';
|
||||||
import { TaskDetailsCloudModel } from '../../task/models/task-details-cloud.model';
|
import { TaskDetailsCloudModel } from '../../task/models/task-details-cloud.model';
|
||||||
import { CompleteFormRepresentation, UploadApi } from '@alfresco/js-api';
|
import { CompleteFormRepresentation, LazyApi, UploadApi } from '@alfresco/js-api';
|
||||||
import { TaskVariableCloud } from '../models/task-variable-cloud.model';
|
import { TaskVariableCloud } from '../models/task-variable-cloud.model';
|
||||||
import { BaseCloudService } from '../../services/base-cloud.service';
|
import { BaseCloudService } from '../../services/base-cloud.service';
|
||||||
import { FormContent } from '../../services/form-fields.interfaces';
|
import { FormContent } from '../../services/form-fields.interfaces';
|
||||||
@@ -32,13 +32,11 @@ export const FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN = new InjectionToken<Form
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class FormCloudService extends BaseCloudService implements FormCloudServiceInterface {
|
export class FormCloudService extends BaseCloudService implements FormCloudServiceInterface {
|
||||||
private _uploadApi: UploadApi;
|
|
||||||
private readonly fieldValidators: FormFieldValidator[] = inject(FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN, { optional: true }) ?? [];
|
private readonly fieldValidators: FormFieldValidator[] = inject(FORM_CLOUD_SERVICE_FIELD_VALIDATORS_TOKEN, { optional: true }) ?? [];
|
||||||
private readonly formService = inject(FormService);
|
private readonly formService = inject(FormService);
|
||||||
get uploadApi(): UploadApi {
|
|
||||||
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
|
@LazyApi((self: FormCloudService) => new UploadApi(self.apiService.getInstance()))
|
||||||
return this._uploadApi;
|
declare readonly uploadApi: UploadApi;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the form definition of a task.
|
* Gets the form definition of a task.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { Observable, from } from 'rxjs';
|
|||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { DownloadService } from '@alfresco/adf-core';
|
import { DownloadService } from '@alfresco/adf-core';
|
||||||
import { ContentService, NodesApiService, AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { ContentService, NodesApiService, AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { AuthenticationApi, Node, UploadApi } from '@alfresco/js-api';
|
import { AuthenticationApi, LazyApi, Node, UploadApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -31,17 +31,11 @@ export class ProcessCloudContentService {
|
|||||||
private readonly contentService = inject(ContentService);
|
private readonly contentService = inject(ContentService);
|
||||||
private readonly downloadService = inject(DownloadService);
|
private readonly downloadService = inject(DownloadService);
|
||||||
|
|
||||||
private _uploadApi: UploadApi;
|
@LazyApi((self: ProcessCloudContentService) => new UploadApi(self.apiService.getInstance()))
|
||||||
get uploadApi(): UploadApi {
|
uploadApi: UploadApi;
|
||||||
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
|
|
||||||
return this._uploadApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _authenticationApi: AuthenticationApi;
|
@LazyApi((self: ProcessCloudContentService) => new AuthenticationApi(self.apiService.getInstance()))
|
||||||
get authenticationApi(): AuthenticationApi {
|
authenticationApi: AuthenticationApi;
|
||||||
this._authenticationApi = this._authenticationApi ?? new AuthenticationApi(this.apiService.getInstance());
|
|
||||||
return this._authenticationApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
createTemporaryRawRelatedContent(file: File, nodeId: string): Observable<Node> {
|
createTemporaryRawRelatedContent(file: File, nodeId: string): Observable<Node> {
|
||||||
return from(this.uploadApi.uploadFile(file, '', nodeId, null, { overwrite: true })).pipe(
|
return from(this.uploadApi.uploadFile(file, '', nodeId, null, { overwrite: true })).pipe(
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ import {
|
|||||||
RelatedContentRepresentation,
|
RelatedContentRepresentation,
|
||||||
ActivitiContentApi,
|
ActivitiContentApi,
|
||||||
AlfrescoEndpointRepresentation,
|
AlfrescoEndpointRepresentation,
|
||||||
AlfrescoContentRepresentation
|
AlfrescoContentRepresentation,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { Observable, from, throwError } from 'rxjs';
|
import { Observable, from, throwError } from 'rxjs';
|
||||||
import { map, catchError } from 'rxjs/operators';
|
import { map, catchError } from 'rxjs/operators';
|
||||||
@@ -39,18 +40,11 @@ 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';
|
||||||
|
|
||||||
private _integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi;
|
@LazyApi((self: ActivitiContentService) => new IntegrationAlfrescoOnPremiseApi(self.apiService.getInstance()))
|
||||||
get integrationAlfrescoOnPremiseApi(): IntegrationAlfrescoOnPremiseApi {
|
declare readonly integrationAlfrescoOnPremiseApi: IntegrationAlfrescoOnPremiseApi;
|
||||||
this._integrationAlfrescoOnPremiseApi =
|
|
||||||
this._integrationAlfrescoOnPremiseApi ?? new IntegrationAlfrescoOnPremiseApi(this.apiService.getInstance());
|
|
||||||
return this._integrationAlfrescoOnPremiseApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _contentApi: ActivitiContentApi;
|
@LazyApi((self: ActivitiContentService) => new ActivitiContentApi(self.apiService.getInstance()))
|
||||||
get contentApi(): ActivitiContentApi {
|
declare readonly contentApi: ActivitiContentApi;
|
||||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of child nodes below the specified folder
|
* 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 { EventEmitter, Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { map, catchError } from 'rxjs/operators';
|
import { map, catchError } from 'rxjs/operators';
|
||||||
import { CustomModelApi } from '@alfresco/js-api';
|
import { CustomModelApi, LazyApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -34,11 +34,8 @@ export class EcmModelService {
|
|||||||
|
|
||||||
error = new EventEmitter<any>();
|
error = new EventEmitter<any>();
|
||||||
|
|
||||||
private _customModelApi: CustomModelApi;
|
@LazyApi((self: EcmModelService) => new CustomModelApi(self.apiService.getInstance()))
|
||||||
get customModelApi(): CustomModelApi {
|
declare readonly customModelApi: CustomModelApi;
|
||||||
this._customModelApi = this._customModelApi ?? new CustomModelApi(this.apiService.getInstance());
|
|
||||||
return this._customModelApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
public createEcmTypeForActivitiForm(formName: string, form: FormModel): Observable<any> {
|
public createEcmTypeForActivitiForm(formName: string, form: FormModel): Observable<any> {
|
||||||
return new Observable((observer) => {
|
return new Observable((observer) => {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from, throwError } from 'rxjs';
|
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 { catchError, map } from 'rxjs/operators';
|
||||||
import { FormDefinitionModel } from '../model/form-definition.model';
|
import { FormDefinitionModel } from '../model/form-definition.model';
|
||||||
|
|
||||||
@@ -31,11 +31,8 @@ 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';
|
||||||
|
|
||||||
private _editorApi: FormModelsApi;
|
@LazyApi((self: EditorService) => new FormModelsApi(self.apiService.getInstance()))
|
||||||
get editorApi(): FormModelsApi {
|
declare readonly editorApi: FormModelsApi;
|
||||||
this._editorApi = this._editorApi ?? new FormModelsApi(this.apiService.getInstance());
|
|
||||||
return this._editorApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a form.
|
* Saves a form.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from, throwError } from 'rxjs';
|
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';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -30,11 +30,8 @@ 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';
|
||||||
|
|
||||||
private _modelsApi: ModelsApi;
|
@LazyApi((self: ModelService) => new ModelsApi(self.apiService.getInstance()))
|
||||||
get modelsApi(): ModelsApi {
|
declare readonly modelsApi: ModelsApi;
|
||||||
this._modelsApi = this._modelsApi ?? new ModelsApi(this.apiService.getInstance());
|
|
||||||
return this._modelsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a Form.
|
* Create a Form.
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import {
|
|||||||
ActivitiContentApi,
|
ActivitiContentApi,
|
||||||
RelatedContentRepresentation,
|
RelatedContentRepresentation,
|
||||||
ResultListDataRepresentationRelatedProcessTask,
|
ResultListDataRepresentationRelatedProcessTask,
|
||||||
ResultListDataRepresentationRelatedContentRepresentation
|
ResultListDataRepresentationRelatedContentRepresentation,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { Observable, from, throwError } from 'rxjs';
|
import { Observable, from, throwError } from 'rxjs';
|
||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
@@ -35,11 +36,8 @@ 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';
|
||||||
|
|
||||||
private _contentApi: ActivitiContentApi;
|
@LazyApi((self: ProcessContentService) => new ActivitiContentApi(self.apiService.getInstance()))
|
||||||
get contentApi(): ActivitiContentApi {
|
declare readonly contentApi: ActivitiContentApi;
|
||||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create temporary related content from an uploaded file.
|
* 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 { FormFieldOption } from '@alfresco/adf-core';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from, throwError } from 'rxjs';
|
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 { catchError } from 'rxjs/operators';
|
||||||
import { DynamicTableColumnOption } from '../widgets/dynamic-table/editors/models/dynamic-table-column-option.model';
|
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 UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
private _processDefinitionsApi: ProcessDefinitionsApi;
|
@LazyApi((self: ProcessDefinitionService) => new ProcessDefinitionsApi(self.apiService.getInstance()))
|
||||||
get processDefinitionsApi(): ProcessDefinitionsApi {
|
declare readonly processDefinitionsApi: ProcessDefinitionsApi;
|
||||||
this._processDefinitionsApi = this._processDefinitionsApi ?? new ProcessDefinitionsApi(this.apiService.getInstance());
|
|
||||||
return this._processDefinitionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets values of fields populated by a REST backend using a process ID.
|
* 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 { FormFieldOption, FormValues, TaskProcessVariableModel } from '@alfresco/adf-core';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { from, Observable, throwError } from 'rxjs';
|
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 { catchError, map } from 'rxjs/operators';
|
||||||
import { DynamicTableColumnOption } from '../widgets/dynamic-table/editors/models/dynamic-table-column-option.model';
|
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 UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
|
||||||
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
static GENERIC_ERROR_MESSAGE: string = 'Server error';
|
||||||
|
|
||||||
private _taskFormsApi: TaskFormsApi;
|
@LazyApi((self: TaskFormService) => new TaskFormsApi(self.apiService.getInstance()))
|
||||||
get taskFormsApi(): TaskFormsApi {
|
declare readonly taskFormsApi: TaskFormsApi;
|
||||||
this._taskFormsApi = this._taskFormsApi ?? new TaskFormsApi(this.apiService.getInstance());
|
|
||||||
return this._taskFormsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves a task form.
|
* Saves a task form.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from, throwError } from 'rxjs';
|
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';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -30,11 +30,8 @@ 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';
|
||||||
|
|
||||||
private _taskApi: TasksApi;
|
@LazyApi((self: TaskService) => new TasksApi(self.apiService.getInstance()))
|
||||||
get taskApi(): TasksApi {
|
declare readonly taskApi: TasksApi;
|
||||||
this._taskApi = this._taskApi ?? new TasksApi(this.apiService.getInstance());
|
|
||||||
return this._taskApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a task.
|
* Gets a task.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { Injectable, inject } from '@angular/core';
|
|||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { CommentModel, CommentsService, User } from '@alfresco/adf-core';
|
import { CommentModel, CommentsService, User } from '@alfresco/adf-core';
|
||||||
import { map } from 'rxjs/operators';
|
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';
|
import { PeopleProcessService } from '../../services/people-process.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -30,11 +30,8 @@ export class CommentProcessService implements CommentsService {
|
|||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
private readonly peopleProcessService = inject(PeopleProcessService);
|
private readonly peopleProcessService = inject(PeopleProcessService);
|
||||||
|
|
||||||
private _commentsApi: ActivitiCommentsApi;
|
@LazyApi((self: CommentProcessService) => new ActivitiCommentsApi(self.apiService.getInstance()))
|
||||||
get commentsApi(): ActivitiCommentsApi {
|
declare readonly commentsApi: ActivitiCommentsApi;
|
||||||
this._commentsApi = this._commentsApi ?? new ActivitiCommentsApi(this.apiService.getInstance());
|
|
||||||
return this._commentsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all comments that have been added to a process instance.
|
* 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 { Observable, from, forkJoin } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import {
|
import {
|
||||||
|
LazyApi,
|
||||||
ResultListDataRepresentationUserProcessInstanceFilterRepresentation,
|
ResultListDataRepresentationUserProcessInstanceFilterRepresentation,
|
||||||
UserFiltersApi,
|
UserFiltersApi,
|
||||||
UserProcessInstanceFilterRepresentation
|
UserProcessInstanceFilterRepresentation
|
||||||
@@ -31,11 +32,8 @@ import {
|
|||||||
export class ProcessFilterService {
|
export class ProcessFilterService {
|
||||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _userFiltersApi: UserFiltersApi;
|
@LazyApi((self: ProcessFilterService) => new UserFiltersApi(self.alfrescoApiService.getInstance()))
|
||||||
get userFiltersApi(): UserFiltersApi {
|
declare readonly userFiltersApi: UserFiltersApi;
|
||||||
this._userFiltersApi = this._userFiltersApi ?? new UserFiltersApi(this.alfrescoApiService.getInstance());
|
|
||||||
return this._userFiltersApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all filters defined for a Process App.
|
* Gets all filters defined for a Process App.
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ import {
|
|||||||
ResultListDataRepresentationProcessInstanceRepresentation,
|
ResultListDataRepresentationProcessInstanceRepresentation,
|
||||||
TasksApi,
|
TasksApi,
|
||||||
ProcessDefinitionRepresentation,
|
ProcessDefinitionRepresentation,
|
||||||
TaskRepresentation
|
TaskRepresentation,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
@@ -42,25 +43,17 @@ import { DatePipe } from '@angular/common';
|
|||||||
export class ProcessService {
|
export class ProcessService {
|
||||||
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
private readonly alfrescoApiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _tasksApi: TasksApi;
|
@LazyApi((self: ProcessService) => new TasksApi(self.alfrescoApiService.getInstance()))
|
||||||
get tasksApi(): TasksApi {
|
declare readonly tasksApi: TasksApi;
|
||||||
return (this._tasksApi ||= new TasksApi(this.alfrescoApiService.getInstance()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private _processDefinitionsApi: ProcessDefinitionsApi;
|
@LazyApi((self: ProcessService) => new ProcessDefinitionsApi(self.alfrescoApiService.getInstance()))
|
||||||
get processDefinitionsApi(): ProcessDefinitionsApi {
|
declare readonly processDefinitionsApi: ProcessDefinitionsApi;
|
||||||
return (this._processDefinitionsApi ||= new ProcessDefinitionsApi(this.alfrescoApiService.getInstance()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private _processInstancesApi: ProcessInstancesApi;
|
@LazyApi((self: ProcessService) => new ProcessInstancesApi(self.alfrescoApiService.getInstance()))
|
||||||
get processInstancesApi(): ProcessInstancesApi {
|
declare readonly processInstancesApi: ProcessInstancesApi;
|
||||||
return (this._processInstancesApi ||= new ProcessInstancesApi(this.alfrescoApiService.getInstance()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private _processInstanceVariablesApi: ProcessInstanceVariablesApi;
|
@LazyApi((self: ProcessService) => new ProcessInstanceVariablesApi(self.alfrescoApiService.getInstance()))
|
||||||
get processInstanceVariablesApi(): ProcessInstanceVariablesApi {
|
declare readonly processInstanceVariablesApi: ProcessInstanceVariablesApi;
|
||||||
return (this._processInstanceVariablesApi ||= new ProcessInstanceVariablesApi(this.alfrescoApiService.getInstance()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets process instances for a filter and optionally a process definition.
|
* Gets process instances for a filter and optionally a process definition.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
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 { Observable, from } from 'rxjs';
|
||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
@@ -27,11 +27,8 @@ import { map } from 'rxjs/operators';
|
|||||||
export class AppsProcessService {
|
export class AppsProcessService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _appsApi: RuntimeAppDefinitionsApi;
|
@LazyApi((self: AppsProcessService) => new RuntimeAppDefinitionsApi(self.apiService.getInstance()))
|
||||||
get appsApi(): RuntimeAppDefinitionsApi {
|
declare readonly appsApi: RuntimeAppDefinitionsApi;
|
||||||
this._appsApi = this._appsApi ?? new RuntimeAppDefinitionsApi(this.apiService.getInstance());
|
|
||||||
return this._appsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of deployed apps for this user.
|
* 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 { GroupModel } from '@alfresco/adf-core';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
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({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -28,29 +28,17 @@ import { TaskActionsApi, UsersApi, ActivitiGroupsApi, UserProfileApi, UserRepres
|
|||||||
export class PeopleProcessService {
|
export class PeopleProcessService {
|
||||||
private readonly apiService = inject(AlfrescoApiService);
|
private readonly apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _taskActionsApi: TaskActionsApi;
|
@LazyApi((self: PeopleProcessService) => new TaskActionsApi(self.apiService.getInstance()))
|
||||||
get taskActionsApi(): TaskActionsApi {
|
declare readonly taskActionsApi: TaskActionsApi;
|
||||||
this._taskActionsApi = this._taskActionsApi ?? new TaskActionsApi(this.apiService.getInstance());
|
|
||||||
return this._taskActionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _userApi: UsersApi;
|
@LazyApi((self: PeopleProcessService) => new UsersApi(self.apiService.getInstance()))
|
||||||
get userApi(): UsersApi {
|
declare readonly userApi: UsersApi;
|
||||||
this._userApi = this._userApi ?? new UsersApi(this.apiService.getInstance());
|
|
||||||
return this._userApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _groupsApi: ActivitiGroupsApi;
|
@LazyApi((self: PeopleProcessService) => new ActivitiGroupsApi(self.apiService.getInstance()))
|
||||||
get groupsApi(): ActivitiGroupsApi {
|
declare readonly groupsApi: ActivitiGroupsApi;
|
||||||
this._groupsApi = this._groupsApi ?? new ActivitiGroupsApi(this.apiService.getInstance());
|
|
||||||
return this._groupsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _profileApi: UserProfileApi;
|
@LazyApi((self: PeopleProcessService) => new UserProfileApi(self.apiService.getInstance()))
|
||||||
get profileApi(): UserProfileApi {
|
declare readonly profileApi: UserProfileApi;
|
||||||
this._profileApi = this._profileApi ?? new UserProfileApi(this.apiService.getInstance());
|
|
||||||
return this._profileApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets information about the current user.
|
* Gets information about the current user.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
import { CommentModel, CommentsService } from '@alfresco/adf-core';
|
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 { inject, Injectable } from '@angular/core';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
@@ -27,11 +27,8 @@ import { PeopleProcessService } from './people-process.service';
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class TaskCommentsService implements CommentsService {
|
export class TaskCommentsService implements CommentsService {
|
||||||
private _commentsApi: ActivitiCommentsApi;
|
@LazyApi((self: TaskCommentsService) => new ActivitiCommentsApi(self.apiService.getInstance()))
|
||||||
get commentsApi(): ActivitiCommentsApi {
|
declare readonly commentsApi: ActivitiCommentsApi;
|
||||||
this._commentsApi = this._commentsApi ?? new ActivitiCommentsApi(this.apiService.getInstance());
|
|
||||||
return this._commentsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected apiService = inject(AlfrescoApiService);
|
protected apiService = inject(AlfrescoApiService);
|
||||||
protected peopleProcessService = inject(PeopleProcessService);
|
protected peopleProcessService = inject(PeopleProcessService);
|
||||||
|
|||||||
@@ -16,18 +16,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { UploadService } from '@alfresco/adf-content-services';
|
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';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class ProcessUploadService extends UploadService {
|
export class ProcessUploadService extends UploadService {
|
||||||
private _contentApi: ActivitiContentApi;
|
@LazyApi((self: ProcessUploadService) => new ActivitiContentApi(self.apiService.getInstance()))
|
||||||
get contentApi(): ActivitiContentApi {
|
declare readonly contentApi: ActivitiContentApi;
|
||||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
getUploadPromise(file: any): Promise<RelatedContentRepresentation> {
|
getUploadPromise(file: any): Promise<RelatedContentRepresentation> {
|
||||||
const opts = {
|
const opts = {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import { inject, Injectable } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { Observable, forkJoin, from } from 'rxjs';
|
import { Observable, forkJoin, from } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
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';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -27,11 +27,8 @@ import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
|||||||
export class TaskFilterService {
|
export class TaskFilterService {
|
||||||
protected apiService = inject(AlfrescoApiService);
|
protected apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _userFiltersApi: UserFiltersApi;
|
@LazyApi((self: TaskFilterService) => new UserFiltersApi(self.apiService.getInstance()))
|
||||||
get userFiltersApi(): UserFiltersApi {
|
declare readonly userFiltersApi: UserFiltersApi;
|
||||||
this._userFiltersApi = this._userFiltersApi ?? new UserFiltersApi(this.apiService.getInstance());
|
|
||||||
return this._userFiltersApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns the default filters for a process app.
|
* Creates and returns the default filters for a process app.
|
||||||
|
|||||||
@@ -17,17 +17,14 @@
|
|||||||
|
|
||||||
import { UploadService } from '@alfresco/adf-content-services';
|
import { UploadService } from '@alfresco/adf-content-services';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivitiContentApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
import { ActivitiContentApi, LazyApi, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class TaskUploadService extends UploadService {
|
export class TaskUploadService extends UploadService {
|
||||||
private _contentApi: ActivitiContentApi;
|
@LazyApi((self: TaskUploadService) => new ActivitiContentApi(self.apiService.getInstance()))
|
||||||
get contentApi(): ActivitiContentApi {
|
declare readonly contentApi: ActivitiContentApi;
|
||||||
this._contentApi = this._contentApi ?? new ActivitiContentApi(this.apiService.getInstance());
|
|
||||||
return this._contentApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
getUploadPromise(file: any): Promise<RelatedContentRepresentation> {
|
getUploadPromise(file: any): Promise<RelatedContentRepresentation> {
|
||||||
const opts = {
|
const opts = {
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ import {
|
|||||||
ResultListDataRepresentationTaskRepresentation,
|
ResultListDataRepresentationTaskRepresentation,
|
||||||
TaskQueryRepresentation,
|
TaskQueryRepresentation,
|
||||||
UserTaskFilterRepresentation,
|
UserTaskFilterRepresentation,
|
||||||
TaskRepresentation
|
TaskRepresentation,
|
||||||
|
LazyApi
|
||||||
} from '@alfresco/js-api';
|
} from '@alfresco/js-api';
|
||||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||||
|
|
||||||
@@ -38,29 +39,17 @@ import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
|||||||
export class TaskListService {
|
export class TaskListService {
|
||||||
protected apiService = inject(AlfrescoApiService);
|
protected apiService = inject(AlfrescoApiService);
|
||||||
|
|
||||||
private _modelsApi: ModelsApi;
|
@LazyApi((self: TaskListService) => new ModelsApi(self.apiService.getInstance()))
|
||||||
get modelsApi(): ModelsApi {
|
declare readonly modelsApi: ModelsApi;
|
||||||
this._modelsApi = this._modelsApi ?? new ModelsApi(this.apiService.getInstance());
|
|
||||||
return this._modelsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _tasksApi: TasksApi;
|
@LazyApi((self: TaskListService) => new TasksApi(self.apiService.getInstance()))
|
||||||
get tasksApi(): TasksApi {
|
declare readonly tasksApi: TasksApi;
|
||||||
this._tasksApi = this._tasksApi ?? new TasksApi(this.apiService.getInstance());
|
|
||||||
return this._tasksApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _taskActionsApi: TaskActionsApi;
|
@LazyApi((self: TaskListService) => new TaskActionsApi(self.apiService.getInstance()))
|
||||||
get taskActionsApi(): TaskActionsApi {
|
declare readonly taskActionsApi: TaskActionsApi;
|
||||||
this._taskActionsApi = this._taskActionsApi ?? new TaskActionsApi(this.apiService.getInstance());
|
|
||||||
return this._taskActionsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _checklistsApi: ChecklistsApi;
|
@LazyApi((self: TaskListService) => new ChecklistsApi(self.apiService.getInstance()))
|
||||||
get checklistsApi(): ChecklistsApi {
|
declare readonly checklistsApi: ChecklistsApi;
|
||||||
this._checklistsApi = this._checklistsApi ?? new ChecklistsApi(this.apiService.getInstance());
|
|
||||||
return this._checklistsApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all the filters in the list that belong to a task.
|
* Gets all the filters in the list that belong to a task.
|
||||||
|
|||||||
Reference in New Issue
Block a user