Improve compatibility (#7214)

* refactor content

* refactor core

* refactor rest

* fix lint

* fix

* lint

* lint

* fix

* fix

* fix
This commit is contained in:
Eugenio Romano
2021-08-16 11:42:29 +02:00
committed by GitHub
parent 8c8e388fa0
commit a25923d1f2
62 changed files with 595 additions and 235 deletions

View File

@@ -67,7 +67,11 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i
rootNodeId = AttachFileCloudWidgetComponent.ALIAS_USER_FOLDER;
selectedNode: Node;
private nodesApi: NodesApi;
_nodesApi: NodesApi;
get nodesApi(): NodesApi {
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
return this._nodesApi;
}
constructor(
formService: FormService,
@@ -81,7 +85,6 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i
private contentNodeSelectorPanelService: ContentNodeSelectorPanelService
) {
super(formService, thumbnails, processCloudContentService, notificationService, logger);
this.nodesApi = new NodesApi(this.apiService.getInstance());
}
ngOnInit() {

View File

@@ -31,14 +31,18 @@ import { Observable, Subject, throwError } from 'rxjs';
})
export class ContentCloudNodeSelectorService {
nodesApi: NodesApi;
_nodesApi: NodesApi;
get nodesApi(): NodesApi {
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
return this._nodesApi;
}
sourceNodeNotFound = false;
constructor(
private apiService: AlfrescoApiService,
private notificationService: NotificationService,
private dialog: MatDialog) {
this.nodesApi = new NodesApi(this.apiService.getInstance());
}
openUploadFileDialog(currentFolderId?: string, selectionMode?: string, isAllFileSources?: boolean, restrictRootToCurrentFolderId?: boolean): Observable<Node[]> {

View File

@@ -36,14 +36,17 @@ import { FormContent } from '../../services/form-fields.interfaces';
})
export class FormCloudService extends BaseCloudService {
uploadApi: UploadApi;
private _uploadApi;
get uploadApi(): UploadApi {
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
return this._uploadApi;
}
constructor(
apiService: AlfrescoApiService,
appConfigService: AppConfigService
) {
super(apiService, appConfigService);
this.uploadApi = new UploadApi(apiService.getInstance());
}
/**

View File

@@ -31,8 +31,17 @@ import { AuthenticationApi, Node, UploadApi } from '@alfresco/js-api';
})
export class ProcessCloudContentService {
uploadApi: UploadApi;
authenticationApi: AuthenticationApi;
private _uploadApi;
get uploadApi(): UploadApi {
this._uploadApi = this._uploadApi ?? new UploadApi(this.apiService.getInstance());
return this._uploadApi;
}
private _authenticationApi;
get authenticationApi(): AuthenticationApi {
this._authenticationApi = this._authenticationApi ?? new AuthenticationApi(this.apiService.getInstance());
return this._authenticationApi;
}
constructor(
private apiService: AlfrescoApiService,
@@ -40,8 +49,6 @@ export class ProcessCloudContentService {
public contentService: ContentService,
private downloadService: DownloadService
) {
this.uploadApi = new UploadApi(this.apiService.getInstance());
this.authenticationApi = new AuthenticationApi(this.apiService.getInstance());
}
createTemporaryRawRelatedContent(