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/19 08:49:10 UTC

[incubator-dlab] branch DLAB-1567 created (now 084b720)

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 084b720  [DLAB-1567]: Removed 'Refresh'/'Export' buttons from Billing if user is not admin

This branch includes the following new commits:

     new 084b720  [DLAB-1567]: Removed 'Refresh'/'Export' buttons from Billing if user is not admin

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]: Removed 'Refresh'/'Export' buttons from Billing if user is not admin

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 084b720e2b50444127c7c8e0dd27b895abad86be
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Feb 18 17:36:59 2020 +0200

    [DLAB-1567]: Removed 'Refresh'/'Export' buttons from Billing if user is not admin
---
 .../src/app/reporting/toolbar/toolbar.component.html       |  2 +-
 .../webapp/src/app/reporting/toolbar/toolbar.component.ts  | 14 +++++++++++---
 .../webapp/src/app/shared/navbar/navbar.component.ts       |  4 ++--
 3 files changed, 14 insertions(+), 6 deletions(-)

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 9c0b9c0..bbab2a4 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,7 +33,7 @@
   <div id="range-picker">
     <ng-daterangepicker [(ngModel)]="value" [options]="options" (ngModelChange)="onChange($event)"></ng-daterangepicker>
   </div>
-  <div class="action-butt">
+  <div class="action-butt" *ngIf="healthStatus && healthStatus.admin">
     <button mat-raised-button class="butt" (click)="export($event)" [disabled]="!reportData?.lines.length">
       <i class="material-icons">file_download</i>Export
     </button>
diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/toolbar/toolbar.component.ts b/services/self-service/src/main/resources/webapp/src/app/reporting/toolbar/toolbar.component.ts
index aaa0e8d..5272e37 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reporting/toolbar/toolbar.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reporting/toolbar/toolbar.component.ts
@@ -20,6 +20,10 @@
 import { Component, OnInit, AfterViewInit, Output, EventEmitter, ViewEncapsulation, ViewChild } from '@angular/core';
 import { NgDateRangePickerOptions } from 'ng-daterangepicker';
 import { DICTIONARY } from '../../../dictionary/global.dictionary';
+import {skip} from 'rxjs/operators';
+import {Subscription} from 'rxjs';
+import {HealthStatusService} from '../../core/services';
+import {GeneralEnvironmentStatus} from '../../administration/management/management.model';
 
 @Component({
   selector: 'dlab-toolbar',
@@ -33,6 +37,8 @@ export class ToolbarComponent implements OnInit, AfterViewInit {
   reportData: any;
   availablePeriodFrom: string;
   availablePeriodTo: string;
+  subscriptions: Subscription = new Subscription();
+  healthStatus: GeneralEnvironmentStatus;
 
   rangeOptions = { 'YTD': 'Year To Date', 'QTD': 'Quarter To Date', 'MTD': 'Month To Date', 'reset': 'All Period Report' };
   options: NgDateRangePickerOptions;
@@ -42,7 +48,7 @@ export class ToolbarComponent implements OnInit, AfterViewInit {
   @Output() exportReport: EventEmitter<{}> = new EventEmitter();
   @Output() setRangeOption: EventEmitter<{}> = new EventEmitter();
 
-  constructor() {
+  constructor(private healthStatusService: HealthStatusService) {
     this.options = {
       theme: 'default',
       range: 'tm',
@@ -58,8 +64,10 @@ export class ToolbarComponent implements OnInit, AfterViewInit {
     if (localStorage.getItem('report_period')) {
       const availableRange = JSON.parse(localStorage.getItem('report_period'));
       this.availablePeriodFrom = availableRange.start_date;
-      this.availablePeriodTo = availableRange.end_date;
-    }
+      this.availablePeriodTo = availableRange.end_date;    }
+    this.subscriptions.add(this.healthStatusService.statusData.pipe(skip(1)).subscribe(result => {
+      this.healthStatus = result;
+    }));
   }
 
   ngAfterViewInit() {
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 78ddd3c..952dfd0 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
@@ -38,8 +38,8 @@ import {
   animateChild,
   state
 } from '@angular/animations';
-import {skip} from "rxjs/operators";
-import {ProgressBarService} from "../../core/services/progress-bar.service";
+import {skip} from 'rxjs/operators';
+import {ProgressBarService} from '../../core/services/progress-bar.service';
 
 @Component({
   selector: 'dlab-navbar',


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