mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-788] Emit error message for max file size (#2566)
* emit message error max fie size add translation message versioning missing editorconfig settings * misspell fixe
This commit is contained in:
@@ -4,10 +4,20 @@ root = true
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[package.json]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[resources/*.json]
|
||||
indent_size = 2
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
|
@@ -1,5 +1,10 @@
|
||||
{
|
||||
"title": "Welcome",
|
||||
"VERSION": {
|
||||
"NO_PERMISSION": "You don't have permission to manage the versions of this content",
|
||||
"NO_PERMISSION_EVENT": "You don't have the ${event.permission} permission to ${event.action} the ${event.type}",
|
||||
"CHOOSE_FILE": "Please choose a document to see the versions of it"
|
||||
},
|
||||
"APP_LAYOUT": {
|
||||
"APP_NAME": "ADF Demo Application",
|
||||
"HOME": "Home",
|
||||
|
@@ -251,13 +251,13 @@
|
||||
<ng-template #choose_document_template>
|
||||
<div class="adf-manage-versions-empty">
|
||||
<mat-icon class="adf-manage-versions-empty-icon">face</mat-icon>
|
||||
Please choose a document to see the versions of it.
|
||||
{{'VERSION.CHOOSE_FILE' | translate}}
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #no_permission_to_versions>
|
||||
<div class="adf-manage-versions-no-permission">
|
||||
<mat-icon class="adf-manage-versions-no-permission-icon">warning</mat-icon>
|
||||
You don't have permission to manage the versions of this content.
|
||||
{{'VERSION.NO_PERMISSION' | translate}}
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
@@ -340,6 +340,7 @@
|
||||
[multipleFiles]="multipleFileUpload"
|
||||
[uploadFolders]="folderUpload"
|
||||
[maxFilesSize]="maxFilesSize"
|
||||
(error)="handleUploadError($event)"
|
||||
[versioning]="versioning"
|
||||
[adf-node-permission]="'create'"
|
||||
[adf-nodes]="getCurrentDocumentListNode()"
|
||||
@@ -357,6 +358,7 @@
|
||||
[multipleFiles]="multipleFileUpload"
|
||||
[uploadFolders]="folderUpload"
|
||||
[versioning]="versioning"
|
||||
(error)="handleUploadError($event)"
|
||||
[adf-node-permission]="'create'"
|
||||
[adf-nodes]="getCurrentDocumentListNode()"
|
||||
(permissionEvent)="handlePermissionError($event)">
|
||||
|
@@ -137,7 +137,7 @@ export class FilesComponent implements OnInit {
|
||||
|
||||
getCurrentDocumentListNode(): MinimalNodeEntity[] {
|
||||
if (this.documentList.folderNode) {
|
||||
return [ { entry: this.documentList.folderNode } ];
|
||||
return [{ entry: this.documentList.folderNode }];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
@@ -168,8 +168,21 @@ export class FilesComponent implements OnInit {
|
||||
}
|
||||
|
||||
handlePermissionError(event: any) {
|
||||
this.translateService.get('OPERATION.ERROR.NO_PERMISSION_EVENT', {
|
||||
permission: event.permission,
|
||||
action: event.action,
|
||||
type: event.type
|
||||
}).subscribe((message) => {
|
||||
this.notificationService.openSnackMessage(
|
||||
message,
|
||||
4000
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
handleUploadError(event: any) {
|
||||
this.notificationService.openSnackMessage(
|
||||
`You don't have the ${event.permission} permission to ${event.action} the ${event.type} `,
|
||||
event,
|
||||
4000
|
||||
);
|
||||
}
|
||||
@@ -217,7 +230,11 @@ export class FilesComponent implements OnInit {
|
||||
const contentEntry = event.value.entry;
|
||||
|
||||
if (this.contentService.hasPermission(contentEntry, 'update')) {
|
||||
this.dialog.open(VersionManagerDialogAdapterComponent, { data: { contentEntry }, panelClass: 'adf-version-manager-dialog', width: '630px' });
|
||||
this.dialog.open(VersionManagerDialogAdapterComponent, {
|
||||
data: { contentEntry },
|
||||
panelClass: 'adf-version-manager-dialog',
|
||||
width: '630px'
|
||||
});
|
||||
} else {
|
||||
const translatedErrorMessage: any = this.translateService.get('OPERATION.ERROR.PERMISSION');
|
||||
this.notificationService.openSnackMessage(translatedErrorMessage.value, 4000);
|
||||
|
Reference in New Issue
Block a user