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/07/13 14:03:26 UTC

[incubator-dlab] branch DLAB-1749 updated (a4ce996 -> cdecfd1)

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

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


    from a4ce996  [DLAB-1749] BE support library installation of particular version
     new e2e5f74  [DLAB-1750] Added validation for existing and installed libs
     new a45f5ac  Merge branch 'DLAB-1749' of github.com:apache/incubator-dlab into DLAB-1749
     new cdecfd1  [DLAB-1750] Added validation for existing and installed libs

The 3 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.


Summary of changes:
 .../install-libraries/install-libraries.component.html  | 12 ++++++++++--
 .../install-libraries/install-libraries.component.scss  |  7 ++++++-
 .../install-libraries/install-libraries.component.ts    | 17 ++++++++++-------
 .../install-libraries/install-libraries.model.ts        |  2 +-
 4 files changed, 27 insertions(+), 11 deletions(-)


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


[incubator-dlab] 01/03: [DLAB-1750] Added validation for existing and installed libs

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

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

commit e2e5f74412e3dfd74689135638d8102b532a69db
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Jul 13 16:13:21 2020 +0300

    [DLAB-1750] Added validation for existing and installed libs
---
 .../exploratory/install-libraries/install-libraries.component.html     | 2 +-
 .../exploratory/install-libraries/install-libraries.component.ts       | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
index c4c96b0..285014d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
@@ -73,7 +73,7 @@
 <!--                        <span *ngIf="item.version && item.version !== 'N/A'">{{ item.version }}</span>-->
                       </a>
                       <span *ngIf="isInSelectedList || isInstalled">{{ item.name }}
-<!--                        <span *ngIf="item.version && item.version !== 'N/A'">{{ item.version }}</span>-->
+                        <span *ngIf="item.version && item.version !== 'N/A'">{{ item.version }}</span>
                       </span>
 
                       <strong *ngIf="isInSelectedList">selected
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 ea50a7d..063e406 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
@@ -189,7 +189,6 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
 
   public addLibrary(item): void {
     const lib = item.split(':').filter(v => !!v);
-    console.log(lib);
     this.model.selectedLibs.push({ group: this.group, name: lib[0], version: lib[1] || 'N/A' });
     this.query = '';
     this.libSearch.setValue('');
@@ -315,7 +314,6 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
     } else {
       this.model.getLibrariesList(this.group, this.query)
         .subscribe(libs => {
-          console.log(libs);
           this.filteredList = libs;
         });
     }
@@ -375,7 +373,6 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
   }
 
   showlibinfo(lib: any) {
-    console.log(lib);
     this.isLibInfoOpened[lib.name] = !this.isLibInfoOpened[lib.name];
   }
 }


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


[incubator-dlab] 02/03: Merge branch 'DLAB-1749' of github.com:apache/incubator-dlab into DLAB-1749

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

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

commit a45f5aced953c7932d46eb61153358fd5a172223
Merge: e2e5f74 a4ce996
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Jul 13 16:14:04 2020 +0300

    Merge branch 'DLAB-1749' of github.com:apache/incubator-dlab into DLAB-1749

 .../epam/dlab/dto/exploratory/LibInstallDTO.java   |  2 +-
 .../dlab/backendapi/dao/ExploratoryLibDAO.java     | 38 +++++++++++++++++++---
 2 files changed, 35 insertions(+), 5 deletions(-)


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


[incubator-dlab] 03/03: [DLAB-1750] Added validation for existing and installed libs

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

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

commit cdecfd13ebe2d02e5b4880dacc5833046fae2f38
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Jul 13 16:30:02 2020 +0300

    [DLAB-1750] Added validation for existing and installed libs
---
 .../install-libraries/install-libraries.component.html     | 10 +++++++++-
 .../install-libraries/install-libraries.component.scss     |  7 ++++++-
 .../install-libraries/install-libraries.component.ts       | 14 ++++++++++----
 .../install-libraries/install-libraries.model.ts           |  2 +-
 4 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
index 285014d..409faeb 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.html
@@ -62,7 +62,15 @@
                 [value]="query"
                 [matAutocomplete]="auto"
               >
-              <mat-icon matSuffix (click)="addLibrary(query)" class="add-icon">add</mat-icon>
+              <span class="add-icon" [matTooltip]="!isLibExist ? 'Current library dosen\'t exist' : 'You have already added or installed current library'"
+              matTooltipPosition="above"
+              [matTooltipDisabled] = "isLibExist && (isInSelectedList || isInstalled)"
+              >
+                <button  mat-icon-button class="btn" [disabled]="!isLibExist || query.length < 1 ||
+                isDuplicated({name: query.slice(0, query.indexOf(':')), version: query.slice(query.indexOf(':') + 1) || 'N/A'})" (click)="addLibrary(query);$event.stopPropagation()">
+                  <mat-icon matSuffix >add</mat-icon>
+                </button>
+              </span>
 
               <mat-autocomplete #auto="matAutocomplete" class="suggestions" >
                 <ng-template ngFor let-item [ngForOf]="filteredList" let-i="index" *ngIf="query.indexOf(':') === -1">
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 b87846d..55b68d8 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
@@ -158,8 +158,13 @@ ul.resources{
 }
 
 .add-icon{
-  margin-right: 10px;
   cursor: pointer;
+  position: absolute;
+  top: -13px;
+  right: 10px;
+  .mat-icon{
+    font-size: 24px;
+  }
 }
 
 .search-box {
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 063e406..a3af674 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
@@ -29,6 +29,11 @@ import { LibrariesInstallationService } from '../../../core/services';
 import { SortUtils, HTTP_STATUS_CODES } from '../../../core/util';
 import {FilterLibsModel} from './filter-libs.model';
 
+interface Library {
+  name: string;
+  version: string;
+}
+
 
 @Component({
   selector: 'install-libraries',
@@ -77,6 +82,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
   @ViewChild('groupSelect', { static: false }) group_select;
   @ViewChild('resourceSelect', { static: false }) resource_select;
   public isLibInfoOpened = {  };
+  private isLibExist: boolean;
 
   constructor(
     @Inject(MAT_DIALOG_DATA) public data: any,
@@ -91,14 +97,12 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
 
   ngOnInit() {
     this.open(this.data);
-    this.uploadLibGroups();
     this.libSearch.valueChanges.pipe(
       debounceTime(1000))
       .subscribe(newValue => {
         this.query = newValue || '';
         this.filterList();
       });
-    this.getInstalledLibsByResource();
   }
 
   ngOnDestroy() {
@@ -161,7 +165,6 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
       this.destination && this.destination.type === 'СOMPUTATIONAL'
         ? this.model.computational_name = this.destination.name
         : this.model.computational_name = null;
-
       this.uploadLibGroups();
       this.getInstalledLibsByResource();
     }
@@ -313,7 +316,10 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
           });
     } else {
       this.model.getLibrariesList(this.group, this.query)
-        .subscribe(libs => {
+        .subscribe((libs: Library[]) => {
+          console.log('libs', libs);
+          console.log(this.query.slice(0, this.query.indexOf(':')));
+          this.isLibExist = libs.some(v => v.name === this.query.slice(0, this.query.indexOf(':')));
           this.filteredList = libs;
         });
     }
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.model.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.model.ts
index b201904..65896d3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.model.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.model.ts
@@ -60,7 +60,7 @@ export class InstallLibrariesModel {
       project_name: this.notebook.project,
       exploratory_name: this.notebook.name,
       group: group,
-      start_with: query
+      start_with: query.slice(0, query.indexOf(':'))
     };
     if (this.computational_name)
       lib_query.computational_name = this.computational_name;


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