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 ff3b701  [DLAB-1739, 1740]: Fixed sorting and filtering on billing 
report
     new 78824a5  Merge remote-tracking branch 'origin/DLAB-1571' into DLAB-1571
ff3b701 is described below

commit ff3b701921422f596b29ad36895e731ea4115b61
Author: Dmytro Gnatyshyn <[email protected]>
AuthorDate: Fri Apr 17 15:19:21 2020 +0300

    [DLAB-1739, 1740]: Fixed sorting and filtering on billing report
---
 .../src/app/reporting/reporting-grid/reporting-grid.component.html  | 6 +++---
 .../src/app/reporting/reporting-grid/reporting-grid.component.ts    | 4 ++--
 2 files changed, 5 insertions(+), 5 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 ce6b865..537cbb5 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
@@ -170,13 +170,13 @@
     </ng-container>
     <ng-container matColumnDef="user-filter">
       <th mat-header-cell *matHeaderCellDef class="filter-row-item">
-        <multi-select-dropdown *ngIf="filterConfiguration" 
(selectionChange)="onUpdate($event)" [type]="'user'"
+        <multi-select-dropdown *ngIf="filterConfiguration" 
(selectionChange)="onUpdate($event)" [type]="'users'"
           [items]="filterConfiguration.users" 
[model]="filteredReportData.users"></multi-select-dropdown>
       </th>
     </ng-container>
     <ng-container matColumnDef="project-filter">
       <th mat-header-cell *matHeaderCellDef class="filter-row-item">
-        <multi-select-dropdown *ngIf="filterConfiguration" 
(selectionChange)="onUpdate($event)" [type]="'project'"
+        <multi-select-dropdown *ngIf="filterConfiguration" 
(selectionChange)="onUpdate($event)" [type]="'projects'"
           [items]="filterConfiguration.projects" 
[model]="filteredReportData.projects"></multi-select-dropdown>
       </th>
     </ng-container>
@@ -189,7 +189,7 @@
     </ng-container>
     <ng-container matColumnDef="status-filter">
       <th mat-header-cell *matHeaderCellDef class="filter-row-item">
-        <multi-select-dropdown *ngIf="filterConfiguration" 
(selectionChange)="onUpdate($event)" [type]="'status'"
+        <multi-select-dropdown *ngIf="filterConfiguration" 
(selectionChange)="onUpdate($event)" [type]="'statuses'"
           [items]="filterConfiguration.statuses" 
[model]="filteredReportData.statuses"></multi-select-dropdown>
       </th>
     </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 bbc1344..d4e0076 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
@@ -69,14 +69,14 @@ 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 : -1;
     });
   }
   if (direction === 'up') {
     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 : -1 ;
     });
   }
   this.refreshData(this.fullReport, report);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to