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

dgnatyshyn pushed a commit to branch DLAB-2049
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit b7d16b68441de618ced98d7c19ee301f7eb29b2e
Author: Dmytro_Gnatyshyn <[email protected]>
AuthorDate: Tue Sep 15 13:19:50 2020 +0300

    [DLAB-2049]: Fixed clicking the same sort icon should not change value 
position in grid
---
 .../reports/reporting/reporting-grid/reporting-grid.component.ts   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.ts
index 6172a78..29e8ed2 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.ts
@@ -58,6 +58,8 @@ export class ReportingGridComponent implements OnInit, 
AfterViewInit {
   isFilterSelected: boolean;
   isFilterChanged: boolean;
   public isScrollButtonsVisible: boolean;
+  public previousItem: string;
+  public previousDirection: string;
 
   @ViewChild('nameFilter', { static: false }) filter;
   @ViewChild('tableWrapper', { static: false }) tableWrapper;
@@ -121,7 +123,12 @@ export class ReportingGridComponent implements OnInit, 
AfterViewInit {
   }
 
   sortBy(sortItem, direction) {
+  if (this.previousItem === sortItem && this.previousDirection === direction) {
+    return;
+  }
   let report: Array<object>;
+  this.previousItem = sortItem;
+  this.previousDirection = direction;
   if (direction === 'down') {
     report = this.reportData.sort((a, b) => {
       if (a[sortItem] === null) a[sortItem] = '';


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

Reply via email to