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/04/06 16:18:07 UTC

[incubator-dlab] branch DLAB-1571 updated: Fixed project terminating

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

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


The following commit(s) were added to refs/heads/DLAB-1571 by this push:
     new 2f467b7  Fixed project terminating
2f467b7 is described below

commit 2f467b74bcf2b68e1d8e722a93707f8e06dd45e8
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Apr 6 19:17:48 2020 +0300

    Fixed project terminating
---
 .../management/management-grid/management-grid.component.ts       | 4 ++--
 .../webapp/src/app/administration/project/project.component.ts    | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management-grid/management-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/management-grid/management-grid.component.ts
index 216d79c..d0ab9dc 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management-grid/management-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management-grid/management-grid.component.ts
@@ -162,11 +162,11 @@ export class ManagementGridComponent implements OnInit {
 
       if (action === 'stop') {
         this.dialog.open(ConfirmationDialogComponent, {
-          data: { notebook: environment, type: type, manageAction: this.isAdmin }, panelClass: 'modal-md'
+          data: { notebook: environment, type: type, manageAction: true }, panelClass: 'modal-md'
         }).afterClosed().subscribe(() => this.buildGrid());
       } else if (action === 'terminate') {
         this.dialog.open(ConfirmationDialogComponent, {
-          data: { notebook: environment, type: ConfirmationDialogType.TerminateExploratory, manageAction: this.isAdmin }, panelClass: 'modal-md'
+          data: { notebook: environment, type: ConfirmationDialogType.TerminateExploratory, manageAction: true }, panelClass: 'modal-md'
         }).afterClosed().subscribe(() => this.buildGrid());
       } else if (action === 'run') {
         this.healthStatusService.runEdgeNode().subscribe(() => {
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 d9b855e..d7442de 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
@@ -122,12 +122,12 @@ export class ProjectComponent implements OnInit, OnDestroy {
 
   private toggleStatusRequest(data, action) {
     if ( action === 'terminate') {
-      const projectsResources = this.resources
-        .filter(resource => resource.project === data.project_name )[0].exploratory
-        .filter(expl => expl.status !== 'terminated' && expl.status !== 'terminating' && expl.status !== 'failed');
+      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, ...projectsResources.filter(resource => resource.endpoint === v)];
+        termResources = [...termResources, ...activeProjectsResources.filter(resource => resource.endpoint === v)];
       });
 
       this.dialog.open(NotificationDialogComponent, { data: {


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