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/20 12:10:44 UTC

[incubator-datalab] branch develop updated: [DATALAB-2250]: Fixed invisible Copy icon on small screen. Fixed bugs on reopened tickets (#1043)

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 1af3b35  [DATALAB-2250]: Fixed invisible Copy icon on small screen. Fixed bugs on reopened tickets (#1043)
1af3b35 is described below

commit 1af3b3514e596ae76a13f15a792335af857b0bea
Author: Dmytro Gnatyshyn <42...@users.noreply.github.com>
AuthorDate: Wed Jan 20 14:10:34 2021 +0200

    [DATALAB-2250]: Fixed invisible Copy icon on small screen. Fixed bugs on reopened tickets (#1043)
    
    [DATALAB-2250]: Fixed invisible 'Copy icon' on small screen. Fixed bugs on reopened tickets
---
 .../project/project-list/project-list.component.ts |  2 +-
 .../administration/project/project.component.ts    |  9 ++++----
 .../bucket-browser/bucket-browser.component.ts     |  4 +++-
 .../cluster-details/cluster-details.component.html |  2 +-
 .../cluster-details/cluster-details.component.ts   |  2 +-
 .../detail-dialog/detail-dialog.component.html     | 14 ++++++------
 .../detail-dialog/detail-dialog.component.scss     |  4 ++++
 .../detail-dialog/detail-dialog.component.ts       |  4 ++--
 .../notification-dialog.component.ts               | 25 ++++++++++++----------
 9 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts
index b977e4f..3a372cd 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts
@@ -129,7 +129,7 @@ export class ProjectListComponent implements OnInit, OnDestroy {
         }
       });
       if (action === 'terminate' && endpoints.length === 1) {
-        this.toggleStatus.emit({project, endpoint: endpoints, action});
+        this.toggleStatus.emit({project, endpoint: endpoints, action, oneEdge: true});
       } else {
         this.dialog.open(EdgeActionDialogComponent, {data: {type: action, item: endpoints}, panelClass: 'modal-sm'})
           .afterClosed().subscribe(endpoint => {
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 24855d1..ba60451 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
@@ -120,12 +120,12 @@ export class ProjectComponent implements OnInit, OnDestroy {
 
   public toggleStatus($event) {
     const data = { 'project_name': $event.project.name, endpoint: $event.endpoint.map(endpoint => endpoint.name)};
-    this.toggleStatusRequest(data, $event.action);
+    this.toggleStatusRequest(data, $event.action, $event.oneEdge);
   }
 
-  private toggleStatusRequest(data, action) {
+  private toggleStatusRequest(data, action, isOnlyOneEdge?) {
     if ( action === 'terminate') {
-      const projectsResources = this.resources.filter(resource => resource.project === data.project_name );
+      const projectsResources = this.resources.filter(resource => resource.project === data.project_name);
       const activeProjectsResources = projectsResources.length ? projectsResources[0].exploratory
         .filter(expl => expl.status !== 'terminated' && expl.status !== 'terminating' && expl.status !== 'failed') : [];
       const termResources = data.endpoint.reduce((res, endp) => {
@@ -133,9 +133,8 @@ export class ProjectComponent implements OnInit, OnDestroy {
         return res;
         }, []).map(resource => resource.name);
 
-      if (termResources.length === 0) {
+      if (termResources.length === 0 && !isOnlyOneEdge) {
         this.edgeNodeAction(data, action);
-
       } else {
         this.dialog.open(NotificationDialogComponent, { data: {
             type: 'terminateNode', item: {action: data, resources: termResources}
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..198152e 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
@@ -447,7 +447,9 @@ export class BucketBrowserComponent implements OnInit, OnDestroy {
     if (cloud !== 'azure') {
       CopyPathUtils.copyPath(protocol + selected.object.bucket + '/' + selected.object.object);
     } else {
-      const azureBucket = selected.object.bucket.replace('.', '@') + '.blob.core.windows.net' + '/' + selected.object.object;
+      const bucketName = selected.object.bucket;
+      const accountName = this.bucketName.replace(selected.object.bucket, '').slice(0, -1);
+      const azureBucket = bucketName + '@' + accountName + '.blob.core.windows.net' + '/' + selected.object.object;
       CopyPathUtils.copyPath(protocol + azureBucket);
     }
     this.clearSelection();
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.html
index 71b5ae5..5ab9801 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.html
@@ -120,7 +120,7 @@
                 *ngIf="isCopyIconVissible[item.description]"
                 [matTooltip]="isCopied ? 'Copy ' + item.description + (item.description.indexOf('url')  === -1 ? ' url' : ''): 'Copied'" matTooltipPosition="above" class="copy-icon-wrapper"
               >
-                <span  class="link-icon" (click)="copyBucketName(item.url)" >
+                <span  class="link-icon" (click)="copyLink(item.url)" >
                   <span _ngcontent-xpv-c19="" class="material-icons" (click)="this.isCopied = false">content_copy</span>
                  </span>
               </span>
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.ts
index b056198..f5e8f45 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.ts
@@ -138,7 +138,7 @@ export class DetailComputationalResourcesComponent implements OnInit {
       ).subscribe();
   }
 
-  copyBucketName(url: string) {
+  public copyLink(url: string) {
     CopyPathUtils.copyPath(url);
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.html
index 5d297e6..3d2dfda 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.html
@@ -71,7 +71,7 @@
                   <span class="description">{{item.description}}: &nbsp;</span>
                   <a (mouseover)="showCopyIcon(item.description)"
                      (click)="logAction(notebook.name, item.description)"
-                     class="ellipsis none-select" matTooltip="{{item.url}}"
+                     class="ellipsis none-select resources-url" matTooltip="{{item.url}}"
                      matTooltipPosition="above"
                      href="{{item.url}}"
                      target="_blank"
@@ -80,7 +80,7 @@
                     &nbsp;{{item.url}}
                   </a>
                   <span (click)="logAction(notebook.name, item.description, 'Copy');$event.stopPropagation()" *ngIf="isCopyIconVissible[item.description]" [matTooltip]="isCopied ? 'Copy ' + item.description + ' url': 'Copied'" matTooltipPosition="above" class="copy-icon-wrapper">
-                      <span  class="link-icon" (click)="copyBucketName(item.url)" >
+                      <span  class="link-icon" (click)="copyLink(item.url)" >
                         <span _ngcontent-xpv-c19="" class="material-icons" (click)="this.isCopied = false">content_copy</span>
                        </span>
                     </span>
@@ -104,7 +104,7 @@
                     <span class="description">{{item.description}}: &nbsp;</span>
                     <a (mouseover)="showCopyIcon(item.description)"
                        (click)="logAction(notebook.name, item.description)"
-                       class="ellipsis none-select" matTooltip="{{item.url}}"
+                       class="ellipsis none-select resources-url" matTooltip="{{item.url}}"
                        matTooltipPosition="above"
                        href="{{item.url}}"
                       target="_blank"
@@ -113,7 +113,7 @@
                       &nbsp;{{item.url}}
                     </a>
                     <span (click)="logAction(notebook.name, item.description, 'Copy');$event.stopPropagation()" *ngIf="isCopyIconVissible[item.description]" [matTooltip]="isCopied ? 'Copy ' + item.description + ' url': 'Copied'" matTooltipPosition="above" class="copy-icon-wrapper">
-                      <span  class="link-icon" (click)="copyBucketName(item.url)" >
+                      <span  class="link-icon" (click)="copyLink(item.url)" >
                         <span _ngcontent-xpv-c19="" class="material-icons" (click)="this.isCopied = false">content_copy</span>
                        </span>
                     </span>
@@ -127,7 +127,6 @@
                 class="strong">{{ notebook.password }}</span></p>
 
             <p class="m-top-30">{{ 'Project bucket' }}: &nbsp;</p>
-            <!--                 (click)="bucketBrowser(notebook.bucket_name, notebook.endpoint, this.bucketStatus['view'])"-->
             <div class="links_block" (mouseleave)="hideCopyIcon()">
                 <p *ngIf="PROVIDER === 'azure' && notebook.account_name" class="bucket-info-wrapper">
                   <span
@@ -138,11 +137,10 @@
                     [matTooltipClass]="'full-size-tooltip'"
                   >
                     {{notebook.bucket_name + '@' + notebook.account_name + '.blob.core.windows.net'}}
-<!--                    rc-22-projecta-conteiner@1ebobsvx7t.blob.core.windows.net-->
                   </span>
 
                   <span  *ngIf="isCopyIconVissible.bucket" [matTooltip]="isCopied ? 'Copy bucket name' : 'Copied'" matTooltipPosition="above">
-                    <span  class="link-icon" (click)="copyBucketName(notebook.bucket_name + '@' + notebook.account_name + '.blob.core.windows.net');$event.stopPropagation()" >
+                    <span  class="link-icon" (click)="copyLink(notebook.bucket_name + '@' + notebook.account_name + '.blob.core.windows.net', true);$event.stopPropagation()" >
                     <span _ngcontent-xpv-c19="" class="material-icons" (click)="this.isCopied = false">content_copy</span>
                   </span>
                   </span>
@@ -155,7 +153,7 @@
                     {{ notebook.bucket_name }}
                 </span>
                   <span  *ngIf="isCopyIconVissible.bucket" [matTooltip]="isCopied ? 'Copy bucket name' : 'Copied'" matTooltipPosition="above">
-                    <span  class="link-icon" (click)="copyBucketName(notebook.bucket_name);$event.stopPropagation()" >
+                    <span  class="link-icon" (click)="copyLink(notebook.bucket_name, true);$event.stopPropagation()" >
                     <span _ngcontent-xpv-c19="" class="material-icons" (click)="this.isCopied = false">content_copy</span>
                   </span>
                   </span>
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.scss b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.scss
index fed1aa5..edb7aac 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.scss
@@ -138,4 +138,8 @@
   }
 }
 
+.resources-url{
+  max-width: 70%;
+}
+
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.ts
index ebe81ef..5902275 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.ts
@@ -163,8 +163,8 @@ export class DetailDialogComponent implements OnInit {
     this.isCopied = true;
   }
 
-  public copyBucketName(copyValue) {
-    const protocol = HelpUtils.getBucketProtocol(this.PROVIDER);
+  public copyLink(copyValue, isBucket?) {
+    const protocol = isBucket ? HelpUtils.getBucketProtocol(this.PROVIDER) : '';
     CopyPathUtils.copyPath(protocol + copyValue);
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/notification-dialog/notification-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/notification-dialog/notification-dialog.component.ts
index 05d32bb..ea00d71 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/notification-dialog/notification-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/notification-dialog/notification-dialog.component.ts
@@ -120,18 +120,21 @@ import {Endpoint} from '../../../administration/project/project.component';
                   </div>
               </div>
                <div class="confirm-dialog" *ngIf="data.type === 'terminateNode'">
-                   <mat-list *ngIf="data.item.resources.length > 0">
-                     <mat-list-item class="list-header sans">
-                       <div class="endpoint">Resources</div>
-                       <div class="status">Further status</div>
+                 <mat-list *ngIf="data.item.resources.length > 0; else noResources">
+                   <mat-list-item class="list-header sans">
+                     <div class="endpoint">Resources</div>
+                     <div class="status">Further status</div>
+                   </mat-list-item>
+                   <div class="scrolling-content scrolling">
+                     <mat-list-item *ngFor="let resource of data.item.resources" class="sans node">
+                       <div class="endpoint ellipsis">{{resource}}</div>
+                       <div class="status terminated">Terminated</div>
                      </mat-list-item>
-                     <div class="scrolling-content scrolling">
-                       <mat-list-item *ngFor="let resource of data.item.resources" class="sans node">
-                         <div class="endpoint ellipsis">{{resource}}</div>
-                         <div class="status terminated">Terminated</div>
-                       </mat-list-item>
-                     </div>
-                   </mat-list>
+                   </div>
+                 </mat-list>
+                 <ng-template #noResources>
+                   There are not related resources to this edge node.
+                 </ng-template>
                    <div mat-dialog-content class="bottom-message" *ngIf="data.item.resources.length > 0">
                      <span class="confirm-message">All connected computes will be terminated as well.</span>
                    </div>


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