You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by dg...@apache.org on 2021/01/19 10:35:51 UTC

[incubator-datalab] branch DATALAB-2237 created (now fe0a95e)

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

dgnatyshyn pushed a change to branch DATALAB-2237
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git.


      at fe0a95e  [DATALAB-2235]: Removed extra confirmation dialog if edge node does not have resources

This branch includes the following new commits:

     new fe0a95e  [DATALAB-2235]: Removed extra confirmation dialog if edge node does not have resources

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@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org


[incubator-datalab] 01/01: [DATALAB-2235]: Removed extra confirmation dialog if edge node does not have resources

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

dgnatyshyn pushed a commit to branch DATALAB-2237
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit fe0a95e6bb5ab398dc30bf1091af44725a75eb99
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Jan 19 12:35:32 2021 +0200

    [DATALAB-2235]: Removed extra confirmation dialog if edge node does not have resources
---
 .../administration/project/project.component.ts    | 27 +++++++++++++---------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
index 96da9d6..24855d1 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
@@ -128,17 +128,22 @@ export class ProjectComponent implements OnInit, OnDestroy {
       const projectsResources = this.resources.filter(resource => resource.project === data.project_name );
       const activeProjectsResources = projectsResources.length ? projectsResources[0].exploratory
         .filter(expl => expl.status !== 'terminated' && expl.status !== 'terminating' && expl.status !== 'failed') : [];
-      let termResources = [];
-      data.endpoint.forEach(v => {
-        termResources = [...termResources, ...activeProjectsResources.filter(resource => resource.endpoint === v)];
-      });
-
-      this.dialog.open(NotificationDialogComponent, { data: {
-        type: 'terminateNode', item: {action: data, resources: termResources.map(resource => resource.name)}
-        }, panelClass: 'modal-sm' })
-        .afterClosed().subscribe(result => {
-        result && this.edgeNodeAction(data, action);
-      });
+      const termResources = data.endpoint.reduce((res, endp) => {
+        res.push(...activeProjectsResources.filter(resource => resource.endpoint === endp));
+        return res;
+        }, []).map(resource => resource.name);
+
+      if (termResources.length === 0) {
+        this.edgeNodeAction(data, action);
+
+      } else {
+        this.dialog.open(NotificationDialogComponent, { data: {
+            type: 'terminateNode', item: {action: data, resources: termResources}
+          }, panelClass: 'modal-sm' })
+          .afterClosed().subscribe(result => {
+          result && this.edgeNodeAction(data, action);
+        });
+      }
     } else {
       this.edgeNodeAction(data, action);
     }


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