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 12:39:54 UTC

[incubator-dlab] branch feature/projects updated: [DLAB-738]: fixed select all action on multiselect list

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


The following commit(s) were added to refs/heads/feature/projects by this push:
     new 8bfbdd7  [DLAB-738]: fixed select all action on multiselect list
     new 41e2f5e  Merge branch 'feature/projects' of github.com:apache/incubator-dlab into feature/projects
8bfbdd7 is described below

commit 8bfbdd742828d5a36bb9a76dfa02f4dc51826bce
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jun 4 15:39:28 2019 +0300

    [DLAB-738]: fixed select all action on multiselect list
---
 .../project/project-form/project-form.component.ts |  3 +-
 .../project-list/project-list.component.html       | 57 ++++++++++------------
 .../administration/project/project.component.html  |  3 ++
 .../app/administration/roles/roles.component.scss  |  3 --
 .../resources/webapp/src/assets/styles/_theme.scss |  3 ++
 5 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
index 9cdc780..4c0e92f 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
@@ -87,7 +87,8 @@ export class ProjectFormComponent implements OnInit {
   }
 
   public selectOptions(list, key, select?) {
-    this.projectForm.controls[key].setValue(select ? list : []);
+    let filter = key === 'endpoints' ? list.map(el => el.name) : list;
+    this.projectForm.controls[key].setValue(select ? filter : []);
   }
 
   private initFormModel(): void {
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
index fd8f907..c22c700 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.html
@@ -17,38 +17,35 @@
   ~ under the License.
   -->
 
-<div class="base-retreat">
+<table mat-table [dataSource]="dataSource" class="projects-table mat-elevation-z6">
+  <ng-container matColumnDef="name">
+    <th mat-header-cell *matHeaderCellDef class="name"> Project name </th>
+    <td mat-cell *matCellDef="let element"> {{element.name}} </td>
+  </ng-container>
 
-  <table mat-table [dataSource]="dataSource" class="projects-table mat-elevation-z6">
-    <ng-container matColumnDef="name">
-      <th mat-header-cell *matHeaderCellDef class="name"> Project name </th>
-      <td mat-cell *matCellDef="let element"> {{element.name}} </td>
-    </ng-container>
+  <ng-container matColumnDef="endpoints">
+    <th mat-header-cell *matHeaderCellDef class="endpoints"> Endpoints </th>
+    <td mat-cell *matCellDef="let element"> {{element.endpoints}} </td>
+  </ng-container>
 
-    <ng-container matColumnDef="endpoints">
-      <th mat-header-cell *matHeaderCellDef class="endpoints"> Endpoints </th>
-      <td mat-cell *matCellDef="let element"> {{element.endpoints}} </td>
-    </ng-container>
+  <ng-container matColumnDef="groups">
+    <th mat-header-cell *matHeaderCellDef class="groups"> Groups </th>
+    <td mat-cell *matCellDef="let element"> {{element.groups}} </td>
+  </ng-container>
 
-    <ng-container matColumnDef="groups">
-      <th mat-header-cell *matHeaderCellDef class="groups"> Groups </th>
-      <td mat-cell *matCellDef="let element"> {{element.groups}} </td>
-    </ng-container>
+  <ng-container matColumnDef="actions">
+    <th mat-header-cell *matHeaderCellDef class="project-actions"></th>
+    <td mat-cell *matCellDef="let element" class="project-actions">
+      <span (click)="editProject(element)">
+        <mat-icon>mode_edit</mat-icon>
+      </span>
+      <span (click)="deleteProject(element)">
+        <mat-icon>delete_forever</mat-icon>
+      </span>
+    </td>
 
-    <ng-container matColumnDef="actions">
-      <th mat-header-cell *matHeaderCellDef class="project-actions"></th>
-      <td mat-cell *matCellDef="let element" class="project-actions">
-        <span (click)="editProject(element)">
-          <mat-icon>mode_edit</mat-icon>
-        </span>
-        <span (click)="deleteProject(element)">
-          <mat-icon>delete_forever</mat-icon>
-        </span>
-      </td>
+  </ng-container>
 
-    </ng-container>
-
-    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
-    <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
-  </table>
-</div>
\ No newline at end of file
+  <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
+  <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
+</table>
\ No newline at end of file
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 d8f10ab..3bb39ec 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,10 +31,13 @@
       </button>
     </div>
   </div>
+
   <mat-card class="base-retreat project-form" *ngIf="!projectList.length">
     <project-form></project-form>
   </mat-card>
+
   <mat-divider></mat-divider>
+
   <div [hidden]="!projectList.length">
     <project-list (editItem)="editProject($event)" (deleteItem)="deleteProject($event)"></project-list>
   </div>
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 a7d1478..eb33091 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
@@ -44,9 +44,6 @@
 .no-details {
   color: #d8d8d8;
 }
-.mat-divider {
-  margin: 10px 0;
-}
 .stepper {
   height: 190px;
   margin-top: 10px;
diff --git a/services/self-service/src/main/resources/webapp/src/assets/styles/_theme.scss b/services/self-service/src/main/resources/webapp/src/assets/styles/_theme.scss
index 037ee29..1ad54ce 100644
--- a/services/self-service/src/main/resources/webapp/src/assets/styles/_theme.scss
+++ b/services/self-service/src/main/resources/webapp/src/assets/styles/_theme.scss
@@ -508,4 +508,7 @@ mat-tab-group.mat-tab-group {
   .mat-tab-body-wrapper {
     height: 100%;
   }
+}
+mat-divider.mat-divider {
+  margin: 10px 0;
 }
\ 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