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/02/16 08:48:33 UTC

[incubator-datalab] branch DATALAB-2229 created (now ead9a79)

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

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


      at ead9a79  Addded service layer

This branch includes the following new commits:

     new ead9a79  Addded service layer

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: Addded service layer

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

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

commit ead9a791d5173e1124fe6bde1ee1c346662d0f1d
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Feb 16 10:48:08 2021 +0200

    Addded service layer
---
 .../configuration/configuration.component.html     | 51 +++++++++++++++-------
 .../configuration/configuration.component.scss     |  2 +-
 .../configuration/configuration.component.ts       |  6 +++
 .../app/administration/roles/roles.component.html  | 11 +++--
 .../app/administration/roles/roles.component.scss  |  7 +--
 .../services/applicationServiceFacade.service.ts   | 12 ++---
 .../app/core/services/configutration.service.ts    |  4 +-
 .../audit/audit-grid/audit-grid.component.html     |  7 ++-
 .../audit/audit-grid/audit-grid.component.scss     |  4 +-
 .../install-libraries.component.ts                 |  4 +-
 .../src/app/resources/resources.component.html     |  2 +-
 .../confirmation-dialog.component.html             | 13 +++++-
 .../webapp/src/assets/styles/_dialogs.scss         |  6 ++-
 .../src/main/resources/webapp/src/styles.scss      |  9 ++--
 14 files changed, 89 insertions(+), 49 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.html
index 6365210..14a8957 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.html
@@ -19,23 +19,42 @@
 
 <div class="base-retreat">
   <div class="sub-nav">
-    <ng-template [ngIf]="activeTab.index !== 0">
-      <button mat-raised-button class="butt"
-              (click)="action('save')"
-              [disabled]="!services['provisioning'].isConfigChanged && !services['self-service'].isConfigChanged && !services['billing'].isConfigChanged"
-      >
-        Save
-      </button>
-      <button mat-raised-button class="butt"
-              (click)="action('discard')"
-              [disabled]="!services['provisioning'].isConfigChanged && !services['self-service'].isConfigChanged && !services['billing'].isConfigChanged"
-      >
-        Discard changes
+    <div class="selection">
+      <div class="mat-reset">
+        <div class="control selector-wrapper" *ngIf="endpoints?.length > 1">
+          <mat-form-field>
+            <mat-label>Select endpoint</mat-label>
+            <mat-select [(value)]="activeEndpoint" panelClass="top-select">
+              <mat-option *ngFor="let endpoint of endpoints" [value]="endpoint"
+                          (click)="setActiveEndpoint(endpoint)">
+                {{ endpoint }}</mat-option>
+            </mat-select>
+            <button class="caret">
+              <i class="material-icons">keyboard_arrow_down</i>
+            </button>
+          </mat-form-field>
+        </div>
+      </div>
+    </div>
+    <div>
+      <ng-template [ngIf]="activeTab.index !== 0">
+        <button mat-raised-button class="butt"
+                (click)="action('save')"
+                [disabled]="!services['provisioning'].isConfigChanged && !services['self-service'].isConfigChanged && !services['billing'].isConfigChanged"
+        >
+          Save
+        </button>
+        <button mat-raised-button class="butt"
+                (click)="action('discard')"
+                [disabled]="!services['provisioning'].isConfigChanged && !services['self-service'].isConfigChanged && !services['billing'].isConfigChanged"
+        >
+          Discard changes
+        </button>
+      </ng-template>
+      <button mat-raised-button class="butt" (click)="refreshConfig()">
+        <i class="material-icons refresh-icon">autorenew</i>Refresh
       </button>
-    </ng-template>
-    <button mat-raised-button class="butt" (click)="refreshConfig()">
-      <i class="material-icons refresh-icon">autorenew</i>Refresh
-    </button>
+    </div>
   </div>
   <mat-divider></mat-divider>
   <div class="configuration-wrapper">
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.scss
index 40f533a..2707249 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.scss
@@ -83,7 +83,7 @@
   }
 }
 .sub-nav{
-  justify-content: flex-end;
+  justify-content: space-between;
 
   .butt{
     margin-left: 10px;
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.ts
index 2e416d2..8442fbd 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/configuration/configuration.component.ts
@@ -50,6 +50,8 @@ export class ConfigurationComponent implements OnInit, OnDestroy {
     discardChanges: 'Discard all unsaved changes.',
     saveChanges: 'After you save changes you need to restart service.',
   };
+  public activeEndpoint: string;
+  public endpoints: Array<string> = ['local', 'endpointAws', 'endpointGcp'];
 
   @HostListener('window:keydown', ['$event'])
   onKeyDown(event: KeyboardEvent) {
@@ -223,6 +225,10 @@ export class ConfigurationComponent implements OnInit, OnDestroy {
   public isServiceSelected(): boolean {
     return Object.keys(this.services).every(service => !this.services[service].selected);
   }
+
+  public setActiveEndpoint(endpoint: string) {
+    this.activeEndpoint = endpoint;
+  }
 }
 
 @Component({
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html
index 7db736a..400048c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html
@@ -103,12 +103,11 @@
         <th mat-header-cell *matHeaderCellDef class="name"> Group name </th>
         <td mat-cell *matCellDef="let element" class="name">
           <div class="d-flex">
-            <span [matTooltip]="element.group"
-                  matTooltipPosition="above"
-                  [matTooltipClass]="'full-size-tooltip'"
-                  [matTooltipDisabled]="element.group.length<30"
-                  class="ellipsis"
-            >
+            <span
+              class="ellipsis" 
+              [matTooltip]="element.group"
+              matTooltipPosition="above"
+              [matTooltipClass]="'full-size-tooltip'">
               {{element.group}}
             </span>
           </div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss
index 2704779..993d387 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss
@@ -352,15 +352,10 @@ table {
     padding-right: 10px;
     overflow: hidden;
     span{
-      overflow: hidden;
-      display: block;
+      cursor: default;
     }
   }
 
-  .roles {
-    width: 35%;
-  }
-
   .users {
     width: 35%;
   }
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 86374b0..251fcdb 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
@@ -79,7 +79,7 @@ export class ApplicationServiceFacade {
   private static readonly ENDPOINT = 'endpoint';
   private static readonly ENDPOINT_CONNECTION = 'endpoint_connection';
   private static readonly AUDIT = 'audit';
-  private static readonly ADMIN = 'admin';
+  private static readonly CONFIG = 'admin';
   private static readonly QUOTA = 'quota';
 
   private requestRegistry: Dictionary<string>;
@@ -676,13 +676,13 @@ export class ApplicationServiceFacade {
 
   public buildGetServiceConfig(data): Observable<any> {
     return this.buildRequest(HTTPMethod.GET,
-      this.requestRegistry.Item(ApplicationServiceFacade.ADMIN),
-      data, { responseType: 'text' });
+      this.requestRegistry.Item(ApplicationServiceFacade.CONFIG),
+      data);
   }
 
   public buildSetServiceConfig(data, body): Observable<any> {
     return this.buildRequest(HTTPMethod.POST,
-      this.requestRegistry.Item(ApplicationServiceFacade.ADMIN) + data,
+      this.requestRegistry.Item(ApplicationServiceFacade.CONFIG) + data,
       body, {
         // responseType: 'text',
         // headers: { 'Content-Type': 'text/plain' }
@@ -691,7 +691,7 @@ export class ApplicationServiceFacade {
 
   public buildRestartServices(data): Observable<any> {
     return this.buildRequest(HTTPMethod.POST,
-      this.requestRegistry.Item(ApplicationServiceFacade.ADMIN) + 'restart' + data,
+      this.requestRegistry.Item(ApplicationServiceFacade.CONFIG) + 'restart' + data,
       null );
   }
 
@@ -783,7 +783,7 @@ export class ApplicationServiceFacade {
     this.requestRegistry.Add(ApplicationServiceFacade.AUDIT, '/api/audit');
 
     // configuration
-    this.requestRegistry.Add(ApplicationServiceFacade.ADMIN, '/api/admin/');
+    this.requestRegistry.Add(ApplicationServiceFacade.CONFIG, '/api/config/multiple/');
   }
 
   private buildRequest(method: HTTPMethod, url_path: string, body: any, opt?) {
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/configutration.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/configutration.service.ts
index 99f012d..eda1a65 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/configutration.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/configutration.service.ts
@@ -39,7 +39,7 @@ export class ConfigurationService {
 
   public setServiceConfig(service: string, config: string): Observable<{}> {
     const settings = {
-      ymlString: config
+      local: config
     };
     service = this.convertProvisioning(service);
 
@@ -51,7 +51,7 @@ export class ConfigurationService {
   }
 
   public restartServices(self: boolean, prov: boolean, billing: boolean): Observable<{}> {
-    const queryString = `?billing=${billing}&provserv=${prov}&ui=${self}`;
+    const queryString = `?billing=${billing}&provserv=${prov}&ui=${self}&endpoints=${'local'}`;
     return this.applicationServiceFacade
       .buildRestartServices(queryString)
       .pipe(
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.html b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.html
index ea38b85..492c54c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.html
@@ -177,7 +177,12 @@
       </th>
       <td mat-cell *matCellDef="let element" class="th_resource">
         <div class="table-item-wrapper">
-          <span class="table-item">{{element.resourceName || 'N/A'}}</span>
+          <span 
+            class="ellipsis"
+            [matTooltip]="element.resourceName || 'N/A'"
+            matTooltipPosition="above">
+            {{element.resourceName || 'N/A'}}
+          </span>
         </div>
       </td>
       <td mat-footer-cell *matFooterCellDef class="table-footer" [hidden]="true">
diff --git a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.scss b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.scss
index 6abfc2f..4b289b6 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/reports/audit/audit-grid/audit-grid.component.scss
@@ -246,8 +246,8 @@
     justify-content: space-between;
     padding-right: 10px;
     span{
-      overflow: hidden;
-      text-overflow: ellipsis;
+      cursor: default;
+
       &::after{
         content: '';
         display: block;
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 45bc6d5..fb6d6c4 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
@@ -219,7 +219,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
           return lib.name.toLowerCase() === item.name.substring(0, item.name.lastIndexOf(':')).toLowerCase();
         });
       }
-    } else if ( this.autoComplete === 'NONE') {
+    } else if ( this.autoComplete === 'NONE' || (this.autoComplete === 'ENABLED' && !this.filteredList?.length && this.group !== 'java')) {
       this.selectedLib = {
         name: this.lib.name,
         version: this.lib.version,
@@ -232,6 +232,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
 
   public addLibrary(item): void {
     if ((this.autoComplete === 'ENABLED' && !this.isLibSelected && this.filteredList?.length)
+      || this.lib.name.trim().length < 2
       || (this.selectedLib && this.selectedLib.isInSelectedList) || this.isVersionInvalid || this.autoComplete === 'UPDATING') {
       return;
     }
@@ -585,6 +586,7 @@ export class ErrorLibMessageDialogComponent {
   `
   ]
 })
+
 export class LibInfoDialogComponent {
   constructor(
     public dialogRef: MatDialogRef<ErrorLibMessageDialogComponent>,
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.html
index 8a15434..82d6c69 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.html
@@ -35,7 +35,7 @@
         <div class="control selector-wrapper" *ngIf="projects?.length">
           <mat-form-field>
             <mat-label>Select project</mat-label>
-            <mat-select [(value)]="resourcesGrid.activeProject">
+            <mat-select [(value)]="resourcesGrid.activeProject" panelClass="top-select">
               <mat-option *ngIf="projects?.length > 1" (click)="setActiveProject('')">Show all</mat-option>
               <mat-option *ngFor="let project of projects" [value]="project"
                 (click)="setActiveProject(project)">
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.component.html b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.component.html
index 20b0cc1..973b597 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.component.html
@@ -39,7 +39,18 @@
       <div *ngIf="data.type === 4" class="text-center m-bot-20">
         <h4 class="strong">Group data will be updated.</h4>
       </div>
-      <p *ngIf="data.type === 4 && data.notebook.length" class="text-center delete-user">User<span *ngIf="data.notebook.length>1">s</span>  <span class="strong"> {{data.notebook.join(', ')}} </span>will be removed from this group. Removing may prevent the user<span *ngIf="data.notebook.length>1">s</span> to access {{data.notebook.length>1 ? 'their' : 'his/her'}} resources</p>
+      <p 
+        *ngIf="data.type === 4 && data.notebook.length" 
+        class="text-center delete-user scrolling" 
+        matTooltip="{{data.notebook.join(', ')}}"
+        matTooltipPosition="above"
+        matTooltipClass="group-updated-tooltip"
+      >
+        User<span *ngIf="data.notebook.length>1">s</span>  
+        <span class="strong" > {{data.notebook.join(', ')}} </span>
+        will be removed from this group. Removing may prevent the user
+        <span *ngIf="data.notebook.length>1">s</span> to access {{data.notebook.length>1 ? 'their' : 'his/her'}} resources
+      </p>
       <p *ngIf="data.type === 5" class="text-center delete-user">Removing the group<span *ngIf="data.notebook.length>1">s</span> <span class="strong">{{' ' + data.notebook}}</span> from the project may prevent the users from this group<span *ngIf="data.notebook.length>1">s</span> to access their resources</p>
         <div class="resource-list" *ngIf="data.type === 0 || data.type === 1">
           <div class="resource-list-header">
diff --git a/services/self-service/src/main/resources/webapp/src/assets/styles/_dialogs.scss b/services/self-service/src/main/resources/webapp/src/assets/styles/_dialogs.scss
index 18133c5..3c75e84 100644
--- a/services/self-service/src/main/resources/webapp/src/assets/styles/_dialogs.scss
+++ b/services/self-service/src/main/resources/webapp/src/assets/styles/_dialogs.scss
@@ -328,7 +328,7 @@ mat-dialog-container {
     }
   }
 
-  .create-resources-dialog {
+  .create-resources-dialog, .top-select {
     margin-left: 6px;
     min-width: calc(100% + 10px) !important;
   }
@@ -369,7 +369,9 @@ mat-dialog-container {
 .confirmation-dialog p.delete-user{
   font-weight: 500;
   max-height: 200px;
-  overflow: auto;
+  padding: 5px;
+  overflow: hidden auto;
+  text-overflow: ellipsis;
 }
 
 .bucket-browser{
diff --git a/services/self-service/src/main/resources/webapp/src/styles.scss b/services/self-service/src/main/resources/webapp/src/styles.scss
index 18cc884..b4c110a 100644
--- a/services/self-service/src/main/resources/webapp/src/styles.scss
+++ b/services/self-service/src/main/resources/webapp/src/styles.scss
@@ -530,14 +530,15 @@ input[type='number'] {
   }
 }
 
-.mat-tooltip-for-users {
-  overflow-wrap: break-word;
+.group-updated-tooltip {
+  word-break: break-all;
+  max-width: 400px !important;
 }
 
-.mat-tooltip-description {
+.mat-tooltip-for-users, .mat-tooltip-description {
   overflow-wrap: break-word;
 }
 
 .billing-user-name {
   word-break: break-all;
-}
\ No newline at end of file
+}


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