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

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


The following commit(s) were added to refs/heads/DLAB-1571 by this push:
     new 501d147  [DLAB-1684, 1690]: Fixed list of resources for user and style 
fo arrows on roles page
     new 6b955d3  Merge remote-tracking branch 'origin/DLAB-1571' into DLAB-1571
501d147 is described below

commit 501d147245e5444c4a173e8e667957a1c5f893e5
Author: Dmytro Gnatyshyn <[email protected]>
AuthorDate: Fri Apr 3 16:44:04 2020 +0300

    [DLAB-1684, 1690]: Fixed list of resources for user and style fo arrows on 
roles page
---
 .../resources-grid/resources-grid.component.html    |  8 +++++---
 .../resources-grid/resources-grid.component.scss    |  4 ++++
 .../resources-grid/resources-grid.component.ts      |  6 ------
 .../resources-grid/resources-grid.model.ts          |  2 ++
 .../src/app/resources/resources.component.html      |  2 +-
 .../webapp/src/app/resources/resources.component.ts | 11 ++---------
 .../multi-level-select-dropdown.component.html      | 18 ++++++++++++++----
 .../multi-level-select-dropdown.component.scss      | 21 ++++++++++-----------
 8 files changed, 38 insertions(+), 34 deletions(-)

diff --git 
a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
 
b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
index 965f9d8..6d08036 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
+++ 
b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
@@ -168,10 +168,12 @@
                     </div>
                   </li>
                   <li *ngIf="element.status.toLowerCase() === 'stopped' || 
element.status.toLowerCase() === 'stopping'"
-                    matTooltip="{{isEdgeNodeStopped(element) ? 'Unable to run 
notebook if edge node is stopped.' : 'Unable to run notebook until it will be 
stopped.'}}" matTooltipPosition="above"
-                    [matTooltipDisabled]="!isResourcesInProgress(element) && 
element.status.toLowerCase() !== 'stopping' && !isEdgeNodeStopped(element)">
+                    matTooltip="{{element.edgeNodeStatus !== 'running' ? 
'Unable to run notebook if edge node is not running.' : 'Unable to run notebook 
until it will be stopped.'}}" matTooltipPosition="above"
+                    [matTooltipDisabled]="!isResourcesInProgress(element) && 
element.status.toLowerCase() !== 'stopping' && element.edgeNodeStatus === 
'running'"
+                    [ngClass]="{'not-allow': isResourcesInProgress(element) || 
element.status.toLowerCase() === 'stopping' || element.edgeNodeStatus !== 
'running' }"
+                  >
                     <div (click)="exploratoryAction(element, 'run')"
-                      [ngClass]="{'not-allowed': 
isResourcesInProgress(element) || element.status.toLowerCase() === 'stopping' 
|| isEdgeNodeStopped(element) }">
+                      [ngClass]="{'not-allowed': 
isResourcesInProgress(element) || element.status.toLowerCase() === 'stopping' 
|| element.edgeNodeStatus !== 'running' }">
                       <i class="material-icons">play_circle_outline</i>
                       <span>Run</span>
                     </div>
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.scss
 
b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.scss
index e09ff3e..d6c0556 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.scss
+++ 
b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.scss
@@ -395,3 +395,7 @@ tr.detail-row {
 .content-row{
   background-clip: padding-box;
 }
+
+.not-allow{
+  cursor: not-allowed !important;
+}
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 3052d84..8dfdf4e 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
@@ -151,12 +151,6 @@ export class ResourcesGridComponent implements OnInit {
     return false;
   }
 
-  public isEdgeNodeStopped(resource) {
-    const currProject = this.projects.filter(proj => proj.name === 
resource.project);
-    const currEdgenodeStatus =  currProject[0].endpoints.filter(node => 
node.name === resource.endpoint)[0].status;
-    return currEdgenodeStatus === 'STOPPED' || currEdgenodeStatus === 
'STOPPING';
-  }
-
   public filterActiveInstances(): FilterConfigurationModel {
     return (<FilterConfigurationModel | any>Object).assign({}, 
this.filterConfiguration, {
       statuses: SortUtils.activeStatuses(),
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.model.ts
 
b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.model.ts
index 14a2824..57f98c9 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.model.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.model.ts
@@ -50,6 +50,7 @@ export class ExploratoryModel {
     public project: string,
     public endpoint: string,
     public tags: any,
+    public edgeNodeStatus: string
   ) { }
 
   public static loadEnvironments(data: Array<any>) {
@@ -88,6 +89,7 @@ export class ExploratoryModel {
             el.project,
             el.endpoint,
             el.tags,
+            value.shared[el.endpoint].status
           )})
         };
       });
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 091ccb7..b705c38 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
@@ -63,5 +63,5 @@
     </div>
   </div>
   <mat-divider></mat-divider>
-  <resources-grid [projects] = "projects"></resources-grid>
+  <resources-grid></resources-grid>
 </div>
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
index c619ada..2587a62 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
@@ -17,14 +17,14 @@
  * under the License.
  */
 
-import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
+import { Component, OnInit, ViewChild } from '@angular/core';
 import { ToastrService } from 'ngx-toastr';
 import { MatDialog } from '@angular/material/dialog';
 
 import { ResourcesGridComponent } from 
'./resources-grid/resources-grid.component';
 import { ExploratoryEnvironmentCreateComponent } from 
'./exploratory/create-environment';
 import { Exploratory } from './resources-grid/resources-grid.model';
-import {ApplicationSecurityService, HealthStatusService, ProjectService} from 
'../core/services';
+import {ApplicationSecurityService, HealthStatusService} from 
'../core/services';
 import { ManageUngitComponent } from './manage-ungit/manage-ungit.component';
 import { Project } from './../administration/project/project.component';
 
@@ -45,13 +45,11 @@ export class ResourcesComponent implements OnInit {
     public toastr: ToastrService,
     private healthStatusService: HealthStatusService,
     private dialog: MatDialog,
-    private projectService: ProjectService,
     private applicationSecurityService: ApplicationSecurityService
   ) { }
 
   ngOnInit() {
     this.getEnvironmentHealthStatus();
-    this.getProjects();
     this.exploratoryEnvironments = this.resourcesGrid.environments;
   }
 
@@ -62,7 +60,6 @@ export class ResourcesComponent implements OnInit {
 
   public refreshGrid(): void {
     this.resourcesGrid.buildGrid();
-    this.getProjects();
     this.checkAutorize();
     this.exploratoryEnvironments = this.resourcesGrid.environments;
   }
@@ -90,10 +87,6 @@ export class ResourcesComponent implements OnInit {
     return this.resourcesGrid.activeProject;
   }
 
-  private getProjects() {
-    this.projectService.getUserProjectsList().subscribe((projects: any) => 
this.projects = projects);
-  }
-
   private checkAutorize() {
    this.applicationSecurityService.isLoggedIn().subscribe( () => {
      this.getEnvironmentHealthStatus();
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
 
b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
index 4e41606..f2d3051 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
+++ 
b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
@@ -40,7 +40,9 @@
         <ng-template  ngFor let-item [ngForOf]="items" let-i="index">
           <li class="role-label" role="presentation" *ngIf="i === 0 || model 
&& item.type !== items[i - 1].type" (click)="toggleItemsForLable(item.type, 
$event)">
             <a href="#" class="list-item" role="menuitem">
-              <span class="arrow" [ngClass]="{'rotate-arrow': 
isOpenCategory[item.type], 'arrow-checked': selectedAllInCattegory(item.type) 
|| selectedSomeInCattegory(item.type)}"></span>
+              <span class="arrow" [ngClass]="{'rotate-arrow': 
isOpenCategory[item.type], 'arrow-checked': selectedAllInCattegory(item.type) 
|| selectedSomeInCattegory(item.type)}">
+                <i class="material-icons">keyboard_arrow_right</i>
+              </span>
               <span class="empty-checkbox" [ngClass]="{'checked': 
selectedAllInCattegory(item.type) || selectedSomeInCattegory(item.type)}" 
(click)="toggleselectedCategory($event, model, 
item.type);$event.stopPropagation()" >
                 <span class="checked-checkbox" 
*ngIf="selectedAllInCattegory(item.type)"></span>
                 <span class="line-checkbox" 
*ngIf="selectedSomeInCattegory(item.type)"></span>
@@ -64,12 +66,20 @@
               || model && isOpenCategory[item.type] && item.type === 
'COMPUTATIONAL_SHAPE' && item.type !== items[i - 1].type"
           >
             <a href="#" class="list-item" role="menuitem">
-              <span class="arrow" [ngClass]="{'rotate-arrow': 
isCloudOpen[item.type + item.cloud], 'arrow-checked': 
selectedAllInCloud(item.type, item.cloud) || selectedSomeInCloud(item.type, 
item.cloud)}"></span>
-              <span class="empty-checkbox" [ngClass]="{'checked': 
selectedAllInCloud(item.type, item.cloud) || selectedSomeInCloud(item.type, 
item.cloud)}" (click)="toggleSelectedCloud($event, model, item.type, 
item.cloud);$event.stopPropagation()" >
+              <span class="arrow" [ngClass]="{'rotate-arrow': 
isCloudOpen[item.type + item.cloud], 'arrow-checked': 
selectedAllInCloud(item.type, item.cloud) || selectedSomeInCloud(item.type, 
item.cloud)}">
+                 <i class="material-icons">keyboard_arrow_right</i>
+              </span>
+              <span class="empty-checkbox"
+                    [ngClass]="{
+                    'checked': selectedAllInCloud(item.type, item.cloud)
+                    || selectedSomeInCloud(item.type, item.cloud)}"
+                    (click)="toggleSelectedCloud($event, model, item.type, 
item.cloud);
+                    $event.stopPropagation()"
+              >
                 <span class="checked-checkbox" 
*ngIf="selectedAllInCloud(item.type, item.cloud)"></span>
                 <span class="line-checkbox" 
*ngIf="selectedSomeInCloud(item.type, item.cloud)"></span>
               </span>
-              {{item.cloud || 'AWS'}}
+              {{item.cloud}}
             </a>
           </li>
           <li class="role-cloud-item" role="presentation" *ngIf="model && 
isCloudOpen[item.type + item.cloud] && isOpenCategory[item.type]" >
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.scss
 
b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.scss
index 5323a24..1902d15 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.scss
+++ 
b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.scss
@@ -278,23 +278,22 @@
     }
 
     &.arrow{
-      width: 16px;
-      height: 14px;
-      border: 8px solid transparent;
-      border-left: 8px solid lightgrey;
-      left: 10px;
-      top: 12px;
-      border-radius: 3px;
-
+      left: 2px;
+      top: 9px;
+      i{
+        color: lightgrey;
+      }
       &.rotate-arrow{
         transform: rotate(90deg);
         transition: .1s ease-in-out;
-        top: 15px;
-        left: 6px;
+        top: 6px;
+        left: 0;
       }
 
       &.arrow-checked{
-        border-left: 8px solid #35afd5;
+        i{
+          color: #36afd5
+        }
       }
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to