mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-11205] Use new LazyApi decorator (#5079)
* [ACS-11205] Use new LazyApi decorator * [ACS-11205] Use latest ADF * [ACS-11025] CR fixes
This commit is contained in:
+3
-6
@@ -34,7 +34,7 @@ import {
|
||||
ValidationErrors,
|
||||
Validators
|
||||
} from '@angular/forms';
|
||||
import { QueriesApi, SiteEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { QueriesApi, SiteEntry, SitePaging, LazyApi } from '@alfresco/js-api';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore, isAdmin, UpdateLibraryAction } from '@alfresco/aca-shared/store';
|
||||
import { AppHookService } from '@alfresco/aca-shared';
|
||||
@@ -77,13 +77,10 @@ export class InstantErrorStateMatcher implements ErrorStateMatcher {
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class LibraryMetadataFormComponent implements OnInit, OnChanges {
|
||||
private _queriesApi: QueriesApi;
|
||||
private _titleErrorTranslationKey: string;
|
||||
|
||||
get queriesApi(): QueriesApi {
|
||||
this._queriesApi = this._queriesApi ?? new QueriesApi(this.alfrescoApiService.getInstance());
|
||||
return this._queriesApi;
|
||||
}
|
||||
@LazyApi((self: LibraryMetadataFormComponent) => new QueriesApi(self.alfrescoApiService.getInstance()))
|
||||
queriesApi: QueriesApi;
|
||||
|
||||
get titleErrorTranslationKey(): string {
|
||||
return this._titleErrorTranslationKey;
|
||||
|
||||
+4
-7
@@ -24,7 +24,7 @@
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { QueriesApi, SitePaging } from '@alfresco/js-api';
|
||||
import { QueriesApi, SitePaging, LazyApi } from '@alfresco/js-api';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export interface LibrarySearchQuery {
|
||||
@@ -39,14 +39,11 @@ export interface LibrarySearchQuery {
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SearchLibrariesQueryBuilderService {
|
||||
_queriesApi: QueriesApi;
|
||||
get queriesApi(): QueriesApi {
|
||||
this._queriesApi = this._queriesApi ?? new QueriesApi(this.alfrescoApiService.getInstance());
|
||||
return this._queriesApi;
|
||||
}
|
||||
|
||||
private _userQuery = '';
|
||||
|
||||
@LazyApi((self: SearchLibrariesQueryBuilderService) => new QueriesApi(self.alfrescoApiService.getInstance()))
|
||||
queriesApi: QueriesApi;
|
||||
|
||||
updated: Subject<any> = new Subject();
|
||||
executed: Subject<any> = new Subject();
|
||||
hadError: Subject<any> = new Subject();
|
||||
|
||||
+3
-4
@@ -25,7 +25,7 @@
|
||||
import { AppStore, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
||||
import { ViewerModule } from '@alfresco/adf-core';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import { SharedLinkEntry, SharedlinksApi } from '@alfresco/js-api';
|
||||
import { SharedLinkEntry, SharedlinksApi, LazyApi } from '@alfresco/js-api';
|
||||
import { Component, DestroyRef, inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
@@ -48,6 +48,7 @@ export class SharedLinkViewComponent implements OnInit {
|
||||
sharedLinkId: string = null;
|
||||
viewerToolbarActions: Array<ContentActionRef> = [];
|
||||
|
||||
@LazyApi((self: SharedLinkViewComponent) => new SharedlinksApi(self.alfrescoApiService.getInstance()))
|
||||
private sharedLinksApi: SharedlinksApi;
|
||||
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
@@ -58,9 +59,7 @@ export class SharedLinkViewComponent implements OnInit {
|
||||
private extensions: AppExtensionService,
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private appService: AppService
|
||||
) {
|
||||
this.sharedLinksApi = new SharedlinksApi(this.alfrescoApiService.getInstance());
|
||||
}
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params
|
||||
|
||||
+4
-4
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
import { AppStore, DownloadNodesAction, EditOfflineAction, SetSelectedNodesAction, getAppSelection } from '@alfresco/aca-shared/store';
|
||||
import { NodeEntry, SharedLinkEntry, Node, NodesApi } from '@alfresco/js-api';
|
||||
import { NodeEntry, SharedLinkEntry, Node, NodesApi, LazyApi } from '@alfresco/js-api';
|
||||
import { Component, inject, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppExtensionService, isLocked } from '@alfresco/aca-shared';
|
||||
@@ -52,7 +52,9 @@ export class ToggleEditOfflineComponent implements OnInit {
|
||||
|
||||
private notificationService = inject(NotificationService);
|
||||
|
||||
@LazyApi((self: ToggleEditOfflineComponent) => new NodesApi(self.alfrescoApiService.getInstance()))
|
||||
private nodesApi: NodesApi;
|
||||
|
||||
selection: NodeEntry;
|
||||
nodeTitle = '';
|
||||
isNodeLocked = false;
|
||||
@@ -61,9 +63,7 @@ export class ToggleEditOfflineComponent implements OnInit {
|
||||
private store: Store<AppStore>,
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private extensions: AppExtensionService
|
||||
) {
|
||||
this.nodesApi = new NodesApi(this.alfrescoApiService.getInstance());
|
||||
}
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.store.select(getAppSelection).subscribe(({ file }) => {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
import { AlfrescoApiService } from '@alfresco/adf-content-services';
|
||||
import { PeopleApi, Person } from '@alfresco/js-api';
|
||||
import { PeopleApi, Person, LazyApi } from '@alfresco/js-api';
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
@@ -57,6 +57,7 @@ import { MatInputModule } from '@angular/material/input';
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ViewProfileComponent implements OnInit {
|
||||
@LazyApi((self: ViewProfileComponent) => new PeopleApi(self.apiService.getInstance()))
|
||||
peopleApi: PeopleApi;
|
||||
profileForm = new FormGroup({
|
||||
firstName: new FormControl(''),
|
||||
@@ -93,7 +94,6 @@ export class ViewProfileComponent implements OnInit {
|
||||
private readonly appService: AppService,
|
||||
private readonly extensionService: AppExtensionService
|
||||
) {
|
||||
this.peopleApi = new PeopleApi(this.apiService.getInstance());
|
||||
this.appNavNarMode$ = appService.appNavNarMode$.pipe(takeUntilDestroyed());
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,17 @@ import {
|
||||
NodeAction,
|
||||
ContentService
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { NodeEntry, Node, SitePaging, NodeChildAssociationPaging, NodeChildAssociationEntry, NodesApi, Site, SitePagingList } from '@alfresco/js-api';
|
||||
import {
|
||||
NodeEntry,
|
||||
Node,
|
||||
SitePaging,
|
||||
NodeChildAssociationPaging,
|
||||
NodeChildAssociationEntry,
|
||||
NodesApi,
|
||||
Site,
|
||||
SitePagingList,
|
||||
LazyApi
|
||||
} from '@alfresco/js-api';
|
||||
import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { catchError, map, mergeMap } from 'rxjs/operators';
|
||||
|
||||
@@ -51,11 +61,8 @@ export class NodeActionsService {
|
||||
moveDeletedEntries: any[] = [];
|
||||
isSitesDestinationAvailable = false;
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
}
|
||||
@LazyApi((self: NodeActionsService) => new NodesApi(self.apiService.getInstance()))
|
||||
nodesApi: NodesApi;
|
||||
|
||||
constructor(
|
||||
private contentService: ContentService,
|
||||
|
||||
@@ -26,7 +26,7 @@ import { inject, Injectable } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { CreateFromTemplateDialogComponent } from '../dialogs/node-template/create-from-template.dialog';
|
||||
import { Subject, from, of } from 'rxjs';
|
||||
import { Node, ResultNode, PathElement, SearchApi } from '@alfresco/js-api';
|
||||
import { Node, ResultNode, PathElement, SearchApi, LazyApi } from '@alfresco/js-api';
|
||||
import { TranslationService, NotificationService } from '@alfresco/adf-core';
|
||||
import { switchMap, catchError } from 'rxjs/operators';
|
||||
import {
|
||||
@@ -54,11 +54,8 @@ export class NodeTemplateService {
|
||||
private currentTemplateConfig: TemplateDialogConfig = null;
|
||||
private rootNode: ResultNode;
|
||||
|
||||
private _searchApi: SearchApi;
|
||||
get searchApi(): SearchApi {
|
||||
this._searchApi = this._searchApi ?? new SearchApi(this.alfrescoApiService.getInstance());
|
||||
return this._searchApi;
|
||||
}
|
||||
@LazyApi((self: NodeTemplateService) => new SearchApi(self.alfrescoApiService.getInstance()))
|
||||
searchApi: SearchApi;
|
||||
|
||||
selectTemplateDialog(config: TemplateDialogConfig): Subject<Node[]> {
|
||||
this.currentTemplateConfig = config;
|
||||
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
import { NodeTemplateService, TemplateDialogConfig } from '../../services/node-template.service';
|
||||
import { NotificationService } from '@alfresco/adf-core';
|
||||
import { from, Observable, of } from 'rxjs';
|
||||
import { Node, NodeBodyUpdate, NodeEntry, NodesApi } from '@alfresco/js-api';
|
||||
import { Node, NodeBodyUpdate, NodeEntry, NodesApi, LazyApi } from '@alfresco/js-api';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { AlfrescoApiService, DocumentListService } from '@alfresco/adf-content-services';
|
||||
|
||||
@@ -47,11 +47,8 @@ export class TemplateEffects {
|
||||
private notificationService = inject(NotificationService);
|
||||
private documentListService = inject(DocumentListService);
|
||||
|
||||
private _nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
|
||||
return this._nodesApi;
|
||||
}
|
||||
@LazyApi((self: TemplateEffects) => new NodesApi(self.apiService.getInstance()))
|
||||
nodesApi: NodesApi;
|
||||
|
||||
matDialog = inject(MatDialog);
|
||||
store = inject(Store<AppStore>);
|
||||
|
||||
@@ -43,7 +43,7 @@ import {
|
||||
ViewNodeAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { ContentActionRef, SelectionState } from '@alfresco/adf-extensions';
|
||||
import { Node, VersionEntry, VersionsApi } from '@alfresco/js-api';
|
||||
import { Node, VersionEntry, VersionsApi, LazyApi } from '@alfresco/js-api';
|
||||
import { Component, DestroyRef, HostListener, inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ActivatedRoute, PRIMARY_OUTLET, Router } from '@angular/router';
|
||||
import { ViewerOpenWithComponent, ViewerSidebarComponent, ViewerToolbarActionsComponent } from '@alfresco/adf-core';
|
||||
@@ -78,12 +78,8 @@ export class AcaViewerComponent implements OnInit, OnDestroy {
|
||||
|
||||
private documentListService = inject(DocumentListService);
|
||||
|
||||
private _versionsApi: VersionsApi;
|
||||
get versionsApi(): VersionsApi {
|
||||
this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance());
|
||||
return this._versionsApi;
|
||||
}
|
||||
|
||||
@LazyApi((self: AcaViewerComponent) => new VersionsApi(self.apiService.getInstance()))
|
||||
versionsApi: VersionsApi;
|
||||
fileName: string;
|
||||
folderId: string = null;
|
||||
infoDrawerOpened$: Observable<boolean>;
|
||||
|
||||
Reference in New Issue
Block a user