Allow button label to be added via staticTitle input (#1566)

* Allow button label to be added via staticTitle input

Refs #1551

* Minor fix to JSDoc
This commit is contained in:
Will Abson 2017-01-28 14:52:12 +00:00 committed by Mario Romano
parent 3fad45394a
commit 09b98e7071
2 changed files with 10 additions and 4 deletions

View File

@ -5,7 +5,8 @@
<!--Multiple Files Upload--> <!--Multiple Files Upload-->
<span *ngIf="multipleFiles"> <span *ngIf="multipleFiles">
<label for="upload-multiple-files">{{'FILE_UPLOAD.BUTTON.UPLOAD_FILE' | translate}}</label> <label *ngIf="!staticTitle" for="upload-multiple-files">{{'FILE_UPLOAD.BUTTON.UPLOAD_FILE' | translate}}</label>
<label *ngIf="staticTitle" for="upload-multiple-files">{{staticTitle}}</label>
<input id="upload-multiple-files" data-automation-id="upload-multiple-files" type="file" name="uploadFiles" <input id="upload-multiple-files" data-automation-id="upload-multiple-files" type="file" name="uploadFiles"
(change)="onFilesAdded($event)" (change)="onFilesAdded($event)"
multiple="multiple" multiple="multiple"
@ -15,7 +16,8 @@
<!--Single Files Upload--> <!--Single Files Upload-->
<span *ngIf="!multipleFiles"> <span *ngIf="!multipleFiles">
<label for="upload-single-file">{{'FILE_UPLOAD.BUTTON.UPLOAD_FILE' | translate}}</label> <label *ngIf="!staticTitle" for="upload-single-file">{{'FILE_UPLOAD.BUTTON.UPLOAD_FILE' | translate}}</label>
<label *ngIf="staticTitle" for="upload-single-file">{{staticTitle}}</label>
<input id="upload-single-file" data-automation-id="upload-single-file" type="file" name="uploadFiles" <input id="upload-single-file" data-automation-id="upload-single-file" type="file" name="uploadFiles"
(change)="onFilesAdded($event)" (change)="onFilesAdded($event)"
accept="{{acceptedFilesType}}" accept="{{acceptedFilesType}}"
@ -26,7 +28,8 @@
<!--Folders Upload--> <!--Folders Upload-->
<div *ngIf="uploadFolders" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored mdl-button--file"> <div *ngIf="uploadFolders" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored mdl-button--file">
<i class="material-icons">file_upload</i> <i class="material-icons">file_upload</i>
<label for="uploadFolder">{{'FILE_UPLOAD.BUTTON.UPLOAD_FOLDER' | translate}}</label> <label *ngIf="!staticTitle" for="uploadFolder">{{'FILE_UPLOAD.BUTTON.UPLOAD_FOLDER' | translate}}</label>
<label *ngIf="staticTitle" for="uploadFolder">{{staticTitle}}</label>
<input id="uploadFolder" data-automation-id="uploadFolder" type="file" name="uploadFiles" <input id="uploadFolder" data-automation-id="uploadFolder" type="file" name="uploadFiles"
(change)="onDirectoryAdded($event)" (change)="onDirectoryAdded($event)"
multiple="multiple" multiple="multiple"

View File

@ -43,7 +43,7 @@ const ERROR_FOLDER_ALREADY_EXIST = 409;
* @InputParam {boolean} [false] versioning - true to indicate that a major version should be created * @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 * @Output - onSuccess - The event is emitted when the file is uploaded
* *
* @returns {UploadDragAreaComponent} . * @returns {UploadButtonComponent} .
*/ */
@Component({ @Component({
selector: 'alfresco-upload-button', selector: 'alfresco-upload-button',
@ -70,6 +70,9 @@ export class UploadButtonComponent {
@Input() @Input()
acceptedFilesType: string = '*'; acceptedFilesType: string = '*';
@Input()
staticTitle: string;
@Input() @Input()
currentFolderPath: string = '/'; currentFolderPath: string = '/';