mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
- expose ‘error’ event - change path only on successful navigation - extend demo shell with error handling and reporting - additional unit tests for document-list
This commit is contained in:
committed by
Eugenio Romano
parent
da70a72bba
commit
7eab89c5ef
@@ -7,3 +7,11 @@
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.error-message {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.error-message--text {
|
||||
color: #d50000;
|
||||
}
|
||||
|
@@ -7,11 +7,18 @@
|
||||
[currentFolderPath]="currentPath"
|
||||
[target]="documentList">
|
||||
</alfresco-document-list-breadcrumb>
|
||||
<div *ngIf="errorMessage" class="error-message">
|
||||
<button (click)="resetError()" class="mdl-button mdl-js-button mdl-button--icon">
|
||||
<i class="material-icons">highlight_off</i>
|
||||
</button>
|
||||
<span class="error-message--text">{{errorMessage}}</span>
|
||||
</div>
|
||||
<alfresco-document-list
|
||||
#documentList
|
||||
[currentFolderPath]="currentPath"
|
||||
[contextMenuActions]="true"
|
||||
[contentActions]="true"
|
||||
(error)="onNavigationError($event)"
|
||||
(preview)="showFile($event)"
|
||||
(folderChange)="onFolderChanged($event)">
|
||||
<!--
|
||||
@@ -117,6 +124,9 @@
|
||||
<li>
|
||||
<button (click)="documentList.currentFolderPath = '/'">Go to root</button>
|
||||
</li>
|
||||
<li>
|
||||
<button (click)="documentList.currentFolderPath = '!@£$%^&*()'">Go to the wrong path</button>
|
||||
</li>
|
||||
<li>
|
||||
<button (click)="fileDialog.toggleShowDialog()">Show/Hide File Dialog</button>
|
||||
</li>
|
||||
|
@@ -38,6 +38,7 @@ declare let __moduleName: string;
|
||||
export class FilesComponent implements OnInit {
|
||||
currentPath: string = '/Sites/swsdp/documentLibrary';
|
||||
|
||||
errorMessage: string = null;
|
||||
fileNodeId: any;
|
||||
fileShowed: boolean = false;
|
||||
multipleFileUpload: boolean = false;
|
||||
@@ -120,6 +121,16 @@ export class FilesComponent implements OnInit {
|
||||
this.router.navigate(['/activiti/tasksnode', event.value.entry.id]);
|
||||
}
|
||||
|
||||
onNavigationError(err: any) {
|
||||
if (err) {
|
||||
this.errorMessage = err.message || 'Navigation error';
|
||||
}
|
||||
}
|
||||
|
||||
resetError() {
|
||||
this.errorMessage = null;
|
||||
}
|
||||
|
||||
private setupBpmActions(actions: any[]) {
|
||||
actions.map(def => {
|
||||
let documentAction = new DocumentActionModel();
|
||||
|
Reference in New Issue
Block a user