[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:
Michal Kinas
2026-03-12 10:15:38 +01:00
committed by GitHub
parent 83e80906d8
commit bc41c33ba8
71 changed files with 465 additions and 592 deletions
@@ -47,7 +47,7 @@ import {
UserPreferencesService,
UserPreferenceValues
} 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 {
AfterContentInit,
Component,
@@ -469,11 +469,8 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
private readonly destroyRef = inject(DestroyRef);
private _nodesApi: NodesApi;
get nodesApi(): NodesApi {
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApiService.getInstance());
return this._nodesApi;
}
@LazyApi((self: DocumentListComponent) => new NodesApi(self.alfrescoApiService.getInstance()))
declare readonly nodesApi: NodesApi;
constructor() {
const appConfig = inject(AppConfigService);