Merge pull request #616 from Alfresco/dev-eromano-updateUplaodDemo

update upload demo
This commit is contained in:
Denys Vuika 2016-08-25 14:53:25 +01:00 committed by GitHub
commit c0a92c4936
2 changed files with 86 additions and 22 deletions

View File

@ -36,29 +36,66 @@ import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload';
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform
operations. operations.
</div> </div>
<hr>
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="false"
[multipleFiles]="false"
(onSuccess)="customMethod($event)">
</alfresco-upload-button>
<br><br> <h5>Upload</h5>
<br>
<alfresco-upload-button [showUdoNotificationBar]="true" <div *ngIf="acceptedFilesTypeShow">
[uploadFolders]="true" <span class="mdl-input__label">Extension accepted</span>
[multipleFiles]="false" <input type="text" data-automation-id="accepted-files-type" [(ngModel)]="acceptedFilesType">
(onSuccess)="customMethod($event)"> <br/>
</alfresco-upload-button> </div>
<div *ngIf="!acceptedFilesTypeShow">
<br><br> <alfresco-upload-button data-automation-id="multiple-file-upload"
[uploaddirectory]="currentPath"
<alfresco-upload-button [showUdoNotificationBar]="true" [currentFolderPath]="currentPath"
[uploadFolders]="false" [multipleFiles]="multipleFileUpload"
[multipleFiles]="true" [uploadFolders]="folderUpload"
(onSuccess)="customMethod($event)"> [versioning] = "versioning"
</alfresco-upload-button> (onSuccess)="documentList.reload()">
<div class="mdl-spinner mdl-js-spinner is-active"></div>
</alfresco-upload-button>
</div>
<div *ngIf="acceptedFilesTypeShow">
<alfresco-upload-button data-automation-id="multiple-file-upload"
[uploaddirectory]="currentPath"
[currentFolderPath]="currentPath"
acceptedFilesType="{{acceptedFilesType}}"
[multipleFiles]="multipleFileUpload"
[uploadFolders]="folderUpload"
[versioning] = "versioning"
(onSuccess)="documentList.reload()">
<div class="mdl-spinner mdl-js-spinner is-active"></div>
</alfresco-upload-button>
</div>
<p style="width:250px;margin: 20px;">
<label for="switch-multiple-file" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input type="checkbox" id="switch-multiple-file" class="mdl-switch__input" (change)="toggleMultipleFileUpload()" >
<span class="mdl-switch__label">Multiple File Upload</span>
</label>
</p>
<p style="width:250px;margin: 20px;">
<label for="switch-folder-upload" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input type="checkbox" id="switch-folder-upload" class="mdl-switch__input" (change)="toggleFolder()">
<span class="mdl-switch__label">Folder Upload</span>
</label>
</p>
<p style="width:250px;margin: 20px;">
<label for="switch-accepted-file-type" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input type="checkbox" id="switch-accepted-file-type" class="mdl-switch__input" (change)="toggleAcceptedFilesType()">
<span class="mdl-switch__label">Filter extension</span>
</label>
</p>
<p style="width:250px;margin: 20px;">
<label for="switch-versioning" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input type="checkbox" id="switch-versioning" class="mdl-switch__input" (change)="toggleVersioning()">
<span class="mdl-switch__label">Versioning</span>
</label>
</p>
<br><br> <br><br>
<alfresco-upload-drag-area (onSuccess)="customMethod($event)" class="upload-border"> <alfresco-upload-drag-area (onSuccess)="customMethod($event)" class="upload-border">
@ -78,6 +115,11 @@ export class MyDemoApp implements OnInit {
public ecmHost: string = 'http://devproducts-platform.alfresco.me'; public ecmHost: string = 'http://devproducts-platform.alfresco.me';
multipleFileUpload: boolean = false;
folderUpload: boolean = false;
acceptedFilesTypeShow: boolean = false;
versioning: boolean = false;
ticket: string; ticket: string;
constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService) { constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService) {
@ -118,6 +160,28 @@ export class MyDemoApp implements OnInit {
this.authenticated = false; this.authenticated = false;
}); });
} }
toggleMultipleFileUpload() {
this.multipleFileUpload = !this.multipleFileUpload;
return this.multipleFileUpload;
}
toggleFolder() {
this.multipleFileUpload = false;
this.folderUpload = !this.folderUpload;
return this.folderUpload;
}
toggleAcceptedFilesType() {
this.acceptedFilesTypeShow = !this.acceptedFilesTypeShow;
return this.acceptedFilesTypeShow;
}
toggleVersioning() {
this.versioning = !this.versioning;
return this.versioning;
}
} }
bootstrap(MyDemoApp, [ bootstrap(MyDemoApp, [

View File

@ -26,7 +26,7 @@
"label-undefined": true, "label-undefined": true,
"max-line-length": [ "max-line-length": [
true, true,
140 180
], ],
"member-ordering": [ "member-ordering": [
true, true,