[ADF-1142] Process instance details - should show the comment componen (#2116)

* Add a comment button in the process details component has we have for the task details

* Update process-instance-details.component.css

* Update process-instance-details.component.html
This commit is contained in:
Maurizio Vitale
2017-07-24 14:35:40 +01:00
committed by Eugenio Romano
parent 3d2e764d3d
commit b8da5bf45b
4 changed files with 39 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ import { ProcessService } from './../services/process.service';
import { ProcessInstanceHeaderComponent } from './process-instance-header.component';
import { ProcessInstanceTasksComponent } from './process-instance-tasks.component';
declare let dialogPolyfill: any;
@Component({
selector: 'adf-process-instance-details, activiti-process-instance-details',
templateUrl: './process-instance-details.component.html',
@@ -41,6 +43,9 @@ export class ProcessInstanceDetailsComponent implements OnChanges {
@ViewChild(ProcessInstanceTasksComponent)
tasksList: ProcessInstanceTasksComponent;
@ViewChild('dialogComments')
commentsDialog: any;
@Input()
showTitle: boolean = true;
@@ -104,6 +109,19 @@ export class ProcessInstanceDetailsComponent implements OnChanges {
}
}
public showCommentsDialog(): void {
if (!this.commentsDialog.nativeElement.showModal) {
dialogPolyfill.registerDialog(this.commentsDialog.nativeElement);
}
this.commentsDialog.nativeElement.showModal();
}
public closeCommentsDialog(): void {
if (this.commentsDialog) {
this.commentsDialog.nativeElement.close();
}
}
isRunning(): boolean {
return this.processInstanceDetails && !this.processInstanceDetails.ended;
}