You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by dg...@apache.org on 2020/02/24 09:37:28 UTC

[incubator-dlab] branch develop updated: [DLAB-1567]: billing issues for user who has not administrative role (#615)

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 89efe59  [DLAB-1567]: billing issues for user who has not administrative role (#615)
89efe59 is described below

commit 89efe591c71a4cf6f22a1d3d65c0ef77b026afab
Author: Dmytro Gnatyshyn <42...@users.noreply.github.com>
AuthorDate: Mon Feb 24 11:37:22 2020 +0200

    [DLAB-1567]: billing issues for user who has not administrative role (#615)
---
 .../src/app/reporting/reporting.component.ts       | 29 ++++++++++++++--------
 .../app/reporting/toolbar/toolbar.component.html   |  3 +--
 2 files changed, 19 insertions(+), 13 deletions(-)

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 d135261..2737ea7 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
@@ -88,22 +88,29 @@ export class ReportingComponent implements OnInit, OnDestroy {
 
   getBillingProvider() {
     this.getEnvironmentHealthStatus();
-    this.endpointService.getEndpointsData().subscribe(list => {
-      // @ts-ignore
-      const endpoints = [...list];
-      const localEndpoint = endpoints.filter(endpoint => endpoint.name === 'local');
-      if (localEndpoint.length) {
-        this.PROVIDER = localEndpoint[0].cloudProvider.toLowerCase();
+    if (this.admin) {
+      this.endpointService.getEndpointsData().subscribe(list => {
+        // @ts-ignore
+        const endpoints = [...list];
+        const localEndpoint = endpoints.filter(endpoint => endpoint.name === 'local');
+        if (localEndpoint.length) {
+          this.PROVIDER = localEndpoint[0].cloudProvider.toLowerCase();
+          if (this.PROVIDER) {
+            this.rebuildBillingReport();
+          }
+        }
+      }, e => {
+        this.PROVIDER = 'gcp';
         if (this.PROVIDER) {
-              this.rebuildBillingReport();
-            }
-      }
-    }, e => {
+          this.rebuildBillingReport();
+        }
+      }) ;
+    } else {
       this.PROVIDER = 'gcp';
       if (this.PROVIDER) {
         this.rebuildBillingReport();
       }
-      }) ;
+    }
   }
 
   getGeneralBillingData() {
diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/toolbar/toolbar.component.html b/services/self-service/src/main/resources/webapp/src/app/reporting/toolbar/toolbar.component.html
index bbab2a4..30de007 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reporting/toolbar/toolbar.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/reporting/toolbar/toolbar.component.html
@@ -33,13 +33,12 @@
   <div id="range-picker">
     <ng-daterangepicker [(ngModel)]="value" [options]="options" (ngModelChange)="onChange($event)"></ng-daterangepicker>
   </div>
-  <div class="action-butt" *ngIf="healthStatus && healthStatus.admin">
+  <div class="action-butt">
     <button mat-raised-button class="butt" (click)="export($event)" [disabled]="!reportData?.lines.length">
       <i class="material-icons">file_download</i>Export
     </button>
     <button mat-raised-button class="butt" (click)="rebuild($event)">
       <i class="material-icons">autorenew</i>Refresh
     </button>
-
   </div>
 </section>


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