[ADF-2054] Created a new widget to handle uploading file from Share (#2810)

* [ADF-2054] start creating custom upload widget for share integration

* [ADF-2054] changed content node selector service to allow different opening approach

* [ADF-2054] addedd support for multi resource files

* [ADF-2054] fixed base case for upload when only local files are selected

* [ADF-2054] start adding and fixing tests for new share attach button widget

* [ADF-2054] changed test to perfrom a correct check

* [ADF-2054] removed fdescribe

* [ADF-2054] added test for share-widget component

* [ADF-2054] added peer reviews changes

* [ADF-2054] created a module folder for content widgets

* [ADF-2054] fixed wrong import

* [ADF-2054] fixed rebase errors

* [ADF-2054] restored some files changed by rebase

* [ADF-2054] added link to content services to fix packaging issue

* [ADF-2054] renamed widget
This commit is contained in:
Vito
2018-01-12 14:28:18 +01:00
committed by Eugenio Romano
parent 69e40ea1c0
commit 46ad98cd8b
37 changed files with 886 additions and 597 deletions

View File

@@ -18,7 +18,7 @@
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { LogService } from '../../services/log.service';
import { Injectable } from '@angular/core';
import { AlfrescoApi } from 'alfresco-js-api';
import { AlfrescoApi, MinimalNodeEntryEntity } from 'alfresco-js-api';
import { Observable } from 'rxjs/Observable';
import { ExternalContent } from '../components/widgets/core/external-content';
import { ExternalContentLink } from '../components/widgets/core/external-content-link';
@@ -49,6 +49,24 @@ export class ActivitiContentService {
.catch(err => this.handleError(err));
}
/**
* Returns a list of all the repositories configured
*
* @param accountId
* @param folderId
* @returns {any}
*/
getAlfrescoRepositories(tenantId: number, includeAccount: boolean): Observable<any> {
let apiService: AlfrescoApi = this.apiService.getInstance();
const opts = {
tenantId: tenantId,
includeAccounts: includeAccount
};
return Observable.fromPromise(apiService.activiti.alfrescoApi.getRepositories(opts))
.map(this.toJsonArray)
.catch(err => this.handleError(err));
}
/**
* Returns a list of child nodes below the specified folder
*
@@ -68,6 +86,20 @@ export class ActivitiContentService {
})).map(this.toJson).catch(err => this.handleError(err));
}
applyAlfrescoNode(node: MinimalNodeEntryEntity, siteId: string, accountId: string) {
let apiService: AlfrescoApi = this.apiService.getInstance();
let params: any = {
source: accountId,
sourceId: node.id + ';1.0@' + siteId,
name: node.name,
link: false
};
return Observable.fromPromise(
apiService.activiti.contentApi.createTemporaryRelatedContent(params))
.map(this.toJson)
.catch(err => this.handleError(err));
}
toJson(res: any) {
if (res) {
return res || {};