You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/06/06 15:22:46 UTC

[incubator-dlab] 04/04: [DLAB-649]: extend billing data grid

This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a commit to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 8aa0bac2d098c8829defa87670466d3e097fa2cc
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu Jun 6 18:21:53 2019 +0300

    [DLAB-649]: extend billing data grid
---
 .../reporting-grid/reporting-grid.component.html   | 28 ++++++++++------------
 .../reporting-grid/reporting-grid.component.ts     |  8 ++++++-
 2 files changed, 19 insertions(+), 17 deletions(-)

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 7b7336f..968d148 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
@@ -92,8 +92,8 @@
 </table> -->
 <!--  *ngIf="full_report" -->
 
-<section class="table-wrapper">
-  <table mat-table [dataSource]="reportData?.lines" class="data-grid reporting mat-elevation-z6">
+<section class="table-wrapper" *ngIf="reportData?.lines">
+  <table mat-table [dataSource]="reportData.lines" class="data-grid reporting mat-elevation-z6">
 
     <ng-container matColumnDef="name" sticky>
       <th mat-header-cell *matHeaderCellDef class="env_name"> Environment name </th>
@@ -146,8 +146,9 @@
       <td mat-cell *matCellDef="let element">
         {{ element[DICTIONARY.billing.cost] }} {{ element[DICTIONARY.billing.currencyCode] }}
       </td>
-      <td mat-footer-cell *matFooterCellDef>{{ reportData[DICTIONARY.billing.costTotal] }}
-        {{ reportData[DICTIONARY.billing.currencyCode] }}</td>
+      <td mat-footer-cell *matFooterCellDef>
+        <span *ngIf="reportData">{{ reportData[DICTIONARY.billing.costTotal] }} {{ reportData[DICTIONARY.billing.currencyCode] }}</span>
+      </td>
     </ng-container>
 
     <!-- ----------------FILTER -->
@@ -159,8 +160,8 @@
     </ng-container>
     <ng-container matColumnDef="user-filter">
       <th mat-header-cell *matHeaderCellDef>
-        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)" [type]="'user'" [items]="filterConfiguration.user"
-          [model]="filteredReportData.user"></multi-select-dropdown>
+        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)" [type]="'user'"
+          [items]="filterConfiguration.user" [model]="filteredReportData.user"></multi-select-dropdown>
       </th>
     </ng-container>
     <ng-container matColumnDef="type-filter">
@@ -178,14 +179,15 @@
     </ng-container>
     <ng-container matColumnDef="shape-filter">
       <th mat-header-cell *matHeaderCellDef>
-        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)" [type]="[DICTIONARY.billing.instance_size]"
-          [items]="filterConfiguration[DICTIONARY.billing.instance_size]"
+        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)"
+          [type]="[DICTIONARY.billing.instance_size]" [items]="filterConfiguration[DICTIONARY.billing.instance_size]"
           [model]="filteredReportData[DICTIONARY.billing.instance_size]"></multi-select-dropdown>
       </th>
     </ng-container>
     <ng-container matColumnDef="service-filter">
       <th mat-header-cell *matHeaderCellDef>
-        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)" [type]="[DICTIONARY.billing.service_filter_key]"
+        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)"
+          [type]="[DICTIONARY.billing.service_filter_key]"
           [items]="filterConfiguration[DICTIONARY.billing.service_filter_key]"
           [model]="filteredReportData[DICTIONARY.billing.service_filter_key]"></multi-select-dropdown>
       </th>
@@ -212,14 +214,8 @@
     <tr mat-footer-row *matFooterRowDef="displayedColumns; sticky: true"></tr>
   </table>
 </section>
-<!-- 
-
-
-<footer *ngIf="data">
-Total {{ reportData[DICTIONARY.billing.costTotal] }} {{ reportData[DICTIONARY.billing.currencyCode] }}
-</footer>
-
 
+<!-- 
 <div *ngIf="!reportData" class="message_block message info">
   <span>To start working, please, create new environment</span>
 </div>
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 0aed840..b919c27 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
@@ -35,7 +35,6 @@ export class ReportingGridComponent implements OnInit {
   collapseFilterRow: boolean = false;
   reportData: any;
   isFiltered: boolean = false;
-  full_report: boolean = false;
 
   @Output() filterReport: EventEmitter<{}> = new EventEmitter();
   @Output() resetRangePicker: EventEmitter<boolean> = new EventEmitter();
@@ -58,6 +57,13 @@ export class ReportingGridComponent implements OnInit {
     this.filteredReportData[$event.type] = $event.model;
   }
 
+  setFullReport(data): void {
+    if (!data) {
+      this.displayedColumns = this.displayedColumns.filter(el => el !== 'user');
+      this.displayedFilterColumns = this.displayedFilterColumns.filter(el => el !== 'user-filter');
+    }
+  }
+
   toggleFilterRow(): void {
     this.collapseFilterRow = !this.collapseFilterRow;
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org