Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Component, OnInit } from '@angular/core';
import { Account } from 'app/core/auth/account.model';
import { AccountService } from 'app/core/auth/account.service';
import { SearchService } from 'app/search/service/search-service';
import { Exercise, searchResultToExercise } from 'app/shared/model/exercise.model';
import { SearchResultsDTO } from 'app/shared/model/search/search-results-dto.model';
import { UserManagementService } from '../user-management/service/user-management.service';
import { User } from '../user-management/user-management.model';
@Component({
selector: 'jhi-review-management',
templateUrl: './review-management.component.html',
styleUrls: ['./review-management.component.scss'],
})
export class ReviewManagementComponent implements OnInit {
currentAccount: Account | null = null;
users: User[] | undefined;
results: Exercise[] = [];
constructor(private userService: UserManagementService, private accountService: AccountService, private searchService: SearchService) {
this.loadAll();
}
ngOnInit(): void {
this.accountService.identity().subscribe(account => (this.currentAccount = account));
this.loadAll();
}
loadAll(): void {
this.userService.loadAll().subscribe(users => {
this.users = users;
});
this.searchService.getAllResources().subscribe(
(data: SearchResultsDTO) => {
const searchResults = data.searchResult.map(searchResultToExercise);
this.results = this.results.concat(searchResults);
},
() => (this.results = [])
);
}
shareCheckedUserList(item: User[]) {
console.log(item[0].email);
}
shareExercise(item: Exercise) {
console.log(item.title);
}
}