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/09/14 09:34:36 UTC

[incubator-dlab] branch DLAB-2030 created (now d4e500f)

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

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


      at d4e500f  [DLAB-2030]: Added hint/message for different cases

This branch includes the following new commits:

     new ce7a97b  added hint to project and roles page
     new 2fd110d  added hint to project and roles page
     new d4e500f  [DLAB-2030]: Added hint/message for different cases

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.



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


[incubator-dlab] 02/03: added hint to project and roles page

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

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

commit 2fd110de25df7712c0967677edff5dc76da2f0e1
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Sep 14 10:24:09 2020 +0300

    added hint to project and roles page
---
 .../webapp/src/app/administration/project/project.component.html      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.html
index 98ea6aa..0765e2c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.html
@@ -46,7 +46,7 @@
 
   <mat-divider></mat-divider>
 
-  <mat-card class="project-form" *ngIf="!projectList.length">
+  <mat-card class="project-form" *ngIf="!projectList.length && healthStatus?.admin">
     <project-form></project-form>
   </mat-card>
 
@@ -54,4 +54,6 @@
     <project-list (editItem)="editProject($event)" (toggleStatus)="toggleStatus($event)">
     </project-list>
   </div>
+
+  <inform-message [message]="noPermissionMessage" *ngIf="!healthStatus?.admin && healthStatus?.projectAdmin && !projectList.length"></inform-message>
 </div>


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


[incubator-dlab] 01/03: added hint to project and roles page

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

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

commit ce7a97bea89fb6f799f079060785d0e38099bdc0
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Sep 14 10:23:59 2020 +0300

    added hint to project and roles page
---
 .../webapp/src/app/administration/project/index.ts | 20 ++++++++++--------
 .../administration/project/project.component.ts    |  1 +
 .../webapp/src/app/administration/roles/index.ts   | 18 ++++++++--------
 .../app/administration/roles/roles.component.html  |  3 ++-
 .../app/administration/roles/roles.component.ts    |  3 ++-
 .../main/resources/webapp/src/app/shared/index.ts  |  1 +
 .../src/app/shared/{ => inform-message}/index.ts   | 13 +++++++++---
 .../inform-message.component.css}                  | 16 ++++++++++++---
 .../inform-message/inform-message.component.html   | 21 +++++++++++++++++++
 .../inform-message.component.ts}                   | 24 +++++++++++++++++++---
 10 files changed, 92 insertions(+), 28 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/index.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/index.ts
index 609ea59..8e57f0f 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/index.ts
@@ -31,17 +31,19 @@ import { ProjectListComponent } from './project-list/project-list.component';
 import { ProjectComponent, EditProjectComponent } from './project.component';
 import { ProjectDataService } from './project-data.service';
 import {BubbleModule} from "../../shared/bubble";
+import {InformMessageModule} from '../../shared/inform-message';
 
 @NgModule({
-  imports: [
-    CommonModule,
-    FormsModule,
-    ReactiveFormsModule,
-    MaterialModule,
-    FormControlsModule,
-    UnderscorelessPipeModule,
-    BubbleModule
-  ],
+    imports: [
+        CommonModule,
+        FormsModule,
+        ReactiveFormsModule,
+        MaterialModule,
+        FormControlsModule,
+        UnderscorelessPipeModule,
+        BubbleModule,
+        InformMessageModule
+    ],
   declarations: [ProjectComponent, EditProjectComponent, ProjectFormComponent, ProjectListComponent],
   entryComponents: [EditProjectComponent],
   providers: [ProjectDataService],
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 d1b172e..bd45793 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
@@ -52,6 +52,7 @@ export class ProjectComponent implements OnInit, OnDestroy {
   healthStatus: any;
   activeFiltering: boolean = false;
   resources: any = [];
+  noPermissionMessage: string = 'You are not assigned to any project.';
 
   private subscriptions: Subscription = new Subscription();
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
index d0c57cc..28c16e2 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
@@ -25,17 +25,19 @@ import { MaterialModule } from '../../shared/material.module';
 import { FormControlsModule } from '../../shared/form-controls';
 import { RolesComponent, ConfirmDeleteUserAccountDialogComponent } from './roles.component';
 import { GroupNameValidationDirective } from './group-name-validarion.directive';
+import {InformMessageModule} from '../../shared/inform-message';
 
 @NgModule({
-  imports: [
-    CommonModule,
-    FormsModule,
-    ReactiveFormsModule,
-    MaterialModule,
-    FormControlsModule
-  ],
+    imports: [
+        CommonModule,
+        FormsModule,
+        ReactiveFormsModule,
+        MaterialModule,
+        FormControlsModule,
+        InformMessageModule
+    ],
   declarations: [RolesComponent, ConfirmDeleteUserAccountDialogComponent, GroupNameValidationDirective],
   entryComponents: [ConfirmDeleteUserAccountDialogComponent],
   exports: [RolesComponent]
 })
-export class RolesModule { }
\ No newline at end of file
+export class RolesModule { }
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html
index 9170e86..0a39fbd 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html
@@ -167,6 +167,7 @@
       <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
       <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
     </table>
-
   </div>
+
+  <inform-message [message]="noPermissionMessage" *ngIf="!healthStatus?.admin && healthStatus?.projectAdmin && !groupsData.length"></inform-message>
 </div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
index 0472e28..189bcba 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
@@ -51,6 +51,7 @@ export class RolesComponent implements OnInit {
   displayedColumns: string[] = ['name', 'roles', 'users', 'actions'];
   @Output() manageRolesGroupAction: EventEmitter<{}> = new EventEmitter();
   private startedGroups: Array<any>;
+  public noPermissionMessage: string = 'You have not permissions for groups which are not assigned to your projects.';
 
   constructor(
     public toastr: ToastrService,
@@ -67,7 +68,7 @@ export class RolesComponent implements OnInit {
   }
 
   openManageRolesDialog() {
-    setTimeout(() => {this.progressBarService.startProgressBar(); } , 0);
+    this.progressBarService.startProgressBar();
     this.rolesService.getGroupsData().subscribe(groups => {
       this.rolesService.getRolesData().subscribe(
         (roles: any) => {
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/index.ts b/services/self-service/src/main/resources/webapp/src/app/shared/index.ts
index 0c56c01..620cb7d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/index.ts
@@ -21,3 +21,4 @@ export * from './modal-dialog/confirmation-dialog';
 export * from './modal-dialog/progress-dialog';
 
 export * from './bubble';
+export * from './inform-message';
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/index.ts b/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/index.ts
similarity index 67%
copy from services/self-service/src/main/resources/webapp/src/app/shared/index.ts
copy to services/self-service/src/main/resources/webapp/src/app/shared/inform-message/index.ts
index 0c56c01..3e10ff7 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/index.ts
@@ -17,7 +17,14 @@
  * under the License.
  */
 
-export * from './modal-dialog/confirmation-dialog';
-export * from './modal-dialog/progress-dialog';
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { MaterialModule } from '../material.module';
+import {InformMessageComponent} from './inform-message.component';
 
-export * from './bubble';
+@NgModule({
+    imports: [CommonModule, MaterialModule],
+    declarations: [InformMessageComponent],
+    exports: [InformMessageComponent]
+})
+export class InformMessageModule { }
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/index.ts b/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.css
similarity index 68%
copy from services/self-service/src/main/resources/webapp/src/app/shared/index.ts
copy to services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.css
index 0c56c01..4a36213 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.css
@@ -17,7 +17,17 @@
  * under the License.
  */
 
-export * from './modal-dialog/confirmation-dialog';
-export * from './modal-dialog/progress-dialog';
+.message-wrapper{
+  min-height: 200px;
+  width: 100%;
+  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
+  transition: box-shadow 280ms cubic-bezier(.4,0,.2,1);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 16px;
+  border-radius: 4px;
+  background: #fff;
+  color: rgba(0,0,0,.87);
+}
 
-export * from './bubble';
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.html b/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.html
new file mode 100644
index 0000000..14a197a
--- /dev/null
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.html
@@ -0,0 +1,21 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<div class="message-wrapper">
+  <p class="highlight">{{message}}</p>
+</div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/index.ts b/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.ts
similarity index 63%
copy from services/self-service/src/main/resources/webapp/src/app/shared/index.ts
copy to services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.ts
index 0c56c01..f516928 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/inform-message/inform-message.component.ts
@@ -17,7 +17,25 @@
  * under the License.
  */
 
-export * from './modal-dialog/confirmation-dialog';
-export * from './modal-dialog/progress-dialog';
+import { Component, Input, Output, EventEmitter, HostBinding,
+         ChangeDetectorRef, ElementRef, OnInit, OnDestroy,
+         ViewEncapsulation, HostListener } from '@angular/core';
 
-export * from './bubble';
+
+@Component({
+  selector: 'inform-message',
+  templateUrl: './inform-message.component.html',
+  styleUrls: ['./inform-message.component.css'],
+
+
+})
+export class InformMessageComponent implements OnInit {
+  @Input() message: string;
+
+  constructor() {}
+
+  ngOnInit(): void {
+  }
+
+
+}


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


[incubator-dlab] 03/03: [DLAB-2030]: Added hint/message for different cases

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

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

commit d4e500f45844aa3c6a6c28cfe825c4e4f9a993fa
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Mon Sep 14 12:34:01 2020 +0300

    [DLAB-2030]: Added hint/message for different cases
---
 ...utational-resource-create-dialog.component.html |  2 +-
 .../create-environment.component.html              | 49 ++++++++++++++--------
 .../create-environment.component.scss              |  4 ++
 .../create-environment.component.ts                |  3 ++
 4 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
index 62ab6af..d8835fe 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.html
@@ -233,7 +233,7 @@
     </div>
     <ng-template #placeholder>
       <div *ngIf="!loading && !clusterTypes?.length" class="info message">
-        Compute creations are not available.<br>Please, check your permissions.</div>
+        Compute creations are not available. Please, check your permissions.</div>
       <div *ngIf="loading" class="info message">
         Compute data is processing
         <mat-progress-bar mode="indeterminate"></mat-progress-bar>
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
index 1fd27d6..f12a3f2 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
@@ -60,24 +60,30 @@
             </mat-form-field>
           </div>
         </div>
-
         <div class="control-group">
           <label class="label">Select template</label>
-          <div class="control selector-wrapper" [ngClass]="{ 'not-active' : !templates.length }">
-            <mat-form-field>
-              <mat-select formControlName="version" disableOptionCentering [disabled]="!templates.length"
-                panelClass="create-resources-dialog" placeholder="Select template">
-                <mat-option *ngFor="let template of templates"
-                  [value]="template.exploratory_environment_versions[0].version" (click)="getShapes(template)">
-                  {{ template.exploratory_environment_versions[0].template_name }}
-                </mat-option>
-                <mat-option *ngIf="!templates.length" class="multiple-select ml-10" disabled>Templates list is empty
-                </mat-option>
-              </mat-select>
-              <button class="caret">
-                <i class="material-icons">keyboard_arrow_down</i>
-              </button>
-            </mat-form-field>
+          <div class="control selector-wrapper"
+               [matTooltip]="'Notebook creations are not available. Please, check your permissions.'"
+               matTooltipPosition="above"
+               [matTooltipClass]="'bucket-item-tooltip'"
+               [matTooltipDisabled]="!(templates.length === 0 && this.createExploratoryForm.controls.endpoint.value)"
+          >
+            <span class="form-field-wrapper"  [ngClass]="{ 'not-active' : !templates.length  || (templates.length === 0 && this.createExploratoryForm.controls.endpoint.value)}">
+              <mat-form-field>
+                <mat-select formControlName="version" disableOptionCentering [disabled]="!templates.length || (templates.length === 0 && this.createExploratoryForm.controls.endpoint.value)"
+                  panelClass="create-resources-dialog" placeholder="Select template">
+                  <mat-option *ngFor="let template of templates"
+                    [value]="template.exploratory_environment_versions[0].version" (click)="getShapes(template)">
+                    {{ template.exploratory_environment_versions[0].template_name }}
+                  </mat-option>
+                  <mat-option *ngIf="!templates.length" class="multiple-select ml-10" disabled>Templates list is empty
+                  </mat-option>
+                </mat-select>
+                <button class="caret">
+                  <i class="material-icons">keyboard_arrow_down</i>
+                </button>
+              </mat-form-field>
+            </span>
           </div>
         </div>
 
@@ -118,10 +124,16 @@
 
         <div class="control-group">
           <label class="label">Instance size</label>
-          <div class="control selector-wrapper" [ngClass]="{ 'not-active': !currentTemplate }">
+          <div class="control selector-wrapper"
+               [matTooltip]="'Instance size are not available. Please, check your permissions.'"
+               matTooltipPosition="above"
+               [matTooltipClass]="'bucket-item-tooltip'"
+               [matTooltipDisabled]="!(!areShapes && currentTemplate)"
+          >
+            <span class="form-field-wrapper" [ngClass]="{ 'not-active': !currentTemplate || !areShapes && currentTemplate}">
             <mat-form-field>
               <mat-label>Select instance size</mat-label>
-              <mat-select formControlName="shape" disableOptionCentering [disabled]="!currentTemplate"
+              <mat-select formControlName="shape" disableOptionCentering [disabled]="!currentTemplate || !areShapes && currentTemplate"
                 panelClass="create-resources-shapes" placeholder="Instance size">
                 <mat-optgroup *ngFor="let item of (shapes | keys)" [label]="item.key | underscoreless">
                   <mat-option *ngFor="let list_item of item.value" [value]="list_item.Type">
@@ -133,6 +145,7 @@
                 <i class="material-icons">keyboard_arrow_down</i>
               </button>
             </mat-form-field>
+            </span>
           </div>
         </div>
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.scss b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.scss
index f02436e..a324aa2 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.scss
@@ -68,6 +68,10 @@
   overflow-y: auto;
 }
 
+.form-field-wrapper{
+  width: 100%;
+}
+
 @-moz-document url-prefix() {
   .create-environment form {
     padding-bottom: 30px;
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
index 4ae38ad..8ca54d1 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
@@ -48,6 +48,7 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
   resourceGrid: any;
   images: Array<any>;
   maxNotebookLength: number = 14;
+  public areShapes: boolean;
 
   @ViewChild('configurationNode', { static: false }) configuration;
 
@@ -99,6 +100,7 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
   public getTemplates(project, endpoint) {
     this.userResourceService.getExploratoryTemplates(project, endpoint)
       .pipe(tap(results => {
+
         results.sort((a, b) =>
           (a.exploratory_environment_versions[0].template_name > b.exploratory_environment_versions[0].template_name) ?
             1 : -1);
@@ -129,6 +131,7 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
       this.shapes = SortUtils.shapesSort(template.exploratory_environment_shapes);
       this.getImagesList();
     }
+    this.areShapes = !!Object.keys(this.shapes).length;
   }
 
   public createExploratoryEnvironment(data) {


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