You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/06/04 10:56:53 UTC

[incubator-dlab] branch feature/projects updated (e27fed5 -> 8f082f6)

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

ankovalyshyn pushed a change to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


    from e27fed5  Merge branch 'feature/projects' of github.com:apache/incubator-dlab into feature/projects
     new 72c4a86  [DLAB-741]: manage roles fixes
     new 8f082f6  [DLAB-386]: manage role form card fixes

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.


Summary of changes:
 .../administration/project/project.component.scss  |  18 ---
 .../administration/project/project.component.ts    |   3 +-
 .../app/administration/roles/roles.component.html  | 129 +++++++++++----------
 .../app/administration/roles/roles.component.scss  |   1 -
 .../app/administration/roles/roles.component.ts    |  47 ++++----
 5 files changed, 88 insertions(+), 110 deletions(-)
 delete mode 100644 services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.scss


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


[incubator-dlab] 01/02: [DLAB-741]: manage roles fixes

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

ankovalyshyn pushed a commit to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 72c4a8617f3d29439c1ed659afd722c318e54830
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jun 4 13:02:17 2019 +0300

    [DLAB-741]: manage roles fixes
---
 .../app/administration/roles/roles.component.html  |  1 -
 .../app/administration/roles/roles.component.scss  |  1 -
 .../app/administration/roles/roles.component.ts    | 47 ++++++++++------------
 3 files changed, 22 insertions(+), 27 deletions(-)

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 0c91936..8ea280d 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
@@ -48,7 +48,6 @@
       <ng-template matStepLabel>Roles</ng-template>
       <div class="inner-step mat-reset">
         <div class="selector-wrapper">
-          <!-- <multi-select-dropdown (selectionChange)="onUpdate($event)" [type]="'role'" [items]="rolesList" [model]="setupRoles"></multi-select-dropdown> -->
           <mat-form-field>
             <mat-select multiple [compareWith]="compareObjects" name="roles" [(value)]="setupRoles"
               placeholder="Select roles">
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss
index 4285e20..a7d1478 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss
@@ -36,7 +36,6 @@
   }
 }
 
-
 .content-box {
   padding: 20px 30px 35px;
   height: 85vh;
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 b5dce66..16e5a67 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
@@ -22,7 +22,7 @@ import { ValidatorFn, FormControl } from '@angular/forms';
 import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
 import { ToastrService } from 'ngx-toastr';
 
-import { RolesGroupsService } from '../../core/services';
+import { RolesGroupsService, HealthStatusService } from '../../core/services';
 import { DICTIONARY } from '../../../dictionary/global.dictionary';
 
 @Component({
@@ -41,27 +41,36 @@ export class RolesComponent implements OnInit {
   public manageUser: string = '';
   public setupRoles: Array<string> = [];
   public updatedRoles: Array<string> = [];
+  public healthStatus: any;
   public delimitersRegex = /[-_]?/g;
   public groupnamePattern = new RegExp(/^[a-zA-Z0-9_\-]+$/);
-
+  
+  stepperView: boolean = false;
   displayedColumns: string[] = ['name', 'roles', 'users', 'actions'];
   @Output() manageRolesGroupAction: EventEmitter<{}> = new EventEmitter();
-  stepperView: boolean = false;
 
   constructor(
     public toastr: ToastrService,
     public dialog: MatDialog,
-    private rolesService: RolesGroupsService
+    private rolesService: RolesGroupsService,
+    private healthStatusService: HealthStatusService
   ) { }
 
   ngOnInit() {
-  this.openManageRolesDialog()
+  this.openManageRolesDialog();
+  this.getEnvironmentHealthStatus();
   }
 
   openManageRolesDialog() {
-    this.rolesService.getGroupsData().subscribe(group => {
+    this.rolesService.getGroupsData().subscribe(groups => {
       this.rolesService.getRolesData().subscribe(
-        roles => this.open(group, roles),
+        (roles: any) => {
+          this.roles = roles;
+          this.rolesList = roles.map(role => role.description);
+          this.updateGroupData(groups);
+      
+          this.stepperView = false;
+        },
         error => this.toastr.error(error.message, 'Oops!'));
     },
     error => this.toastr.error(error.message, 'Oops!'));
@@ -73,23 +82,6 @@ export class RolesComponent implements OnInit {
       error => this.toastr.error(error.message, 'Oops!'));
   }
 
-  public open(groups, roles): void {
-    this.roles = roles;
-    this.rolesList = roles.map(role => role.description);
-    this.updateGroupData(groups);
-
-    this.stepperView = false;
-  }
-
-  public onUpdate($event) {
-    if ($event.type === 'role') {
-      this.setupRoles = $event.model;
-    } else {
-      this.updatedRoles = $event.model;
-    }
-    $event.$event.preventDefault();
-  }
-
   public selectAllOptions(item, values, byKey?) {
     byKey ? (item[byKey] = values ? values : []) : this.setupRoles = values ? values : [];
   }
@@ -128,7 +120,7 @@ export class RolesComponent implements OnInit {
     this.resetDialog();
   }
 
-  manageRolesGroups($event) {
+  public manageRolesGroups($event) {
     switch ($event.action) {
       case 'create':
         this.rolesService.setupNewGroup($event.value).subscribe(res => {
@@ -215,6 +207,11 @@ export class RolesComponent implements OnInit {
       item.users instanceof Array ? item.users.push(value.trim()) : item.users = [value.trim()];
     }
   }
+
+  private getEnvironmentHealthStatus() {
+    this.healthStatusService.getEnvironmentHealthStatus()
+      .subscribe((result: any) => this.healthStatus = result);
+  }
 }
 
 


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


[incubator-dlab] 02/02: [DLAB-386]: manage role form card fixes

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

ankovalyshyn pushed a commit to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 8f082f66fae54f29cd9d3b6bfca0005e0020b471
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jun 4 13:56:25 2019 +0300

    [DLAB-386]: manage role form card fixes
---
 .../administration/project/project.component.scss  |  18 ---
 .../administration/project/project.component.ts    |   3 +-
 .../app/administration/roles/roles.component.html  | 128 +++++++++++----------
 3 files changed, 66 insertions(+), 83 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.scss
deleted file mode 100644
index 7220975..0000000
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.scss
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
\ No newline at end of file
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 6a1f7a9..c41ab27 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
@@ -34,8 +34,7 @@ export interface Project {
 
 @Component({
   selector: 'dlab-project',
-  templateUrl: './project.component.html',
-  styleUrls: ['./project.component.scss']
+  templateUrl: './project.component.html'
 })
 export class ProjectComponent implements OnInit, OnDestroy {
   projectList: Project[] = [];
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 8ea280d..fe499ae 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
@@ -27,70 +27,72 @@
     <div></div>
   </div>
 
-  <mat-horizontal-stepper #stepper *ngIf="stepperView" class="stepper ani">
-    <mat-step>
-      <ng-template matStepLabel>Groups</ng-template>
-      <div class="inner-step mat-reset">
-        <input [validator]="groupValidarion()" type="text" placeholder="Enter group name" [(ngModel)]="setupGroup"
-          #setupGroupName="ngModel">
-        <div class="danger_color" *ngIf="setupGroupName.errors?.patterns && setupGroupName.dirty">Group name can only
-          contain letters, numbers, hyphens and '_'</div>
-        <div class="danger_color" *ngIf="setupGroupName.errors?.duplicate && setupGroupName.dirty">Group name already
-          exists</div>
-      </div>
-      <div class="text-center m-bott-10">
-        <button mat-raised-button (click)="resetDialog()" class="butt">Cancel</button>
-        <button mat-raised-button matStepperNext class="butt">Next<i
-            class="material-icons">keyboard_arrow_right</i></button>
-      </div>
-    </mat-step>
-    <mat-step>
-      <ng-template matStepLabel>Roles</ng-template>
-      <div class="inner-step mat-reset">
-        <div class="selector-wrapper">
-          <mat-form-field>
-            <mat-select multiple [compareWith]="compareObjects" name="roles" [(value)]="setupRoles"
-              placeholder="Select roles">
-              <mat-option class="multiple-select" disabled>
-                <a class="select ani" (click)="selectAllOptions(setupRoles, rolesList)">
-                  <i class="material-icons">playlist_add_check</i>&nbsp;All
-                </a>
-                <a class="deselect ani" (click)="selectAllOptions(setupRoles)">
-                  <i class="material-icons">clear</i>&nbsp;None
-                </a>
-              </mat-option>
-              <mat-option *ngFor="let role of rolesList" [value]="role">
-                {{ role }}
-              </mat-option>
-            </mat-select>
-            <button class="caret">
-              <i class="material-icons">keyboard_arrow_down</i>
-            </button>
-          </mat-form-field>
+  <mat-card *ngIf="stepperView" class="m-top-10">
+    <mat-horizontal-stepper #stepper  class="stepper ani">
+      <mat-step>
+        <ng-template matStepLabel>Groups</ng-template>
+        <div class="inner-step mat-reset">
+          <input [validator]="groupValidarion()" type="text" placeholder="Enter group name" [(ngModel)]="setupGroup"
+            #setupGroupName="ngModel">
+          <div class="danger_color" *ngIf="setupGroupName.errors?.patterns && setupGroupName.dirty">Group name can only
+            contain letters, numbers, hyphens and '_'</div>
+          <div class="danger_color" *ngIf="setupGroupName.errors?.duplicate && setupGroupName.dirty">Group name already
+            exists</div>
+        </div>
+        <div class="text-center m-bott-10">
+          <button mat-raised-button (click)="resetDialog()" class="butt">Cancel</button>
+          <button mat-raised-button matStepperNext class="butt">Next<i
+              class="material-icons">keyboard_arrow_right</i></button>
+        </div>
+      </mat-step>
+      <mat-step>
+        <ng-template matStepLabel>Roles</ng-template>
+        <div class="inner-step mat-reset">
+          <div class="selector-wrapper">
+            <mat-form-field>
+              <mat-select multiple [compareWith]="compareObjects" name="roles" [(value)]="setupRoles"
+                placeholder="Select roles">
+                <mat-option class="multiple-select" disabled>
+                  <a class="select ani" (click)="selectAllOptions(setupRoles, rolesList)">
+                    <i class="material-icons">playlist_add_check</i>&nbsp;All
+                  </a>
+                  <a class="deselect ani" (click)="selectAllOptions(setupRoles)">
+                    <i class="material-icons">clear</i>&nbsp;None
+                  </a>
+                </mat-option>
+                <mat-option *ngFor="let role of rolesList" [value]="role">
+                  {{ role }}
+                </mat-option>
+              </mat-select>
+              <button class="caret">
+                <i class="material-icons">keyboard_arrow_down</i>
+              </button>
+            </mat-form-field>
+          </div>
+        </div>
+        <div class="text-center m-bott-10">
+          <button mat-raised-button matStepperPrevious class="butt"><i
+              class="material-icons">keyboard_arrow_left</i>Back</button>
+          <button mat-raised-button (click)="resetDialog()" class="butt">Cancel</button>
+          <button mat-raised-button matStepperNext class="butt">Next<i
+              class="material-icons">keyboard_arrow_right</i></button>
+        </div>
+      </mat-step>
+      <mat-step>
+        <ng-template matStepLabel>Users</ng-template>
+        <div class="inner-step mat-reset">
+          <input type="text" placeholder="Enter user login" [(ngModel)]="setupUser">
+        </div>
+        <div class="text-center m-bott-10">
+          <button mat-raised-button matStepperPrevious class="butt"><i
+              class="material-icons">keyboard_arrow_left</i>Back</button>
+          <button mat-raised-button (click)="resetDialog()" class="butt">Cancel</button>
+          <button mat-raised-button (click)="manageAction('create', 'group')" class="butt butt-success"
+            [disabled]="!setupGroup || setupGroupName.errors?.pattern || !setupRoles.length > 0">Create</button>
         </div>
-      </div>
-      <div class="text-center m-bott-10">
-        <button mat-raised-button matStepperPrevious class="butt"><i
-            class="material-icons">keyboard_arrow_left</i>Back</button>
-        <button mat-raised-button (click)="resetDialog()" class="butt">Cancel</button>
-        <button mat-raised-button matStepperNext class="butt">Next<i
-            class="material-icons">keyboard_arrow_right</i></button>
-      </div>
-    </mat-step>
-    <mat-step>
-      <ng-template matStepLabel>Users</ng-template>
-      <div class="inner-step mat-reset">
-        <input type="text" placeholder="Enter user login" [(ngModel)]="setupUser">
-      </div>
-      <div class="text-center m-bott-10">
-        <button mat-raised-button matStepperPrevious class="butt"><i
-            class="material-icons">keyboard_arrow_left</i>Back</button>
-        <button mat-raised-button (click)="resetDialog()" class="butt">Cancel</button>
-        <button mat-raised-button (click)="manageAction('create', 'group')" class="butt butt-success"
-          [disabled]="!setupGroup || setupGroupName.errors?.pattern || !setupRoles.length > 0">Create</button>
-      </div>
-    </mat-step>
-  </mat-horizontal-stepper>
+      </mat-step>
+    </mat-horizontal-stepper>
+  </mat-card>
   <mat-divider></mat-divider>
 
   <div *ngIf="groupsData.length" class="ani">


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