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

commit 9959aabd8de47f77469b652f78d742a726f023c6
Author: Dmytro Gnatyshyn <[email protected]>
AuthorDate: Thu Apr 2 20:52:15 2020 +0300

    [DLAB-1491, 1682]: Fixed administrative page appear for user who has not 
permission,Fixed billing header
---
 .../src/app/administration/project/project.component.ts |  3 +--
 .../reporting-grid/reporting-grid.component.html        |  2 +-
 .../reporting-grid/reporting-grid.component.scss        |  5 ++++-
 .../reporting-grid/reporting-grid.component.ts          |  6 ++----
 .../webapp/src/app/reporting/reporting.component.ts     | 17 ++++++++---------
 .../confirmation-dialog/confirmation-dialog.model.ts    | 16 ++++++++++------
 6 files changed, 26 insertions(+), 23 deletions(-)

diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
index 9833a40..d9b855e 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
@@ -124,8 +124,7 @@ export class ProjectComponent implements OnInit, OnDestroy {
     if ( action === 'terminate') {
       const projectsResources = this.resources
         .filter(resource => resource.project === data.project_name 
)[0].exploratory
-        .filter(expl => expl.status !== 'terminated' && expl.status !== 
'terminating');
-
+        .filter(expl => expl.status !== 'terminated' && expl.status !== 
'terminating' && expl.status !== 'failed');
       let termResources = [];
       data.endpoint.forEach(v => {
         termResources = [...termResources, 
...projectsResources.filter(resource => resource.endpoint === v)];
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 0eb86a4..b1392f3 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
@@ -208,7 +208,7 @@
     </ng-container>
     <ng-container matColumnDef="actions" stickyEnd>
       <th mat-header-cell *matHeaderCellDef>
-        <div class="actions">
+        <div class="actions th_charges">
           <button mat-icon-button class="btn reset" (click)="resetFiltering(); 
isFiltered = !isFiltered">
             <i class="material-icons">close</i>
           </button>
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.scss
 
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.scss
index 1e8082b..cb0833c 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.scss
+++ 
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.scss
@@ -67,6 +67,9 @@
     &.header-row {
       th {
         font-size: 11px;
+        .label{
+          padding-left: 0;
+        }
       }
     }
   }
@@ -116,7 +119,7 @@
   }
 
   .th_charges {
-    width: 8%;
+    width: 10%;
     min-width: 140px;
     padding-right: 15px;
     text-align: right;
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 3d99814..159ed56 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
@@ -18,9 +18,7 @@
  */
 
 import {Component, OnInit, Output, EventEmitter, ViewChild, Input} from 
'@angular/core';
-
-import { DICTIONARY, ReportingConfigModel } from 
'../../../dictionary/global.dictionary';
-import {logger} from 'codelyzer/util/logger';
+import { ReportingConfigModel } from '../../../dictionary/global.dictionary';
 
 @Component({
   selector: 'dlab-reporting-grid',
@@ -30,7 +28,6 @@ import {logger} from 'codelyzer/util/logger';
 
 })
 export class ReportingGridComponent implements OnInit {
-  readonly DICTIONARY = DICTIONARY;
 
   filterConfiguration: ReportingConfigModel;
   filteredReportData: ReportingConfigModel = new ReportingConfigModel([], [], 
[], [], [], '', '', '', []);
@@ -46,6 +43,7 @@ export class ReportingGridComponent implements OnInit {
   @Output() resetRangePicker: EventEmitter<boolean> = new EventEmitter();
   displayedColumns: string[] = ['name', 'user', 'project', 'type', 'status', 
'shape', 'service', 'charge'];
   displayedFilterColumns: string[] = ['name-filter', 'user-filter', 
'project-filter', 'type-filter', 'status-filter', 'shape-filter', 
'service-filter', 'actions'];
+  filtered: any;
 
   ngOnInit() {}
 
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 872c3a5..cd44999 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
@@ -77,20 +77,14 @@ export class ReportingComponent implements OnInit, 
OnDestroy {
   ) { }
 
   ngOnInit() {
-    this.rebuildBillingReport();
+    this.getEnvironmentHealthStatus();
+    this.buildBillingReport();
   }
 
   ngOnDestroy() {
     this.clearStorage();
   }
 
-  initBilling() {
-    this.getEnvironmentHealthStatus();
-    if (this.admin) {
-      this.rebuildBillingReport();
-    }
-  }
-
   getGeneralBillingData() {
     setTimeout(() => {this.progressBarService.startProgressBar(); } , 0);
     this.billingReportService.getGeneralBillingData(this.reportData)
@@ -120,6 +114,11 @@ export class ReportingComponent implements OnInit, 
OnDestroy {
 
   rebuildBillingReport(): void {
     this.checkAutorize();
+    this.buildBillingReport();
+
+  }
+
+  buildBillingReport() {
     this.clearStorage();
     this.resetRangePicker();
     this.reportData.defaultConfigurations();
@@ -137,7 +136,7 @@ export class ReportingComponent implements OnInit, 
OnDestroy {
     this.billingReportService.downloadReport(this.reportData)
       .subscribe(
         data => FileUtils.downloadFile(data),
-        error => this.toastr.error('Billing report export failed!', 'Oops!'));
+        () => this.toastr.error('Billing report export failed!', 'Oops!'));
   }
 
   getDefaultFilterConfiguration(data): void {
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
 
b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
index 1bfcd06..9f92ef3 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
@@ -70,15 +70,19 @@ export class ConfirmationDialogModel {
 
 
   private stopExploratory(): Observable<{}> {
-    return this.manageAction
-      ? 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
'stop', this.notebook.project, this.notebook.name)
-      : this.userResourceService.suspendExploratoryEnvironment(this.notebook, 
'stop');
+    // return this.manageAction
+    //   ?
+      return 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
'stop', this.notebook.project, this.notebook.name);
+      // : 
this.userResourceService.suspendExploratoryEnvironment(this.notebook, 'stop');
   }
 
   private terminateExploratory(): Observable<{}> {
-    return this.manageAction
-      ? 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
'terminate', this.notebook.project,  this.notebook.name)
-      : this.userResourceService.suspendExploratoryEnvironment(this.notebook, 
'terminate');
+    // return this.manageAction
+    //   ?
+      return this.manageEnvironmentsService.environmentManagement(
+        this.notebook.user, 'terminate', this.notebook.project,  
this.notebook.name
+      );
+      // : 
this.userResourceService.suspendExploratoryEnvironment(this.notebook, 
'terminate');
   }
 
   private stopEdgeNode(): Observable<{}> {


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

Reply via email to