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 aa09a0407704312fbb12036617b122af301a52bb
Author: Andriana Kovalyshyn <[email protected]>
AuthorDate: Mon May 27 16:05:18 2019 +0300

    [DLAB-631]: added extra check if no project data
---
 .../project/project-list/project-list.component.ts | 27 +++++++++++-----------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts
index 4f73aa6..daf82a7 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-list/project-list.component.ts
@@ -17,13 +17,13 @@
  * under the License.
  */
 
- import { Component, OnInit, Output, EventEmitter, OnDestroy } from 
'@angular/core';
- import { ToastrService } from 'ngx-toastr';
- import { MatTableDataSource } from '@angular/material';
- import { Subscription } from 'rxjs';
+import { Component, OnInit, Output, EventEmitter, OnDestroy } from 
'@angular/core';
+import { ToastrService } from 'ngx-toastr';
+import { MatTableDataSource } from '@angular/material';
+import { Subscription } from 'rxjs';
 
- import { ProjectDataService } from '../project-data.service';
- import { Project } from '../project.component';
+import { ProjectDataService } from '../project-data.service';
+import { Project } from '../project.component';
 
 @Component({
   selector: 'project-list',
@@ -32,8 +32,8 @@
 })
 export class ProjectListComponent implements OnInit, OnDestroy {
 
-  displayedColumns: string[] = ['project_name', 'endpoints_list', 
'project_tag', 'actions'];
-  dataSource: Project[] | any;
+  displayedColumns: string[] = ['name', 'endpoints', 'groups', 'actions'];
+  dataSource: Project[] | any = [];
   @Output() editItem: EventEmitter<{}> = new EventEmitter();
   @Output() deleteItem: EventEmitter<{}> = new EventEmitter();
 
@@ -42,12 +42,12 @@ export class ProjectListComponent implements OnInit, 
OnDestroy {
   constructor(
     public toastr: ToastrService,
     private projectDataService: ProjectDataService
-    ) { }
+  ) { }
 
 
   ngOnInit() {
-    this.subscriptions.add(this.projectDataService._projects.subscribe(value 
=> {
-      this.dataSource = new MatTableDataSource(value);
+    this.subscriptions.add(this.projectDataService._projects.subscribe((value: 
Project[]) => {
+      if (value) this.dataSource = new MatTableDataSource(value);
     }));
   }
 
@@ -55,10 +55,11 @@ export class ProjectListComponent implements OnInit, 
OnDestroy {
     this.subscriptions.unsubscribe();
   }
 
-  public editProject(item: Project[]) {;
+  public editProject(item: Project[]) {
+    ;
     this.editItem.emit(item);
   }
-  
+
   public deleteProject(item: Project[]) {
     this.deleteItem.emit(item);
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to