mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Improve compatibility (#7214)
* refactor content * refactor core * refactor rest * fix lint * fix * lint * lint * fix * fix * fix
This commit is contained in:
@@ -38,7 +38,12 @@ export class LibraryFavoriteDirective implements OnChanges {
|
||||
@Output() error = new EventEmitter<any>();
|
||||
|
||||
private targetLibrary = null;
|
||||
private favoritesApi: FavoritesApi;
|
||||
|
||||
_favoritesApi: FavoritesApi;
|
||||
get favoritesApi(): FavoritesApi {
|
||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.alfrescoApiService.getInstance());
|
||||
return this._favoritesApi;
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
onClick() {
|
||||
@@ -58,7 +63,6 @@ export class LibraryFavoriteDirective implements OnChanges {
|
||||
}
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||
this.favoritesApi = new FavoritesApi(this.alfrescoApiService.getInstance());
|
||||
}
|
||||
|
||||
ngOnChanges(changes) {
|
||||
|
@@ -48,7 +48,11 @@ export class LibraryMembershipDirective implements OnChanges {
|
||||
|
||||
isJoinRequested: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||
|
||||
private sitesApi: SitesApi;
|
||||
_sitesApi: SitesApi;
|
||||
get sitesApi(): SitesApi {
|
||||
this._sitesApi = this._sitesApi ?? new SitesApi(this.alfrescoApiService.getInstance());
|
||||
return this._sitesApi;
|
||||
}
|
||||
|
||||
/** Site for which to toggle the membership request. */
|
||||
@Input('adf-library-membership')
|
||||
@@ -75,7 +79,6 @@ export class LibraryMembershipDirective implements OnChanges {
|
||||
private sitesService: SitesService,
|
||||
private versionCompatibilityService: VersionCompatibilityService
|
||||
) {
|
||||
this.sitesApi = new SitesApi(this.alfrescoApiService.getInstance());
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -62,8 +62,17 @@ export class NodeDeleteDirective implements OnChanges {
|
||||
@Output()
|
||||
delete: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
private trashcanApi: TrashcanApi;
|
||||
private nodesApi: NodesApi;
|
||||
_trashcanApi: TrashcanApi;
|
||||
get trashcanApi(): TrashcanApi {
|
||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.alfrescoApiService.getInstance());
|
||||
return this._trashcanApi;
|
||||
}
|
||||
|
||||
_nodesApi: NodesApi;
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.alfrescoApiService.getInstance());
|
||||
return this._nodesApi;
|
||||
}
|
||||
|
||||
@HostListener('click')
|
||||
onClick() {
|
||||
@@ -73,8 +82,6 @@ export class NodeDeleteDirective implements OnChanges {
|
||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||
private translation: TranslationService,
|
||||
private elementRef: ElementRef) {
|
||||
this.trashcanApi = new TrashcanApi(this.alfrescoApiService.getInstance());
|
||||
this.nodesApi = new NodesApi(this.alfrescoApiService.getInstance());
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
|
@@ -31,7 +31,11 @@ import { DownloadService } from '../services/download.service';
|
||||
})
|
||||
export class NodeDownloadDirective {
|
||||
|
||||
private contentApi: ContentApi;
|
||||
_contentApi: ContentApi;
|
||||
get contentApi(): ContentApi {
|
||||
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
|
||||
return this._contentApi;
|
||||
}
|
||||
|
||||
/** Nodes to download. */
|
||||
@Input('adfNodeDownload')
|
||||
@@ -50,7 +54,6 @@ export class NodeDownloadDirective {
|
||||
private apiService: AlfrescoApiService,
|
||||
private downloadService: DownloadService,
|
||||
private dialog: MatDialog) {
|
||||
this.contentApi = new ContentApi(this.apiService.getInstance());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -30,7 +30,11 @@ import { catchError, map } from 'rxjs/operators';
|
||||
export class NodeFavoriteDirective implements OnChanges {
|
||||
favorites: any[] = [];
|
||||
|
||||
private favoritesApi: FavoritesApi;
|
||||
_favoritesApi: FavoritesApi;
|
||||
get favoritesApi(): FavoritesApi {
|
||||
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.alfrescoApiService.getInstance());
|
||||
return this._favoritesApi;
|
||||
}
|
||||
|
||||
/** Array of nodes to toggle as favorites. */
|
||||
@Input('adf-node-favorite')
|
||||
@@ -48,7 +52,6 @@ export class NodeFavoriteDirective implements OnChanges {
|
||||
}
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||
this.favoritesApi = new FavoritesApi(this.alfrescoApiService.getInstance());
|
||||
}
|
||||
|
||||
ngOnChanges(changes) {
|
||||
|
@@ -35,7 +35,12 @@ export class RestoreMessageModel {
|
||||
})
|
||||
export class NodeRestoreDirective {
|
||||
private readonly restoreProcessStatus;
|
||||
private trashcanApi: TrashcanApi;
|
||||
|
||||
_trashcanApi: TrashcanApi;
|
||||
get trashcanApi(): TrashcanApi {
|
||||
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.alfrescoApiService.getInstance());
|
||||
return this._trashcanApi;
|
||||
}
|
||||
|
||||
/** Array of deleted nodes to restore. */
|
||||
@Input('adf-restore')
|
||||
@@ -53,7 +58,6 @@ export class NodeRestoreDirective {
|
||||
constructor(private alfrescoApiService: AlfrescoApiService,
|
||||
private translation: TranslationService) {
|
||||
this.restoreProcessStatus = this.processStatus();
|
||||
this.trashcanApi = new TrashcanApi(this.alfrescoApiService.getInstance());
|
||||
}
|
||||
|
||||
private recover(selection: any) {
|
||||
|
Reference in New Issue
Block a user