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/06/24 16:59:00 UTC

[incubator-dlab] branch DLAB-1887 created (now f64e1ec)

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

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


      at f64e1ec  [DLAB-1887]: small fix

This branch includes the following new commits:

     new d0a1324  [DLAB-1889]: Added resource-type filter property to query params
     new 0bb204b  [DLAB-1887]: Made the same behaviour for refresh buttons on all pages
     new f64e1ec  [DLAB-1887]: small fix

The 3 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] 02/03: [DLAB-1887]: Made the same behaviour for refresh buttons on all pages

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

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

commit 0bb204b8e712373073a82caf45747d8246af688f
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Wed Jun 24 19:44:19 2020 +0300

    [DLAB-1887]: Made the same behaviour for refresh buttons on all pages
---
 .../management/management-grid/management-grid.component.ts  |  2 +-
 .../app/administration/management/management.component.html  |  2 +-
 .../app/administration/management/management.component.ts    |  4 ++++
 .../reporting/reporting-grid/reporting-grid.component.html   |  2 +-
 .../reporting/reporting-grid/reporting-grid.component.ts     |  3 ++-
 .../webapp/src/app/reports/reporting/reporting.component.ts  | 12 +++++++-----
 .../multi-select-dropdown.component.html                     |  6 +++---
 .../multi-select-dropdown/multi-select-dropdown.component.ts |  1 +
 8 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management-grid/management-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/management-grid/management-grid.component.ts
index f7dbaf4..226c9a5 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management-grid/management-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management-grid/management-grid.component.ts
@@ -107,7 +107,7 @@ export class ManagementGridComponent implements OnInit {
   }
 
   public resetFilterConfigurations(): void {
-    this.filterForm.defaultConfigurations();
+    // this.filterForm.defaultConfigurations();
     this.applyFilter(this.filterForm);
     this.buildGrid();
   }
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
index eeb2d9b..02ab5b9 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
@@ -66,7 +66,7 @@
         <i class="material-icons">backup</i>Backup
       </button> -->
     </div>
-    <button mat-raised-button class="butt" (click)="buildGrid()">
+    <button mat-raised-button class="butt" (click)="refreshGrid()">
       <i class="material-icons">autorenew</i>Refresh
     </button>
   </div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
index ed66061..d7e5a45 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
@@ -83,6 +83,10 @@ export class ManagementComponent implements OnInit {
     this.environmentsDataService.updateEnvironmentData();
   }
 
+  public refreshGrid() {
+     this.buildGrid();
+  }
+
   public manageEnvironmentAction($event) {
     this.manageEnvironmentsService
       .environmentManagement(
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.html b/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.html
index 577e2d4..afd4873 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.html
@@ -182,7 +182,7 @@
     </ng-container>
     <ng-container matColumnDef="type-filter">
       <th mat-header-cell *matHeaderCellDef class="filter-row-item">
-        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)" [type]="['resource_type']"
+        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)" [type]="'resource_type'"
           [items]="filterConfiguration.resource_type" [model]="filteredReportData.resource_type">
         </multi-select-dropdown>
       </th>
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.ts
index 421ad84..8ff5a8d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting-grid/reporting-grid.component.ts
@@ -30,7 +30,7 @@ import { ReportingConfigModel } from '../../../../dictionary/global.dictionary';
 export class ReportingGridComponent implements OnInit {
 
   filterConfiguration: ReportingConfigModel;
-  filteredReportData: ReportingConfigModel = new ReportingConfigModel([], [], [], [], [], '', '', '', []);
+  // filteredReportData: ReportingConfigModel = new ReportingConfigModel([], [], [], [], [], '', '', '', []);
   collapseFilterRow: boolean = true;
   reportData: Array<any> = [];
   fullReport: Array<any>;
@@ -41,6 +41,7 @@ export class ReportingGridComponent implements OnInit {
 
   @Output() filterReport: EventEmitter<{}> = new EventEmitter();
   @Output() resetRangePicker: EventEmitter<boolean> = new EventEmitter();
+  @Input() filteredReportData: ReportingConfigModel;
   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;
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting.component.ts b/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting.component.ts
index a3e7fa2..98b578b 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/reporting/reporting.component.ts
@@ -37,7 +37,7 @@ import {ProgressBarService} from '../../core/services/progress-bar.service';
                   (setRangeOption)="setRangeOption($event)">
     </dlab-toolbar>
     <mat-divider></mat-divider>
-    <dlab-reporting-grid (filterReport)="filterReport($event)" (resetRangePicker)="resetRangePicker()"></dlab-reporting-grid>
+    <dlab-reporting-grid (filterReport)="filterReport($event)" (resetRangePicker)="resetRangePicker()" [filteredReportData]="reportData" ></dlab-reporting-grid>
   </div>
 
   `,
@@ -62,11 +62,12 @@ export class ReportingComponent implements OnInit, OnDestroy {
   @ViewChild(ReportingGridComponent, { static: false }) reportingGrid: ReportingGridComponent;
   @ViewChild(ToolbarComponent, { static: true }) reportingToolbar: ToolbarComponent;
 
-  reportData: ReportingConfigModel = ReportingConfigModel.getDefault();
+  reportData: ReportingConfigModel = new ReportingConfigModel([], [], [], [], [], '', '', '', []);
   filterConfiguration: ReportingConfigModel = ReportingConfigModel.getDefault();
   data: any;
   billingEnabled: boolean;
   admin: boolean;
+  private cashedFilterData: any;
 
   constructor(
     private billingReportService: BillingReportService,
@@ -87,12 +88,13 @@ export class ReportingComponent implements OnInit, OnDestroy {
 
   getGeneralBillingData() {
     setTimeout(() => {this.progressBarService.startProgressBar(); } , 0);
+    this.cashedFilterData = JSON.parse(JSON.stringify(this.reportData));
+    Object.setPrototypeOf(this.cashedFilterData, Object.getPrototypeOf(this.reportData));
     this.billingReportService.getGeneralBillingData(this.reportData)
       .subscribe(data => {
         this.data = data;
         this.reportingGrid.refreshData(this.data, this.data.report_lines);
         this.reportingGrid.setFullReport(this.data.is_full);
-
         this.reportingToolbar.reportData = this.data;
         if (!localStorage.getItem('report_period')) {
           localStorage.setItem('report_period', JSON.stringify({
@@ -114,14 +116,14 @@ export class ReportingComponent implements OnInit, OnDestroy {
 
   rebuildBillingReport(): void {
     this.checkAutorize();
+    console.log(this.cashedFilterData);
+    this.reportData = this.cashedFilterData;
     this.buildBillingReport();
-
   }
 
   buildBillingReport() {
     this.clearStorage();
     this.resetRangePicker();
-    this.reportData.defaultConfigurations();
     this.getGeneralBillingData();
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.html b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.html
index 16c9a0f..ef43e63 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.html
@@ -19,7 +19,7 @@
 
 <div class="dropdown-multiselect btn-group" ngClass="{{type || ''}}">
   <button type="button" #list (click)="multiactions.toggle($event, list)">
-    <span class="ellipsis" *ngIf="model.length === 0">Select {{type.replace('_', ' ')}}</span>
+    <span class="ellipsis" *ngIf="model.length === 0">Select {{ type | convertaction }}</span>
     <span class="selected-items ellipsis" *ngIf="model.length !== 0">
       Selected {{model.length}} item<strong *ngIf="model.length > 1">s</strong>
     </span>
@@ -40,8 +40,8 @@
           <li role="presentation" *ngIf="model">
             <a href="#" class="list-item" role="menuitem" (click)="toggleSelectedOptions($event, model, item)">
               <span class="material-icons" *ngIf="model.indexOf(item) >= 0">done</span>
-              <ng-container *ngIf="type[0] !== 'resource_type' && type !== 'resource_types'">{{item}}</ng-container>
-              <ng-container *ngIf="type[0] === 'resource_type' || type === 'resource_types'">{{item | convertaction}}</ng-container>
+              <ng-container *ngIf="type !== 'resource_type' && type !== 'resource_types'">{{item}}</ng-container>
+              <ng-container *ngIf="type === 'resource_type' || type === 'resource_types'">{{item | titlecase}}</ng-container>
             </a>
           </li>
         </ng-template>
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.ts b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.ts
index 5fcb6d1..0e819ac 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.ts
@@ -56,6 +56,7 @@ export class MultiSelectDropdownComponent {
   }
 
   onUpdate($event): void {
+    console.log(this.type);
     this.selectionChange.emit({ model: this.model, type: this.type, $event });
   }
 }


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


[incubator-dlab] 01/03: [DLAB-1889]: Added resource-type filter property to query params

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

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

commit d0a1324eb8bc99c8f58bde73b0f9f1c7969f8371
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Wed Jun 24 13:56:42 2020 +0300

    [DLAB-1889]: Added resource-type filter property to query params
---
 .../resources/webapp/src/app/core/services/audit.service.ts |  2 +-
 .../app/reports/audit/audit-grid/audit-grid.component.html  |  2 +-
 .../app/reports/audit/audit-grid/audit-grid.component.ts    | 13 +++++++++----
 .../audit/audit-toolbar/audit-toolbar.component.html        |  3 ---
 .../audit/audit-toolbar/audit-toolbar.component.scss        |  2 +-
 .../webapp/src/app/reports/audit/audit.component.ts         |  6 +++---
 6 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/audit.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/audit.service.ts
index 499c716..1d54792 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/audit.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/audit.service.ts
@@ -18,7 +18,7 @@ export class AuditService {
       queryString += `&resource-names=${filterData.resources.join(',')}`;
     }
     if (filterData.resource_types.length) {
-      queryString += `&resource_types=${filterData.resource_types.map(v => v.toLowerCase()).join(',')}`;
+      queryString += `&resource-types=${filterData.resource_types.join(',')}`;
     }
     if (filterData.users.length) {
       queryString += `&users=${filterData.users.join(',')}`;
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.html b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.html
index faf6256..a6125f9 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.html
@@ -204,7 +204,7 @@
             <i class="material-icons">close</i>
           </button>
 
-          <button mat-icon-button class="btn apply" (click)="refreshAudit(true)" [disabled]="!didFilterChanged()">
+          <button mat-icon-button class="btn apply" (click)="buildAuditGrid(true)" [disabled]="!didFilterChanged()">
             <i class="material-icons">done</i>
           </button>
         </div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.ts
index d0f6e2d..dedd0c7 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.ts
@@ -53,7 +53,7 @@ export class AuditGridComponent implements OnInit {
 
   ngOnInit() {}
 
-  public refreshAudit(filter?) {
+  public buildAuditGrid(filter?) {
     if (!this.showItemsPrPage) {
       if (window.localStorage.getItem('audit_per_page')) {
         this.showItemsPrPage = +window.localStorage.getItem('audit_per_page');
@@ -84,6 +84,11 @@ export class AuditGridComponent implements OnInit {
     });
   }
 
+  public refreshAuditPage() {
+    this.filterAuditData = this.copiedFilterAuditData;
+    this.getAuditData();
+  }
+
   public setAvaliblePeriod(period) {
     this.filterAuditData.date_start = period.start_date;
     this.filterAuditData.date_end = period.end_date;
@@ -106,7 +111,7 @@ export class AuditGridComponent implements OnInit {
     this.firstItem = 1;
     if (this.lastItem !== item) {
       this.lastItem = item;
-      this.refreshAudit();
+      this.buildAuditGrid();
     }
   }
 
@@ -131,12 +136,12 @@ export class AuditGridComponent implements OnInit {
 
   public loadItemsForPage(action) {
     this.changePage(action);
-    this.refreshAudit();
+    this.buildAuditGrid();
   }
 
   public resetFilterConfigurations() {
     this.filterAuditData = FilterAuditModel.getDefault();
-    this.refreshAudit(true);
+    this.buildAuditGrid(true);
   }
 
   public didFilterChanged() {
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-toolbar/audit-toolbar.component.html b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-toolbar/audit-toolbar.component.html
index 601a4dd..3562b08 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-toolbar/audit-toolbar.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-toolbar/audit-toolbar.component.html
@@ -34,9 +34,6 @@
     <ng-daterangepicker [(ngModel)]="value" [options]="options" (ngModelChange)="onChange($event)"></ng-daterangepicker>
   </div>
   <div class="action-butt">
-<!--    <button mat-raised-button class="butt" (click)="export($event)" [disabled]="!reportData?.report_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>
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-toolbar/audit-toolbar.component.scss b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-toolbar/audit-toolbar.component.scss
index 4a150bf..744bfdc 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-toolbar/audit-toolbar.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-toolbar/audit-toolbar.component.scss
@@ -41,7 +41,7 @@ section.toolbar {
 
   button {
     &:first-child {
-      margin-right: 10px;
+      margin-right: 0;
     }
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit.component.ts b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit.component.ts
index 814c444..6f48b71 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit.component.ts
@@ -83,16 +83,16 @@ export class AuditComponent implements OnInit, OnDestroy {
   }
 
   public buildAuditReport() {
-    this.auditGrid.refreshAudit();
+    this.auditGrid.buildAuditGrid();
   }
 
   public rebuildAuditGrid() {
-    this.buildAuditReport();
+    this.auditGrid.refreshAuditPage();
   }
 
   private getEnvironmentHealthStatus() {
     this.healthStatusService.getEnvironmentHealthStatus()
-      .subscribe((result: any) => {});
+      .subscribe();
   }
 
   public setRangeOption(event) {


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


[incubator-dlab] 03/03: [DLAB-1887]: small fix

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

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

commit f64e1ec3a7f37ca727e8908edb249e67c30f39e9
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Wed Jun 24 19:55:35 2020 +0300

    [DLAB-1887]: small fix
---
 .../multi-select-dropdown/multi-select-dropdown.component.html          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.html b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.html
index ef43e63..210aef3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-select-dropdown/multi-select-dropdown.component.html
@@ -19,7 +19,7 @@
 
 <div class="dropdown-multiselect btn-group" ngClass="{{type || ''}}">
   <button type="button" #list (click)="multiactions.toggle($event, list)">
-    <span class="ellipsis" *ngIf="model.length === 0">Select {{ type | convertaction }}</span>
+    <span class="ellipsis" *ngIf="model.length === 0 && type">Select {{ type  }}</span>
     <span class="selected-items ellipsis" *ngIf="model.length !== 0">
       Selected {{model.length}} item<strong *ngIf="model.length > 1">s</strong>
     </span>


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