This is an automated email from the ASF dual-hosted git repository.
dgnatyshyn pushed a commit to branch DLAB-1571
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-1571 by this push:
new 9fa0e9e [DLAB-1731]: Fixed billing report
9fa0e9e is described below
commit 9fa0e9effb682e173ca36bdc72596b3ad8f7c783
Author: Dmytro Gnatyshyn <[email protected]>
AuthorDate: Fri Apr 17 11:44:13 2020 +0300
[DLAB-1731]: Fixed billing report
---
.../webapp/src/app/administration/roles/roles.component.ts | 9 ---------
.../app/reporting/reporting-grid/reporting-grid.component.html | 4 +++-
.../src/app/reporting/reporting-grid/reporting-grid.component.ts | 6 +++---
.../resources/webapp/src/app/reporting/reporting.component.ts | 3 ++-
4 files changed, 8 insertions(+), 14 deletions(-)
diff --git
a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
index da36c4e..2b1e26b 100644
---
a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
@@ -75,9 +75,6 @@ export class RolesComponent implements OnInit {
this.rolesList = roles.map((role) => {
return {role: role.description, type: role.type, cloud:
role.cloud};
});
- if (!this.healthStatus.admin) {
- this.rolesList = this.rolesList.filter(role => role.role !==
'Allow to execute administration operation');
- }
this.rolesList = this.rolesList.sort((a, b) => (a.cloud > b.cloud) ?
1 : ((b.cloud > a.cloud) ? -1 : 0));
this.rolesList = this.rolesList.sort((a, b) => (a.type > b.type) ? 1
: ((b.type > a.type) ? -1 : 0));
this.updateGroupData(groups);
@@ -215,13 +212,7 @@ export class RolesComponent implements OnInit {
return v;
}).sort((a, b) => (a.group > b.group) ? 1 : ((b.group > a.group) ? -1 :
0));
this.groupsData.forEach(item => {
- if (this.healthStatus.admin) {
item.selected_roles = item.roles.map(role => ({role: role.description,
type: role.type, cloud: role.cloud}));
- } else {
- item.selected_roles = item.roles.filter(role => role.description !==
'Allow to execute administration operation')
- .map(role => ({role: role.description, type: role.type, cloud:
role.cloud}));
- }
-
});
this.getGroupsListCopy();
}
diff --git
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
index 8413a5d..ce6b865 100644
---
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
+++
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
@@ -116,7 +116,9 @@
</button>
</th>
<td mat-cell *matCellDef="let element">
- <div *ngFor="let shape of shapeSplit(element.shape)">{{shape}}</div>
+ <ng-container *ngIf="element.shape">
+ <div *ngFor="let shape of shapeSplit(element.shape)">{{shape}}</div>
+ </ng-container>
</td>
<td mat-footer-cell *matFooterCellDef class="table-footer"></td>
</ng-container>
diff --git
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.ts
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.ts
index ef24283..bbc1344 100644
---
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.ts
@@ -76,7 +76,7 @@ export class ReportingGridComponent implements OnInit {
report = this.reportData.sort((a, b) => {
if (a[sortItem] === null) a = '';
if (b[sortItem] === null) b = '';
- return (a[sortItem] < b[sortItem]) ? 1 : ((b[sortItem] < a[sortItem]) ?
-1 : 0)
+ return (a[sortItem] < b[sortItem]) ? 1 : ((b[sortItem] < a[sortItem]) ?
-1 : 0);
});
}
this.refreshData(this.fullReport, report);
@@ -112,7 +112,7 @@ export class ReportingGridComponent implements OnInit {
this.resetRangePicker.emit(true);
}
- shapeSplit(shape){
- return shape.split(/(?=S)/g)
+ shapeSplit(shape) {
+ return shape.split(/(?=Slave)/g);
}
}
diff --git
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
index 70de4ab..03f7ca9 100644
---
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
@@ -156,8 +156,9 @@ export class ReportingComponent implements OnInit,
OnDestroy {
types.push(item['resource_type']);
if (item.shape && types.indexOf(item.shape)) {
+ console.log(item);
if (item.shape.indexOf('Master') > -1) {
- for (let shape of item.shape.split(/(?=S)/g)) {
+ for (let shape of item.shape.split(/(?=Slave)/g)) {
shape = shape.replace('Master: ', '');
shape = shape.replace(/Slave: /, '');
shape = shape.replace(/\s+/g, '');
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]