aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.service.ts
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2018-08-29 17:01:32 +0300
committerIttay Stern <ittay.stern@att.com>2019-02-18 18:35:30 +0200
commit6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 (patch)
tree936005c364dc5a7264d6304d4777c3d83494db22 /vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.service.ts
parent67d99f816cc583643c35193197594cf78d8ce60a (diff)
merge from ecomp a88f0072 - Modern UI
Issue-ID: VID-378 Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.service.ts')
-rw-r--r--vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.service.ts49
1 files changed, 41 insertions, 8 deletions
diff --git a/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.service.ts b/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.service.ts
index e0057bb4d..fe6ebc7ee 100644
--- a/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.service.ts
+++ b/vid-webpack-master/src/app/shared/server/serviceInfo/serviceInfo.service.ts
@@ -1,19 +1,23 @@
import {Injectable} from '@angular/core';
-import {Observable} from 'rxjs/Observable';
+import {Observable} from 'rxjs';
import {ServiceInfoModel} from './serviceInfo.model';
-import {HttpClient} from '@angular/common/http';
-import 'rxjs/add/operator/map'
+import {HttpClient, HttpHeaders} from '@angular/common/http';
+import { of } from 'rxjs';
+import { map } from 'rxjs/operators';
import {Constants} from '../../utils/constants';
import {forkJoin} from "rxjs/observable/forkJoin";
+import * as _ from 'lodash';
+import {AuditStatus} from "./AuditStatus.model";
@Injectable()
export class ServiceInfoService {
constructor(private _http: HttpClient) {
}
- getServicesJobInfo(filterByUser : boolean): Observable<ServiceInfoModel[]> {
+ getServicesJobInfo(filterByUser : boolean, showSpinner: boolean = true): Observable<ServiceInfoModel[]> {
let pathQuery = Constants.Path.SERVICES_JOB_INFO_PATH;
- return this._http.get<ServiceInfoModel[]>(pathQuery).map(res => res );
+ let headers = new HttpHeaders({'x-show-spinner': showSpinner.toString()});
+ return this._http.get<ServiceInfoModel[]>(pathQuery, { headers: headers }).map(res => res );
}
deleteJob(jobId: string): Observable<any> {
@@ -26,13 +30,42 @@ export class ServiceInfoService {
return this._http.post<any>(pathQuery, null).map(res => res);
}
- getJobAuditStatus(jobId : string) : Observable<Object[]>{
- let pathQueryVID = Constants.Path.SERVICES_JOB_INFO_PATH + Constants.Path.SERVICES_JOB_AUDIT_PATH + '/' + jobId + '?source=VID';
- let pathQueryMSO = Constants.Path.SERVICES_JOB_INFO_PATH + Constants.Path.SERVICES_JOB_AUDIT_PATH + '/' + jobId + '?source=MSO';
+ getJobAuditStatus(jobData: ServiceInfoModel) : Observable<Object[]>{
+ let pathQueryBySource: string = Constants.Path.SERVICES_JOB_INFO_PATH + Constants.Path.SERVICES_JOB_AUDIT_PATH + '/' + jobData.jobId + '?source=';
+ let pathQueryVID: string = pathQueryBySource + 'VID';
+ let pathQueryMSO: string;
+
+ // just call it
+ if(jobData.aLaCarte) {
+ let requestParams: string[] = [];
+ pathQueryMSO = Constants.Path.SERVICES_JOB_INFO_PATH + Constants.Path.SERVICES_JOB_AUDIT_PATH + '/' + jobData.jobId + '/mso';
+ if (!_.isEmpty(jobData.requestId)) {
+ requestParams[requestParams.length] = 'requestId=' + jobData.requestId;
+ }
+ if (!_.isEmpty(jobData.serviceInstanceId)) {
+ requestParams[requestParams.length] = 'serviceInstanceId=' + jobData.serviceInstanceId;
+ }
+ if (requestParams.length > 0) {
+ pathQueryMSO += '?' + requestParams.join('&');
+ }
+ }
+ else {
+ pathQueryMSO = pathQueryBySource + 'MSO';
+ }
+
let vidObs = this._http.get(pathQueryVID);
let msoObs = this._http.get(pathQueryMSO);
return forkJoin([vidObs, msoObs]);
}
+ getInstanceAuditStatus(instanceId: string, type :string) : Observable<AuditStatus[]>{
+ let pathQuery: string = Constants.Path.SERVICES_JOB_INFO_PATH + Constants.Path.SERVICES_JOB_AUDIT_PATH + '/' + type + '/' + instanceId + '/mso';
+ return this._http.get<any>(pathQuery).map(res => res);
+ }
+
+ getAuditStatusForRetry(trackById: string) : Observable<AuditStatus>{
+ let pathQuery: string = Constants.Path.AUDIT_STATUS_FOR_RETRY_PATH + '/' + trackById ;
+ return this._http.get<any>(pathQuery).map(res => res);
+ }
}