diff --git a/demo-shell-ng2/systemjs.config.js b/demo-shell-ng2/systemjs.config.js index 41dde07cfd..ce50a6ced1 100644 --- a/demo-shell-ng2/systemjs.config.js +++ b/demo-shell-ng2/systemjs.config.js @@ -24,7 +24,7 @@ 'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable', 'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist/dist', 'ng2-alfresco-login': 'node_modules/ng2-alfresco-login', - 'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload', + 'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/dist', 'ng2-translate': 'node_modules/ng2-translate', 'rxjs': 'node_modules/rxjs' }; diff --git a/ng2-components/ng2-alfresco-upload/.npmignore b/ng2-components/ng2-alfresco-upload/.npmignore new file mode 100644 index 0000000000..da0fb078c2 --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/.npmignore @@ -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 diff --git a/ng2-components/ng2-alfresco-upload/demo/package.json b/ng2-components/ng2-alfresco-upload/demo/package.json index 46f72ca3a6..9b5edd92e2 100644 --- a/ng2-components/ng2-alfresco-upload/demo/package.json +++ b/ng2-components/ng2-alfresco-upload/demo/package.json @@ -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", diff --git a/ng2-components/ng2-alfresco-upload/demo/src/components/my-demo.component.ts b/ng2-components/ng2-alfresco-upload/demo/src/components/my-demo.component.ts index da206ea2a0..845837b4d0 100644 --- a/ng2-components/ng2-alfresco-upload/demo/src/components/my-demo.component.ts +++ b/ng2-components/ng2-alfresco-upload/demo/src/components/my-demo.component.ts @@ -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', diff --git a/ng2-components/ng2-alfresco-upload/demo/src/my-app.ts b/ng2-components/ng2-alfresco-upload/demo/src/my-app.ts index e5cdfbba1a..edbc66c570 100644 --- a/ng2-components/ng2-alfresco-upload/demo/src/my-app.ts +++ b/ng2-components/ng2-alfresco-upload/demo/src/my-app.ts @@ -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', diff --git a/ng2-components/ng2-alfresco-upload/package.json b/ng2-components/ng2-alfresco-upload/package.json index 46cba12cb0..53b3c90ae7 100644 --- a/ng2-components/ng2-alfresco-upload/package.json +++ b/ng2-components/ng2-alfresco-upload/package.json @@ -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", diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts index 7bfcf331fd..eba04c0226 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts @@ -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]; } } diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts index 958bf038bb..c2f6d3c982 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts @@ -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]; } } diff --git a/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts b/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts index 87484cb6d4..39356ac9c1 100644 --- a/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts +++ b/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts @@ -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); }