X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fei-coordinator%2Fei-job.datasource.ts;h=5fc64fc10bd586183ec5419a2951864d0d3c001b;hb=47d0224358d746f8a290a9c132580a4d46041495;hp=64c948c158eafe3302c68055d01d7a51342d7496;hpb=b38d7384f7ef6571895d6d0cf89791749c33f783;p=portal%2Fnonrtric-controlpanel.git diff --git a/webapp-frontend/src/app/ei-coordinator/ei-job.datasource.ts b/webapp-frontend/src/app/ei-coordinator/ei-job.datasource.ts index 64c948c..5fc64fc 100644 --- a/webapp-frontend/src/app/ei-coordinator/ei-job.datasource.ts +++ b/webapp-frontend/src/app/ei-coordinator/ei-job.datasource.ts @@ -19,7 +19,6 @@ */ import { Injectable } from '@angular/core'; -import { MatTableDataSource } from '@angular/material'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; @@ -30,9 +29,13 @@ import { EIService } from '../services/ei/ei.service'; providedIn: 'root' }) -export class EIJobDataSource extends MatTableDataSource { +export class EIJobDataSource { - eiJobsSubject = new BehaviorSubject([]); + private eiJobsSubject = new BehaviorSubject([]); + + public eiJobs(): EIJob[] { + return this.eiJobsSubject.value; + } private loadingSubject = new BehaviorSubject(false); @@ -42,10 +45,9 @@ export class EIJobDataSource extends MatTableDataSource { constructor( private eiSvc: EIService) { - super(); } - getJobs() { + loadJobs() { this.loadingSubject.next(true); this.eiSvc.getProducerIds() .subscribe((producerIds: string[]) => { @@ -68,13 +70,4 @@ export class EIJobDataSource extends MatTableDataSource { const updatedValue = [...currentValue, ...jobs]; this.eiJobsSubject.next(updatedValue); } - - connect(): BehaviorSubject { - return this.eiJobsSubject; - } - - disconnect(): void { - this.eiJobsSubject.complete(); - this.loadingSubject.complete(); - } }