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/23 09:58:10 UTC

[incubator-dlab] branch audit updated: Changed audit columns positions,

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

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


The following commit(s) were added to refs/heads/audit by this push:
     new f32a31d  Changed audit columns positions,
f32a31d is described below

commit f32a31dc6c5e3e762c49f2c3c9afcb7e894d0ced
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Jun 23 12:57:43 2020 +0300

    Changed audit columns positions,
---
 .../audit/audit-grid/audit-grid.component.html     | 33 ++++++++++++++++++++++
 .../audit/audit-grid/audit-grid.component.scss     | 18 ++++++++----
 .../audit/audit-grid/audit-grid.component.ts       | 13 +++++----
 3 files changed, 54 insertions(+), 10 deletions(-)

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 fe79635..93a6f08 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
@@ -48,6 +48,20 @@
       <td mat-footer-cell *matFooterCellDef class="table-footer"></td>
     </ng-container>
 
+    <ng-container matColumnDef="resource-type">
+      <th mat-header-cell *matHeaderCellDef class="th_resource-type label-header">
+        <div class="label"><span class="text">Resource type</span></div>
+        <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()">
+          <i class="material-icons">
+            <span *ngIf="filterAuditData.resource.length > 0; else user_filtered">filter_list</span>
+            <ng-template #user_filtered>more_vert</ng-template>
+          </i>
+        </button>
+      </th>
+      <td mat-cell *matCellDef="let element"><span class="table-item">{{element.resourceName || 'N/A'}}</span></td>
+      <td mat-footer-cell *matFooterCellDef class="table-footer"></td>
+    </ng-container>
+
     <ng-container matColumnDef="resource">
       <th mat-header-cell *matHeaderCellDef class="th_resource label-header">
         <div class="label"><span class="text">Resource</span></div>
@@ -135,6 +149,12 @@
       </td>
     </ng-container>
 
+    <ng-container matColumnDef="buttons">
+      <th mat-header-cell *matHeaderCellDef class="th_buttons label-header"></th>
+      <td mat-cell *matCellDef="let element"></td>
+      <td mat-footer-cell *matFooterCellDef class="table-footer"></td>
+    </ng-container>
+
     <ng-container matColumnDef="user-filter">
       <th mat-header-cell *matHeaderCellDef class="filter-row-item">
         <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)" [type]="'users'"
@@ -156,12 +176,25 @@
       </th>
     </ng-container>
 
+    <ng-container matColumnDef="resource-type-filter">
+      <th mat-header-cell *matHeaderCellDef class="filter-row-item">
+        <multi-select-dropdown *ngIf="filterConfiguration" (selectionChange)="onUpdate($event)" [type]="'resources'"
+                               [items]="filterConfiguration.resource" [model]="filterAuditData.resource"></multi-select-dropdown>
+      </th>
+    </ng-container>
+
     <ng-container matColumnDef="actions-filter">
       <th mat-header-cell *matHeaderCellDef class="filter-row-item">
       </th>
     </ng-container>
+
     <ng-container matColumnDef="action-filter" stickyEnd>
       <th mat-header-cell *matHeaderCellDef>
+      </th>
+    </ng-container>
+
+    <ng-container matColumnDef="filter-buttons" stickyEnd>
+      <th mat-header-cell *matHeaderCellDef>
         <div class="actions audit-actions">
           <button mat-icon-button class="btn reset" (click)="resetFilterConfigurations()">
             <i class="material-icons">close</i>
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.scss b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.scss
index b413a86..bd3b8c6 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.scss
@@ -32,23 +32,31 @@
 
     tr {
       .th_user {
-        width: 25%;
+        width: 18%;
       }
 
       .th_action {
-        width: 20%;
+        width: 10%;
       }
 
       .th_date {
-        width: 20%;
+        width: 13%;
       }
 
       .th_project{
-        width: 15%;
+        width: 10%;
       }
 
       .th_resource{
-        width: 20%;
+        width: 10%;
+      }
+
+      .th_resource-type{
+        width: 13%;
+      }
+
+      .th_buttons{
+        width: 6%;
       }
 
       th {
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 0630773..77f8a44 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
@@ -30,8 +30,8 @@ import {AuditService} from '../../../core/services/audit.service';
 })
 export class AuditGridComponent implements OnInit {
   public auditData: Array<object>;
-  public displayedColumns: string[] = ['user', 'project', 'resource', 'action', 'date'];
-  public displayedFilterColumns: string[] = ['user-filter', 'project-filter', 'resource-filter', 'actions-filter', 'action-filter'];
+  public displayedColumns: string[] = ['date', 'user', 'action', 'project', 'resource-type', 'resource', 'buttons'];
+  public displayedFilterColumns: string[] = ['action-filter', 'user-filter', 'actions-filter',  'project-filter', 'resource-type-filter', 'resource-filter', 'filter-buttons'];
   public collapseFilterRow: boolean = true;
   public filterConfiguration: FilterAuditModel = new FilterAuditModel([], [], [], [], '', '');
   public filterAuditData: FilterAuditModel = new FilterAuditModel([], [], [], [], '', '');
@@ -115,12 +115,15 @@ export class AuditGridComponent implements OnInit {
       this.lastItem = this.showItemsPrPage;
     } else if (action === 'previous') {
       this.firstItem = this.firstItem - this.showItemsPrPage;
-      this.lastItem = this.lastItem % this.showItemsPrPage === 0 ? this.lastItem - this.showItemsPrPage : this.lastItem - (this.lastItem % this.showItemsPrPage);
+      this.lastItem = this.lastItem % this.showItemsPrPage === 0 ?
+        this.lastItem - this.showItemsPrPage : this.lastItem - (this.lastItem % this.showItemsPrPage);
     } else if (action === 'next') {
       this.firstItem = this.firstItem + this.showItemsPrPage;
-      this.lastItem = (this.lastItem + this.showItemsPrPage) > this.allItems ? this.allItems : this.lastItem + this.showItemsPrPage;
+      this.lastItem = (this.lastItem + this.showItemsPrPage) > this.allItems ?
+        this.allItems : this.lastItem + this.showItemsPrPage;
     } else if (action === 'last') {
-      this.firstItem = this.allItems % this.showItemsPrPage === 0 ? this.allItems - this.showItemsPrPage : this.allItems - (this.allItems % this.showItemsPrPage) + 1;
+      this.firstItem = this.allItems % this.showItemsPrPage === 0 ?
+        this.allItems - this.showItemsPrPage : this.allItems - (this.allItems % this.showItemsPrPage) + 1;
       this.lastItem = this.allItems;
     }
   }


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