Fix uploads from folders opened from search results

Refs #1248
This commit is contained in:
Will Abson
2016-12-16 17:52:57 +00:00
parent 2bed309023
commit fb851271e9
8 changed files with 101 additions and 21 deletions

View File

@@ -53,6 +53,8 @@ const ERROR_FOLDER_ALREADY_EXIST = 409;
})
export class UploadButtonComponent {
private static DEFAULT_ROOT_ID: string = '-root-';
@ViewChild('undoNotificationBar')
undoNotificationBar: any;
@@ -72,7 +74,10 @@ export class UploadButtonComponent {
acceptedFilesType: string = '*';
@Input()
currentFolderPath: string = '/Sites/swsdp/documentLibrary';
currentFolderPath: string = '/';
@Input()
rootFolderId: string = UploadButtonComponent.DEFAULT_ROOT_ID;
@Output()
onSuccess = new EventEmitter();
@@ -151,7 +156,7 @@ export class UploadButtonComponent {
private uploadFiles(path: string, files: any[]) {
if (files.length) {
let latestFilesAdded = this._uploaderService.addToQueue(files);
this._uploaderService.uploadFilesInTheQueue(path, this.onSuccess);
this._uploaderService.uploadFilesInTheQueue(this.rootFolderId, path, this.onSuccess);
if (this.showUdoNotificationBar) {
this._showUndoNotificationBar(latestFilesAdded);
}