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/05/30 10:32:04 UTC

[incubator-dlab] branch feature/projects updated (761393d -> 8cee4bb)

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 761393d  [DLAB-631]: fixed parameters passing impacted prod build
     new 72b6fb9  [DLAB-631]: fixed backdrop issue on 403 page
     new 536904e  [DLAB-631]: added Delete Endpoint
     new 484d8d6  [DLAB-631]: added admin guard to check user access
     new deffced  [DLAB-631]: modified passageway to check user access
     new 9598995  [DLAB-631]: moved manage roles functionality into separate page
     new 766d0f9  [DLAB-631]: moved manage roles functionality into separate page
     new 3c78764  [DLAB-631]: added roles to navigation
     new 397c9f3  [DLAB-631]: added tabs with endpoints list
     new 182e9c2  [DLAB-631]: added ability to delete endpoints with confirmation
     new 8cee4bb  [DLAB-631]: tabs component fixes

The 10 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:
 .../app/access-denied/access-denied.component.scss |   5 -
 .../app/administration/administration.module.ts    |   5 +-
 .../management/endpoints/endpoints.component.html  |  80 +++++++---
 .../management/endpoints/endpoints.component.scss  |  42 ++++++
 .../management/endpoints/endpoints.component.ts    |  15 +-
 .../src/app/administration/management/index.ts     |   7 -
 .../manage-roles-groups.component.html             | 154 --------------------
 .../management/management.component.html           |  44 +++---
 .../management/management.component.ts             |  92 ++++++------
 .../administration/project/project.component.html  |   2 +-
 .../group-name-validarion.directive.ts             |   0
 .../scheduler => administration/roles}/index.ts    |  21 +--
 .../app/administration/roles/roles.component.html  | 161 +++++++++++++++++++++
 .../roles.component.scss}                          |   0
 .../roles.component.ts}                            |  82 +++++++++--
 .../resources/webapp/src/app/app.routing.module.ts |  11 +-
 .../resources/webapp/src/app/core/core.module.ts   |   2 +
 .../{cloudProvider.guard.ts => admin.quard.ts}     |   4 +-
 .../services/applicationServiceFacade.service.ts   |   6 +
 .../src/app/core/services/cloudProvider.guard.ts   |   2 +-
 .../src/app/core/services/endpoint.service.ts      |   9 ++
 .../src/app/core/services/healthStatus.service.ts  |   8 +-
 .../webapp/src/app/core/services/index.ts          |   1 +
 .../manage-ungit/manage-ungit.component.html       |   2 +-
 .../src/app/shared/navbar/navbar.component.html    |  15 +-
 .../src/app/shared/navbar/navbar.component.scss    |  34 +++--
 .../webapp/src/assets/styles/_general.scss         |   1 +
 .../src/main/resources/webapp/src/styles.scss      |   4 +-
 28 files changed, 496 insertions(+), 313 deletions(-)
 delete mode 100644 services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.html
 rename services/self-service/src/main/resources/webapp/src/app/administration/{management/manage-roles-groups => roles}/group-name-validarion.directive.ts (100%)
 copy services/self-service/src/main/resources/webapp/src/app/{resources/scheduler => administration/roles}/index.ts (71%)
 create mode 100644 services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html
 rename services/self-service/src/main/resources/webapp/src/app/administration/{management/manage-roles-groups/manage-roles-groups.component.scss => roles/roles.component.scss} (100%)
 rename services/self-service/src/main/resources/webapp/src/app/administration/{management/manage-roles-groups/manage-roles-groups.component.ts => roles/roles.component.ts} (68%)
 copy services/self-service/src/main/resources/webapp/src/app/core/services/{cloudProvider.guard.ts => admin.quard.ts} (91%)


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


[incubator-dlab] 02/10: [DLAB-631]: added Delete Endpoint

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 536904efd98e28de9cbb46a2b62ae77d90a531b0
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:15:28 2019 +0300

    [DLAB-631]: added Delete Endpoint
---
 .../src/app/core/services/applicationServiceFacade.service.ts    | 6 ++++++
 .../resources/webapp/src/app/core/services/endpoint.service.ts   | 9 +++++++++
 2 files changed, 15 insertions(+)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
index 9039f20..4f7330d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
@@ -551,6 +551,12 @@ export class ApplicationServiceFacade {
       data);
   }
 
+  public buildDeleteEndpoint(param): Observable<any> {
+    return this.buildRequest(RequestMethod.Delete,
+      this.requestRegistry.Item(ApplicationServiceFacade.ENDPOINT) + param,
+      null);
+  }
+
   private setupRegistry(): void {
     this.requestRegistry = new Dictionary<string>();
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/endpoint.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/endpoint.service.ts
index 970956e..98801b4 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/endpoint.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/endpoint.service.ts
@@ -46,5 +46,14 @@ export class EndpointService {
         map(response => response),
         catchError(ErrorUtils.handleServiceError));
   }
+
+  public deleteEndpoint(data): Observable<any> {
+    const url = `/${data}`;
+    return this.applicationServiceFacade
+      .buildDeleteEndpoint(url)
+      .pipe(
+        map(response => response),
+        catchError(ErrorUtils.handleServiceError));
+  }
 }
 


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


[incubator-dlab] 05/10: [DLAB-631]: moved manage roles functionality into separate page

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 9598995a4b353953870355a9733b97b3ae9ba4da
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:26:00 2019 +0300

    [DLAB-631]: moved manage roles functionality into separate page
---
 .../manage-roles-groups.component.html             | 154 --------------------
 .../group-name-validarion.directive.ts             |   0
 .../index.ts}                                      |  36 +++--
 .../app/administration/roles/roles.component.html  | 161 +++++++++++++++++++++
 .../roles.component.scss}                          |   0
 .../roles.component.ts}                            |  82 +++++++++--
 6 files changed, 248 insertions(+), 185 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.html
deleted file mode 100644
index b21d860..0000000
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.html
+++ /dev/null
@@ -1,154 +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.
-  -->
-
-<modal-dialog #bindDialog modalClass="manage-roles-dialog modal-xxl">
-  <modal-header>
-    <h4 class="modal-title">Manage roles</h4>
-  </modal-header>
-  <modal-content>
-    <div class="content-box">
-      <button mat-raised-button class="butt add-group" (click)="stepperView = !stepperView">
-        <i class="material-icons">people_outline</i>Add group
-      </button>
-      <mat-horizontal-stepper #stepper *ngIf="stepperView" class="stepper roles 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">
-              <!-- <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">
-                    <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>
-        </mat-step>
-      </mat-horizontal-stepper>
-      <mat-divider></mat-divider>
-      <div *ngIf="groupsData.length" class="ani">
-        <table class="dashboard_table">
-          <tr>
-            <th class="th_name groups">Name</th>
-            <th class="roles">Roles</th>
-            <th class="users">Users</th>
-            <th class="th_actions">Action</th>
-          </tr>
-          <tr *ngFor="let item of groupsData" class="dashboard_table_body filter-row">
-            <td>{{ item.group }}</td>
-            <td class="roles mat-reset">
-              <div class="selector-wrapper-edit">
-                <mat-form-field>
-                  <mat-select multiple [compareWith]="compareObjects" name="selected_roles" [(value)]="item.selected_roles" placeholder="Select roles">
-                    <mat-option class="multiple-select" disabled>
-                      <a class="select ani" (click)="selectAllOptions(item, rolesList, 'selected_roles')">
-                        <i class="material-icons">playlist_add_check</i>&nbsp;All
-                      </a>
-                      <a class="deselect ani" (click)="selectAllOptions(item, null, 'selected_roles')">
-                        <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 ani">
-                    <i class="material-icons">keyboard_arrow_down</i>
-                  </button>
-                </mat-form-field>
-              </div>
-            </td>
-            <td class="users-list ani">
-              <mat-form-field class="chip-list">
-                <input #user matInput placeholder="Enter user login" pattern="[@.-_0-9a-zA-Z]" (keydown.enter)="addUser(user.value, item); user.value = ''">
-                <button mat-icon-button matSuffix (click)="addUser(user.value, item); user.value = ''">
-                  <mat-icon>person_add</mat-icon>
-                </button>
-              </mat-form-field>
-              <div class="list-selected list-container ani">
-                <mat-chip-list>
-                  <mat-chip *ngFor="let user of item.users">
-                    {{ user }}
-                    <a class="material-icons" (click)="removeUser(item.users, user)">clear</a>
-                  </mat-chip>
-                </mat-chip-list>
-              </div>
-            </td>
-            <td class="actions">
-              <button mat-icon-button class="reset ani" (click)="manageAction('delete', 'group', item)">
-                <i class="material-icons">close</i>
-              </button>
-
-              <button mat-icon-button class="apply ani" matTooltip="Group cannot be updated without any selected role"
-                      matTooltipPosition="above"
-                      [matTooltipDisabled]="item.selected_roles.length > 0"
-                      [ngClass]="{ 'not-allowed' : !item.selected_roles.length }"
-                      (click)="manageAction('update', 'group', item)">
-                <i class="material-icons">done</i>
-              </button>
-            </td>
-          </tr>
-        </table>
-      </div>
-    </div>
-  </modal-content>
-</modal-dialog>
-
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/group-name-validarion.directive.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/group-name-validarion.directive.ts
similarity index 100%
copy from services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/group-name-validarion.directive.ts
copy to services/self-service/src/main/resources/webapp/src/app/administration/roles/group-name-validarion.directive.ts
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/group-name-validarion.directive.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
similarity index 50%
rename from services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/group-name-validarion.directive.ts
rename to services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
index e3f7207..d0c57cc 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/group-name-validarion.directive.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/index.ts
@@ -17,21 +17,25 @@
  * under the License.
  */
 
-import { Directive, forwardRef, Input } from '@angular/core';
-import { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 
-@Directive({
-  selector: '[validator][ngModel],[group-dir][ngFormControl]',
-  providers: [{
-    multi: true,
-    provide: NG_VALIDATORS,
-    useExisting: forwardRef(() => GroupNameValidationDirective)
-  }]
-})
-export class GroupNameValidationDirective implements Validator {
-  @Input() validator: Function;
+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';
 
-  validate(control: AbstractControl): { [key: string]: any; } {
-    return this.validator(control);
-  }
-}
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    ReactiveFormsModule,
+    MaterialModule,
+    FormControlsModule
+  ],
+  declarations: [RolesComponent, ConfirmDeleteUserAccountDialogComponent, GroupNameValidationDirective],
+  entryComponents: [ConfirmDeleteUserAccountDialogComponent],
+  exports: [RolesComponent]
+})
+export class RolesModule { }
\ No newline at end of file
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
new file mode 100644
index 0000000..cade0b6
--- /dev/null
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.html
@@ -0,0 +1,161 @@
+<!--
+  ~ 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.
+  -->
+
+<!-- <modal-dialog #bindDialog modalClass="manage-roles-dialog modal-xxl">
+  <modal-header>
+    <h4 class="modal-title">Manage roles</h4>
+  </modal-header>
+  <modal-content> -->
+<div class="content-box">
+  <button mat-raised-button class="butt add-group" (click)="stepperView = !stepperView">
+    <i class="material-icons">people_outline</i>Add group
+  </button>
+  <mat-horizontal-stepper #stepper *ngIf="stepperView" class="stepper roles 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">
+          <!-- <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">
+              <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>
+    </mat-step>
+  </mat-horizontal-stepper>
+  <mat-divider></mat-divider>
+  <div *ngIf="groupsData.length" class="ani">
+    <table class="dashboard_table">
+      <tr>
+        <th class="th_name groups">Name</th>
+        <th class="roles">Roles</th>
+        <th class="users">Users</th>
+        <th class="th_actions">Action</th>
+      </tr>
+      <tr *ngFor="let item of groupsData" class="dashboard_table_body filter-row">
+        <td>{{ item.group }}</td>
+        <td class="roles mat-reset">
+          <div class="selector-wrapper-edit">
+            <mat-form-field>
+              <mat-select multiple [compareWith]="compareObjects" name="selected_roles" [(value)]="item.selected_roles"
+                placeholder="Select roles">
+                <mat-option class="multiple-select" disabled>
+                  <a class="select ani" (click)="selectAllOptions(item, rolesList, 'selected_roles')">
+                    <i class="material-icons">playlist_add_check</i>&nbsp;All
+                  </a>
+                  <a class="deselect ani" (click)="selectAllOptions(item, null, 'selected_roles')">
+                    <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 ani">
+                <i class="material-icons">keyboard_arrow_down</i>
+              </button>
+            </mat-form-field>
+          </div>
+        </td>
+        <td class="users-list ani">
+          <mat-form-field class="chip-list">
+            <input #user matInput placeholder="Enter user login" pattern="[@.-_0-9a-zA-Z]"
+              (keydown.enter)="addUser(user.value, item); user.value = ''">
+            <button mat-icon-button matSuffix (click)="addUser(user.value, item); user.value = ''">
+              <mat-icon>person_add</mat-icon>
+            </button>
+          </mat-form-field>
+          <div class="list-selected list-container ani">
+            <mat-chip-list>
+              <mat-chip *ngFor="let user of item.users">
+                {{ user }}
+                <a class="material-icons" (click)="removeUser(item.users, user)">clear</a>
+              </mat-chip>
+            </mat-chip-list>
+          </div>
+        </td>
+        <td class="actions">
+          <button mat-icon-button class="reset ani" (click)="manageAction('delete', 'group', item)">
+            <i class="material-icons">close</i>
+          </button>
+
+          <button mat-icon-button class="apply ani" matTooltip="Group cannot be updated without any selected role"
+            matTooltipPosition="above" [matTooltipDisabled]="item.selected_roles.length > 0"
+            [ngClass]="{ 'not-allowed' : !item.selected_roles.length }" (click)="manageAction('update', 'group', item)">
+            <i class="material-icons">done</i>
+          </button>
+        </td>
+      </tr>
+    </table>
+  </div>
+</div>
+<!-- </modal-content>
+</modal-dialog> -->
\ No newline at end of file
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss
similarity index 100%
rename from services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.scss
rename to services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.scss
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
similarity index 68%
rename from services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.ts
rename to services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
index bc91c94..8bc7b8d 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-roles-groups/manage-roles-groups.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
@@ -17,17 +17,20 @@
  * under the License.
  */
 
-import { Component, OnInit, ViewChild, Output, EventEmitter, Inject } from '@angular/core';
-import { ValidatorFn, FormControl, NgModel } from '@angular/forms';
+import { Component, OnInit, Output, EventEmitter, Inject } from '@angular/core';
+import { ValidatorFn, FormControl } from '@angular/forms';
 import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
-import { DICTIONARY } from '../../../../dictionary/global.dictionary';
+import { ToastrService } from 'ngx-toastr';
+
+import { RolesGroupsService } from '../../core/services';
+import { DICTIONARY } from '../../../dictionary/global.dictionary';
 
 @Component({
-  selector: 'dlab-manage-roles-groups',
-  templateUrl: './manage-roles-groups.component.html',
-  styleUrls: ['../../../resources/resources-grid/resources-grid.component.css', './manage-roles-groups.component.scss']
+  selector: 'dlab-roles',
+  templateUrl: './roles.component.html',
+  styleUrls: ['../../resources/resources-grid/resources-grid.component.css', './roles.component.scss']
 })
-export class ManageRolesGroupsComponent implements OnInit {
+export class RolesComponent implements OnInit {
   readonly DICTIONARY = DICTIONARY;
 
   public groupsData: Array<any> = [];
@@ -41,23 +44,40 @@ export class ManageRolesGroupsComponent implements OnInit {
   public delimitersRegex = /[-_]?/g;
   public groupnamePattern = new RegExp(/^[a-zA-Z0-9_\-]+$/);
 
-  @ViewChild('bindDialog') bindDialog;
   @Output() manageRolesGroupAction: EventEmitter<{}> = new EventEmitter();
   stepperView: boolean = false;
 
-  constructor(public dialog: MatDialog) { }
+  constructor(
+    public toastr: ToastrService,
+    public dialog: MatDialog,
+    private rolesService: RolesGroupsService
+  ) { }
 
   ngOnInit() {
-    this.bindDialog.onClosing = () => this.resetDialog();
+  this.openManageRolesDialog()
+  }
+
+  openManageRolesDialog() {
+    this.rolesService.getGroupsData().subscribe(group => {
+      this.rolesService.getRolesData().subscribe(
+        roles => this.open(group, roles),
+        error => this.toastr.error(error.message, 'Oops!'));
+    },
+    error => this.toastr.error(error.message, 'Oops!'));
   }
 
-  public open(param, groups, roles): void {
+  getGroupsData() {
+    this.rolesService.getGroupsData().subscribe(
+      list => this.updateGroupData(list),
+      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;
-    this.bindDialog.open(param);
   }
 
   public onUpdate($event) {
@@ -75,7 +95,7 @@ export class ManageRolesGroupsComponent implements OnInit {
 
   public manageAction(action: string, type: string, item?: any, value?) {
     if (action === 'create') {
-      this.manageRolesGroupAction.emit(
+      this.manageRolesGroups(
         { action, type, value: {
           name: this.setupGroup,
           users: this.setupUser ? this.setupUser.split(',').map(elem => elem.trim()) : [],
@@ -95,11 +115,11 @@ export class ManageRolesGroupsComponent implements OnInit {
           const emitValue = (type === 'users')
             ? {action, type, id: item.name, value: { user: value, group: item.group }}
             : {action, type, id: item.name, value: item.group} ;
-          this.manageRolesGroupAction.emit(emitValue);
+          this.manageRolesGroups(emitValue);
         }
       });
     } else if (action === 'update') {
-      this.manageRolesGroupAction.emit({action, type, value: {
+      this.manageRolesGroups({action, type, value: {
         name: item.group,
         roleIds: this.extractIds(this.roles, item.selected_roles),
         users: item.users || [] }});
@@ -107,6 +127,38 @@ export class ManageRolesGroupsComponent implements OnInit {
     this.resetDialog();
   }
 
+  manageRolesGroups($event) {
+    switch ($event.action) {
+      case 'create':
+        this.rolesService.setupNewGroup($event.value).subscribe(res => {
+          this.toastr.success('Group creation success!', 'Created!');
+          this.getGroupsData();
+        }, () => this.toastr.error('Group creation failed!', 'Oops!'));
+        break;
+      case 'update':
+        this.rolesService.updateGroup($event.value).subscribe(res => {
+          this.toastr.success('Group data successfully updated!', 'Success!');
+          this.getGroupsData();
+        }, () => this.toastr.error('Failed group data updating!', 'Oops!'));
+        break;
+      case 'delete':
+        if ($event.type === 'users') {
+          this.rolesService.removeUsersForGroup($event.value).subscribe(res => {
+            this.toastr.success('Users was successfully deleted!', 'Success!');
+            this.getGroupsData();
+          }, () => this.toastr.error('Failed users deleting!', 'Oops!'));
+        } else if ($event.type === 'group') {
+          console.log('delete group');
+          this.rolesService.removeGroupById($event.value).subscribe(res => {
+            this.toastr.success('Group was successfully deleted!', 'Success!');
+            this.getGroupsData();
+          }, () => this.toastr.error('Failed group deleting!', 'Oops!'));
+        }
+        break;
+      default:
+    }
+  }
+  
   public extractIds(sourceList, target) {
     return sourceList.reduce((acc, item) => {
       target.includes(item.description) && acc.push(item._id);


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


[incubator-dlab] 01/10: [DLAB-631]: fixed backdrop issue on 403 page

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 72b6fb9bc68f4b8af927e0c71cbe435ea4bd596a
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:13:54 2019 +0300

    [DLAB-631]: fixed backdrop issue on 403 page
---
 .../webapp/src/app/access-denied/access-denied.component.scss        | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/access-denied/access-denied.component.scss b/services/self-service/src/main/resources/webapp/src/app/access-denied/access-denied.component.scss
index df52859..eb3eac2 100644
--- a/services/self-service/src/main/resources/webapp/src/app/access-denied/access-denied.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/access-denied/access-denied.component.scss
@@ -17,14 +17,9 @@
  * under the License.
  */
 .no-access-page {
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 100%;
   height: 100%;
   background: #f5f5f5;
   color: #8c8888;
-  z-index: -1;
   .content {
     position: absolute;
     top: 0;


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


[incubator-dlab] 03/10: [DLAB-631]: added admin guard to check user access

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 484d8d6bac3cf8f6769482eb90031a9038636b1b
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:23:32 2019 +0300

    [DLAB-631]: added admin guard to check user access
---
 .../resources/webapp/src/app/core/core.module.ts   |  2 ++
 .../webapp/src/app/core/services/admin.quard.ts    | 31 ++++++++++++++++++++++
 .../webapp/src/app/core/services/index.ts          |  1 +
 3 files changed, 34 insertions(+)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts b/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
index 0280665..4b308c3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
@@ -27,6 +27,7 @@ import { UserAccessKeyService } from './services/userAccessKey.service';
 import { UserResourceService } from './services/userResource.service';
 import { AuthorizationGuard } from './services/authorization.guard';
 import { CloudProviderGuard } from './services/cloudProvider.guard';
+import { AdminGuard } from './services/admin.quard';
 import { CheckParamsGuard } from './services/checkParams.guard';
 import { LibrariesInstallationService } from './services/librariesInstallation.service';
 import { ManageUngitService } from './services/manageUngit.service';
@@ -57,6 +58,7 @@ export class CoreModule {
       providers: [
         ApplicationSecurityService,
         AuthorizationGuard,
+        AdminGuard,
         CloudProviderGuard,
         CheckParamsGuard,
         UserAccessKeyService,
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/admin.quard.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/admin.quard.ts
new file mode 100644
index 0000000..a58e4cc
--- /dev/null
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/admin.quard.ts
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+import { Injectable } from '@angular/core';
+import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
+import { HealthStatusService } from './healthStatus.service';
+
+@Injectable()
+export class AdminGuard implements CanActivate {
+  constructor(private _healthStatus: HealthStatusService) {}
+
+  canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+    return this._healthStatus.isPassageway('administration');
+  }
+}
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/index.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/index.ts
index 803fd9d..caf1904 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/index.ts
@@ -24,6 +24,7 @@ export * from './healthStatus.service';
 export * from './userAccessKey.service';
 export * from './userResource.service';
 export * from './authorization.guard';
+export * from './admin.quard';
 export * from './cloudProvider.guard';
 export * from './checkParams.guard';
 export * from './librariesInstallation.service';


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


[incubator-dlab] 08/10: [DLAB-631]: added tabs with endpoints list

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 397c9f33b186fd8f3b58c973f87649be4f1782fb
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:29:28 2019 +0300

    [DLAB-631]: added tabs with endpoints list
---
 .../management/endpoints/endpoints.component.html  | 80 +++++++++++++++++-----
 .../management/endpoints/endpoints.component.scss  | 42 ++++++++++++
 2 files changed, 104 insertions(+), 18 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.html
index c6c663b..99404fc 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.html
@@ -18,20 +18,24 @@
   -->
 
 
-  <div class="ami-dialog" id="dialog-box">
-      <header class="dialog-header">
-        <h4 class="modal-title">Create endpoint</h4>
-        <button type="button" class="close" (click)="dialogRef.close()">&times;</button>
-      </header>
-      <div class="dialog-content">
-        <div class="content-box">
+<div class="endpoints-dialog" id="dialog-box">
+  <header class="dialog-header">
+    <h4 class="modal-title">Create endpoint</h4>
+    <button type="button" class="close" (click)="dialogRef.close()">&times;</button>
+  </header>
+  <div class="dialog-content tabs">
+    <div class="content-box">
+      <mat-tab-group>
+        <mat-tab label="CREATE ENDPOINT">
           <form [formGroup]="createEndpointForm" novalidate>
             <div class="control-group">
               <label class="label">Name</label>
               <div class="control">
                 <input type="text" formControlName="name" placeholder="Enter endpoint name">
-                <span class="error" *ngIf="!createEndpointForm?.controls.name.valid && createEndpointForm.controls.name.touched">
-                    Endpoint name can only contain letters, numbers, hyphens and '_' but can not end with special characters
+                <span class="error"
+                  *ngIf="!createEndpointForm?.controls.name.valid && createEndpointForm.controls.name.touched">
+                  Endpoint name can only contain letters, numbers, hyphens and '_' but can not end with special
+                  characters
                 </span>
               </div>
             </div>
@@ -39,8 +43,10 @@
               <label class="label">Endpoint url</label>
               <div class="control">
                 <input type="text" formControlName="url" placeholder="Enter endpoint url">
-                <span class="error" *ngIf="!createEndpointForm?.controls.url.valid && createEndpointForm.controls.url.touched">
-                    Endpoint url can only contain letters, numbers, hyphens and '_' but can not end with special characters
+                <span class="error"
+                  *ngIf="!createEndpointForm?.controls.url.valid && createEndpointForm.controls.url.touched">
+                  Endpoint url can only contain letters, numbers, hyphens and '_' but can not end with special
+                  characters
                 </span>
               </div>
             </div>
@@ -48,16 +54,54 @@
               <label class="label">Account</label>
               <div class="control">
                 <input type="text" formControlName="account" placeholder="Enter account">
-                <span class="error" *ngIf="!createEndpointForm?.controls.account.valid && createEndpointForm.controls.account.touched">
-                    Endpoint url can only contain letters, numbers, hyphens and '_' but can not end with special characters
+                <span class="error"
+                  *ngIf="!createEndpointForm?.controls.account.valid && createEndpointForm.controls.account.touched">
+                  Endpoint account can only contain letters, numbers, hyphens and '_' but can not end with special
+                  characters
                 </span>
               </div>
             </div>
           </form>
-          <div class="text-center m-top-30 m-bott-10">
+          <div class="action-group">
             <button mat-raised-button type="button" class="butt action" (click)="dialogRef.close()">Cancel</button>
-            <button mat-raised-button type="button" [disabled]="!createEndpointForm.valid" (click)="assignChanges(createEndpointForm.value)" class="butt butt-success action">Create</button>
+            <button mat-raised-button type="button" [disabled]="!createEndpointForm.valid"
+              (click)="assignChanges(createEndpointForm.value)" class="butt butt-success action">Create</button>
           </div>
-        </div>
-      </div>
-    </div>
\ No newline at end of file
+        </mat-tab>
+        <mat-tab label="ENDPOINTS LIST">
+          <div class="endpoints">
+            <table mat-table [dataSource]="endpoints" class="endpoints-table"
+              *ngIf="endpoints?.length">
+              <ng-container matColumnDef="name">
+                <th mat-header-cell *matHeaderCellDef class="name"> Endpoint name </th>
+                <td mat-cell *matCellDef="let element"> {{element.name}} </td>
+              </ng-container>
+
+              <ng-container matColumnDef="url">
+                <th mat-header-cell *matHeaderCellDef class="url"> Url </th>
+                <td mat-cell *matCellDef="let element"> {{element.url}} </td>
+              </ng-container>
+
+              <ng-container matColumnDef="account">
+                <th mat-header-cell *matHeaderCellDef class="account"> Account </th>
+                <td mat-cell *matCellDef="let element"> {{element.account}} </td>
+              </ng-container>
+
+              <ng-container matColumnDef="actions">
+                <th mat-header-cell *matHeaderCellDef class="actions"></th>
+                <td mat-cell *matCellDef="let element" class="actions">
+                  <span (click)="deleteEndpoint(element)">
+                    <mat-icon>delete_forever</mat-icon>
+                  </span>
+                </td>
+              </ng-container>
+
+              <tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
+              <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
+            </table>
+          </div>
+        </mat-tab>
+      </mat-tab-group>
+    </div>
+  </div>
+</div>
\ No newline at end of file
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.scss
index 510f082..9a49606 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.scss
@@ -17,3 +17,45 @@
  * under the License.
  */
 
+.content-box {
+  padding: 10px 30px 30px;
+  height: 380px;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  form {
+    padding: 20px 10px;
+    .control-group {
+      .error {
+        position: absolute;
+        right: 0;
+        bottom: 5px;
+      }
+    }
+  }
+  .action-group {
+    text-align: center;
+  }
+  .endpoints {
+    height: 265px;
+    table {
+      width: 100%;
+      .actions {
+        color: #607d8b;
+        width: 10%;
+        text-align: center;
+        span {
+          transition: all .5s ease-in-out;
+          cursor: pointer;
+          .mat-icon {
+            font-size: 18px;
+            padding-top: 5px;
+          }
+          &:hover {
+            color: darken(#607d8b, 10%);
+          }
+        }
+      }
+    }
+  }
+}


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


[incubator-dlab] 07/10: [DLAB-631]: added roles to navigation

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 3c78764031a0b246d8b1981af9a95d7f2d010594
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:28:03 2019 +0300

    [DLAB-631]: added roles to navigation
---
 .../src/app/shared/navbar/navbar.component.html    | 15 +++++++---
 .../src/app/shared/navbar/navbar.component.scss    | 34 +++++++++++++++-------
 2 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.html b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.html
index 9afd109..3fd9218 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.html
@@ -83,15 +83,15 @@
           <span *ngIf="isExpanded; else resources">List of Resources</span>
           <ng-template #resources><i class="material-icons">dashboard</i></ng-template>
         </a>
-        <a class="nav-item has-children">
+        <a class="nav-item has-children" *ngIf="healthStatus?.admin">
           <span *ngIf="isExpanded">Administration</span>
 
           <a class="sub-nav-item" [style.margin-left.px]="isExpanded ? '30' : '0'"
-             [routerLink]="['/environment_management']"
+             [routerLink]="['/roles']"
              [routerLinkActive]="['active']"
              [routerLinkActiveOptions]="{exact:true}">
-             <span *ngIf="isExpanded; else env">Environment Management</span>
-             <ng-template #env><i class="material-icons">account_box</i></ng-template>
+             <span *ngIf="isExpanded; else roles">Roles</span>
+             <ng-template #roles><i class="material-icons">account_box</i></ng-template>
           </a>
           <a class="sub-nav-item" [style.margin-left.px]="isExpanded ? '30' : '0'"
              [routerLink]="['/projects']"
@@ -100,6 +100,13 @@
              <span *ngIf="isExpanded; else projects">Projects</span>
              <ng-template #projects><i class="material-icons">dns</i></ng-template>
           </a>
+          <a class="sub-nav-item" [style.margin-left.px]="isExpanded ? '30' : '0'"
+            [routerLink]="['/environment_management']"
+            [routerLinkActive]="['active']"
+            [routerLinkActiveOptions]="{exact:true}">
+            <span *ngIf="isExpanded; else env">Environment Management</span>
+            <ng-template #env><i class="material-icons">settings</i></ng-template>
+          </a>
         </a>
         <a *ngIf="healthStatus?.billingEnabled" class="nav-item"
           [routerLink]="['/billing_report']"
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.scss b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.scss
index ac83142..823bf8e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.scss
@@ -57,11 +57,15 @@
       }
       .ok {
         color: #81b44a;
-        &:hover { color: #618738; }
+        &:hover {
+          color: #618738;
+        }
       }
       .warning {
         color: #f7b500;
-        &:hover { color: #bd8d0a; }
+        &:hover {
+          color: #bd8d0a;
+        }
       }
       .error {
         color: #ef5c4b;
@@ -136,9 +140,10 @@ a.nav-item {
     vertical-align: middle;
     padding-left: 8px;
   }
-  &:not(.has-children):hover {
+  &:not(.has-children):hover i,
+  &:not(.has-children):hover span {
     background: none !important;
-    color: #36afd5;
+    color: #36afd5 !important;
   }
   &:not(:last-child)::after {
     content: ' ';
@@ -151,7 +156,7 @@ a.nav-item {
     background: #edf1f5;
   }
   &.active {
-    color: #36afd5;
+    color: #36afd5 !important;
   }
   &.has-children {
     height: auto;
@@ -167,10 +172,17 @@ a.nav-item {
       background: none !important;
       color: #36afd5 !important;
     }
+    &.active {
+      color: #36afd5 !important;
+    }
   }
- }
+}
 
-.ok, .warning, .error, .user-name, .meta {
+.ok,
+.warning,
+.error,
+.user-name,
+.meta {
   transition: all .35s ease-in-out;
 }
 
@@ -184,7 +196,7 @@ a.nav-item {
   cursor: pointer;
   border-radius: 0;
   transition: all .45s ease-in-out;
-  .line{
+  .line {
     width: 22px;
     height: 2px;
     display: block;
@@ -215,14 +227,14 @@ a.nav-item {
   }
 }
 
-.hamburger:hover .line:nth-child(1){
+.hamburger:hover .line:nth-child(1) {
   -webkit-transform: translateY(8px) translateX(-6px) rotate(45deg);
   -ms-transform: translateY(8px) translateX(-6px) rotate(45deg);
   -o-transform: translateY(8px) translateX(-6px) rotate(45deg);
   transform: translateY(8px) translateX(-6px) rotate(45deg);
 }
 
-.hamburger:hover .line:nth-child(3){
+.hamburger:hover .line:nth-child(3) {
   -webkit-transform: translateY(-4px) translateX(6px) rotate(-45deg);
   -ms-transform: translateY(-4px) translateX(6px) rotate(-45deg);
   -o-transform: translateY(-4px) translateX(6px) rotate(-45deg);
@@ -233,4 +245,4 @@ mat-sidenav-content {
   &.mat-drawer-content {
     transition: all 0.35s ease-out;
   }
-}
\ No newline at end of file
+}


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


[incubator-dlab] 10/10: [DLAB-631]: tabs component 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 8cee4bbccaa61c6a9bcad764f5d4b9fc37fea399
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:31:45 2019 +0300

    [DLAB-631]: tabs component fixes
---
 .../webapp/src/app/administration/project/project.component.html      | 2 +-
 .../webapp/src/app/resources/manage-ungit/manage-ungit.component.html | 2 +-
 .../src/main/resources/webapp/src/assets/styles/_general.scss         | 1 +
 services/self-service/src/main/resources/webapp/src/styles.scss       | 4 ++--
 4 files changed, 5 insertions(+), 4 deletions(-)

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 beabad0..ed23dcf 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
@@ -31,8 +31,8 @@
       </button>
     </div>
   </div>
-
   <mat-card class="base-retreat project-form" *ngIf="!projectList.length">
+    <mat-divider></mat-divider>
     <project-form></project-form>
   </mat-card>
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/manage-ungit/manage-ungit.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/manage-ungit/manage-ungit.component.html
index cca7629..c8766ff 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/manage-ungit/manage-ungit.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/manage-ungit/manage-ungit.component.html
@@ -22,7 +22,7 @@
     <h4 class="modal-title">Manage Git Credentials</h4>
     <button type="button" class="close" (click)="dialogRef.close()">&times;</button>
   </header>
-  <div class="manage-ungit dialog-content">
+  <div class="dialog-content tabs">
     <mat-tab-group mat-stretch-tabs #tabGroup class="content-box">
       <mat-tab label="LIST">
         <button mat-raised-button class="butt add-creds" (click)="tabGroup.selectedIndex = 1">
diff --git a/services/self-service/src/main/resources/webapp/src/assets/styles/_general.scss b/services/self-service/src/main/resources/webapp/src/assets/styles/_general.scss
index 258cd30..718da2e 100644
--- a/services/self-service/src/main/resources/webapp/src/assets/styles/_general.scss
+++ b/services/self-service/src/main/resources/webapp/src/assets/styles/_general.scss
@@ -84,6 +84,7 @@ textarea::placeholder {
   display: flex;
   flex-flow: row wrap;
   padding-bottom: 20px;
+  position: relative;
 }
 .row-wrap {
   padding-bottom: 0;
diff --git a/services/self-service/src/main/resources/webapp/src/styles.scss b/services/self-service/src/main/resources/webapp/src/styles.scss
index c4ad580..a6ff705 100644
--- a/services/self-service/src/main/resources/webapp/src/styles.scss
+++ b/services/self-service/src/main/resources/webapp/src/styles.scss
@@ -33,8 +33,8 @@
 }
 
 .install-libraries .mat-ink-bar,
-.manage-ungit .mat-ink-bar {
-  background-color: #35afd5 !important;
+.tabs .mat-ink-bar,
+.tabs .mat-tab-label {
   width: 50% !important;
 }
 


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


[incubator-dlab] 06/10: [DLAB-631]: moved manage roles functionality into separate page

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 766d0f9fd4ce380a3452d2306e7f0a02f760bcc5
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:27:18 2019 +0300

    [DLAB-631]: moved manage roles functionality into separate page
---
 .../app/administration/administration.module.ts    |  5 +-
 .../src/app/administration/management/index.ts     |  7 --
 .../management/management.component.html           | 44 +++++------
 .../management/management.component.ts             | 92 +++++++++++-----------
 .../resources/webapp/src/app/app.routing.module.ts | 11 ++-
 5 files changed, 77 insertions(+), 82 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/administration.module.ts b/services/self-service/src/main/resources/webapp/src/app/administration/administration.module.ts
index 2ae70a4..e535bda 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/administration.module.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/administration.module.ts
@@ -22,10 +22,11 @@ import { CommonModule } from '@angular/common';
 
 import { ManagenementModule } from './management';
 import { ProjectModule } from './project';
+import { RolesModule } from './roles';
 
 @NgModule({
-  imports: [CommonModule, ManagenementModule, ProjectModule],
+  imports: [CommonModule, ManagenementModule, ProjectModule, RolesModule],
   declarations: [],
-  exports: [ManagenementModule, ProjectModule]
+  exports: [ManagenementModule, ProjectModule, RolesModule]
 })
 export class AdministrationModule { }
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/index.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/index.ts
index f5146e4..3dadada 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/index.ts
@@ -38,12 +38,10 @@ import { FormControlsModule } from '../../shared/form-controls';
 import { BackupDilogComponent } from './backup-dilog/backup-dilog.component';
 import { ManageEnvironmentComponent, ConfirmActionDialogComponent } from './manage-environment/manage-environment-dilog.component';
 
-import { GroupNameValidationDirective } from './manage-roles-groups/group-name-validarion.directive';
 import { DirectivesModule } from '../../core/directives';
 
 import { SsnMonitorComponent } from './ssn-monitor/ssn-monitor.component';
 import { EndpointsComponent } from './endpoints/endpoints.component';
-import { ManageRolesGroupsComponent, ConfirmDeleteUserAccountDialogComponent } from './manage-roles-groups/manage-roles-groups.component';
 import { ProjectModule } from '../project';
 
 export * from './management.component';
@@ -67,21 +65,16 @@ export * from './management.component';
   declarations: [
     ManagementComponent,
     ManagementGridComponent,
-
-    GroupNameValidationDirective,
     BackupDilogComponent,
     ManageEnvironmentComponent,
     ConfirmationDialogComponent,
     ConfirmActionDialogComponent,
-    ConfirmDeleteUserAccountDialogComponent,
     SsnMonitorComponent,
-    ManageRolesGroupsComponent,
     EndpointsComponent
   ],
   entryComponents: [
     ConfirmationDialogComponent,
     ConfirmActionDialogComponent,
-    ConfirmDeleteUserAccountDialogComponent,
     BackupDilogComponent,
     SsnMonitorComponent,
     EndpointsComponent,
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
index fb159c2..cffca62 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
@@ -18,33 +18,29 @@
   -->
 
 <div class="sub-nav base-retreat">
-    <div *ngIf="healthStatus?.admin" class="admin-group">
-      <button mat-raised-button class="butt ssn" (click)="showEndpointsDialog()">
-        <i class="material-icons"></i>Endpoints
-      </button>
-      <button mat-raised-button class="butt ssn" (click)="openManageRolesDialog()">
-        <i class="material-icons"></i>Manage roles
-      </button>
-        <button mat-raised-button class="butt ssn" (click)="openSsnMonitorDialog()">
-        <i class="material-icons"></i>SSN Monitor
-      </button>
-        <button mat-raised-button class="butt env" (click)="openManageEnvironmentDialog()">
-        <i class="material-icons"></i>Manage environment
-      </button>
-        <button mat-raised-button class="butt" (click)="showBackupDialog()" [disabled]="creatingBackup">
-        <i class="material-icons">backup</i>Backup
-      </button>
-    </div>
-    <button mat-raised-button class="butt" (click)="buildGrid()">
+  <div *ngIf="healthStatus?.admin" class="admin-group">
+    <button mat-raised-button class="butt ssn" (click)="showEndpointsDialog()">
+      <i class="material-icons"></i>Endpoints
+    </button>
+    <button mat-raised-button class="butt ssn" (click)="openSsnMonitorDialog()">
+      <i class="material-icons"></i>SSN Monitor
+    </button>
+    <button mat-raised-button class="butt env" (click)="openManageEnvironmentDialog()">
+      <i class="material-icons"></i>Manage environment
+    </button>
+    <button mat-raised-button class="butt" (click)="showBackupDialog()" [disabled]="creatingBackup">
+      <i class="material-icons">backup</i>Backup
+    </button>
+  </div>
+  <button mat-raised-button class="butt" (click)="buildGrid()">
     <i class="material-icons">autorenew</i>Refresh
   </button>
 </div>
 
-<management-grid [currentUser]="user.toLowerCase()" [uploadKey]="uploadKey" [healthStatus]="healthStatus?.status" [isAdmin]="healthStatus?.admin" [allEnvironmentData]="allEnvironmentData" [environmentsHealthStatuses]="healthStatus?.list_resources" (refreshGrid)="buildGrid()"
-    (actionToggle)="manageEnvironmentAction($event)">
+<management-grid [currentUser]="user.toLowerCase()" [uploadKey]="uploadKey" [healthStatus]="healthStatus?.status"
+  [isAdmin]="healthStatus?.admin" [allEnvironmentData]="allEnvironmentData"
+  [environmentsHealthStatuses]="healthStatus?.list_resources" (refreshGrid)="buildGrid()"
+  (actionToggle)="manageEnvironmentAction($event)">
 </management-grid>
 
-<progress-dialog #preloaderModal></progress-dialog>
-
-<dlab-manage-roles-groups #rolesGroupsModal (manageRolesGroupAction)="manageRolesGroups($event)">
-</dlab-manage-roles-groups>
\ No newline at end of file
+<progress-dialog #preloaderModal></progress-dialog>
\ No newline at end of file
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
index bca3920..e698281 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
@@ -60,7 +60,7 @@ export class ManagementComponent implements OnInit, OnDestroy {
   @ViewChild('keyUploadModal') keyUploadDialog;
   @ViewChild('preloaderModal') preloaderDialog;
   @ViewChild('ssnMonitor') ssnMonitorDialog;
-  @ViewChild('rolesGroupsModal') rolesGroupsDialog;
+  // @ViewChild('rolesGroupsModal') rolesGroupsDialog;
 
   constructor(
     public toastr: ToastrService,
@@ -111,7 +111,7 @@ export class ManagementComponent implements OnInit, OnDestroy {
   }
 
   showEndpointsDialog() {
-    this.dialog.open(EndpointsComponent, { panelClass: 'modal-sm' })
+    this.dialog.open(EndpointsComponent, { panelClass: 'modal-xl-s' })
       .afterClosed().subscribe(result => result && this.buildGrid());
   }
 
@@ -140,14 +140,14 @@ export class ManagementComponent implements OnInit, OnDestroy {
       () => this.toastr.error('Failed ssn data loading!', 'Oops!'));
   }
 
-  openManageRolesDialog() {
-    this.rolesService.getGroupsData().subscribe(group => {
-      this.rolesService.getRolesData().subscribe(
-        roles => this.rolesGroupsDialog.open({ isFooter: false }, group, roles),
-        error => this.toastr.error(error.message, 'Oops!'));
-    },
-      error => this.toastr.error(error.message, 'Oops!'));
-  }
+  // openManageRolesDialog() {
+  //   this.rolesService.getGroupsData().subscribe(group => {
+  //     this.rolesService.getRolesData().subscribe(
+  //       roles => this.rolesGroupsDialog.open({ isFooter: false }, group, roles),
+  //       error => this.toastr.error(error.message, 'Oops!'));
+  //   },
+  //     error => this.toastr.error(error.message, 'Oops!'));
+  // }
 
   isEnvironmentsInProgress(data): boolean {
     return data.exploratory.some(el => {
@@ -169,37 +169,37 @@ export class ManagementComponent implements OnInit, OnDestroy {
       error => this.toastr.error(error.message, 'Oops!'));
   }
 
-  manageRolesGroups($event) {
-    switch ($event.action) {
-      case 'create':
-        this.rolesService.setupNewGroup($event.value).subscribe(res => {
-          this.toastr.success('Group creation success!', 'Created!');
-          this.getGroupsData();
-        }, () => this.toastr.error('Group creation failed!', 'Oops!'));
-        break;
-      case 'update':
-        this.rolesService.updateGroup($event.value).subscribe(res => {
-          this.toastr.success('Group data successfully updated!', 'Success!');
-          this.getGroupsData();
-        }, () => this.toastr.error('Failed group data updating!', 'Oops!'));
-        break;
-      case 'delete':
-        if ($event.type === 'users') {
-          this.rolesService.removeUsersForGroup($event.value).subscribe(res => {
-            this.toastr.success('Users was successfully deleted!', 'Success!');
-            this.getGroupsData();
-          }, () => this.toastr.error('Failed users deleting!', 'Oops!'));
-        } else if ($event.type === 'group') {
-          console.log('delete group');
-          this.rolesService.removeGroupById($event.value).subscribe(res => {
-            this.toastr.success('Group was successfully deleted!', 'Success!');
-            this.getGroupsData();
-          }, () => this.toastr.error('Failed group deleting!', 'Oops!'));
-        }
-        break;
-      default:
-    }
-  }
+  // manageRolesGroups($event) {
+  //   switch ($event.action) {
+  //     case 'create':
+  //       this.rolesService.setupNewGroup($event.value).subscribe(res => {
+  //         this.toastr.success('Group creation success!', 'Created!');
+  //         this.getGroupsData();
+  //       }, () => this.toastr.error('Group creation failed!', 'Oops!'));
+  //       break;
+  //     case 'update':
+  //       this.rolesService.updateGroup($event.value).subscribe(res => {
+  //         this.toastr.success('Group data successfully updated!', 'Success!');
+  //         this.getGroupsData();
+  //       }, () => this.toastr.error('Failed group data updating!', 'Oops!'));
+  //       break;
+  //     case 'delete':
+  //       if ($event.type === 'users') {
+  //         this.rolesService.removeUsersForGroup($event.value).subscribe(res => {
+  //           this.toastr.success('Users was successfully deleted!', 'Success!');
+  //           this.getGroupsData();
+  //         }, () => this.toastr.error('Failed users deleting!', 'Oops!'));
+  //       } else if ($event.type === 'group') {
+  //         console.log('delete group');
+  //         this.rolesService.removeGroupById($event.value).subscribe(res => {
+  //           this.toastr.success('Group was successfully deleted!', 'Success!');
+  //           this.getGroupsData();
+  //         }, () => this.toastr.error('Failed group deleting!', 'Oops!'));
+  //       }
+  //       break;
+  //     default:
+  //   }
+  // }
 
   setBudgetLimits($event) {
     this.healthStatusService.updateUsersBudget($event.users).subscribe((result: any) => {
@@ -212,11 +212,11 @@ export class ManagementComponent implements OnInit, OnDestroy {
     }, error => this.toastr.error(error.message, 'Oops!'));
   }
 
-  getGroupsData() {
-    this.rolesService.getGroupsData().subscribe(
-      list => this.rolesGroupsDialog.updateGroupData(list),
-      error => this.toastr.error(error.message, 'Oops!'));
-  }
+  // getGroupsData() {
+  //   this.rolesService.getGroupsData().subscribe(
+  //     list => this.rolesGroupsDialog.updateGroupData(list),
+  //     error => this.toastr.error(error.message, 'Oops!'));
+  // }
 
   manageEnvironment(event: { action: string, user: string }) {
     this.healthStatusService
diff --git a/services/self-service/src/main/resources/webapp/src/app/app.routing.module.ts b/services/self-service/src/main/resources/webapp/src/app/app.routing.module.ts
index dae0bd9..5135e02 100644
--- a/services/self-service/src/main/resources/webapp/src/app/app.routing.module.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/app.routing.module.ts
@@ -30,8 +30,9 @@ import { ReportingComponent } from './reporting/reporting.component';
 import { WebterminalComponent } from './webterminal/webterminal.component';
 import { ManagementComponent } from './administration/management/management.component';
 import { ProjectComponent } from './administration/project/project.component';
+import { RolesComponent } from './administration/roles/roles.component';
 
-import { AuthorizationGuard, CheckParamsGuard, CloudProviderGuard } from './core/services';
+import { AuthorizationGuard, CheckParamsGuard, CloudProviderGuard, AdminGuard } from './core/services';
 
 const routes: Routes = [{
     path: 'login',
@@ -56,11 +57,15 @@ const routes: Routes = [{
     }, {
       path: 'projects',
       component: ProjectComponent,
-      canActivate: [AuthorizationGuard],
+      canActivate: [AuthorizationGuard, AdminGuard],
+    }, {
+      path: 'roles',
+      component: RolesComponent,
+      canActivate: [AuthorizationGuard, AdminGuard],
     }, {
       path: 'environment_management',
       component: ManagementComponent,
-      canActivate: [AuthorizationGuard]
+      canActivate: [AuthorizationGuard, AdminGuard]
     }, {
       path: 'terminal/:id',
       component: WebterminalComponent


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


[incubator-dlab] 04/10: [DLAB-631]: modified passageway to check user access

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 deffcedfb8e46cebc2ad1f9737a93933bf76156e
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:24:13 2019 +0300

    [DLAB-631]: modified passageway to check user access
---
 .../resources/webapp/src/app/core/services/cloudProvider.guard.ts | 2 +-
 .../webapp/src/app/core/services/healthStatus.service.ts          | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/cloudProvider.guard.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/cloudProvider.guard.ts
index 5ebfa1e..7127cc0 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/cloudProvider.guard.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/cloudProvider.guard.ts
@@ -26,6 +26,6 @@ export class CloudProviderGuard implements CanActivate {
   constructor(private _healthStatus: HealthStatusService) {}
 
   canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
-    return this._healthStatus.isBillingEnabled();
+    return this._healthStatus.isPassageway('billing');
   }
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/healthStatus.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/healthStatus.service.ts
index 68795b2..8dbad93 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/healthStatus.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/healthStatus.service.ts
@@ -108,17 +108,21 @@ export class HealthStatusService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public isBillingEnabled(): Observable<boolean> {
+  public isPassageway(parameter: string): Observable<boolean> {
     return this.applicationServiceFacade
       .buildGetEnvironmentHealthStatus()
       .pipe(
         map(response => {
           if (response.status === HTTP_STATUS_CODES.OK) {
             const data = response.body;
-            if (!data.billingEnabled) {
+            if (parameter === 'billing' && !data.billingEnabled) {
               this.appRoutingService.redirectToHomePage();
               return false;
             }
+            if (parameter === 'administration' && !data.admin) {
+              this.appRoutingService.redirectToNoAccessPage();
+              return false;
+            }
           }
           return true;
         }));


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


[incubator-dlab] 09/10: [DLAB-631]: added ability to delete endpoints with confirmation

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 182e9c21fba785ba416d2b4ce9a18f139edfefb2
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu May 30 13:30:29 2019 +0300

    [DLAB-631]: added ability to delete endpoints with confirmation
---
 .../management/endpoints/endpoints.component.ts           | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.ts
index 9ad5b97..da41791 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/endpoints/endpoints.component.ts
@@ -19,10 +19,11 @@
 
 import { Component, OnInit, Inject } from '@angular/core';
 import { FormGroup, FormBuilder, Validators } from '@angular/forms';
-import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
+import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material';
 import { ToastrService } from 'ngx-toastr';
 
 import { EndpointService } from '../../../core/services';
+import { NotificationDialogComponent } from '../../../shared/modal-dialog/notification-dialog';
 
 export interface Endpoint {
   name: string;
@@ -39,11 +40,13 @@ export class EndpointsComponent implements OnInit {
   public createEndpointForm: FormGroup;
   namePattern = '[-_a-zA-Z0-9]+';
   endpoints: Endpoint[] = [];
+  displayedColumns: string[] = ['name', 'url', 'account', 'actions'];
 
   constructor(
     @Inject(MAT_DIALOG_DATA) public data: any,
     public toastr: ToastrService,
     public dialogRef: MatDialogRef<EndpointsComponent>,
+    public dialog: MatDialog,
     private endpointService: EndpointService,
     private _fb: FormBuilder
   ) { }
@@ -60,6 +63,16 @@ export class EndpointsComponent implements OnInit {
     }, error => this.toastr.error(error.message || 'Endpoint creation failed!', 'Oops!'));
   }
 
+  public deleteEndpoint(data) {
+    this.dialog.open(NotificationDialogComponent, { data: { type: 'confirmation', item: data }, panelClass: 'modal-sm' })
+      .afterClosed().subscribe(result => {
+        result && this.endpointService.deleteEndpoint(data.name).subscribe(() => {
+          this.toastr.success('Endpoint successfully deleted!', 'Success!');
+          this.getEndpointList();
+        }, error => this.toastr.error(error.message || 'Endpoint creation failed!', 'Oops!'));
+      });
+  }
+
   private initFormModel(): void {
     this.createEndpointForm = this._fb.group({
       name: ['', Validators.compose([Validators.required, Validators.pattern(this.namePattern)])],


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