Commit d97cece1 by Muhammad Usman

jobs listing

parent 539eac42
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<hr class="mt-5"> <hr class="mt-5">
<div class="d-flex justify-content-center mt-5"> <div class="d-flex justify-content-center mt-5">
<button class="ui-button-info mc-btn-primary" (click)="initiateWorkPreference(true)" *ngIf="workPreferenceQuestion.QuestionNo > 1" pButton label="Go Back"></button> <button class="ui-button-info mc-btn-primary" [disabled]="isLoading" (click)="initiateWorkPreference(true)" *ngIf="workPreferenceQuestion.QuestionNo > 1" pButton label="Go Back"></button>
</div> </div>
</ng-container> </ng-container>
......
...@@ -30,6 +30,7 @@ export const CLASSES = { ...@@ -30,6 +30,7 @@ export const CLASSES = {
INTRO: 'performa.orm.IntroductionLetter', INTRO: 'performa.orm.IntroductionLetter',
ILWorkExperience: 'performa.orm.ILWorkExperience', ILWorkExperience: 'performa.orm.ILWorkExperience',
ILSkill: 'performa.orm.ILSkill', ILSkill: 'performa.orm.ILSkill',
Job: 'performa.orm.Job',
}; };
export const SERVICES = { export const SERVICES = {
...@@ -47,6 +48,7 @@ export const SERVICES = { ...@@ -47,6 +48,7 @@ export const SERVICES = {
LOGIN_LINKEDIN: 'LoginWithLinkedIn', LOGIN_LINKEDIN: 'LoginWithLinkedIn',
LOGIN_GOOGLE: 'LoginWithGoogle', LOGIN_GOOGLE: 'LoginWithGoogle',
INTRODUCTION_LETTERS: 'IntroductionLetters', INTRODUCTION_LETTERS: 'IntroductionLetters',
APPLICANT_TALENT_JOBS: 'ApplicantTalentJobs',
}; };
export const SEARCH = { export const SEARCH = {
......
...@@ -55,11 +55,16 @@ export class ProfileTasksComponent extends BaseComponent { ...@@ -55,11 +55,16 @@ export class ProfileTasksComponent extends BaseComponent {
t.completed = false; t.completed = false;
t.inProgress = false; t.inProgress = false;
t.started = false; t.started = false;
if (t.key === 'CompletedPercentageCH' && this.careerProfile[t.key] >= 100 && !this.careerProfile.PublishProfile) { if (this.careerProfile[t.key] >= 100) {
if (t.key === 'CompletedPercentageCH') {
if (this.careerProfile[t.key] === 100) {
this.careerProfile[t.key] = 99; this.careerProfile[t.key] = 99;
} else {
t.completed = true;
} }
if (this.careerProfile[t.key] >= 100) { } else {
t.completed = true; t.completed = true;
}
} else if (this.careerProfile[t.key] > 0 && this.careerProfile[t.key] <= 100) { } else if (this.careerProfile[t.key] > 0 && this.careerProfile[t.key] <= 100) {
t.inProgress = true; t.inProgress = true;
} }
......
...@@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core'; ...@@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core';
@Component({ @Component({
selector: 'app-job', selector: 'app-job',
templateUrl: './job.component.html', templateUrl: './job.component.html',
styleUrls: ['./job.component.css'] styleUrls: ['./job.component.scss']
}) })
export class JobComponent implements OnInit { export class JobComponent implements OnInit {
......
...@@ -4,12 +4,18 @@ import { CommonModule } from '@angular/common'; ...@@ -4,12 +4,18 @@ import { CommonModule } from '@angular/common';
import { JobsRouting } from './jobs.routing'; import { JobsRouting } from './jobs.routing';
import { JobsComponent } from './jobs/jobs.component'; import { JobsComponent } from './jobs/jobs.component';
import { JobComponent } from './job/job.component'; import { JobComponent } from './job/job.component';
import { McSharedModule } from '../mc-shared/mc-shared.module';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
JobsRouting JobsRouting,
McSharedModule
], ],
declarations: [JobsComponent, JobComponent] declarations: [
JobsComponent,
JobComponent
]
}) })
export class JobsModule { } export class JobsModule {
}
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { JobsComponent } from './jobs/jobs.component';
import { JobComponent } from './job/job.component';
const routes: Routes = []; const routes: Routes = [
{
path: '',
component: JobsComponent
},
{
path: 'new',
component: JobComponent
},
{
path: ':id',
component: JobComponent
}
];
@NgModule({ @NgModule({
imports: [RouterModule.forChild(routes)], imports: [RouterModule.forChild(routes)],
......
<p> <div class="mc-page">
jobs works!
</p> <div class="mc-page-header">
<div class="mc-page-header-logo">
<img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt="">
</div>
</div>
<div class="mc-page-body container">
<div class="mc-card">
<app-overlay [isActive]="isLoading"></app-overlay>
<div class="mc-page-body-heading">Jobs</div>
<div class="d-flex justify-content-end">
<button class="mc-btn-primary" pButton routerLink="/my-career-web/jobs/new" label="Add Job"></button>
</div>
<div class="d-flex justify-content-end mt-3" style="margin-right: 40px;">
<span style="margin-right: 20px;">Include Completed Jobs:</span>
<p-inputSwitch [(ngModel)]="includeCompleted" (onChange)="getJobApplicants()"></p-inputSwitch>
</div>
<div class="applicant-jobs">
<div class="applicant-job" *ngIf="applicantJobs.length === 0">
<div class="job-title text-center" style="flex: 1;">No jobs found. </div>
</div>
<div class="applicant-job" *ngFor="let applicantJob of applicantJobs;">
<div class="applicant-job-title">{{applicantJob.JobTitle}} - {{applicantJob.Employer}} </div>
<div class="applicant-job-status">{{applicantJob.JobStatus.Description}}</div>
<button class="mc-btn-secondary" pButton label="Edit" routerLink="/my-career-web/jobs/{{applicantJob.ObjectID}}"></button>
</div>
</div>
</div>
</div>
</div>
@import "../../../../styles/my-career-styles/variables";
.applicant-jobs {
margin-top: 24px;
.applicant-job {
border: 1px solid #f2f2f2;
padding: 15px 20px 10px;
display: flex;
align-items: center;
justify-content: space-between;
transition: .3s;
&-title {
flex: 0 0 300px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
&:hover {
background: #f2f2f2;
}
.mc-btn-secondary {
min-width: 100px;
height: 40px;
}
}
}
@media screen and (max-width: 1024px) {
.mc-btn-primary {
min-width: 100% !important;
margin-top: 20px;
}
}
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { BaseComponent } from '../../base/base.component';
import { JobService } from '../../services/job.service';
import { takeUntil } from 'rxjs/operators';
import { UtilsService } from '../../../oneit/services/utils.service';
import { ApplicantJobModel } from '../../models/applicant-job.model';
@Component({ @Component({
selector: 'app-jobs', selector: 'app-jobs',
templateUrl: './jobs.component.html', templateUrl: './jobs.component.html',
styleUrls: ['./jobs.component.css'] styleUrls: ['./jobs.component.scss']
}) })
export class JobsComponent implements OnInit {
constructor() { } export class JobsComponent extends BaseComponent implements OnInit {
ngOnInit() { assocs = [];
includeCompleted = false;
applicantJobs: ApplicantJobModel[] = [];
constructor(
private utilsService: UtilsService,
private jobsService: JobService
) {
super();
}
ngOnInit(): void {
this.getJobApplicants();
}
getJobApplicants(): void {
this.isLoading = true;
this.jobsService.getApplicantTalentJobs({IncludeCompleted: this.includeCompleted}, this.assocs)
.pipe(takeUntil(this.componentInView))
.subscribe(response => {
this.isLoading = false;
this.applicantJobs = response;
}, err => {
this.isLoading = false;
this.utilsService.handleError(err);
})
} }
} }
...@@ -15,6 +15,7 @@ import { TooltipModule } from 'primeng/tooltip'; ...@@ -15,6 +15,7 @@ import { TooltipModule } from 'primeng/tooltip';
import { IntroLetterService } from '../services/intro-letter.service'; import { IntroLetterService } from '../services/intro-letter.service';
import { TableModule } from 'primeng/table'; import { TableModule } from 'primeng/table';
import { IconReplacerDirective } from './icon-replacer.directive'; import { IconReplacerDirective } from './icon-replacer.directive';
import { JobService } from '../services/job.service';
const MODULES = [ const MODULES = [
ReactiveFormsModule, ReactiveFormsModule,
...@@ -55,7 +56,8 @@ const PIPES = [ ...@@ -55,7 +56,8 @@ const PIPES = [
ToasterService, ToasterService,
PersonalDetailsService, PersonalDetailsService,
AssessmentService, AssessmentService,
IntroLetterService IntroLetterService,
JobService
], ],
declarations: [ declarations: [
...COMPONENTS, ...COMPONENTS,
......
import { BaseModel } from './base.model';
import { CLASSES } from '../config/constants';
export class ApplicantJobModel extends BaseModel {
ObjectClass = CLASSES.Job;
JobTitle: string;
Employer: string;
ApplicantJobStatus: string;
JobStatus: any;
}
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { EnumService } from '../../oneit/services/enum.service';
import { SaveService } from '../../oneit/services/save.service';
import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service';
import { SERVICES } from '../config/constants';
@Injectable()
export class JobService {
constructor(
private enumService: EnumService,
private utilsService: UtilsService,
private searchService: SearchService,
private saveService: SaveService
) {
}
getApplicantTalentJobs(queryParams = {}, assocs = []): Observable<any> {
return this.searchService.getObjects(SERVICES.APPLICANT_TALENT_JOBS, 'All', queryParams, assocs, null, null, null, null)
.map(
data => {
return this.utilsService.convertResponseToObjects(data, assocs);
}
)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment