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/02/05 10:42:53 UTC

[incubator-dlab] branch DLAB-1513 created (now a4f9f53)

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

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


      at a4f9f53  [DLAB-1513]: Fixed 'Formatted exploratory name' request repetition

This branch includes the following new commits:

     new a4f9f53  [DLAB-1513]: Fixed 'Formatted exploratory name' request repetition

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@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/01: [DLAB-1513]: Fixed 'Formatted exploratory name' request repetition

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

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

commit a4f9f53d8aad21b3b44bea0cec6bfec555826582
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Wed Feb 5 12:40:55 2020 +0200

    [DLAB-1513]: Fixed 'Formatted exploratory name' request repetition
---
 .../install-libraries.component.ts                 | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

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 3bee009..3266238 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
@@ -44,6 +44,7 @@ export class InstallLibrariesComponent implements OnInit {
   public groupsList: Array<string>;
   public notebookLibs: Array<any> = [];
   public notebookFailedLibs: Array<any> = [];
+  public loadLibsTimer: any;
 
   public query: string = '';
   public group: string;
@@ -67,7 +68,6 @@ export class InstallLibrariesComponent implements OnInit {
 
   private readonly CHECK_GROUPS_TIMEOUT: number = 5000;
   private clear: number;
-  private clearCheckInstalling = undefined;
 
   public filterConfiguration: FilterLibsModel = new FilterLibsModel('', [], [], [], []);
   public filterModel: FilterLibsModel = new FilterLibsModel('', [], [], [], []);
@@ -199,12 +199,10 @@ export class InstallLibrariesComponent implements OnInit {
         if (response.status === HTTP_STATUS_CODES.OK) {
           this.getInstalledLibrariesList();
           this.resetDialog();
-          console.log('Open response status');
         }
       },
       error => this.toastr.error(error.message || 'Library installation failed!', 'Oops!'),
       () => {
-        console.log('Failed open response status');
         this.getInstalledLibrariesList(true);
         this.changeDetector.detectChanges();
         this.selectorsReset();
@@ -220,9 +218,8 @@ export class InstallLibrariesComponent implements OnInit {
   public isInstallingInProgress(): void {
     const isInstallingNow = this.notebookLibs.some(lib => lib.filteredStatus.some(status => status.status === 'installing'));
       if (isInstallingNow) {
-        this.clearCheckInstalling = window.setInterval(() => this.getInstalledLibrariesList(), 10000);
-      } else {
-        window.clearInterval(this.clearCheckInstalling);
+        clearTimeout(this.loadLibsTimer);
+        this.loadLibsTimer = window.setTimeout(() => this.getInstalledLibrariesList(), 1000);
       }
     }
 
@@ -242,7 +239,9 @@ export class InstallLibrariesComponent implements OnInit {
         if ( !this.filtredNotebookLibs.length || data.length !== this.notebookLibs.length) {
           this.filtredNotebookLibs = [...data];
         }
-        this.filtredNotebookLibs = data.filter(lib => this.filtredNotebookLibs.some(v => (v.name + v.version === lib.name + v.version) && v.resource === lib.resource));
+        this.filtredNotebookLibs = data.filter(lib =>
+          this.filtredNotebookLibs.some(v =>
+            (v.name + v.version === lib.name + v.version) && v.resource === lib.resource));
         this.notebookLibs = data ? data : [];
         this.notebookLibs.forEach(lib => {
           lib.filteredStatus = lib.status;
@@ -253,7 +252,8 @@ export class InstallLibrariesComponent implements OnInit {
         this.changeDetector.markForCheck();
         this.filterConfiguration.group = this.createFilterList(this.notebookLibs.map(v => this.groupsListMap[v.group]));
         this.filterConfiguration.resource = this.createFilterList(this.notebookLibs.map(lib => lib.status.map(status => status.resource)));
-        this.filterConfiguration.resourceType = this.createFilterList(this.notebookLibs.map(lib => lib.status.map(status => status.resourceType)));
+        this.filterConfiguration.resourceType = this.createFilterList(this.notebookLibs.map(lib =>
+          lib.status.map(status => status.resourceType)));
         this.filterConfiguration.status = this.createFilterList(this.notebookLibs.map(lib => lib.status.map(status => status.status)));
         this.isInstallingInProgress();
       });
@@ -321,8 +321,6 @@ export class InstallLibrariesComponent implements OnInit {
 
     this.libSearch.disable();
     clearTimeout(this.clear);
-    clearInterval(this.clearCheckInstalling);
-    this.clearCheckInstalling = undefined;
     this.selectorsReset();
   }
 
@@ -332,7 +330,9 @@ export class InstallLibrariesComponent implements OnInit {
 
   public filterLibs(): void {
     this.filtredNotebookLibs = this.notebookLibs.filter((lib) => {
-      const isName = this.filterModel.name ? lib.name.toLowerCase().indexOf(this.filterModel.name.toLowerCase().trim()) !== -1 || lib.version.indexOf(this.filterModel.name.toLowerCase().trim()) !== -1 : true;
+      const isName = this.filterModel.name ?
+        lib.name.toLowerCase().indexOf(this.filterModel.name.toLowerCase().trim()) !== -1
+        || lib.version.indexOf(this.filterModel.name.toLowerCase().trim()) !== -1 : true;
       const isGroup = this.filterModel.group.length ? this.filterModel.group.includes(this.groupsListMap[lib.group]) : true;
       lib.filteredStatus = lib.status.filter(status => {
         const isResource = this.filterModel.resource.length ? this.filterModel.resource.includes(status.resource) : true;


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