From 4edcfbb503366cf099a531b27c653d06a3ba32b8 Mon Sep 17 00:00:00 2001 From: shinuj1989 Date: Wed, 28 Nov 2018 10:22:11 +0000 Subject: Flow loses highlighted path on page reloads Change-Id: I7806cdd1998c4451359b452eb5c9bf1e7059fc32 Issue-ID: SO-1245 Signed-off-by: shinuj1989 (cherry picked from commit 8bc174515ba421f2163b74788454bda9bcb885b5) --- .../so-monitoring-ui/src/main/frontend/src/app/data.service.ts | 7 ++++--- .../src/main/frontend/src/app/details/details.component.ts | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts index 796739077c..2e8f4237f7 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts @@ -30,6 +30,7 @@ import { environment } from '../environments/environment'; import { HttpResponse } from '@angular/common/http'; import { PII } from './model/processInstance.model'; import { HttpErrorHandlerService } from './http-error-handler.service'; +import { ACTINST } from './model/activityInstance.model'; @Injectable({ @@ -59,12 +60,12 @@ export class DataService { } // HTTP GET to return Activity instancs using ProcessInstanceID - getActivityInstance(processInstanceId) { + getActivityInstance(processInstanceId): Promise { var url = environment.soMonitoringBackendURL + 'activity-instance/' + processInstanceId; - return this.http.get(url) + return this.http.get(url) .pipe( catchError(this.httpErrorHandlerService.handleError("GET", url)) - ); + ).toPromise(); } // HTTP GET to return Activity Instance using ProcessInstanceID diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts index 4c19ba1039..bb464a9e21 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts @@ -43,7 +43,6 @@ import { NgxSpinnerService } from 'ngx-spinner'; }) export class DetailsComponent implements OnInit { - bpmnViewer: any; processInstanceID: string; @@ -67,8 +66,8 @@ export class DetailsComponent implements OnInit { constructor(private route: ActivatedRoute, private data: DataService, private popup: ToastrNotificationService, private router: Router, private spinner: NgxSpinnerService) { } - getActInst(procInstId: string) { - this.data.getActivityInstance(procInstId).subscribe( + async getActInst(procInstId: string) { + await this.data.getActivityInstance(procInstId).then( (data: ACTINST[]) => { this.activityInstance = data; console.log(data); @@ -90,7 +89,7 @@ export class DetailsComponent implements OnInit { }); } - async getProcInstance(procInstId) { + async getProcInstance(procInstId) { await this.data.getProcessInstance(procInstId).then( async (data: PII) => { this.processInstance = data; @@ -160,4 +159,5 @@ export class DetailsComponent implements OnInit { this.getVarInst(this.processInstanceID); }); } + } -- cgit 1.2.3-korg