Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Renamed things to fit with namechange of RicSynchronizationTask
[nonrtric.git]
/
dashboard
/
webapp-frontend
/
src
/
app
/
policy-control
/
policy-instance.datasource.ts
diff --git
a/dashboard/webapp-frontend/src/app/policy-control/policy-instance.datasource.ts
b/dashboard/webapp-frontend/src/app/policy-control/policy-instance.datasource.ts
index
c74c9ab
..
b82ee75
100644
(file)
--- a/
dashboard/webapp-frontend/src/app/policy-control/policy-instance.datasource.ts
+++ b/
dashboard/webapp-frontend/src/app/policy-control/policy-instance.datasource.ts
@@
-42,16
+42,16
@@
export class PolicyInstanceDataSource extends DataSource<PolicyInstance> {
public rowCount = 1; // hide footer during intial load
constructor(
public rowCount = 1; // hide footer during intial load
constructor(
- private policySvc: PolicyService,
+ private policySvc: PolicyService,
public sort: MatSort,
public sort: MatSort,
- private notificationService: NotificationService,
+ private notificationService: NotificationService,
private policyType: PolicyType) {
super();
}
loadTable() {
this.loadingSubject.next(true);
private policyType: PolicyType) {
super();
}
loadTable() {
this.loadingSubject.next(true);
- this.policySvc.getPolicyInstances(this.policyType.
policy_type_id
)
+ this.policySvc.getPolicyInstances(this.policyType.
name
)
.pipe(
catchError((her: HttpErrorResponse) => {
this.notificationService.error('Failed to get policy instances: ' + her.message);
.pipe(
catchError((her: HttpErrorResponse) => {
this.notificationService.error('Failed to get policy instances: ' + her.message);
@@
-88,13
+88,16
@@
export class PolicyInstanceDataSource extends DataSource<PolicyInstance> {
return data.sort((a, b) => {
const isAsc = this.sort.direction === 'asc';
switch (this.sort.active) {
return data.sort((a, b) => {
const isAsc = this.sort.direction === 'asc';
switch (this.sort.active) {
- case 'instanceId': return compare(a.instanceId, b.instanceId, isAsc);
+ case 'instanceId': return compare(a.id, b.id, isAsc);
+ case 'ric': return compare(a.ric, b.ric, isAsc);
+ case 'service': return compare(a.service, b.service, isAsc);
+ case 'lastModified': return compare(a.lastModified, b.lastModified, isAsc)
default: return 0;
}
});
}
}
default: return 0;
}
});
}
}
-function compare(a: string, b: string, isAsc: boolean) {
+function compare(a: string, b: string, isAsc: boolean) {
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
}
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
}