You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by bh...@apache.org on 2019/11/14 13:41:43 UTC

[incubator-dlab] branch v2.2-RC1 updated: [DLAB-1214]: added request parameters to get project list per user (#412)

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

bhliva pushed a commit to branch v2.2-RC1
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/v2.2-RC1 by this push:
     new e1ff503  [DLAB-1214]: added request parameters to get project list per user (#412)
e1ff503 is described below

commit e1ff5032e4e3475c50e6f1387be592a6169ae647
Author: Andriana Kovalyshyn <an...@epam.com>
AuthorDate: Thu Nov 14 15:33:53 2019 +0200

    [DLAB-1214]: added request parameters to get project list per user (#412)
    
    * [DLAB-1214]: added request parameters to get project list per user
---
 .../src/app/core/services/applicationServiceFacade.service.ts     | 6 +++---
 .../resources/webapp/src/app/core/services/project.service.ts     | 5 +++--
 .../create-environment/create-environment.component.ts            | 4 ++--
 .../resources/webapp/src/app/resources/resources.component.ts     | 2 +-
 .../webapp/src/app/webterminal/webterminal.component.scss         | 2 +-
 .../resources/webapp/src/app/webterminal/webterminal.component.ts | 8 ++++----
 6 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
index 67c7010..cffcf03 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
@@ -74,7 +74,7 @@ export class ApplicationServiceFacade {
   private static readonly DOWNLOAD_REPORT = 'download_report';
   private static readonly SETTINGS = 'settings';
   private static readonly PROJECT = 'project';
-  private static readonly USER_PROJECT = 'project/me';
+  private static readonly USER_PROJECT = 'user_project';
   private static readonly ENDPOINT = 'endpoint';
 
   private requestRegistry: Dictionary<string>;
@@ -545,9 +545,9 @@ export class ApplicationServiceFacade {
       null);
   }
 
-  public buildGetUserProjectsList(): Observable<any> {
+  public buildGetUserProjectsList(params?): Observable<any> {
     return this.buildRequest(HTTPMethod.GET,
-      this.requestRegistry.Item(ApplicationServiceFacade.USER_PROJECT),
+      this.requestRegistry.Item(ApplicationServiceFacade.USER_PROJECT) + params,
       null);
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
index d623f52..0d03ec3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
@@ -52,9 +52,10 @@ export class ProjectService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public getUserProjectsList(): Observable<{}> {
+  public getUserProjectsList(isActive?): Observable<{}> {
+    const params = isActive ? '?active=true' : '';
     return this.applicationServiceFacade
-      .buildGetUserProjectsList()
+      .buildGetUserProjectsList(params)
       .pipe(
         map(response => response),
         catchError(ErrorUtils.handleServiceError));
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 b5c2a76..e42ea92 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
@@ -69,7 +69,7 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
   }
 
   public getUserProjects() {
-    this.projectService.getUserProjectsList().subscribe((projects: any) => {
+    this.projectService.getUserProjectsList(true).subscribe((projects: any) => {
       this.projects = projects;
       const activeProject = projects.find(item => item.name === this.resourceGrid.activeProject);
       if (this.resourceGrid.activeProject && activeProject) {
@@ -131,7 +131,7 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
 
   private getImagesList() {
     this.userResourceService.getUserImages(this.currentTemplate.image, this.createExploratoryForm.controls['project'].value,
-    this.createExploratoryForm.controls['endpoint'].value)
+      this.createExploratoryForm.controls['endpoint'].value)
       .subscribe((res: any) => this.images = res.filter(el => el.status === 'CREATED'),
         error => this.toastr.error(error.message || 'Images list loading failed!', 'Oops!'));
   }
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
index a31e129..bab05a7 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
@@ -90,7 +90,7 @@ export class ResourcesComponent implements OnInit {
   }
 
   private getProjects() {
-    this.projectService.getProjectsList().subscribe((projects: any) => this.projects = projects);
+    this.projectService.getUserProjectsList().subscribe((projects: any) => this.projects = projects);
   }
 
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/webterminal/webterminal.component.scss b/services/self-service/src/main/resources/webapp/src/app/webterminal/webterminal.component.scss
index 3ced756..7d986f4 100644
--- a/services/self-service/src/main/resources/webapp/src/app/webterminal/webterminal.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/webterminal/webterminal.component.scss
@@ -37,6 +37,6 @@
   height: 100%;
   flex-direction: column;
   align-items: center;
-  zoom: .85 !important;
+  // zoom: .85 !important;
   // -moz-transform: scale(.85);
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/webterminal/webterminal.component.ts b/services/self-service/src/main/resources/webapp/src/app/webterminal/webterminal.component.ts
index 8ec8127..7f796d1 100644
--- a/services/self-service/src/main/resources/webapp/src/app/webterminal/webterminal.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/webterminal/webterminal.component.ts
@@ -80,10 +80,10 @@ export class WebterminalComponent implements OnInit {
     // Mouse
     const mouse = new Guacamole.Mouse(guac.getDisplay().getElement());
     mouse.onmousemove = (mouseState) => {
-      if (navigator.userAgent.indexOf('Firefox') === -1) {
-        mouseState.x = mouseState.x + 125;
-        mouseState.y = mouseState.y + 65;
-      }
+      // if (navigator.userAgent.indexOf('Firefox') === -1) {
+      //   mouseState.x = mouseState.x + 125;
+      //   mouseState.y = mouseState.y + 65;
+      // }
       guac.sendMouseState(mouseState);
     }
 


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