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/07/16 14:21:18 UTC

[incubator-dlab] branch feature/projects updated (80827ec -> bf5b7cc)

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

ankovalyshyn pushed a change to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


    from 80827ec  DLAB-000 added project_name param for check inactivity
     new 33ec031  [DLAB-867]: added filtering controls to resources list
     new 51033ac  [DLAB-867]: added filtering controls to resources list
     new a322bd8  [DLAB-867]: filtering by status and shapes
     new 218245a  [DLAB-867]: fixed issue with project edit
     new bf5b7cc  Merge branch 'feature/projects' of github.com:apache/incubator-dlab into feature/projects

The 5 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.


Summary of changes:
 .../project-list/project-list.component.html       |   2 +-
 .../resources-grid/resources-grid.component.html   |  72 +++++++++--
 .../resources-grid/resources-grid.component.scss   |  22 ++++
 .../resources-grid/resources-grid.component.ts     | 134 ++++++++++++---------
 4 files changed, 166 insertions(+), 64 deletions(-)


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


[incubator-dlab] 05/05: Merge branch 'feature/projects' of github.com:apache/incubator-dlab into feature/projects

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

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

commit bf5b7ccd703de76dbdd1e4cfad09015645f19f05
Merge: 218245a 80827ec
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jul 16 17:21:07 2019 +0300

    Merge branch 'feature/projects' of github.com:apache/incubator-dlab into feature/projects

 .../backendapi/service/impl/ProjectServiceImpl.java |  4 ++--
 .../mock_response/aws/project_terminate.json        | 12 ++++++++++++
 .../com/epam/dlab/backendapi/domain/ProjectDTO.java | 17 +++++++++++++++++
 .../resources/callback/ProjectCallback.java         |  3 ++-
 .../service/impl/EnvironmentServiceImpl.java        | 21 +++++++++++++--------
 .../epam/dlab/backendapi/util/RequestBuilder.java   |  6 ++++--
 6 files changed, 50 insertions(+), 13 deletions(-)


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


[incubator-dlab] 01/05: [DLAB-867]: added filtering controls to resources list

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

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

commit 33ec031d08f7b6a6ea4f46cf298a41c3358a1283
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Mon Jul 15 15:23:39 2019 +0300

    [DLAB-867]: added filtering controls to resources list
---
 .../resources-grid/resources-grid.component.html   | 61 +++++++++++++++++++---
 .../resources-grid/resources-grid.component.ts     | 16 +++---
 2 files changed, 61 insertions(+), 16 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 feba6d0..bdd30a7 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
@@ -24,19 +24,13 @@
     <ng-container matColumnDef="project">
       <td mat-cell *matCellDef="let element" [attr.colspan]="6" class="highlight"> {{ element.project }} </td>
     </ng-container>
-
-
     <ng-container *ngFor="let column of filteringColumns; let i = index" matColumnDef="{{ column.name }}">
       <th mat-header-cell *matHeaderCellDef ngClass="{{ column.class }}"> {{ column.title }} </th>
     </ng-container>
-
-
     <ng-container matColumnDef="expandedDetail">
-
       <td mat-cell *matCellDef="let element" class="exploratory" [attr.colspan]="6"
         [@detailExpand]="element == expandedElement || forse ? 'expanded' : 'collapsed'">
 
-
         <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>
           <td class="status-col status" ngClass="{{ element.status.toLowerCase() || ''}}">
@@ -133,13 +127,63 @@
       </td>
     </ng-container>
 
+    <!-- FILTER START -->
+    <ng-container matColumnDef="name-filter" sticky>
+      <th mat-header-cell *matHeaderCellDef>
+        <input placeholder="Filter by environment name" type="text" class="form-control filter-field"
+          [value]="filterForm.name" (input)="filterForm.name = $event.target.value" />
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="status-filter">
+      <th mat-header-cell *matHeaderCellDef>
+        <multi-select-dropdown (selectionChange)="onUpdate($event)" [type]="'statuses'"
+          [items]="filterConfiguration.statuses" [model]="filterForm.statuses"></multi-select-dropdown>
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="shape-filter">
+      <th mat-header-cell *matHeaderCellDef>
+        <multi-select-dropdown (selectionChange)="onUpdate($event)"
+          [type]="DICTIONARY.cloud_provider === 'aws' ? 'shapes': 'sizes'" [items]="filterConfiguration.shapes"
+          [model]="filterForm.shapes"></multi-select-dropdown>
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="resource-filter">
+      <th mat-header-cell *matHeaderCellDef>
+        <multi-select-dropdown (selectionChange)="onUpdate($event)" [type]="'resources'"
+          [items]="filterConfiguration.resources" [model]="filterForm.resources"></multi-select-dropdown>
+      </th>
+    </ng-container>
+    <ng-container matColumnDef="cost-filter">
+      <th mat-header-cell *matHeaderCellDef>
+
+      </th>
+    </ng-container>
+
+    <ng-container matColumnDef="action-filter" stickyEnd>
+      <th mat-header-cell *matHeaderCellDef>
+        <div class="actions">
+          <button mat-icon-button class="btn reset" (click)="resetFilterConfigurations()">
+            <i class="material-icons">close</i>
+          </button>
+
+          <button mat-icon-button class="btn apply" (click)="applyFilter_btnClick(filterForm)"
+            [disabled]="filteredEnvironments.length == 0 && !filtering">
+            <i class="material-icons"
+              [ngClass]="{'not-allowed': filteredEnvironments.length == 0 && !filtering}">done</i>
+          </button>
+        </div>
+      </th>
+    </ng-container>
+
+    <!-- FILTER END -->
+
     <tr mat-header-row *matHeaderRowDef="displayedColumns" class="header-row"></tr>
 
+    <tr mat-header-row *matHeaderRowDef="displayedFilterColumns; sticky: true" class="filter-row"></tr>
     <tr mat-row *matRowDef="let element; columns: ['project']" class="element-row"
       [class.expanded-row]="expandedElement === element"
       (click)="expandedElement = expandedElement === element ? null : element">
     </tr>
-
     <tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="detail-row"></tr>
 
   </table>
@@ -167,6 +211,9 @@
           </th>
         </tr>
 
+
+
+
         <tr *ngIf="filteredEnvironments && collapseFilterRow" class="filter-row">
           <td>
             <input placeholder="Filter by environment name" type="text" class="form-control filter-field"
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 d1084eb..7bc9595 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
@@ -56,9 +56,6 @@ import { DICTIONARY } from '../../../dictionary/global.dictionary';
 export class ResourcesGridComponent implements OnInit {
   readonly DICTIONARY = DICTIONARY;
 
-  // displayedColumns: string[] = ['name', 'status', 'shape', 'resources', 'cost', 'actions'];
-  displayedFilterColumns: string[] = ['name-filter', 'user-filter', 'type-filter', 'status-filter', 'shape-filter', 'service-filter', 'actions'];
-
   environments: Exploratory[];
   forse: boolean = true;
 
@@ -76,15 +73,16 @@ export class ResourcesGridComponent implements OnInit {
   healthStatus: GeneralEnvironmentStatus;
 
   public filteringColumns: Array<any> = [
-    { title: 'Environment name', name: 'name', class: 'name-col', filtering: {} },
-    { title: 'Status', name: 'statuses', class: 'status-col', filtering: {} },
-    { title: DICTIONARY.instance_size, name: 'shapes', class: 'shape-col', filtering: {} },
-    { title: DICTIONARY.computational_resource, name: 'resources', class: 'resources-col', filtering: {} },
-    { title: 'Cost', name: 'cost', class: 'cost-col' },
-    { title: '', name: 'actions', class: 'actions-col' }
+    { title: 'Environment name', name: 'name', class: 'name-col', filter: 'name-filter' },
+    { title: 'Status', name: 'statuses', class: 'status-col', filter: 'status-filter' },
+    { title: DICTIONARY.instance_size, name: 'shapes', class: 'shape-col', filter: 'shape-filter' },
+    { title: DICTIONARY.computational_resource, name: 'resources', class: 'resources-col', filter: 'resource-filter' },
+    { title: 'Cost', name: 'cost', class: 'cost-col', filter: 'cost-filter' },
+    { title: '', name: 'actions', class: 'actions-col', filter: 'action-filter' }
   ];
 
   displayedColumns: string[] = this.filteringColumns.map(item => item.name);
+  displayedFilterColumns: string[] = this.filteringColumns.map(item => item.filter);
 
   constructor(
     public toastr: ToastrService,


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


[incubator-dlab] 03/05: [DLAB-867]: filtering by status and shapes

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

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

commit a322bd86cb3ddaccc57600bc549a99ab7b206498
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jul 16 17:20:17 2019 +0300

    [DLAB-867]: filtering by status and shapes
---
 .../resources-grid/resources-grid.component.html   |   4 +-
 .../resources-grid/resources-grid.component.scss   |   6 ++
 .../resources-grid/resources-grid.component.ts     | 101 +++++++++++++--------
 3 files changed, 70 insertions(+), 41 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 62c1022..bda825c 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
@@ -157,8 +157,8 @@
     </ng-container>
     <ng-container matColumnDef="resource-filter">
       <th mat-header-cell *matHeaderCellDef class="resources-col">
-        <multi-select-dropdown (selectionChange)="onUpdate($event)" [type]="'resources'"
-          [items]="filterConfiguration.resources" [model]="filterForm.resources"></multi-select-dropdown>
+        <!-- <multi-select-dropdown (selectionChange)="onUpdate($event)" [type]="'resources'"
+          [items]="filterConfiguration.resources" [model]="filterForm.resources"></multi-select-dropdown> -->
       </th>
     </ng-container>
     <ng-container matColumnDef="cost-filter">
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 cf2d788..b984844 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
@@ -47,6 +47,12 @@ table {
 
   .filter-row {
     height: 0 !important;
+
+    th {
+      &:last-child {
+        padding-right: 6px;
+      }
+    }
   }
 
   .name-col {
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 a7f868e..a3ec44c 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
@@ -58,20 +58,10 @@ export class ResourcesGridComponent implements OnInit {
 
   environments: Exploratory[];
   forse: boolean = true;
-
-
-
-
   filteredEnvironments: Exploratory[] = [];
   filterConfiguration: FilterConfigurationModel = new FilterConfigurationModel('', [], [], [], '');
   filterForm: FilterConfigurationModel = new FilterConfigurationModel('', [], [], [], '');
 
-  isOutscreenDropdown: boolean;
-  collapseFilterRow: boolean = false;
-  filtering: boolean = false;
-  activeFiltering: boolean = false;
-  healthStatus: GeneralEnvironmentStatus;
-
   public filteringColumns: Array<any> = [
     { 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 },
@@ -81,8 +71,25 @@ export class ResourcesGridComponent implements OnInit {
     { title: '', name: 'actions', class: 'actions-col', filter_class: 'action-filter', filtering: false }
   ];
 
-  displayedColumns: string[] = this.filteringColumns.map(item => item.name);
-  displayedFilterColumns: string[] = this.filteringColumns.map(item => item.filter_class);
+  public displayedColumns: string[] = this.filteringColumns.map(item => item.name);
+  public displayedFilterColumns: string[] = this.filteringColumns.map(item => item.filter_class);
+
+
+
+
+
+
+
+  isOutscreenDropdown: boolean;
+  collapseFilterRow: boolean = false;
+  filtering: boolean = false;
+  activeFiltering: boolean = false;
+  healthStatus: GeneralEnvironmentStatus;
+
+
+
+
+
 
   constructor(
     public toastr: ToastrService,
@@ -109,9 +116,8 @@ export class ResourcesGridComponent implements OnInit {
 
 
 
-
-
-  getDefaultFilterConfiguration(): void {
+  // PRIVATE
+  private getDefaultFilterConfiguration(): void {
     const data: Exploratory[] = this.environments;
     const shapes = [], statuses = [], resources = [];
 
@@ -130,36 +136,53 @@ export class ResourcesGridComponent implements OnInit {
     }));
 
     this.filterConfiguration = new FilterConfigurationModel('', statuses, shapes, resources, '');
+  }
 
-    debugger;
+
+
+  private getEnvironmentsListCopy() {
+    // let filteredData: any = this.environments.map(env => (<any>Object).create(env));
+    return this.environments.map(env => JSON.parse(JSON.stringify(env)));
   }
 
+
+
+
   applyFilter_btnClick(config: FilterConfigurationModel) {
     this.filtering = true;
+    let filteredData = this.getEnvironmentsListCopy();
 
-    let filteredData: Exploratory[] = this.environments.map(env => (<any>Object).assign({}, env));
-    // let filteredData: any = this.environments.map(env => (<any>Object).create(env));
-    // const containsStatus = (list, selectedItems) => {
-    //   return list.filter((item: any) => { if (selectedItems.indexOf(item.status) !== -1) return item; });
-    // };
-
-    // config && (filteredData = filteredData.filter((item: any) => {
-    //   const isName = item.name.toLowerCase().indexOf(config.name.toLowerCase()) !== -1;
-    //   const isStatus = config.statuses.length > 0 ? (config.statuses.indexOf(item.status) !== -1) : (config.type !== 'active');
-    //   const isShape = config.shapes.length > 0 ? (config.shapes.indexOf(item.shape) !== -1) : true;
-
-    //   const modifiedResources = containsStatus(item.resources, config.resources);
-    //   let isResources = config.resources.length > 0 ? (modifiedResources.length > 0) : true;
-
-    //   if (config.resources.length > 0 && modifiedResources.length > 0) { item.resources = modifiedResources; }
-    //   if (config.resources.length === 0 && config.type === 'active' ||
-    //     modifiedResources.length >= 0 && config.resources.length > 0 && config.type === 'active') {
-    //     item.resources = modifiedResources;
-    //     isResources = true;
-    //   }
-
-    //   return isName && isStatus && isShape && isResources;
-    // }));
+
+    const containsStatus = (list, selectedItems) => {
+      debugger;
+      return list.filter((item: any) => { if (selectedItems.indexOf(item.status) !== -1) return item; });
+    };
+
+    config && (filteredData.forEach((project: any) => {
+
+
+      debugger;
+
+      project.exploratory = project.exploratory.filter(item => {
+
+        const isName = item.name.toLowerCase().indexOf(config.name.toLowerCase()) !== -1;
+        const isStatus = config.statuses.length > 0 ? (config.statuses.indexOf(item.status) !== -1) : (config.type !== 'active');
+        const isShape = config.shapes.length > 0 ? (config.shapes.indexOf(item.shape) !== -1) : true;
+
+        const modifiedResources = containsStatus(item.resources, config.resources);
+        let isResources = config.resources.length > 0 ? (modifiedResources.length > 0) : true;
+
+        if (config.resources.length > 0 && modifiedResources.length > 0) { item.resources = modifiedResources; }
+
+        if (config.resources.length === 0 && config.type === 'active' ||
+          modifiedResources.length >= 0 && config.resources.length > 0 && config.type === 'active') {
+          item.resources = modifiedResources;
+          isResources = true;
+        }
+        // && isResources
+        return isName && isStatus && isShape;
+      })
+    }));
 
     config && this.updateUserPreferences(config);
     this.filteredEnvironments = filteredData;


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


[incubator-dlab] 02/05: [DLAB-867]: added filtering controls to resources list

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

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

commit 51033ac9d2fbf8a006e94822bc7171a4bd9657f0
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jul 16 14:46:30 2019 +0300

    [DLAB-867]: added filtering controls to resources list
---
 .../resources-grid/resources-grid.component.html   | 21 +++++---
 .../resources-grid/resources-grid.component.scss   | 16 ++++++
 .../resources-grid/resources-grid.component.ts     | 59 ++++++++++++----------
 3 files changed, 62 insertions(+), 34 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 bdd30a7..62c1022 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
@@ -25,7 +25,15 @@
       <td mat-cell *matCellDef="let element" [attr.colspan]="6" class="highlight"> {{ element.project }} </td>
     </ng-container>
     <ng-container *ngFor="let column of filteringColumns; let i = index" matColumnDef="{{ column.name }}">
-      <th mat-header-cell *matHeaderCellDef ngClass="{{ column.class }}"> {{ column.title }} </th>
+      <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()">
+          <i class="material-icons">
+            <span *ngIf="filtering && filterForm[column.name].length > 0 && !collapseFilterRow">filter_list</span>
+            <span [hidden]="filtering && filterForm[column.name].length > 0 && !collapseFilterRow">more_vert</span>
+          </i>
+        </button>
+      </th>
     </ng-container>
     <ng-container matColumnDef="expandedDetail">
       <td mat-cell *matCellDef="let element" class="exploratory" [attr.colspan]="6"
@@ -129,32 +137,32 @@
 
     <!-- FILTER START -->
     <ng-container matColumnDef="name-filter" sticky>
-      <th mat-header-cell *matHeaderCellDef>
+      <th mat-header-cell *matHeaderCellDef class="name-col">
         <input placeholder="Filter by environment name" type="text" class="form-control filter-field"
           [value]="filterForm.name" (input)="filterForm.name = $event.target.value" />
       </th>
     </ng-container>
     <ng-container matColumnDef="status-filter">
-      <th mat-header-cell *matHeaderCellDef>
+      <th mat-header-cell *matHeaderCellDef class="status-col">
         <multi-select-dropdown (selectionChange)="onUpdate($event)" [type]="'statuses'"
           [items]="filterConfiguration.statuses" [model]="filterForm.statuses"></multi-select-dropdown>
       </th>
     </ng-container>
     <ng-container matColumnDef="shape-filter">
-      <th mat-header-cell *matHeaderCellDef>
+      <th mat-header-cell *matHeaderCellDef class="shape-col">
         <multi-select-dropdown (selectionChange)="onUpdate($event)"
           [type]="DICTIONARY.cloud_provider === 'aws' ? 'shapes': 'sizes'" [items]="filterConfiguration.shapes"
           [model]="filterForm.shapes"></multi-select-dropdown>
       </th>
     </ng-container>
     <ng-container matColumnDef="resource-filter">
-      <th mat-header-cell *matHeaderCellDef>
+      <th mat-header-cell *matHeaderCellDef class="resources-col">
         <multi-select-dropdown (selectionChange)="onUpdate($event)" [type]="'resources'"
           [items]="filterConfiguration.resources" [model]="filterForm.resources"></multi-select-dropdown>
       </th>
     </ng-container>
     <ng-container matColumnDef="cost-filter">
-      <th mat-header-cell *matHeaderCellDef>
+      <th mat-header-cell *matHeaderCellDef class="cost-col">
 
       </th>
     </ng-container>
@@ -180,6 +188,7 @@
     <tr mat-header-row *matHeaderRowDef="displayedColumns" class="header-row"></tr>
 
     <tr mat-header-row *matHeaderRowDef="displayedFilterColumns; sticky: true" class="filter-row"></tr>
+
     <tr mat-row *matRowDef="let element; columns: ['project']" class="element-row"
       [class.expanded-row]="expandedElement === element"
       (click)="expandedElement = expandedElement === element ? null : element">
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 c40c2cd..cf2d788 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
@@ -24,6 +24,13 @@
 table {
   width: 100%;
 
+  .header-row {
+    .label {
+      display: inline-block;
+      padding-top: 10px;
+    }
+  }
+
   .exploratory {
     padding: 0;
 
@@ -35,6 +42,11 @@ table {
         border-bottom: 1px solid #d9d9d9;
       }
     }
+
+  }
+
+  .filter-row {
+    height: 0 !important;
   }
 
   .name-col {
@@ -44,19 +56,23 @@ table {
 
   .status-col {
     width: 16%;
+    padding: 5px;
   }
 
   .shape-col {
     width: 16%;
+    padding: 5px;
   }
 
   .resources-col {
     width: 30%;
+    padding: 5px;
   }
 
   .cost-col {
     width: 10%;
     text-align: center;
+
   }
 
   .actions-col {
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 7bc9595..a7f868e 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
@@ -63,7 +63,7 @@ export class ResourcesGridComponent implements OnInit {
 
 
   filteredEnvironments: Exploratory[] = [];
-  filterConfiguration: FilterConfigurationModel;
+  filterConfiguration: FilterConfigurationModel = new FilterConfigurationModel('', [], [], [], '');
   filterForm: FilterConfigurationModel = new FilterConfigurationModel('', [], [], [], '');
 
   isOutscreenDropdown: boolean;
@@ -73,16 +73,16 @@ export class ResourcesGridComponent implements OnInit {
   healthStatus: GeneralEnvironmentStatus;
 
   public filteringColumns: Array<any> = [
-    { title: 'Environment name', name: 'name', class: 'name-col', filter: 'name-filter' },
-    { title: 'Status', name: 'statuses', class: 'status-col', filter: 'status-filter' },
-    { title: DICTIONARY.instance_size, name: 'shapes', class: 'shape-col', filter: 'shape-filter' },
-    { title: DICTIONARY.computational_resource, name: 'resources', class: 'resources-col', filter: 'resource-filter' },
-    { title: 'Cost', name: 'cost', class: 'cost-col', filter: 'cost-filter' },
-    { title: '', name: 'actions', class: 'actions-col', filter: 'action-filter' }
+    { 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: 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 }
   ];
 
   displayedColumns: string[] = this.filteringColumns.map(item => item.name);
-  displayedFilterColumns: string[] = this.filteringColumns.map(item => item.filter);
+  displayedFilterColumns: string[] = this.filteringColumns.map(item => item.filter_class);
 
   constructor(
     public toastr: ToastrService,
@@ -92,7 +92,6 @@ export class ResourcesGridComponent implements OnInit {
 
   ngOnInit(): void {
     this.buildGrid();
-    debugger;
   }
 
   public buildGrid(): void {
@@ -104,35 +103,35 @@ export class ResourcesGridComponent implements OnInit {
       });
   }
 
+  public toggleFilterRow(): void {
+    this.collapseFilterRow = !this.collapseFilterRow;
+  }
 
 
 
 
 
-
-  toggleFilterRow(): void {
-    this.collapseFilterRow = !this.collapseFilterRow;
-  }
-
   getDefaultFilterConfiguration(): void {
-    // const data: Exploratory[] = this.environments;
+    const data: Exploratory[] = this.environments;
     const shapes = [], statuses = [], resources = [];
 
-    // data.forEach((item: any) => {
-    //   if (shapes.indexOf(item.shape) === -1)
-    //     shapes.push(item.shape);
-    //   if (statuses.indexOf(item.status) === -1)
-    //     statuses.push(item.status);
-    //   statuses.sort(SortUtil.statusSort);
-
-    //   item.resources.forEach((resource: any) => {
-    //     if (resources.indexOf(resource.status) === -1)
-    //       resources.push(resource.status);
-    //     resources.sort(SortUtil.statusSort);
-    //   });
-    // });
+    data.filter(elem => elem.exploratory.forEach((item: any) => {
+      if (shapes.indexOf(item.shape) === -1)
+        shapes.push(item.shape);
+      if (statuses.indexOf(item.status) === -1)
+        statuses.push(item.status);
+      statuses.sort(SortUtils.statusSort);
+
+      item.resources.forEach((resource: any) => {
+        if (resources.indexOf(resource.status) === -1)
+          resources.push(resource.status);
+        resources.sort(SortUtils.statusSort);
+      });
+    }));
 
     this.filterConfiguration = new FilterConfigurationModel('', statuses, shapes, resources, '');
+
+    debugger;
   }
 
   applyFilter_btnClick(config: FilterConfigurationModel) {
@@ -298,4 +297,8 @@ export class ResourcesGridComponent implements OnInit {
         .afterClosed().subscribe(() => this.buildGrid());
     }
   }
+
+
+
+
 }


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


[incubator-dlab] 04/05: [DLAB-867]: fixed issue with project edit

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

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

commit 218245abbb90a5fb050dcfb7ddc22249c8c7774f
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jul 16 17:20:56 2019 +0300

    [DLAB-867]: fixed issue with project edit
---
 .../app/administration/project/project-list/project-list.component.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
index 449d0f8..9ae3c82 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
@@ -63,7 +63,7 @@
       </span>
       <span [ngClass]="{'not-active' : element.status !== 'ACTIVE' && element.status !== 'NOT_ACTIVE' }">
         <a [ngClass]="{'not-allowed' : element.status !== 'ACTIVE' && element.status !== 'NOT_ACTIVE' }"
-          (click)="element.status === 'ACTIVE' && editProject(element)">
+          (click)="editProject(element)">
           <mat-icon>mode_edit</mat-icon>
         </a>
       </span>


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