Misc improvements in front end
Removed unused imports and methods.
Sorted imports.
Change-Id: I0aecb1103c985578252d152fd94c08353c3f9778
Issue-ID: NONRTRIC-389
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
diff --git a/webapp-frontend/src/app/ei-coordinator/ei-coordinator.component.ts b/webapp-frontend/src/app/ei-coordinator/ei-coordinator.component.ts
index 7c4979e..554779c 100644
--- a/webapp-frontend/src/app/ei-coordinator/ei-coordinator.component.ts
+++ b/webapp-frontend/src/app/ei-coordinator/ei-coordinator.component.ts
@@ -18,19 +18,19 @@
* ========================LICENSE_END===================================
*/
import { Component, OnInit, ViewChild, Version } from '@angular/core';
-import { MatDialog } from '@angular/material/dialog';
import { MatSort } from '@angular/material/sort';
import { animate, state, style, transition, trigger } from '@angular/animations';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MatTableDataSource } from '@angular/material';
+import { defer, BehaviorSubject, Observable } from 'rxjs';
+import { map, withLatestFrom, startWith, tap } from 'rxjs/operators';
+
import { EIService } from '../services/ei/ei.service';
import { EIJob, EIProducer } from '../interfaces/ei.jobs';
import { EIProducerDataSource } from './ei-producer.datasource';
import { EIJobDataSource } from './ei-job.datasource';
import { NotificationService } from '../services/ui/notification.service';
-import { defer, BehaviorSubject, Observable } from 'rxjs';
-import { map, withLatestFrom, startWith, tap } from 'rxjs/operators';
import { UiService } from '../services/ui/ui.service';
class EIJobInfo {
@@ -66,10 +66,8 @@
formGroup: FormGroup;
eiProducersData: MatTableDataSource<EIProducerDataSource>;
-
constructor(
private eiSvc: EIService,
- private dialog: MatDialog,
private notificationService: NotificationService,
private ui: UiService,
private formBuilder: FormBuilder) {
@@ -97,12 +95,6 @@
});
}
- ngAfterViewInit() {
- this.eiJobsDataSource.sort = this.sort;
- this.eiProducersDataSource.sort = this.sort;
-
- }
-
getEIJobInfo(eiJob: EIJob): EIJobInfo {
let info: EIJobInfo = this.eiJobInfo.get(eiJob.ei_job_data);
if (!info) {
diff --git a/webapp-frontend/src/app/interceptor.mock.ts b/webapp-frontend/src/app/interceptor.mock.ts
index bfba913..e22c99d 100644
--- a/webapp-frontend/src/app/interceptor.mock.ts
+++ b/webapp-frontend/src/app/interceptor.mock.ts
@@ -1,11 +1,13 @@
-import { Injectable, Injector } from '@angular/core';
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http';
+import { Injectable, Injector } from '@angular/core';
import { Observable, of } from 'rxjs';
-import * as policytypes from './mock/policytypes.json';
-import * as policyinstances from './mock/policy-instance.json';
-import * as policyinstanceedit from './mock/policy-instance-edit.json';
+
import * as eijobs from './mock/ei-jobs.json';
import * as eiproducers from './mock/ei-producers.json';
+import * as nopolicyinstances from './mock/nopolicyinstances.json';
+import * as policytypes from './mock/policytypes.json';
+import * as policyinstanceedit from './mock/policy-instance-edit.json';
+import * as policyinstances from './mock/policy-instance.json';
import * as rics from './mock/rics.json';
const urls = [
@@ -18,6 +20,10 @@
json: policyinstances
},
{
+ url: 'api/policy/policies?type=2',
+ json: nopolicyinstances
+ },
+ {
url: 'api/policy/policies/2000?type=1',
json: policyinstanceedit
},
@@ -36,6 +42,10 @@
{
url: 'api/policy/rics?policyType=1',
json: rics
+ },
+ {
+ url: 'api/policy/rics?policyType=2',
+ json: rics
}
];
diff --git a/webapp-frontend/src/app/mock/nopolicyinstances.json b/webapp-frontend/src/app/mock/nopolicyinstances.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/webapp-frontend/src/app/mock/nopolicyinstances.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/webapp-frontend/src/app/mock/policy-instance.json b/webapp-frontend/src/app/mock/policy-instance.json
index e29997e..3dc9fa7 100644
--- a/webapp-frontend/src/app/mock/policy-instance.json
+++ b/webapp-frontend/src/app/mock/policy-instance.json
@@ -14,5 +14,21 @@
},
"service": "service1",
"lastModified": "2020-12-08T21:12:43.719084Z"
+ },
+ {
+ "id": "3000",
+ "type": "1",
+ "ric": "ric2",
+ "json": {
+ "scope": {
+ "ueId": "ue3300",
+ "qosId": "qos3300"
+ },
+ "qosObjectives": {
+ "priorityLevel": 3300
+ }
+ },
+ "service": "service1",
+ "lastModified": "2020-12-08T21:12:43.719084Z"
}
]
\ No newline at end of file
diff --git a/webapp-frontend/src/app/policy-control/policy-control.component.spec.ts b/webapp-frontend/src/app/policy-control/policy-control.component.spec.ts
index a817cf1..1f8275d 100644
--- a/webapp-frontend/src/app/policy-control/policy-control.component.spec.ts
+++ b/webapp-frontend/src/app/policy-control/policy-control.component.spec.ts
@@ -20,7 +20,7 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { MatDialog } from '@angular/material/dialog';
-import { MatIconModule, MatSort, MatTableModule } from '@angular/material';
+import { MatIconModule, MatTableModule } from '@angular/material';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { of } from 'rxjs';
diff --git a/webapp-frontend/src/app/policy-control/policy-control.component.ts b/webapp-frontend/src/app/policy-control/policy-control.component.ts
index f1629e0..d74dc78 100644
--- a/webapp-frontend/src/app/policy-control/policy-control.component.ts
+++ b/webapp-frontend/src/app/policy-control/policy-control.component.ts
@@ -17,18 +17,18 @@
* limitations under the License.
* ========================LICENSE_END===================================
*/
-import { Component, OnInit, ViewChild } from '@angular/core';
-import { MatDialog } from '@angular/material/dialog';
import { animate, state, style, transition, trigger } from '@angular/animations';
+import { Component, OnInit } from '@angular/core';
+import { MatDialog } from '@angular/material/dialog';
+import { BehaviorSubject, Observable } from 'rxjs';
+
+import { NoTypePolicyInstanceDialogComponent } from './no-type-policy-instance-dialog.component';
import { PolicyType } from '../interfaces/policy.types';
import { PolicyTypeDataSource } from './policy-type.datasource';
import { getPolicyDialogProperties } from './policy-instance-dialog.component';
import { PolicyInstanceDialogComponent } from './policy-instance-dialog.component';
-import { NotificationService } from '../services/ui/notification.service';
-import { BehaviorSubject, Observable } from 'rxjs';
import { UiService } from '../services/ui/ui.service';
-import { NoTypePolicyInstanceDialogComponent } from './no-type-policy-instance-dialog.component';
class PolicyTypeInfo {
constructor(public type: PolicyType) { }
@@ -57,7 +57,6 @@
constructor(
private policyTypesDataSource: PolicyTypeDataSource,
private dialog: MatDialog,
- private notificationService: NotificationService,
private ui: UiService) { }
ngOnInit() {