mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
#384 improve style and error messagge
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
[contextMenuActions]="true"
|
[contextMenuActions]="true"
|
||||||
[contentActions]="true"
|
[contentActions]="true"
|
||||||
(error)="onNavigationError($event)"
|
(error)="onNavigationError($event)"
|
||||||
|
(success)="resetError()"
|
||||||
(preview)="showFile($event)"
|
(preview)="showFile($event)"
|
||||||
(folderChange)="onFolderChanged($event)">
|
(folderChange)="onFolderChanged($event)">
|
||||||
<!--
|
<!--
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<alfresco-document-menu-action *ngIf="contentMenuActions"
|
<alfresco-document-menu-action *ngIf="contentMenuActions"
|
||||||
[currentFolderPath]="currentFolderPath"
|
[currentFolderPath]="currentFolderPath"
|
||||||
(onSuccess)="reload()">
|
(onSuccess)="onActionMenuSuccess($event)"
|
||||||
|
(onError)="onActionMenuError($event)">
|
||||||
</alfresco-document-menu-action>
|
</alfresco-document-menu-action>
|
||||||
<alfresco-datatable
|
<alfresco-datatable
|
||||||
[data]="data"
|
[data]="data"
|
||||||
|
@@ -121,6 +121,9 @@ export class DocumentList implements OnInit, AfterContentInit {
|
|||||||
@Output()
|
@Output()
|
||||||
preview: EventEmitter<any> = new EventEmitter();
|
preview: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
success: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
error: EventEmitter<any> = new EventEmitter();
|
error: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
@@ -402,4 +405,13 @@ export class DocumentList implements OnInit, AfterContentInit {
|
|||||||
this.executeContentAction(node, action);
|
this.executeContentAction(node, action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onActionMenuError(event) {
|
||||||
|
this.error.emit(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
onActionMenuSuccess(event) {
|
||||||
|
this.reload();
|
||||||
|
this.success.emit(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -71,4 +71,15 @@
|
|||||||
|
|
||||||
.mdl-menu__item-icon {
|
.mdl-menu__item-icon {
|
||||||
margin-right: 32px;
|
margin-right: 32px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mdl-menu--bottom-left {
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mdl-menu__text {
|
||||||
|
float: right;
|
||||||
|
margin-right: 22px;
|
||||||
}
|
}
|
@@ -1,22 +1,21 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="action">
|
<div class="action">
|
||||||
<button id="actions" class="mdl-button mdl-js-button mdl-button--raised">
|
<button id="actions" class="mdl-button mdl-js-button mdl-button--raised">
|
||||||
<i class="material-icons">add</i> Create...
|
<i class="material-icons">add</i> {{ 'BUTTON.ACTION_CREATE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<ul alfresco-mdl-menu class="mdl-menu--bottom-left"
|
<ul alfresco-mdl-menu class="mdl-menu--bottom-left"
|
||||||
[attr.for]="'actions'">
|
[attr.for]="'actions'">
|
||||||
<li class="mdl-menu__item"
|
<li class="mdl-menu__item"
|
||||||
(click)="showDialog()" >
|
(click)="showDialog()" >
|
||||||
<i class="material-icons mdl-menu__item-icon">folder</i>
|
<i class="material-icons mdl-menu__item-icon">folder</i>
|
||||||
New Folder
|
<span class="mdl-menu__text">{{ 'BUTTON.ACTION_NEW_FOLDER' | translate }}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div>{{message}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<dialog class="mdl-dialog" #dialog>
|
<dialog class="mdl-dialog" #dialog>
|
||||||
<h4 class="mdl-dialog__title">New folder</h4>
|
<h4 class="mdl-dialog__title">{{ 'BUTTON.ACTION_NEW_FOLDER' | translate }}</h4>
|
||||||
<div class="mdl-dialog__content">
|
<div class="mdl-dialog__content">
|
||||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||||
<input
|
<input
|
||||||
@@ -30,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-dialog__actions">
|
<div class="mdl-dialog__actions">
|
||||||
<button type="button" (click)="createFolder(name.value)" class="mdl-button">Create</button>
|
<button type="button" (click)="createFolder(name.value)" class="mdl-button">{{ 'BUTTON.CREATE' | translate }}</button>
|
||||||
<button type="button" (click)="cancel()" class="mdl-button close">Cancel</button>
|
<button type="button" (click)="cancel()" class="mdl-button close">{{ 'BUTTON.CANCEL' | translate }}</button>
|
||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
@@ -78,10 +78,11 @@ export class DocumentMenuAction implements OnInit {
|
|||||||
error => {
|
error => {
|
||||||
let errorMessagePlaceholder = this.getErrorMessage(error.response);
|
let errorMessagePlaceholder = this.getErrorMessage(error.response);
|
||||||
if (errorMessagePlaceholder) {
|
if (errorMessagePlaceholder) {
|
||||||
this.onError.emit({value: errorMessagePlaceholder});
|
|
||||||
this.message = this.formatString(errorMessagePlaceholder, [name]);
|
this.message = this.formatString(errorMessagePlaceholder, [name]);
|
||||||
|
this.onError.emit({message: this.message});
|
||||||
console.log(this.message);
|
console.log(this.message);
|
||||||
} else {
|
} else {
|
||||||
|
this.onError.emit(error);
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,5 +12,11 @@
|
|||||||
"ft_ic_archive": "Archive file",
|
"ft_ic_archive": "Archive file",
|
||||||
"ft_ic_presentation": "Presentation file",
|
"ft_ic_presentation": "Presentation file",
|
||||||
"ft_ic_spreadsheet": "Spreadsheet file"
|
"ft_ic_spreadsheet": "Spreadsheet file"
|
||||||
|
},
|
||||||
|
"BUTTON": {
|
||||||
|
"ACTION_CREATE": "Create...",
|
||||||
|
"ACTION_NEW_FOLDER": "New Folder",
|
||||||
|
"CREATE": "Create",
|
||||||
|
"CANCEL": "Cancel"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user