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

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

commit 136c0043e9a76acb007302c4c428892a4dac5a6e
Author: Andriana Kovalyshyn <andriana_kovalys...@epam.com>
AuthorDate: Thu May 23 14:54:29 2019 +0300

    added groups list select with ability check/delete all
---
 .../project/project-form/project-form.component.ts | 23 +++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 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 5da71d8..b6650a8 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
@@ -21,7 +21,7 @@
  import { FormGroup, FormBuilder, Validators } from '@angular/forms';
  import { ToastrService } from 'ngx-toastr';
 
- import { ProjectService } from '../../../core/services';
+ import { ProjectService,RolesGroupsService } from '../../../core/services';
  import { Project } from '../project.component';
 
 @Component({
@@ -32,17 +32,23 @@
 export class ProjectFormComponent implements OnInit {
 
   public projectForm: FormGroup;
+  public groupsList: any;
+  public setupGroupsList = [];
+
   constructor(
     public toastr: ToastrService,
     private _fb: FormBuilder,
-    private projectService: ProjectService
+    private projectService: ProjectService,
+    private rolesService: RolesGroupsService
   ) { }
 
   ngOnInit() {
     this.initFormModel();
+    this.getGroupsData();
   }
 
   public createProject(data) {
+    // let parameters = {...data, users: this.setupGroupsList };
     console.log(data);
 
     this.projectService.createProject(data).subscribe(response => {
@@ -60,11 +66,16 @@ export class ProjectFormComponent implements OnInit {
     this.projectForm.controls.project_tag.setValue(user_tag.toLowerCase());
   }
 
+  public selectOptions(select) {
+    debugger;
+    this.projectForm.controls.users_group.setValue(select ? this.groupsList : 
[]);
+  }
+
   private initFormModel(): void {
     this.projectForm = this._fb.group({
       'project_name': ['', Validators.required],
       'endpoint_name': ['', Validators.required],
-      'project_tag': ['dlab-', Validators.required],
+      'project_tag': ['', Validators.required],
       'users_group': [[]]
     });
   }
@@ -78,4 +89,10 @@ export class ProjectFormComponent implements OnInit {
       'users_list': [item.users_list, Validators.required]
     });
   }
+
+  private getGroupsData() {
+    this.rolesService.getGroupsData().subscribe(
+      (list: any) => this.groupsList = list.map(el => el.group),
+      error => this.toastr.error(error.message, 'Oops!'));
+  }
 }


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

Reply via email to