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

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

commit 91dfc62e05864ddcb426f993c3836791fefb7e83
Author: Dmytro Gnatyshyn <[email protected]>
AuthorDate: Thu Mar 19 12:29:44 2020 +0200

    [DLAB-1640]: Fixed actions requests in environment management
---
 .../management/management-grid/management-grid.component.ts         | 1 +
 .../src/app/administration/management/management.component.ts       | 1 +
 .../webapp/src/app/core/services/managementEnvironments.service.ts  | 4 ++--
 .../modal-dialog/confirmation-dialog/confirmation-dialog.model.ts   | 6 +++---
 4 files changed, 7 insertions(+), 5 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..0f24b95 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
@@ -148,6 +148,7 @@ export class ManagementGridComponent implements OnInit {
   }
 
   toggleResourceAction(environment: any, action: string, resource?): void {
+    console.log(environment.project);
     if (resource) {
       const resource_name = resource ? resource.computational_name : 
environment.name;
       this.dialog.open(ReconfirmationDialogComponent, {
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
index da2122b..d31783a 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
@@ -78,6 +78,7 @@ export class ManagementComponent implements OnInit {
       .environmentManagement(
         $event.environment.user,
         $event.action,
+        $event.environment.project,
         $event.environment.type === 'edge node' ? 'edge' : 
$event.environment.name,
         $event.resource ? $event.resource.computational_name : null
       ).subscribe(
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/core/services/managementEnvironments.service.ts
 
b/services/self-service/src/main/resources/webapp/src/app/core/services/managementEnvironments.service.ts
index 4b759b6..2d21fd5 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/core/services/managementEnvironments.service.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/core/services/managementEnvironments.service.ts
@@ -36,8 +36,8 @@ export class ManageEnvironmentsService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  environmentManagement(data, action: string, resource: string, 
computational?: string): Observable<{}> {
-    const params = computational ? `/${action}/${resource}/${computational}` : 
`/${action}/${resource}`;
+  environmentManagement(data, action: string, project: string, resource: 
string, computational?: string): Observable<{}> {
+    const params = computational ? 
`/${action}/${project}/${resource}/${computational}` : 
`/${action}/${project}/${resource}`;
     return this.applicationServiceFacade
       .buildEnvironmentManagement(params, data)
       .pipe(
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
 
b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
index 41c31cc..ddc9486 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
@@ -71,19 +71,19 @@ export class ConfirmationDialogModel {
 
   private stopExploratory(): Observable<{}> {
     return this.manageAction
-      ? 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
'stop', this.notebook.name)
+      ? 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
'stop', this.notebook.project, this.notebook.name)
       : this.userResourceService.suspendExploratoryEnvironment(this.notebook, 
'stop');
   }
 
   private terminateExploratory(): Observable<{}> {
     return this.manageAction
-      ? 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
'terminate', this.notebook.name)
+      ? 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
this.notebook.project, 'terminate', this.notebook.name)
       : this.userResourceService.suspendExploratoryEnvironment(this.notebook, 
'terminate');
   }
 
   private stopEdgeNode(): Observable<{}> {
     return this.manageAction
-      ? 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
'stop', 'edge')
+      ? 
this.manageEnvironmentsService.environmentManagement(this.notebook.user, 
this.notebook.project, 'stop', 'edge')
       : this.healthStatusService.suspendEdgeNode();
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to