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 2183f70  Fixed sorting on billing page, upd parsing master and slave, 
removed no projects message for superadmin
     new e46ea8b  Merge remote-tracking branch 'origin/DLAB-1571' into DLAB-1571
2183f70 is described below

commit 2183f70323dba2eb61ea7dbe37b414f9008647d8
Author: Dmytro Gnatyshyn <[email protected]>
AuthorDate: Thu Apr 16 14:24:18 2020 +0300

    Fixed sorting on billing page, upd parsing master and slave, removed no 
projects message for superadmin
---
 .../reporting-grid/reporting-grid.component.html         |  2 +-
 .../reporting/reporting-grid/reporting-grid.component.ts | 16 ++++++++++++++--
 .../webapp/src/app/reporting/reporting.component.ts      |  2 +-
 .../webapp/src/app/shared/navbar/navbar.component.ts     |  2 +-
 4 files changed, 17 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 2ec7c45..8413a5d 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,7 @@
         </button>
       </th>
       <td mat-cell *matCellDef="let element">
-        <div *ngFor="let shape of element.shape.split('↵')">{{shape}}</div>
+        <div *ngFor="let shape of shapeSplit(element.shape)">{{shape}}</div>
       </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 159ed56..ef24283 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
@@ -66,10 +66,18 @@ export class ReportingGridComponent implements OnInit {
   sortBy(sortItem, direction) {
   let report: Array<object>;
   if (direction === 'down') {
-    report = this.reportData.sort((a, b) => (a[sortItem] > b[sortItem]) ? 1 : 
((b[sortItem] > a[sortItem]) ? -1 : 0));
+    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);
+    });
   }
   if (direction === 'up') {
-    report = this.reportData.sort((a, b) => (a[sortItem] < b[sortItem]) ? 1 : 
((b[sortItem] < a[sortItem]) ? -1 : 0));
+    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)
+    });
   }
   this.refreshData(this.fullReport, report);
   this.removeSorting();
@@ -103,4 +111,8 @@ export class ReportingGridComponent implements OnInit {
     this.filterReport.emit(this.filteredReportData);
     this.resetRangePicker.emit(true);
   }
+
+  shapeSplit(shape){
+    return shape.split(/(?=S)/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 d2abd7a..70de4ab 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
@@ -157,7 +157,7 @@ export class ReportingComponent implements OnInit, 
OnDestroy {
 
       if (item.shape && types.indexOf(item.shape)) {
        if (item.shape.indexOf('Master') > -1) {
-          for (let shape of item.shape.split('↵')) {
+          for (let shape of item.shape.split(/(?=S)/g)) {
             shape = shape.replace('Master: ', '');
             shape = shape.replace(/Slave: /, '');
             shape = shape.replace(/\s+/g, '');
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.ts
index 952dfd0..1f33caa 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.ts
@@ -111,7 +111,7 @@ export class NavbarComponent implements OnInit, OnDestroy {
         
this.subscriptions.add(this.healthStatusService.statusData.pipe(skip(1)).subscribe(result
 => {
           this.healthStatus = result;
           result.status && this.checkQuoteUsed(this.healthStatus);
-          result.status && !result.projectAssigned && 
this.checkAssignment(this.healthStatus);
+          result.status && !result.projectAssigned && !result.admin && 
this.checkAssignment(this.healthStatus);
         }));
         this.subscriptions.add(timer(0, 
this.CHECK_ACTIVE_SCHEDULE_TIMEOUT).subscribe(() => 
this.refreshSchedulerData()));
         this.currentUserName = this.getUserName();


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

Reply via email to