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/02/05 12:58:26 UTC

[incubator-dlab] branch DLAB-1522 created (now 126118e)

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

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


      at 126118e  [DLAB-1522]: Made notebook name unique per project

This branch includes the following new commits:

     new 126118e  [DLAB-1522]: Made notebook name unique per project

The 1 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] 01/01: [DLAB-1522]: Made notebook name unique per project

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

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

commit 126118e542c2d94f482ccf189e54bbafc264cc6f
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Wed Feb 5 14:57:51 2020 +0200

    [DLAB-1522]: Made notebook name unique per project
---
 .../create-environment/create-environment.component.ts        | 11 ++++++++---
 .../app/resources/resources-grid/resources-grid.component.ts  | 10 ++++++----
 .../edge-action-dialog/edge-action-dialog.component.ts        |  4 ++--
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
index eb32cec..852b242 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
@@ -27,7 +27,7 @@ import { UserResourceService, ProjectService } from '../../../core/services';
 import { CheckUtils, SortUtils, HTTP_STATUS_CODES, PATTERNS } from '../../../core/util';
 import { DICTIONARY } from '../../../../dictionary/global.dictionary';
 import { CLUSTER_CONFIGURATION } from '../../computational/computational-resource-create-dialog/cluster-configuration-templates';
-import {tap} from "rxjs/operators";
+import {tap} from 'rxjs/operators';
 
 @Component({
   selector: 'create-environment',
@@ -63,6 +63,9 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
   ngOnInit() {
     this.getUserProjects();
     this.initFormModel();
+    this.createExploratoryForm.get('project').valueChanges.subscribe(v =>
+      this.createExploratoryForm.get('name').updateValueAndValidity()
+    );
   }
 
   public getProjects() {
@@ -91,7 +94,9 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
   public getTemplates(project, endpoint) {
     this.userResourceService.getExploratoryTemplates(project, endpoint)
       .pipe(tap(results => {
-        results.sort((a,b) => (a.exploratory_environment_versions[0].template_name > b.exploratory_environment_versions[0].template_name) ? 1 : -1)
+        results.sort((a, b) =>
+          (a.exploratory_environment_versions[0].template_name > b.exploratory_environment_versions[0].template_name) ?
+            1 : -1);
       }))
       .subscribe(templates =>  {
         this.templates = templates;
@@ -147,7 +152,7 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
   }
 
   private checkDuplication(control) {
-    if (this.resourceGrid.containsNotebook(control.value))
+    if (this.createExploratoryForm && this.resourceGrid.containsNotebook(control.value, this.createExploratoryForm.controls.project.value))
       return { duplication: true };
   }
 
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 78bb38a..21545d0 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
@@ -125,11 +125,13 @@ export class ResourcesGridComponent implements OnInit {
     this.buildGrid();
   }
 
-  public containsNotebook(notebook_name: string): boolean {
+  public containsNotebook(notebook_name: string, project_name: string): boolean {
     if (notebook_name && this.environments && this.environments.length ) {
-      return this.environments
-        .filter(project => project.exploratory
-          .some(item => CheckUtils.delimitersFiltering(notebook_name) === CheckUtils.delimitersFiltering(item.name))).length > 0;
+      const currentProj = this.environments.filter(project => project.project === project_name);
+      if (currentProj.length) {
+        return currentProj[0].exploratory.some(item => CheckUtils.delimitersFiltering(notebook_name) === CheckUtils.delimitersFiltering(item.name));
+      }
+      return false;
     }
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts
index b514e78..ffa714a 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/edge-action-dialog/edge-action-dialog.component.ts
@@ -51,9 +51,9 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
     .action{text-transform: capitalize}
     .action-text { text-align: center; }
     .scrolling-content{overflow-y: auto; max-height: 200px; }
-    label { font-size: 15px; font-weight: 500; font-family: "Open Sans",sans-serif; cursor: pointer; display: flex; align-items: center;}
+    label { font-size: 15px; font-weight: 300; font-family: "Open Sans",sans-serif; cursor: pointer; display: flex; align-items: center; padding-left: 10px}
     label input {margin-top: 2px; margin-right: 10px;cursor: pointer;}
-    .all{font-size: 16px; font-weight: 600;}
+    .all{font-size: 16px; padding-left: 0; font-weight: 500}
     .scrolling-content{overflow-y: auto; max-height: 200px;}
   `]
 })


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