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/12 15:31:24 UTC

[incubator-datalab] 01/01: [DATALAB-2209]: Fixed possibility to install Java dependency and filters select on small screen

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

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

commit 2f11a1c8d0e04a6e29faba6d24add3bd1dab5496
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Jan 12 17:29:42 2021 +0200

    [DATALAB-2209]: Fixed possibility to install Java dependency and filters select on small screen
---
 .../src/app/administration/project/project.component.ts     |  1 -
 .../webapp/src/app/core/interceptors/error.interceptor.ts   |  7 ++-----
 .../webapp/src/app/core/services/project.service.ts         | 12 ++----------
 .../main/resources/webapp/src/app/core/util/errorUtils.ts   |  3 +--
 .../install-libraries/install-libraries.component.scss      | 13 ++++++++++---
 .../install-libraries/install-libraries.component.ts        |  2 ++
 6 files changed, 17 insertions(+), 21 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 1ea698a..96da9d6 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
@@ -149,7 +149,6 @@ export class ProjectComponent implements OnInit, OnDestroy {
       this.refreshGrid();
       this.toastr.success(`Edge node ${this.toEndpointAction(action)} is in progress!`, 'Processing!');
     }, error => {
-      console.log('edgeNodeAction', error);
       this.toastr.error(error.message, 'Oops!');
     });
   }
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/interceptors/error.interceptor.ts b/services/self-service/src/main/resources/webapp/src/app/core/interceptors/error.interceptor.ts
index a1fc63d..ac57d6c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/interceptors/error.interceptor.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/interceptors/error.interceptor.ts
@@ -28,9 +28,7 @@ import {
 } from '@angular/common/http';
 
 import { Observable, throwError } from 'rxjs';
-import { _throw } from 'rxjs/observable/throw';
 import { switchMap, filter, take, catchError } from 'rxjs/operators';
-
 import { StorageService, AppRoutingService, ApplicationSecurityService } from '../services';
 import { HTTP_STATUS_CODES } from '../util';
 
@@ -47,7 +45,7 @@ import { HTTP_STATUS_CODES } from '../util';
   intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
     return next.handle(request).pipe(
       catchError(error => {
-        if (error.error && error.error.message && error.error.message.indexOf('query param artifact') !== -1) return _throw(error);
+        if (error.error && error.error.message && error.error.message.indexOf('query param artifact') !== -1) return throwError(error);
         if (error instanceof HttpErrorResponse) {
           switch ((<HttpErrorResponse>error).status) {
             case HTTP_STATUS_CODES.UNAUTHORIZED:
@@ -55,13 +53,12 @@ import { HTTP_STATUS_CODES } from '../util';
             case HTTP_STATUS_CODES.BAD_REQUEST:
               return this.handleBadRequest(error, request, next);
             default:
-              console.log('interceptor', error);
               return throwError(error);
           }
         } else {
           this.routingService.redirectToLoginPage();
           this.jwtService.destroyTokens();
-          return _throw(error);
+          return throwError(error);
         }
       }));
   }
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 32416e8..e912503 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
@@ -64,19 +64,11 @@ export class ProjectService {
 
   public toggleProjectStatus(data, action): Observable<{}> {
     const url = `/${action}`;
-    this.applicationServiceFacade
-      .buildToggleProjectStatus(url, data).pipe(map(v => !!v)).subscribe(console.log);
     return this.applicationServiceFacade
       .buildToggleProjectStatus(url, data)
       .pipe(
-        map(response => {
-          console.log(response);
-          return response;
-        }),
-        catchError(err => {
-          console.log('service', typeof err, err);
-          return ErrorUtils.handleServiceError(err);
-        }));
+        map(response => response),
+        catchError(ErrorUtils.handleServiceError));
   }
 
   public updateProjectsBudget(data): Observable<{}> {
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/util/errorUtils.ts b/services/self-service/src/main/resources/webapp/src/app/core/util/errorUtils.ts
index 5a8ab20..1d5154d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/util/errorUtils.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/util/errorUtils.ts
@@ -41,9 +41,8 @@ export class ErrorUtils {
   // }
 
   public static handleServiceError(errorMessage) {
-    console.log('handleServiceError', errorMessage);
-    
     const error = CheckUtils.isJSON(errorMessage.error) ? JSON.parse(errorMessage.error) : errorMessage.error;
+
     return observableThrowError({
       status: error.code,
       statusText: errorMessage.statusText,
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.scss b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.scss
index 8aa03dd..0033c6d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.scss
@@ -336,7 +336,6 @@ mat-chip.mat-chip:not(.mat-basic-chip) {
   .mat-list {
     width: 100%;
     overflow-y: auto;
-    overflow-x: overlay;
     position: relative;
     height: 350px;
     padding-top: 0;
@@ -420,7 +419,7 @@ mat-chip.mat-chip:not(.mat-basic-chip) {
 
     .wrap-col {
       display: flex;
-      padding: 5px 0px;
+      padding: 5px 0;
 
       .lib-destination-col {
         width: 33.3%;
@@ -575,7 +574,9 @@ mat-chip.mat-chip:not(.mat-basic-chip) {
   .libs-info {
     .mat-list {
       height: 250px;
-
+      .dropdown-multiselect .list-menu{
+        max-height: 143px;
+      }
     }
   }
 }
@@ -584,6 +585,9 @@ mat-chip.mat-chip:not(.mat-basic-chip) {
     .libs-info {
       .mat-list {
         height: 200px;
+        .dropdown-multiselect .list-menu{
+          max-height: 94px;
+        }
       }
     }
   }
@@ -601,6 +605,9 @@ mat-chip.mat-chip:not(.mat-basic-chip) {
   .libs-info {
     .mat-list {
       height: 160px;
+      .dropdown-multiselect .list-menu{
+        max-height: 54px;
+      }
     }
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
index 72d6563..f2e913d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
@@ -180,6 +180,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
   public onUpdate($event) {
     if ($event.model.type === 'group_lib') {
       this.group = $event.model.value;
+      this.autoComplete = '';
       this.isLibSelected = false;
       if (this.group) {
         this.libSearch.enable();
@@ -230,6 +231,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
   }
 
   public addLibrary(item): void {
+    console.log(this.autoComplete, this.isLibSelected);
     if ((this.autoComplete === 'ENABLED' && !this.isLibSelected )
       || (this.selectedLib && this.selectedLib.isInSelectedList) || this.isVersionInvalid || this.autoComplete === 'UPDATING') {
       return;


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