You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/08/22 17:55:48 UTC

[incubator-dlab] 03/04: added tags into resources list grid

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

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

commit e4245e2f994b7fcaaeddcd699487ed30fdbbe04c
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu Aug 22 20:53:57 2019 +0300

    added tags into resources list grid
---
 .../resources-grid/resources-grid.component.html   | 85 +++++++++++++++++++++-
 .../resources-grid/resources-grid.component.scss   | 13 +++-
 .../resources-grid/resources-grid.component.ts     |  1 +
 3 files changed, 91 insertions(+), 8 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
index 4301874..946a156 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
@@ -22,9 +22,11 @@
     class="data-grid resources mat-elevation-z6">
 
     <ng-container matColumnDef="project">
-      <td mat-cell *matCellDef="let element" [attr.colspan]="6" class="highlight"> {{ element.project }} </td>
+      <td mat-cell *matCellDef="let element" [attr.colspan]="8" class="highlight"> {{ element.project }} </td>
     </ng-container>
-    <ng-container *ngFor="let column of filteringColumns; let i = index" matColumnDef="{{ column.name }}">
+
+    <!-- <ng-container *ngFor="let column of filteringColumns; let i = index" matColumnDef="{{ column.name }}"
+      [attr.sticky]="column.name === 'name' ? true : null">
       <th mat-header-cell *matHeaderCellDef ngClass="{{ column.class }}">
         <span class="label">{{ column.title }}</span>
         <button mat-icon-button *ngIf="column.filtering" aria-label="More" class="ar" (click)="toggleFilterRow()">
@@ -34,10 +36,71 @@
           </i>
         </button>
       </th>
+    </ng-container> -->
+
+    <ng-container matColumnDef="name" sticky>
+      <th mat-header-cell *matHeaderCellDef class="name-col">
+        <span class="label">Environment name</span>
+        <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()">
+          <i class="material-icons">
+            <span *ngIf="filtering && filterForm.name.length > 0 && !collapsedFilterRow">filter_list</span>
+            <span [hidden]="filtering && filterForm.name.length > 0 && !collapsedFilterRow">more_vert</span>
+          </i>
+        </button>
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="statuses">
+      <th mat-header-cell *matHeaderCellDef class="status-col">
+        <span class="label"> Status </span>
+        <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()">
+          <i class="material-icons">
+            <span *ngIf="filtering && filterForm.statuses.length > 0 && !collapsedFilterRow">filter_list</span>
+            <span [hidden]="filtering && filterForm.statuses.length > 0 && !collapsedFilterRow">more_vert</span>
+          </i>
+        </button>
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="shapes">
+      <th mat-header-cell *matHeaderCellDef class="shape-col">
+        <span class="label"> {{ DICTIONARY.instance_size }} </span>
+        <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()">
+          <i class="material-icons">
+            <span *ngIf="filtering && filterForm.shapes.length > 0 && !collapsedFilterRow">filter_list</span>
+            <span [hidden]="filtering && filterForm.shapes.length > 0 && !collapsedFilterRow">more_vert</span>
+          </i>
+        </button>
+      </th>
     </ng-container>
+    <ng-container matColumnDef="tag">
+      <th mat-header-cell *matHeaderCellDef class="tag-col">
+        <span class="label"> Tags </span>
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="resources">
+      <th mat-header-cell *matHeaderCellDef class="resources-col">
+        <span class="label"> {{ DICTIONARY.computational_resource }} </span>
+        <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()">
+          <i class="material-icons">
+            <span *ngIf="filtering && filterForm.resources.length > 0 && !collapsedFilterRow">filter_list</span>
+            <span [hidden]="filtering && filterForm.resources.length > 0 && !collapsedFilterRow">more_vert</span>
+          </i>
+        </button>
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="cost">
+      <th mat-header-cell *matHeaderCellDef class="cost-col">
+        <span class="label"> Cost </span>
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="actions" stickyEnd>
+      <th mat-header-cell *matHeaderCellDef class="actions-col"></th>
+    </ng-container>
+
+    <!-- ----------------------------------------------------- -->
+
     <ng-container matColumnDef="expandedDetail">
-      <td mat-cell *matCellDef="let element" class="exploratory" [attr.colspan]="6"
-        [@detailExpand]="element == expandedElement || forse ? 'expanded' : 'collapsed'">
+      <td mat-cell *matCellDef="let element" class="exploratory" [attr.colspan]="8"
+        [@detailExpand]="element == expandedElement || forse ? 'expanded' : 'collapsed'" sticky>
 
         <tr *ngFor="let element of element.exploratory; let i = index" class="element-row mat-row">
           <td class="name-col" (click)="printDetailEnvironmentModal(element)">{{ element.name }}</td>
@@ -46,6 +109,15 @@
           </td>
           <td class="shape-col">{{ element.shape }}</td>
 
+          <td class="tag-col">
+            <mat-chip-list aria-label="Fish selection">
+              <mat-chip>{{ element.tags.endpoint_tag }}</mat-chip>
+              <mat-chip>{{ element.tags.custom_tag }}</mat-chip>
+              <mat-chip>{{ element.tags.user_tag }}</mat-chip>
+              <mat-chip>{{ element.tags.project_tag }}</mat-chip>
+            </mat-chip-list>
+          </td>
+
           <td class="resources-col">
             <computational-resources-list [resources]="element.resources" [environment]="element"
               (buildGrid)="buildGrid($event)">
@@ -153,6 +225,11 @@
           [model]="filterForm.shapes"></multi-select-dropdown>
       </th>
     </ng-container>
+    <ng-container matColumnDef="tag-filter">
+      <th mat-header-cell *matHeaderCellDef class="tag-col">
+
+      </th>
+    </ng-container>
     <ng-container matColumnDef="resource-filter">
       <th mat-header-cell *matHeaderCellDef class="resources-col">
         <multi-select-dropdown (selectionChange)="onUpdate($event)" [type]="'resources'"
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.scss b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.scss
index 7ebaa93..aba13b9 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.scss
@@ -33,7 +33,7 @@ table {
     }
 
     th {
-      text-align: center;
+      // text-align: center;
     }
   }
 
@@ -62,18 +62,23 @@ table {
   }
 
   .name-col {
-    width: 20%;
+    width: 18%;
     padding-left: 24px;
     padding-right: 5px;
   }
 
   .status-col {
-    width: 16%;
+    width: 14%;
     padding: 5px;
   }
 
   .shape-col {
-    width: 16%;
+    width: 14%;
+    padding: 5px;
+  }
+
+  .tag-col {
+    width: 10%;
     padding: 5px;
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
index d9bb789..57df495 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
@@ -72,6 +72,7 @@ export class ResourcesGridComponent implements OnInit {
     { title: 'Environment name', name: 'name', class: 'name-col', filter_class: 'name-filter', filtering: true },
     { title: 'Status', name: 'statuses', class: 'status-col', filter_class: 'status-filter', filtering: true },
     { title: DICTIONARY.instance_size, name: 'shapes', class: 'shape-col', filter_class: 'shape-filter', filtering: true },
+    { title: 'Tags', name: 'tag', class: 'tag-col', filter_class: 'tag-filter', filtering: false },
     { title: DICTIONARY.computational_resource, name: 'resources', class: 'resources-col', filter_class: 'resource-filter', filtering: true },
     { title: 'Cost', name: 'cost', class: 'cost-col', filter_class: 'cost-filter', filtering: false },
     { title: '', name: 'actions', class: 'actions-col', filter_class: 'action-filter', filtering: false }


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