+
{{ 'JOB.SKILL.TITLE' | translate }} {{i + 1}}
@@ -81,7 +89,7 @@
{{ 'JOB.SKILL.TITLE' | translate }} {{i + 1}}
{{ 'JOB.SKILL.NAME.LABEL' | translate }}
-
+
diff --git a/src/app/_components/jobs-add/jobs-add.component.ts b/src/app/_components/jobs-add/jobs-add.component.ts
index 8d6de142..febf9506 100644
--- a/src/app/_components/jobs-add/jobs-add.component.ts
+++ b/src/app/_components/jobs-add/jobs-add.component.ts
@@ -56,7 +56,7 @@ export class JobsAddComponent implements OnInit {
employmentType: ['', Validators.required ],
level: ['', Validators.required ],
JobDescription: ['', Validators.required ],
- SkillReq: this.fb.array([ this.initSkill() ])
+ skillReq: this.fb.array([ this.initSkill() ])
});
*/
@@ -72,17 +72,17 @@ export class JobsAddComponent implements OnInit {
addSkill() {
// add skill to the skills list
- //this.control =
this.angForm.controls['SkillReq'];
+ //this.control = this.angForm.controls['skillReq'];
//this.control.push(this.initSkill());
let newJobSkill = {} as JobSkill;
newJobSkill.SkillLabel = "";
- newJobSkill.assign = "";
- newJobSkill.priority = "";
+ //newJobSkill.assign = "";
+ //newJobSkill.priority = "";
newJobSkill.proficiencyLevel = "";
- if (!this.dataIn.skills) {
- this.dataIn.skills = [newJobSkill];
+ if (!this.dataIn.skillReq) {
+ this.dataIn.skillReq = [newJobSkill];
} else {
- this.dataIn.skills.push(newJobSkill);
+ this.dataIn.skillReq.push(newJobSkill);
}
@@ -90,20 +90,20 @@ export class JobsAddComponent implements OnInit {
removeSkill(i: number) {
// remove address from the list
- //this.control = this.angForm.controls['SkillReq'];
+ //this.control = this.angForm.controls['skillReq'];
//this.control.removeAt(i);
- this.dataIn.skills.splice(i, 1);
+ this.dataIn.skillReq.splice(i, 1);
}
addJob() {
- this.dataIn.creator_id = 1;
- this.dataIn.date = "24-4-2020";
+ //this.dataIn.creator_id = 1;
+ //this.dataIn.date = "24-4-2020";
let dataToSend = this.dataIn;
delete dataToSend.id;
this.js.addJob(dataToSend).subscribe(
res => {
- //console.log("Job created");
+ console.log("Job created");
//console.log(res);
//after update the job
window.location.href="/jobs";
@@ -135,9 +135,11 @@ export class JobsAddComponent implements OnInit {
console.log("loadDataJob");
if (!dataObject) {
- this.dataIn = {id: 111, creator_id: 1, date: "24-4-2020", start_date: "24-4-2020", end_date: "24-4-2020", title:"DEMO FE developer", job_description:"department1", employment_type:"4", level:"5", skills: [{SkillLabel: "skillA", assign: "True", priority: "high", proficiencyLevel: "expert"}]};
+ this.dataIn = {id: null, label: "DEMO FE developer", jobLocation: "department1", employmentType:"", level:"",jobDescription:"",startDate: "",endDate: "",skillReq:[]};
+
}
else {
+ console.log(dataObject);
this.dataIn = dataObject;
}
@@ -145,7 +147,7 @@ export class JobsAddComponent implements OnInit {
/*
for (let i=1; ithis.angForm.controls['SkillReq'];
+ this.control = this.angForm.controls['skillReq'];
this.control.push(this.initSkill());
}
*/
@@ -156,11 +158,11 @@ export class JobsAddComponent implements OnInit {
ngOnInit() {
- this.dataIn = {id: null, creator_id: null, date: "", start_date: "", end_date: "", title:"", job_description:"", employment_type:"", level:"" };
+ this.dataIn = {id: null, label: null, employmentType:"", level:"",jobDescription:"",jobLocation:"",startDate: "",endDate: "",skillReq:[]};
this.route.params.subscribe(params => {
- const id = +params.id;
+ const id = params.id;
this.mode = "";
- if (id && id > 0) {
+ if (id ) {
this.mode = "Edit";
this.jobId=String(id);
//console.log(this.jobId);
diff --git a/src/app/_components/jobs/jobs.component.html b/src/app/_components/jobs/jobs.component.html
index 5bbf1013..d9777fe3 100644
--- a/src/app/_components/jobs/jobs.component.html
+++ b/src/app/_components/jobs/jobs.component.html
@@ -40,13 +40,13 @@ {{ 'JOBS.TITLE' | translate }}
- -->
+
+
+
+ {{ 'RECRUITMENT.SEARCH_LABEL' | translate }}
+
+
+ {{job.label}}
+
+
+
+
diff --git a/src/app/_components/recruitment/recruitment.component.ts b/src/app/_components/recruitment/recruitment.component.ts
index 86991600..c63ac2ec 100644
--- a/src/app/_components/recruitment/recruitment.component.ts
+++ b/src/app/_components/recruitment/recruitment.component.ts
@@ -4,6 +4,8 @@ import {MatTableDataSource} from '@angular/material/table';
import {MatSort} from '@angular/material/sort';
import { MatchingService } from '../../_services/matching.service';
import { ExcelServiceService } from '../../_services/excel/excel-service.service';
+import { Job } from '../../_models/Job';
+import { JobsService } from '../../_services/jobs.service';
@Component({
selector: 'app-recruitment',
@@ -44,7 +46,8 @@ export class RecruitmentComponent implements OnInit {
];
//listOfCandidates = [];
- recruits = this.listOfCandidates;
+ jobs: Job[];
+ recruits = [];//this.listOfCandidates;
canvas: any;
ctx: any;
seachJobTextInput: string;
@@ -89,7 +92,7 @@ export class RecruitmentComponent implements OnInit {
public ChartType = 'pie';
- constructor(private matchingService: MatchingService, private excelService:ExcelServiceService) { }
+ constructor(private jobService: JobsService, private matchingService: MatchingService, private excelService:ExcelServiceService) { }
//displayedColumns: string[] = ['id', 'title', 'action'];
displayedColumns: string[] = ['id', 'name', 'role', 'available', 'expsalary', 'score', 'action'];
@@ -111,8 +114,8 @@ export class RecruitmentComponent implements OnInit {
console.log(this.dataSource);
this.dataSource.sort = this.sort;
this.dataSource.paginator = this.paginator;
- this.getMatchedCVs('Job1');
-
+ //this.getMatchedCVs('Job1');
+ this.getAvailableJobs();
}
processSeacrhJobForm() {
@@ -125,15 +128,11 @@ export class RecruitmentComponent implements OnInit {
this.matchingService.matchJob(jobID)
.subscribe(
CVs => {
- console.log(CVs);
- for (const CV of CVs) {
- console.log(CV);
- const data = this.dataSource.data;
- data.push(CV);
- this.dataSource.data = data;
- }
-
-
+ this.recruits = CVs;
+ this.recruits.sort((a, b) => b.score - a.score);
+
+ this.dataSource.data = this.recruits;
+
},
err => {
console.log(err);
@@ -161,6 +160,17 @@ export class RecruitmentComponent implements OnInit {
}
+ getAvailableJobs() {
+ this.jobService.getJobs()
+ .subscribe((data: Job[]) => {
+ this.jobs = data;
+ console.log(data);
+ },
+ err => {
+ console.log(err);
+ });
+}
+
exportExcel(){
this.excelService.exportAsExcelFile(this.listOfCandidates, 'list_of_candidates');
}
diff --git a/src/app/_models/Job.ts b/src/app/_models/Job.ts
index d7beb1a5..7dd93c7b 100644
--- a/src/app/_models/Job.ts
+++ b/src/app/_models/Job.ts
@@ -8,14 +8,28 @@ export default class Product {
*/
export class JobSkill {
- SkillLabel: string;
+ SkillLabel: string; // required field
+ proficiencyLevel: string;
+ skillPriority: string;
+
+/*
assign: string;
priority: string;
- proficiencyLevel: string;
+ */
}
export class Job {
- id: number;
+ id: string;
+ label: string; // Position
+ employmentType: string;
+ level: string; // Seniority Level
+ jobDescription: String;
+ jobLocation: String;
+ // SkillReq?: string [];
+ skillReq: JobSkill [];
+ startDate: string;
+ endDate: string;
+ /* id: number;
creator_id: number;
date: string;
employment_type: string;
@@ -25,4 +39,5 @@ export class JobSkill {
skills?: [JobSkill];
start_date: string;
title: string;
+ */
}
\ No newline at end of file
diff --git a/src/app/_services/cv.service.ts b/src/app/_services/cv.service.ts
index c9eb5ded..7ee1a8ed 100644
--- a/src/app/_services/cv.service.ts
+++ b/src/app/_services/cv.service.ts
@@ -14,14 +14,12 @@ import { environment } from './../../environments/environment';
export class CVService {
uri = environment.cvUrl;
- //uri = 'http://localhost:4000/cvs';
-
constructor(private httpClient: HttpClient) {
}
- getCV(userId: Number) {
+ getCV(userId: String) {
return this
.httpClient
.get(`${this.uri}/${userId}`);
diff --git a/src/app/_services/jobs.service.ts b/src/app/_services/jobs.service.ts
index 90754e11..bbdeea6b 100644
--- a/src/app/_services/jobs.service.ts
+++ b/src/app/_services/jobs.service.ts
@@ -1,30 +1,32 @@
import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
+import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from './../../environments/environment';
import { throwError } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
+import { Job } from '../_models/Job';
@Injectable({
providedIn: 'root'
})
export class JobsService {
- //uri = 'http://localhost:4000/jobs';
private jobsURL = environment.jobsUrl;
private uriGet = environment.jobpostGet;
private uriPost = environment.jobpostUrl;
constructor(private http: HttpClient) { }
- addJob(dataIn: any) {
- return this.http.post(`${this.jobsURL}`, dataIn).
- pipe(
+ addJob(dataIn: Job){
+ return this.http.post(`${this.jobsURL}`, JSON.stringify(dataIn))
+ /*
+ .pipe(
map((data: any) => {
return data;
}), catchError( error => {
return throwError( 'Something went wrong!' );
})
)
+ */
}
getJobs() {
@@ -97,6 +99,9 @@ export class JobsService {
)
}
+ deleteJob(jobId){
+ return this.http.delete(`${this.jobsURL}/${jobId}`);
+ }
}
diff --git a/src/app/_services/matching.service.ts b/src/app/_services/matching.service.ts
index 182e0b8c..499aff8f 100644
--- a/src/app/_services/matching.service.ts
+++ b/src/app/_services/matching.service.ts
@@ -14,18 +14,10 @@ export class MatchingService {
public matchJob (jobID): Observable
{
+ // const params = new HttpParams().set('jobid', jobID);
+ // return this.httpClient.get(this.serverurl, {responseType: 'json', params});
+ return this.httpClient.get(`${this.serverurl}/${jobID}/candidates`, {responseType: 'json'});
- /*
- const httpOptions = {
- headers: new HttpHeaders({ 'Content-Type': 'application/json'}),
- params: new HttpParams().set('jobid', jobID)
- };
- */
-console.log(jobID)
- const params = new HttpParams().set('jobid', jobID);
- console.log(params);
- console.log(this.serverurl);
- return this.httpClient.get(this.serverurl, {responseType: 'json', params});
}
}
diff --git a/src/app/_services/users.service.ts b/src/app/_services/users.service.ts
index 0790e24d..fe6c526f 100644
--- a/src/app/_services/users.service.ts
+++ b/src/app/_services/users.service.ts
@@ -9,7 +9,6 @@ import { map, catchError } from 'rxjs/operators';
})
export class UsersService {
- //uri = 'http://localhost:4000/users';
private uriUsers = environment.usersUrl;
constructor(private http: HttpClient) { }
@@ -20,7 +19,8 @@ export class UsersService {
.get(`${this.uriUsers}`);
}
- getUser(userId: Number) {
+ getUser(userId: String) {
+ console.log("load data");
return this
.http
.get(`${this.uriUsers}/${userId}`);
@@ -28,7 +28,7 @@ export class UsersService {
addUser(obj: Object) {
- return this.http.post(`${this.uriUsers}`, obj).
+ return this.http.post(`${this.uriUsers}`, JSON.stringify(obj)).
pipe(
map((data: any) => {
return data;
diff --git a/src/assets/i18n/el.json b/src/assets/i18n/el.json
index db48ac65..1411cb1c 100644
--- a/src/assets/i18n/el.json
+++ b/src/assets/i18n/el.json
@@ -59,6 +59,8 @@
"LABEL": "Title",
"PLACEHOLDER": "Position"
},
+ "Description":"Description"
+ ,
"DEPARTMENT": {
"LABEL": "Deparment",
"PLACEHOLDER": "Deparment"
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index ce7dd130..33356671 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -59,6 +59,8 @@
"LABEL": "Title",
"PLACEHOLDER": "Position"
},
+ "Description":"Description"
+ ,
"DEPARTMENT": {
"LABEL": "Deparment",
"PLACEHOLDER": "Deparment"
diff --git a/src/assets/i18n/pt.json b/src/assets/i18n/pt.json
index 3fbd88c7..577906be 100644
--- a/src/assets/i18n/pt.json
+++ b/src/assets/i18n/pt.json
@@ -59,6 +59,8 @@
"LABEL": "Title",
"PLACEHOLDER": "Position"
},
+ "Description":"Description"
+ ,
"DEPARTMENT": {
"LABEL": "Deparment",
"PLACEHOLDER": "Deparment"
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index f3a02d53..1842bba5 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -5,15 +5,15 @@
export const environment = {
production: false,
authUrl : 'http://qualichain.epu.ntua.gr:5000/auth',
- usersUrl : 'http://qualichain.epu.ntua.gr:5000/users',
- jobsUrl : 'http://qualichain.epu.ntua.gr:5000/jobs',
+ usersUrl : 'http://localhost:8000/profiles',//'http://qualichain.epu.ntua.gr:5000/users',
+ jobsUrl : 'http://localhost:8000/jobs',
smartBadgesManagementUrl : 'https://localhost:4000/smartBadgesManagement',
verificationAndEquivalenceUrl : 'https://localhost:4000/verificationAndEquivalence',
profileUrl : 'https://localhost:4000/profile',
educationManagementUrl : 'https://localhost:4000/educationManagement',
competencyManagementUrl : 'https://localhost:4000/competencyManagement',
- cvUrl : 'http://qualichain.epu.ntua.gr:5000/CV',
- jobmatchingUrl : 'http://localhost:8000/jobmatching',
+ cvUrl : 'http://localhost:8000/cv',//'http://qualichain.epu.ntua.gr:5000/CV',
+ jobmatchingUrl : 'http://localhost:8000/jobs',
jobpostGet : 'https://localhost:8000/jobget',
jobpostUrl : 'https://localhost:8000/jobpost'
};