Skip to content

Commit

Permalink
Placeholder for job status API
Browse files Browse the repository at this point in the history
  • Loading branch information
Harminder Singh committed May 3, 2019
1 parent 370757b commit f8a29a7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,28 @@ export class SystemManagementComponent implements OnInit, OnDestroy {
errorVal = 0;
modalTitle = 'Confirmation Required';
private systemSubscription: Subscription;
private systemStatusSubscription: Subscription;
constructor(
private commonResponseService: CommonResponseService,
private router: Router,
private logger: LoggerService,
private titleCasePipe: TitleCasePipe
) { }

ngOnInit() {
getJobStatus() {
const url = 'https://internal-pacbot-43782189.us-east-1.elb.amazonaws.com/api/admin/operations';
const method = environment.systemJobStatus.method;

this.systemStatusSubscription = this.commonResponseService
.getData(url, method, {}, {}).subscribe(
response => {
this.isCheckedRules = response[0].status;
this.isCheckedJobs = response[1].status;
},
error => {

}
)
}

ontoggleAccess(e, selectToggle) {
Expand Down Expand Up @@ -86,6 +100,7 @@ export class SystemManagementComponent implements OnInit, OnDestroy {
this.showLoader = true;
if (this.systemSubscription) {
this.systemSubscription.unsubscribe();
this.systemStatusSubscription.unsubscribe();
}
const url = 'https://internal-pacbot-43782189.us-east-1.elb.amazonaws.com/api/admin/operations';
const method = environment.systemOperations.method;
Expand All @@ -109,7 +124,6 @@ export class SystemManagementComponent implements OnInit, OnDestroy {
this.showLoader = false;
this.toggleBtnOnSuccess(jobType);
} , error => {
console.log('error', error);
this.errorVal = -1;
this.modalTitle = 'Error';
this.showLoader = false;
Expand All @@ -127,6 +141,10 @@ export class SystemManagementComponent implements OnInit, OnDestroy {

}

ngOnInit() {
// this.getJobStatus();
}

ngOnDestroy() {
try {
if (this.systemSubscription) {
Expand Down
4 changes: 4 additions & 0 deletions webapp/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,10 @@ export const environment = {
systemOperations: {
url: '{{baseUrl}}/admin/operations',
method: 'POST'
},
systemJobStatus: {
url: '{{baseUrl}}/admin/operations',
method: 'POST'
}

};
4 changes: 4 additions & 0 deletions webapp/src/environments/environment.stg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,5 +813,9 @@ export const environment = {
systemOperations: {
url: '{{baseUrl}}/admin/operations',
method: 'POST'
},
systemJobStatus: {
url: '{{baseUrl}}/admin/operations',
method: 'POST'
}
};
4 changes: 4 additions & 0 deletions webapp/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,5 +813,9 @@ export const environment = {
systemOperations: {
url: '{{baseUrl}}/admin/operations',
method: 'POST'
},
systemJobStatus: {
url: '{{baseUrl}}/admin/operations',
method: 'POST'
}
};

0 comments on commit f8a29a7

Please sign in to comment.