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/29 14:09:22 UTC

[incubator-dlab] 01/04: [DLAB-845]: added validation check for uniq env name per user

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

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

commit 368bdc9418f730c95ab3dced085573c8a48cac62
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Mon Jul 29 16:20:18 2019 +0300

    [DLAB-845]: added validation check for uniq env name per user
---
 .../resources-grid/resources-grid.component.html   |  6 +--
 .../resources-grid/resources-grid.component.ts     | 50 ++++++++++------------
 2 files changed, 26 insertions(+), 30 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 c0aa2f6..6eb2810 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
@@ -29,8 +29,8 @@
         <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 && collapsedFilterRow">filter_list</span>
-            <span [hidden]="filtering && filterForm[column.name].length > 0 && collapsedFilterRow">more_vert</span>
+            <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>
@@ -194,7 +194,7 @@
 
     <tr mat-header-row *matHeaderRowDef="displayedColumns" class="header-row"></tr>
 
-    <tr [hidden]="!collapsedFilterRow" mat-header-row *matHeaderRowDef="displayedFilterColumns; sticky: true"
+    <tr [hidden]="!collapseFilterRow" mat-header-row *matHeaderRowDef="displayedFilterColumns; sticky: true"
       class="filter-row"></tr>
 
     <tr mat-row *matRowDef="let element; columns: ['project']" class="element-row"
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 c55c29f..621b299 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
@@ -59,8 +59,10 @@ export class ResourcesGridComponent implements OnInit {
   environments: Exploratory[];
   forse: boolean = true;
 
-  collapsedFilterRow: boolean = false;
-
+  collapseFilterRow: boolean = false;
+  filtering: boolean = false;
+  activeFiltering: boolean = false;
+  healthStatus: GeneralEnvironmentStatus;
 
   filteredEnvironments: Exploratory[] = [];
   filterConfiguration: FilterConfigurationModel = new FilterConfigurationModel('', [], [], [], '');
@@ -82,12 +84,6 @@ export class ResourcesGridComponent implements OnInit {
 
 
 
-  isOutscreenDropdown: boolean;
-
-  filtering: boolean = false;
-  activeFiltering: boolean = false;
-  healthStatus: GeneralEnvironmentStatus;
-
 
 
 
@@ -116,9 +112,25 @@ export class ResourcesGridComponent implements OnInit {
   }
 
   public toggleFilterRow(): void {
-    this.collapsedFilterRow = !this.collapsedFilterRow;
+    this.collapseFilterRow = !this.collapseFilterRow;
   }
 
+  public onUpdate($event) {
+    this.filterForm[$event.type] = $event.model;
+  }
+
+  public showActiveInstances(): void {
+    this.filterForm = this.loadUserPreferences(this.filterActiveInstances());
+    this.applyFilter_btnClick(this.filterForm);
+    this.buildGrid();
+  }
+
+  public containsNotebook(notebook_name: string): boolean {
+    if (notebook_name)
+      return this.environments
+        .filter(project => project.exploratory
+          .some(item => CheckUtils.delimitersFiltering(notebook_name) === CheckUtils.delimitersFiltering(item.name))).length > 0;
+  }
 
 
   // PRIVATE
@@ -189,11 +201,7 @@ export class ResourcesGridComponent implements OnInit {
 
 
 
-  showActiveInstances(): void {
-    this.filterForm = this.loadUserPreferences(this.filterActiveInstances());
-    this.applyFilter_btnClick(this.filterForm);
-    this.buildGrid();
-  }
+
 
   isResourcesInProgress(notebook) {
     // const filteredEnv = this.environments.find(env => env.exploratory.find(el => el.name === notebook.name));
@@ -240,9 +248,7 @@ export class ResourcesGridComponent implements OnInit {
         this.activeFiltering = true;
   }
 
-  onUpdate($event) {
-    this.filterForm[$event.type] = $event.model;
-  }
+
 
   resetFilterConfigurations(): void {
     this.filterForm.resetConfigurations();
@@ -251,16 +257,6 @@ export class ResourcesGridComponent implements OnInit {
   }
 
 
-
-  containsNotebook(notebook_name: string): boolean {
-    // if (notebook_name)
-    //   for (let index = 0; index < this.environments.length; index++)
-    //     if (CheckUtils.delimitersFiltering(notebook_name) === CheckUtils.delimitersFiltering(this.environments[index].name))
-    //       return true;
-
-    return false;
-  }
-
   getUserPreferences(): void {
     this.userResourceService.getUserPreferences()
       .subscribe((result: FilterConfigurationModel) => {


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