Merge branch 'development' into dev-denys-dts

# Conflicts:
#	demo-shell-ng2/systemjs.config.js
#	ng2-components/ng2-alfresco-upload/src/services/upload.service.spec.ts
#	ng2-components/ng2-alfresco-upload/src/services/upload.service.ts
#
ng2-components/ng2-alfresco-viewer/src/componets/viewer.component.spec.t
s
#	ng2-components/ng2-alfresco-viewer/src/componets/viewer.component.ts
This commit is contained in:
Denys Vuika
2016-09-05 09:10:08 +01:00
176 changed files with 4641 additions and 1173 deletions

View File

@@ -7,7 +7,6 @@
top: 0;
width: 300px;
z-index: 4;
background-color: rgb(255,152,0);
}
.mdl-textfield--file .mdl-textfield__input {
@@ -17,4 +16,4 @@
.mdl-textfield--file .mdl-button--file {
right: 0;
}
}

View File

@@ -38,10 +38,11 @@ const ERROR_FOLDER_ALREADY_EXIST = 409;
* This component, provide a set of buttons to upload files to alfresco.
*
* @InputParam {boolean} [true] showUdoNotificationBar - hide/show notification bar.
* @InputParam {boolean} [false] versioning - true to indicate that a major version should be created
* @InputParam {boolean} [false] uploadFolders - allow/disallow upload folders (only for chrome).
* @InputParam {boolean} [false] multipleFiles - allow/disallow multiple files.
* @InputParam {string} [*] acceptedFilesType - array of allowed file extensions.
*
* @InputParam {boolean} [false] versioning - true to indicate that a major version should be created
* @Output - onSuccess - The event is emitted when the file is uploaded
*
* @returns {UploadDragAreaComponent} .
@@ -67,6 +68,9 @@ export class UploadButtonComponent {
@Input()
multipleFiles: boolean = false;
@Input()
versioning: boolean = false;
@Input()
acceptedFilesType: string = '*';
@@ -85,16 +89,16 @@ export class UploadButtonComponent {
translate: AlfrescoTranslationService;
constructor(public el: ElementRef,
private _uploaderService: UploadService,
translate: AlfrescoTranslationService) {
let formFields = this.createFormFields();
this._uploaderService.setOptions(formFields);
constructor(public el: ElementRef, private _uploaderService: UploadService, translate: AlfrescoTranslationService) {
this.translate = translate;
this.translate.addTranslationFolder('node_modules/ng2-alfresco-upload/dist/src');
}
ngOnChanges(changes) {
let formFields = this.createFormFields();
this._uploaderService.setOptions(formFields, this.versioning);
}
/**
* Method called when files are dropped in the drag area.
*
@@ -123,21 +127,21 @@ export class UploadButtonComponent {
this._uploaderService.createFolder(absolutePath, directoryName)
.subscribe(
res => {
let relativeDir = this.currentFolderPath + '/' + directoryPath;
this.uploadFiles(relativeDir, filesDir);
},
let relativeDir = this.currentFolderPath + '/' + directoryPath;
this.uploadFiles(relativeDir, filesDir);
},
error => {
let errorMessagePlaceholder = this.getErrorMessage(error.response);
if (errorMessagePlaceholder) {
this.onError.emit({value: errorMessagePlaceholder});
let errorMessage = this.formatString(errorMessagePlaceholder, [directoryName]);
if (errorMessage) {
this._showErrorNotificationBar(errorMessage);
let errorMessagePlaceholder = this.getErrorMessage(error.response);
if (errorMessagePlaceholder) {
this.onError.emit({value: errorMessagePlaceholder});
let errorMessage = this.formatString(errorMessagePlaceholder, [directoryName]);
if (errorMessage) {
this._showErrorNotificationBar(errorMessage);
}
}
console.log(error);
}
console.log(error);
}
);
);
});
// reset the value of the input file
$event.target.value = '';

View File

@@ -51,6 +51,9 @@ export class UploadDragAreaComponent {
@Input()
showUdoNotificationBar: boolean = true;
@Input()
versioning: boolean = false;
@Input()
currentFolderPath: string = '/Sites/swsdp/documentLibrary';
@@ -59,16 +62,16 @@ export class UploadDragAreaComponent {
translate: AlfrescoTranslationService;
constructor(private _uploaderService: UploadService,
translate: AlfrescoTranslationService) {
let formFields = this.createFormFields();
this._uploaderService.setOptions(formFields);
constructor(private _uploaderService: UploadService, translate: AlfrescoTranslationService) {
this.translate = translate;
this.translate.addTranslationFolder('node_modules/ng2-alfresco-upload/dist/src');
}
ngOnChanges(changes) {
let formFields = this.createFormFields();
this._uploaderService.setOptions(formFields, this.versioning);
}
/**
* Method called when files are dropped in the drag area.
*
@@ -227,7 +230,7 @@ export class UploadDragAreaComponent {
* @returns {string}
*/
private getErrorMessage(response: any): string {
if (response.body.error.statusCode === ERROR_FOLDER_ALREADY_EXIST ) {
if (response.body.error.statusCode === ERROR_FOLDER_ALREADY_EXIST) {
let errorMessage: any;
errorMessage = this.translate.get('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST');
return errorMessage.value;