mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Disable upload button with no permission (#1820)
* Add the permission check on the activiti button * Fix code after unit test * Add basic documentation
This commit is contained in:
committed by
Mario Romano
parent
721e96c01b
commit
0e4dab8b66
@@ -150,6 +150,13 @@
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p class="options-container">
|
||||
<label for="switch-disableWithNoPermission" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||
<input type="checkbox" id="switch-disableWithNoPermission" class="mdl-switch__input" (change)="toggleDisableWithNoPermission()" >
|
||||
<span class="mdl-switch__label">Disable upload</span>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<h5>Upload</h5>
|
||||
<br>
|
||||
<div *ngIf="acceptedFilesTypeShow">
|
||||
@@ -164,7 +171,9 @@
|
||||
[rootFolderId]="documentList.currentFolderId"
|
||||
[multipleFiles]="multipleFileUpload"
|
||||
[uploadFolders]="folderUpload"
|
||||
[versioning] = "versioning">
|
||||
[versioning] = "versioning"
|
||||
[disableWithNoPermission]="disableWithNoPermission"
|
||||
(permissionEvent)="onUploadPermissionFailed($event)">
|
||||
<div class="mdl-spinner mdl-js-spinner is-active"></div>
|
||||
</alfresco-upload-button>
|
||||
</div>
|
||||
@@ -175,7 +184,9 @@
|
||||
[acceptedFilesType]="acceptedFilesType"
|
||||
[multipleFiles]="multipleFileUpload"
|
||||
[uploadFolders]="folderUpload"
|
||||
[versioning] = "versioning">
|
||||
[versioning] = "versioning"
|
||||
[disableWithNoPermission]="disableWithNoPermission"
|
||||
(permissionEvent)="onUploadPermissionFailed($event)">
|
||||
<div class="mdl-spinner mdl-js-spinner is-active"></div>
|
||||
</alfresco-upload-button>
|
||||
</div>
|
||||
|
@@ -35,6 +35,7 @@ export class FilesComponent implements OnInit, AfterViewInit {
|
||||
fileNodeId: any;
|
||||
fileShowed: boolean = false;
|
||||
multipleFileUpload: boolean = false;
|
||||
disableWithNoPermission: boolean = false;
|
||||
folderUpload: boolean = false;
|
||||
acceptedFilesTypeShow: boolean = false;
|
||||
versioning: boolean = false;
|
||||
@@ -86,6 +87,11 @@ export class FilesComponent implements OnInit, AfterViewInit {
|
||||
return this.multipleFileUpload;
|
||||
}
|
||||
|
||||
toggleDisableWithNoPermission() {
|
||||
this.disableWithNoPermission = !this.disableWithNoPermission;
|
||||
return this.disableWithNoPermission;
|
||||
}
|
||||
|
||||
toggleFolder() {
|
||||
this.multipleFileUpload = false;
|
||||
this.folderUpload = !this.folderUpload;
|
||||
@@ -173,6 +179,10 @@ export class FilesComponent implements OnInit, AfterViewInit {
|
||||
this.notificationService.openSnackMessage(`you don't have the ${event.permission} permission to ${event.action} the ${event.type} `, 4000);
|
||||
}
|
||||
|
||||
onUploadPermissionFailed(event: any) {
|
||||
this.notificationService.openSnackMessage(`you don't have the ${event.permission} permission to ${event.action} the ${event.type} `, 4000);
|
||||
}
|
||||
|
||||
reload(event: any) {
|
||||
if (event && event.value && event.value.entry && event.value.entry.parentId) {
|
||||
if (this.documentList.currentFolderId === event.value.entry.parentId) {
|
||||
|
Reference in New Issue
Block a user