@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatPaginator) paginator: MatPaginator;
@Output() passBackSelectedUser: EventEmitter<any> = new EventEmitter();
+ @Output() userNotFoundFlag = new EventEmitter<boolean>();
searchString: string;
txtResults = 'result';
searchUsersResults: any;
selectedUser: any;
displayedColumns: string[] = ['firstName'];
dataSourceMap = new MatTableDataSource(this.searchUsersResults);
+ submitted = false;
+ message = " No users found with your query. Please change your search and try again.";
ngOnInit() {
this.searchString = '';
this.passBackSelectedUser.emit(systemUser);
}
+ noUserFlag: boolean = false;
searchUsers() {
if (!this.isSystemUser) {
this.isLoading = true;
this.userService.searchUsers(this.searchString).subscribe((_data: PortalAdmin) => {
this.searchUsersResults = _data;
if (this.searchUsersResults == null || this.searchUsersResults.length == 0) {
- const modelRef = this.ngModal.open(ConfirmationModalComponent)
- modelRef.componentInstance.title = "Confirmation";
- modelRef.componentInstance.message = " No users found with your query. Please change your search and try again."
+ this.noUserFlag = true;
this.isLoading = false;
} else {
+ this.noUserFlag = false;
this.showUserTable = true;
this.isLoading = false;
this.dataSourceMap = new MatTableDataSource(this.searchUsersResults);
this.passBackSelectedUser.emit(this.selectedUser);
}
+ addNewUser() {
+ console.log("Emit the value to parent");
+ this.userNotFoundFlag.emit(true);
+ }
+
}