dist folder for uploader component

This commit is contained in:
Mario Romano
2016-05-19 16:23:13 +01:00
parent 283e214e94
commit c771c0a205
9 changed files with 34 additions and 18 deletions

View File

@@ -0,0 +1,14 @@
npm-debug.log
.idea
assets/
coverage/
demo/
node_modules
typings/
src/
/ng2-alfresco-upload.ts
/ng2-alfresco-upload.d.ts
/ng2-alfresco-upload.js
/ng2-alfresco-upload.js.map

View File

@@ -17,7 +17,7 @@
"es6-shim": "0.35.0",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"ng2-alfresco-core": "^0.1.0",
"ng2-alfresco-core": "^0.1.6",
"ng2-alfresco-upload": "^0.1.0",
"ng2-translate": "^1.11.2",
"reflect-metadata": "0.1.2",

View File

@@ -18,7 +18,7 @@
*/
import { Component } from 'angular2/core';
import { ALFRESCO_ULPOAD_COMPONENT } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
import { ALFRESCO_ULPOAD_COMPONENT } from 'ng2-alfresco-upload/ng2-alfresco-upload';
@Component({
selector: 'my-demo',

View File

@@ -20,7 +20,7 @@ import { bootstrap } from 'angular2/platform/browser';
import { HTTP_PROVIDERS } from 'angular2/http';
import { MyDemoComponent } from "./components/my-demo.component";
import { TranslateLoader, TranslateService } from 'ng2-translate/ng2-translate';
import { AlfrescoTranslationLoader } from 'ng2-alfresco-core/services';
import { AlfrescoTranslationLoader } from 'ng2-alfresco-core/services/AlfrescoTranslationService';
@Component({
selector: 'my-app',

View File

@@ -1,7 +1,7 @@
{
"name": "ng2-alfresco-upload",
"description": "Alfresco Angular2 Upload Component",
"version": "0.1.1",
"version": "0.1.2",
"author": "Alfresco Software, Ltd.",
"scripts": {
"typings": "typings install",

View File

@@ -180,7 +180,7 @@ export class UploadButtonComponent {
* @returns {any}
*/
private getSiteId(): string {
return this.currentFolderPath.replace('/Sites/','').split('/')[0];
return this.currentFolderPath.replace('/Sites/', '').split('/')[0];
}
/**
@@ -188,6 +188,6 @@ export class UploadButtonComponent {
* @returns {any}
*/
private getContainerId(): string {
return this.currentFolderPath.replace('/Sites/','').split('/')[1];
return this.currentFolderPath.replace('/Sites/', '').split('/')[1];
}
}

View File

@@ -131,9 +131,9 @@ export class UploadDragAreaComponent {
});
},
error => {
error;
console.log(error);
}
);
);
}
}
@@ -144,8 +144,8 @@ export class UploadDragAreaComponent {
*/
private _traverseFileTree(item: any): void {
if (item.isFile) {
let self = this;
self.onFilesEntityDropped(item);
let self = this;
self.onFilesEntityDropped(item);
} else {
if (item.isDirectory) {
let self = this;
@@ -166,7 +166,7 @@ export class UploadDragAreaComponent {
* @returns {string}
*/
private getSiteId(): string {
return this.currentFolderPath.replace('/Sites/','').split('/')[0];
return this.currentFolderPath.replace('/Sites/', '').split('/')[0];
}
/**
@@ -174,6 +174,6 @@ export class UploadDragAreaComponent {
* @returns {string}
*/
private getContainerId(): string {
return this.currentFolderPath.replace('/Sites/','').split('/')[1];
return this.currentFolderPath.replace('/Sites/', '').split('/')[1];
}
}

View File

@@ -21,6 +21,8 @@ import { EventEmitter } from 'angular2/core';
import { Observable } from 'rxjs/Observable';
import { Response } from 'angular2/http';
declare let AlfrescoApi: any;
/**
*
* UploadService keep the queue of the file to upload and uploads them.
@@ -195,7 +197,7 @@ export class UploadService {
let xmlHttpRequest = this.createXMLHttpRequestInstance(uploadingFileModel, elementEmit);
xmlHttpRequest.open(this._method, this._host + this._url, true);
let authToken = btoa(basicAuth.username +':'+ basicAuth.password);
let authToken = btoa(basicAuth.username + ':' + basicAuth.password);
if (authToken) {
xmlHttpRequest.setRequestHeader('Authorization', `${basicAuth.type} ${authToken}`);
}
@@ -230,14 +232,14 @@ export class UploadService {
let apiInstance = new AlfrescoApi.NodesApi(this._alfrescoClient);
let nodeId = '-root-';
let nodeBody = {
'name':name,
'nodeType':'cm:folder',
'relativePath':relativePath
'name': name,
'nodeType': 'cm:folder',
'relativePath': relativePath
};
return Observable.fromPromise(apiInstance.addNode(nodeId, nodeBody))
.map(res => {
console.log(res);
} )
})
.do(data => console.log('Node data', data)) // eyeball results in the console
.catch(this.handleError);
}