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:36:08 UTC

[incubator-dlab] branch DLAB-1567 created (now 89f412b)

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

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


      at 89f412b  [DLAB-1567]: billing issues for user who has not administrative role

This branch includes the following new commits:

     new 89f412b  [DLAB-1567]: billing issues for user who has not administrative role

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-dlab] 01/01: [DLAB-1567]: billing issues for user who has not administrative role

Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 89f412b5772bf68dfb6962b828f1e5c7aeeb3a65
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Feb 24 11:35:45 2020 +0200

    [DLAB-1567]: billing issues for user who has not administrative role
---
 .../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