Skip to content

Commit 2e639a8

Browse files
committed
Get list of available jobs for Recruitment
1 parent 7dc01a7 commit 2e639a8

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

src/app/_components/recruitment/recruitment.component.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ <h1>{{ 'RECRUITMENT.TITLE' | translate }}</h1>
1414

1515

1616
<form #formSearch="ngForm" (ngSubmit)="processSeacrhJobForm()">
17+
<!--
1718
<div class="form-group field col-lg-10" [class.has-error]="seachJobTextInputModel.invalid">
18-
<!--<span>{{ 'RECRUITMENT.SEARCH_LABEL' | translate }}</span>-->
19+
1920
<input
2021
type="text"
2122
name="searchtext"
@@ -25,7 +26,19 @@ <h1>{{ 'RECRUITMENT.TITLE' | translate }}</h1>
2526
required
2627
minlength="3"
2728
#seachJobTextInputModel="ngModel">
29+
</div> -->
30+
<!-- Jobs -->
31+
<div class="form-group field col-lg-10" >
32+
<mat-form-field class="create-profile-full-width">
33+
<mat-label>{{ 'RECRUITMENT.SEARCH_LABEL' | translate }}</mat-label>
34+
<mat-select [(ngModel)]="seachJobTextInput" name="searchtext" required>
35+
<mat-option *ngFor="let job of jobs" [value]="job.id">
36+
{{job.label}}
37+
</mat-option>
38+
</mat-select>
39+
</mat-form-field>
2840
</div>
41+
2942
<!--
3043
<button type="submit" class="btn btn-success" [disabled]="formSearch.invalid">{{ 'RECRUITMENT.BUTTON.SEARCH' | translate }}</button>
3144
-->

src/app/_components/recruitment/recruitment.component.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {MatTableDataSource} from '@angular/material/table';
44
import {MatSort} from '@angular/material/sort';
55
import { MatchingService } from '../../_services/matching.service';
66
import { ExcelServiceService } from '../../_services/excel/excel-service.service';
7+
import { Job } from '../../_models/Job';
8+
import { JobsService } from '../../_services/jobs.service';
79

810
@Component({
911
selector: 'app-recruitment',
@@ -44,6 +46,7 @@ export class RecruitmentComponent implements OnInit {
4446
];
4547
//listOfCandidates = [];
4648

49+
jobs: Job[];
4750
recruits = [];//this.listOfCandidates;
4851
canvas: any;
4952
ctx: any;
@@ -89,7 +92,7 @@ export class RecruitmentComponent implements OnInit {
8992
public ChartType = 'pie';
9093

9194

92-
constructor(private matchingService: MatchingService, private excelService:ExcelServiceService) { }
95+
constructor(private jobService: JobsService, private matchingService: MatchingService, private excelService:ExcelServiceService) { }
9396

9497
//displayedColumns: string[] = ['id', 'title', 'action'];
9598
displayedColumns: string[] = ['id', 'name', 'role', 'available', 'expsalary', 'score', 'action'];
@@ -111,8 +114,8 @@ export class RecruitmentComponent implements OnInit {
111114
console.log(this.dataSource);
112115
this.dataSource.sort = this.sort;
113116
this.dataSource.paginator = this.paginator;
114-
this.getMatchedCVs('Job1');
115-
117+
//this.getMatchedCVs('Job1');
118+
this.getAvailableJobs();
116119
}
117120

118121
processSeacrhJobForm() {
@@ -157,6 +160,17 @@ export class RecruitmentComponent implements OnInit {
157160

158161
}
159162

163+
getAvailableJobs() {
164+
this.jobService.getJobs()
165+
.subscribe((data: Job[]) => {
166+
this.jobs = data;
167+
console.log(data);
168+
},
169+
err => {
170+
console.log(err);
171+
});
172+
}
173+
160174
exportExcel(){
161175
this.excelService.exportAsExcelFile(this.listOfCandidates, 'list_of_candidates');
162176
}

0 commit comments

Comments
 (0)