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/25 15:28:27 UTC

[incubator-dlab] branch DLAB-1541 updated: [DLAB-1585]: Fixed creation computational resources with the same name for second project

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

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


The following commit(s) were added to refs/heads/DLAB-1541 by this push:
     new b04499f  [DLAB-1585]: Fixed creation computational resources with the same name for second project
b04499f is described below

commit b04499f7f819942d2ea2f6b2726246c6ef7d1639
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Feb 25 17:27:32 2020 +0200

    [DLAB-1585]: Fixed creation computational resources with the same name for second project
---
 .../src/app/resources/resources-grid/resources-grid.component.ts  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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 ef8afa4..977f302 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
@@ -140,7 +140,7 @@ export class ResourcesGridComponent implements OnInit {
 
 
   public isResourcesInProgress(notebook) {
-    const env = this.getResourceByName(notebook.name);
+    const env = this.getResourceByName(notebook.name, notebook.project);
 
     if (env && env.resources.length) {
       return env.resources.filter(item => (item.status !== 'failed' && item.status !== 'terminated'
@@ -175,7 +175,7 @@ export class ResourcesGridComponent implements OnInit {
   }
 
   public exploratoryAction(data, action: string) {
-    const resource = this.getResourceByName(data.name);
+    const resource = this.getResourceByName(data.name, data.project);
 
     if (action === 'deploy') {
       this.dialog.open(ComputationalResourceCreateDialogComponent, { data: { notebook: resource, full_list: this.environments }, panelClass: 'modal-xxl' })
@@ -208,8 +208,8 @@ export class ResourcesGridComponent implements OnInit {
 
 
   // PRIVATE
-  private getResourceByName(notebook_name: string) {
-    return this.getEnvironmentsListCopy()
+  private getResourceByName(notebook_name: string, project_name: string) {
+    return this.getEnvironmentsListCopy().filter(environments => environments.project === project_name)
       .map(env => env.exploratory.find(({ name }) => name === notebook_name))
       .filter(name => !!name)[0];
   }


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