mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
Add dialog to task details component to notify the user of an error
Refs #851
This commit is contained in:
parent
c005002b8f
commit
ea1953771b
@ -1,3 +1,7 @@
|
||||
:host {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.error-dialog h3 {
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
@ -40,4 +40,11 @@
|
||||
<button type="button" class="mdl-button" *ngIf="!hasFormKey() && isTaskActive()" (click)="onComplete()">
|
||||
{{ 'TASK_DETAILS.BUTTON.COMPLETE' | translate }}
|
||||
</button>
|
||||
<dialog class="mdl-dialog error-dialog" #errorDialog>
|
||||
<div class="mdl-dialog__content">
|
||||
<h3>{{'TASK_DETAILS.ERROR.TITLE'|translate}}</h3>
|
||||
<p>{{'TASK_DETAILS.ERROR.DESCRIPTION'|translate}}</p>
|
||||
<button type="button" class="mdl-button" (click)="closeErrorDialog()">{{'TASK_DETAILS.ERROR.CLOSE'|translate}}</button>
|
||||
</div>
|
||||
</dialog>
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, ViewChild, Output, EventEmitter, TemplateRef, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { Component, Input, OnInit, ViewChild, Output, EventEmitter, TemplateRef, OnChanges, SimpleChanges, DebugElement } from '@angular/core';
|
||||
import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
@ -37,6 +37,9 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
|
||||
@ViewChild('activitichecklist')
|
||||
activitichecklist: any;
|
||||
|
||||
@ViewChild('errorDialog')
|
||||
errorDialog: DebugElement;
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
||||
|
||||
@ -215,10 +218,15 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
onFormError(error: any) {
|
||||
this.errorDialog.nativeElement.showModal();
|
||||
this.onError.emit(error);
|
||||
}
|
||||
|
||||
onExecuteFormOutcome(event: FormOutcomeEvent) {
|
||||
this.executeOutcome.emit(event);
|
||||
}
|
||||
|
||||
closeErrorDialog(): void {
|
||||
this.errorDialog.nativeElement.close();
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,11 @@
|
||||
},
|
||||
"CHECKLIST": {
|
||||
"NONE": "No checklist."
|
||||
},
|
||||
"ERROR": {
|
||||
"TITLE": "Something went wrong",
|
||||
"DESCRIPTION": "Could not complete the specified action. Please try again or check that you have permission.",
|
||||
"CLOSE": "Close"
|
||||
}
|
||||
},
|
||||
"TASK_FILTERS": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user