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/21 15:57:14 UTC

[incubator-datalab] branch DATALAB-2254 created (now db296ae)

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

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


      at db296ae  [DATALAB-2254]: Small fix

This branch includes the following new commits:

     new a406b50  [DATALAB-2254]: Update delete/upload action on Azure
     new db296ae  [DATALAB-2254]: Small fix

The 2 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/02: [DATALAB-2254]: Update delete/upload action on Azure

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

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

commit a406b500e9f36918f93a52046681c67ea17b94b1
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Thu Jan 21 17:52:07 2021 +0200

    [DATALAB-2254]: Update delete/upload action on Azure
---
 .../bucket-browser/bucket-browser.component.ts     |  2 +-
 .../folder-tree/folder-tree.component.ts           |  7 ++
 .../resources-grid/resources-grid.component.ts     | 99 +++++++++++-----------
 3 files changed, 57 insertions(+), 51 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/bucket-browser.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/bucket-browser.component.ts
index 91c8b1f..d84087d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/bucket-browser.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/bucket-browser.component.ts
@@ -93,6 +93,7 @@ export class BucketBrowserComponent implements OnInit, OnDestroy {
     this.bucketStatus = this.data.bucketStatus;
     this.buckets = this.data.buckets;
     this.cloud = this.getCloud();
+    // this.cloud = 'azure';
   }
 
   ngOnDestroy() {
@@ -128,7 +129,6 @@ export class BucketBrowserComponent implements OnInit, OnDestroy {
     this.addedFiles = [];
   }
 
-
   public toggleSelectedFile(file, type) {
     type === 'file' ?  file.isSelected = !file.isSelected : file.isFolderSelected = !file.isFolderSelected;
     this.selected = this.folderItems.filter(item => item.isSelected);
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/folder-tree/folder-tree.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/folder-tree/folder-tree.component.ts
index 28ed2c0..698491d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/folder-tree/folder-tree.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/folder-tree/folder-tree.component.ts
@@ -73,13 +73,19 @@ export class FolderTreeComponent implements OnDestroy {
     this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
     this.subscriptions.add(this.bucketDataService._bucketData.subscribe(data => {
       if (data) {
+        console.log('BeforeDATA', this.dataSource.data);
         this.dataSource.data = data;
+        console.log('AfterDATA', data);
         const subject = this.dataSource._flattenedData;
         const subjectData = subject.getValue();
+        console.log('selectedFolderBefore', this.selectedFolder);
+        console.log('subjectData', subjectData);
           if (this.selectedFolder) {
+            console.log(this.cloud);
             this.selectedFolder = subjectData.find(v => v.item === this.selectedFolder.item &&
               v.level === this.selectedFolder.level && v.obj === this.selectedFolder.obj);
           }
+          console.log('selectedFolderAfter', this.selectedFolder);
           this.expandAllParents(this.selectedFolder || subjectData[0]);
           this.showItem(this.selectedFolder || subjectData[0]);
           if (this.selectedFolder && !this.bucketDataService.emptyFolder) {
@@ -151,6 +157,7 @@ export class FolderTreeComponent implements OnDestroy {
     if (el) {
       this.treeControl.expand(el);
       this.selectedFolder = el;
+      console.log(this.selectedFolder);
       const path = this.getPath(el);
       this.path = [];
       const data = {
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
index cdb4407..934113d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
@@ -295,7 +295,7 @@ export class ResourcesGridComponent implements OnInit {
             }
             if (projectBucket && currEndpoint.status !== 'terminated'
               && currEndpoint.status !== 'terminating' && currEndpoint.status !== 'failed') {
-              edgeItem.children.push({name: projectBucket, endpoint: endpoint.name});
+              edgeItem.children.push({name: 'kscnnptkah.az-20-01-proj-local-bucket', endpoint: endpoint.name});
             }
             if (sharedBucket) {
               edgeItem.children.push({name: sharedBucket, endpoint: endpoint.name});
@@ -309,34 +309,11 @@ export class ResourcesGridComponent implements OnInit {
     this.bucketsList = SortUtils.flatDeep(bucketsList, 1).filter(v => v.children.length);
   }
 
+  public isActiveFilter(filterConfig): void {
+    this.activeFiltering = false;
 
-  // PRIVATE
-  private getResourceByName(notebook_name: string, project_name: string) {
-    return this.getEnvironmentsListCopy().filter(environments => environments.project === project_name)
-      .map(env => env.exploratory.find(({ name }) => name === notebook_name))
-      .filter(name => !!name)[0];
-  }
-
-  private getEnvironmentsListCopy() {
-    return this.environments.map(env => JSON.parse(JSON.stringify(env)));
-  }
-
-  private getDefaultFilterConfiguration(): void {
-    const data: Exploratory[] = this.environments;
-    const shapes = [], statuses = [], resources = [];
-
-    data.filter(elem => elem.exploratory.map((item: any) => {
-      if (shapes.indexOf(item.shape) === -1) shapes.push(item.shape);
-      if (statuses.indexOf(item.status) === -1) statuses.push(item.status);
-      statuses.sort(SortUtils.statusSort);
-
-      item.resources.map((resource: any) => {
-        if (resources.indexOf(resource.status) === -1) resources.push(resource.status);
-        resources.sort(SortUtils.statusSort);
-      });
-    }));
-
-    this.filterConfiguration = new FilterConfigurationModel('', statuses, shapes, resources, '', '');
+    for (const index in filterConfig)
+      if (filterConfig[index].length) this.activeFiltering = true;
   }
 
   public applyFilter_btnClick(config: FilterConfigurationModel): void {
@@ -411,6 +388,50 @@ export class ResourcesGridComponent implements OnInit {
     this.filteredEnvironments = filteredData;
   }
 
+  public logAction(name) {
+    this.auditService.sendDataToAudit({
+      resource_name: name, info: `Open terminal, requested for notebook`, type: 'WEB_TERMINAL'
+    }).subscribe();
+  }
+
+  public trackBy(index, item) {
+    return null;
+  }
+
+  public onFilterNameUpdate(targetElement: any) {
+    this.filterForm.name = targetElement;
+    this.checkFilters();
+  }
+
+  // PRIVATE
+  private getResourceByName(notebook_name: string, project_name: string) {
+    return this.getEnvironmentsListCopy().filter(environments => environments.project === project_name)
+      .map(env => env.exploratory.find(({ name }) => name === notebook_name))
+      .filter(name => !!name)[0];
+  }
+
+  private getEnvironmentsListCopy() {
+    return this.environments.map(env => JSON.parse(JSON.stringify(env)));
+  }
+
+  private getDefaultFilterConfiguration(): void {
+    const data: Exploratory[] = this.environments;
+    const shapes = [], statuses = [], resources = [];
+
+    data.filter(elem => elem.exploratory.map((item: any) => {
+      if (shapes.indexOf(item.shape) === -1) shapes.push(item.shape);
+      if (statuses.indexOf(item.status) === -1) statuses.push(item.status);
+      statuses.sort(SortUtils.statusSort);
+
+      item.resources.map((resource: any) => {
+        if (resources.indexOf(resource.status) === -1) resources.push(resource.status);
+        resources.sort(SortUtils.statusSort);
+      });
+    }));
+
+    this.filterConfiguration = new FilterConfigurationModel('', statuses, shapes, resources, '', '');
+  }
+
   private modifyGrid(): void {
     this.displayedColumns = this.displayedColumns.filter(el => el !== 'cost');
     this.displayedFilterColumns = this.displayedFilterColumns.filter(el => el !== 'cost-filter');
@@ -424,13 +445,6 @@ export class ResourcesGridComponent implements OnInit {
     return config;
   }
 
-  isActiveFilter(filterConfig): void {
-    this.activeFiltering = false;
-
-    for (const index in filterConfig)
-      if (filterConfig[index].length) this.activeFiltering = true;
-  }
-
   private getUserPreferences(): void {
     this.userResourceService.getUserPreferences()
       .subscribe((result: FilterConfigurationModel) => {
@@ -463,19 +477,4 @@ export class ResourcesGridComponent implements OnInit {
       }, error => this.toastr.error(error.message || `Odahu cluster ${action} failed!`, 'Oops!')
     );
   }
-
-  public logAction(name) {
-    this.auditService.sendDataToAudit({
-      resource_name: name, info: `Open terminal, requested for notebook`, type: 'WEB_TERMINAL'
-    }).subscribe();
-  }
-
-  public trackBy(index, item) {
-    return null;
-  }
-
-  public onFilterNameUpdate(targetElement: any) {
-    this.filterForm.name = targetElement;
-    this.checkFilters();
-  }
 }


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


[incubator-datalab] 02/02: [DATALAB-2254]: Small fix

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

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

commit db296ae75bfd0e28ba26eab646e4b2257cc18ca1
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Thu Jan 21 17:56:07 2021 +0200

    [DATALAB-2254]: Small fix
---
 .../resources-grid/resources-grid.component.ts     | 99 +++++++++++-----------
 1 file changed, 50 insertions(+), 49 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
index 934113d..cdb4407 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
@@ -295,7 +295,7 @@ export class ResourcesGridComponent implements OnInit {
             }
             if (projectBucket && currEndpoint.status !== 'terminated'
               && currEndpoint.status !== 'terminating' && currEndpoint.status !== 'failed') {
-              edgeItem.children.push({name: 'kscnnptkah.az-20-01-proj-local-bucket', endpoint: endpoint.name});
+              edgeItem.children.push({name: projectBucket, endpoint: endpoint.name});
             }
             if (sharedBucket) {
               edgeItem.children.push({name: sharedBucket, endpoint: endpoint.name});
@@ -309,11 +309,34 @@ export class ResourcesGridComponent implements OnInit {
     this.bucketsList = SortUtils.flatDeep(bucketsList, 1).filter(v => v.children.length);
   }
 
-  public isActiveFilter(filterConfig): void {
-    this.activeFiltering = false;
 
-    for (const index in filterConfig)
-      if (filterConfig[index].length) this.activeFiltering = true;
+  // PRIVATE
+  private getResourceByName(notebook_name: string, project_name: string) {
+    return this.getEnvironmentsListCopy().filter(environments => environments.project === project_name)
+      .map(env => env.exploratory.find(({ name }) => name === notebook_name))
+      .filter(name => !!name)[0];
+  }
+
+  private getEnvironmentsListCopy() {
+    return this.environments.map(env => JSON.parse(JSON.stringify(env)));
+  }
+
+  private getDefaultFilterConfiguration(): void {
+    const data: Exploratory[] = this.environments;
+    const shapes = [], statuses = [], resources = [];
+
+    data.filter(elem => elem.exploratory.map((item: any) => {
+      if (shapes.indexOf(item.shape) === -1) shapes.push(item.shape);
+      if (statuses.indexOf(item.status) === -1) statuses.push(item.status);
+      statuses.sort(SortUtils.statusSort);
+
+      item.resources.map((resource: any) => {
+        if (resources.indexOf(resource.status) === -1) resources.push(resource.status);
+        resources.sort(SortUtils.statusSort);
+      });
+    }));
+
+    this.filterConfiguration = new FilterConfigurationModel('', statuses, shapes, resources, '', '');
   }
 
   public applyFilter_btnClick(config: FilterConfigurationModel): void {
@@ -388,50 +411,6 @@ export class ResourcesGridComponent implements OnInit {
     this.filteredEnvironments = filteredData;
   }
 
-  public logAction(name) {
-    this.auditService.sendDataToAudit({
-      resource_name: name, info: `Open terminal, requested for notebook`, type: 'WEB_TERMINAL'
-    }).subscribe();
-  }
-
-  public trackBy(index, item) {
-    return null;
-  }
-
-  public onFilterNameUpdate(targetElement: any) {
-    this.filterForm.name = targetElement;
-    this.checkFilters();
-  }
-
-  // PRIVATE
-  private getResourceByName(notebook_name: string, project_name: string) {
-    return this.getEnvironmentsListCopy().filter(environments => environments.project === project_name)
-      .map(env => env.exploratory.find(({ name }) => name === notebook_name))
-      .filter(name => !!name)[0];
-  }
-
-  private getEnvironmentsListCopy() {
-    return this.environments.map(env => JSON.parse(JSON.stringify(env)));
-  }
-
-  private getDefaultFilterConfiguration(): void {
-    const data: Exploratory[] = this.environments;
-    const shapes = [], statuses = [], resources = [];
-
-    data.filter(elem => elem.exploratory.map((item: any) => {
-      if (shapes.indexOf(item.shape) === -1) shapes.push(item.shape);
-      if (statuses.indexOf(item.status) === -1) statuses.push(item.status);
-      statuses.sort(SortUtils.statusSort);
-
-      item.resources.map((resource: any) => {
-        if (resources.indexOf(resource.status) === -1) resources.push(resource.status);
-        resources.sort(SortUtils.statusSort);
-      });
-    }));
-
-    this.filterConfiguration = new FilterConfigurationModel('', statuses, shapes, resources, '', '');
-  }
-
   private modifyGrid(): void {
     this.displayedColumns = this.displayedColumns.filter(el => el !== 'cost');
     this.displayedFilterColumns = this.displayedFilterColumns.filter(el => el !== 'cost-filter');
@@ -445,6 +424,13 @@ export class ResourcesGridComponent implements OnInit {
     return config;
   }
 
+  isActiveFilter(filterConfig): void {
+    this.activeFiltering = false;
+
+    for (const index in filterConfig)
+      if (filterConfig[index].length) this.activeFiltering = true;
+  }
+
   private getUserPreferences(): void {
     this.userResourceService.getUserPreferences()
       .subscribe((result: FilterConfigurationModel) => {
@@ -477,4 +463,19 @@ export class ResourcesGridComponent implements OnInit {
       }, error => this.toastr.error(error.message || `Odahu cluster ${action} failed!`, 'Oops!')
     );
   }
+
+  public logAction(name) {
+    this.auditService.sendDataToAudit({
+      resource_name: name, info: `Open terminal, requested for notebook`, type: 'WEB_TERMINAL'
+    }).subscribe();
+  }
+
+  public trackBy(index, item) {
+    return null;
+  }
+
+  public onFilterNameUpdate(targetElement: any) {
+    this.filterForm.name = targetElement;
+    this.checkFilters();
+  }
 }


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