Commit f4950a68 by Muhammad Usman

toaster sisues

parent c3f8d252
...@@ -42,6 +42,7 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On ...@@ -42,6 +42,7 @@ export class WorkPreferenceComponent extends BaseComponent implements OnInit, On
.subscribe(response => { .subscribe(response => {
this.isLoading = false; this.isLoading = false;
this.autoSavedOn = new Date(); this.autoSavedOn = new Date();
this.autoSave();
if (response.length > 0) { if (response.length > 0) {
this.workPreferenceQuestion = response[0]; this.workPreferenceQuestion = response[0];
} else { } else {
......
...@@ -41,6 +41,7 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr ...@@ -41,6 +41,7 @@ export class WorkStyleComponent extends BaseComponent implements OnInit, OnDestr
.subscribe(response => { .subscribe(response => {
this.isLoading = false; this.isLoading = false;
this.autoSavedOn = new Date(); this.autoSavedOn = new Date();
this.autoSave();
if (response.length > 0) { if (response.length > 0) {
this.workStyleQuestion = response[0]; this.workStyleQuestion = response[0];
} }
......
<h4 class="tab-heading">Tell us about your education, qualifications and certifications</h4> <div class="position-relative">
<app-overlay [isActive]="isLoading"></app-overlay>
<div class="row" style="margin-top: 24px;">
<div class="col-md-12 form-group">
<p-checkbox label="I don't have any education qualification or certificates to record"></p-checkbox>
</div>
</div>
<h4 class="tab-heading">Tell us about your education, qualifications and certifications</h4>
<div class="row education-wrapper">
<div class="col-md-9"> <div class="row" style="margin-top: 24px;"
<div class="row"> *ngIf="!careerProfile?.EducationCertificates[0]?.Certification && careerProfile?.EducationCertificates?.length <= 1">
<div class="col-md-6 form-group"> <div class="col-md-12 form-group">
<label>Course or Certification</label> <p-checkbox label="I don't have any education qualification or certificates to record" [binary]="true"
<input type="text" class="form-control" placeholder="Employeer name" name="Skype"> [(ngModel)]="careerProfile.NoEducationQualification">
</div> </p-checkbox>
</div> </div>
</div>
<div class="row"> <form #form="ngForm" *ngIf="!careerProfile.NoEducationQualification">
<div class="col-md-6 form-group">
<label>Where Studied</label>
<input type="text" class="form-control" placeholder="Where studied" name="Skype">
</div>
<div class="col-md-6 form-group"> <div class="row education-wrapper" *ngFor="let education of careerProfile.EducationCertificates; let i = index;">
<label>Where Issued</label>
<input type="text" class="form-control" placeholder="Where issued" name="Skype">
</div>
</div>
<div class="row"> <div class="remove-record">
<div class="col-md-3 form-group"> <i class="fa fa-remove" (click)="removeEducation(education)"></i>
<label>GPA or Outcome</label>
<input type="text" class="form-control" placeholder="Where studied" name="Skype">
</div> </div>
<div class="col-md-6 col-md-offset-3 form-group"> <div class="col-md-9">
<label>When Completed</label> <div class="row">
<p-calendar></p-calendar> <div class="col-md-6 form-group">
<label>Course or Certification</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Certification" name="Certification" [(ngModel)]="education.Certification">
</app-form-control>
</div>
</div>
<div class="row">
<div class="col-md-6 form-group">
<label>Where Studied</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Where studied" name="WhereStudied" [(ngModel)]="education.WhereStudied">
</app-form-control>
</div>
<div class="col-md-6 form-group">
<label>Where Issued</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Where issued" name="WhereIssued" [(ngModel)]="education.WhereIssued">
</app-form-control>
</div>
</div>
<div class="row">
<div class="col-md-3 form-group">
<label>GPA or Outcome</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Outcome" name="Outcome" [(ngModel)]="education.Outcome">
</app-form-control>
</div>
<div class="col-md-6 col-md-offset-3 form-group">
<label>When Completed</label>
<app-form-control>
<p-calendar [(ngModel)]="education.WhenCompletedField" name="WhenCompletedField">
</p-calendar>
</app-form-control>
</div>
</div>
<div class="row">
<div class="col-md-4 form-group">
<label>Upload Certificate</label>
<p-fileUpload mode="basic" name="Upload your Cover Letter" withCredentials="true" auto="true"
chooseLabel="Browse"></p-fileUpload>
</div>
</div>
</div> </div>
</div>
<div class="row">
<div class="col-md-4 form-group">
<label>Upload Certificate</label>
<p-fileUpload mode="basic" name="Upload your Cover Letter" withCredentials="true" auto="true" chooseLabel="Browse"></p-fileUpload>
</div>
</div> </div>
</div>
</form>
</div>
<div class="row">
<div class="row"> <div class="col-md-12">
<div class="col-md-12"> <button pButton class="btn btn-info-outline add-more" label="Add Education +" (click)="addEducation()"></button>
<button pButton class="btn btn-info-outline add-more" label="Add Education +"></button> </div>
</div> </div>
</div>
<div class="d-flex justify-content-center" style="margin-top: 48px;">
<button pButton label="Next Section" class="ui-button-info next-section" (click)="saveEducation()"></button>
</div>
<div class="d-flex justify-content-center" style="margin-top: 48px;">
<button pButton label="Next Section" class="ui-button-info next-section"></button>
</div> </div>
import { Component, OnInit } from '@angular/core'; import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { CareerProfileModel } from '../../../models/career-profile.model';
import { HelperService } from '../../../services/helper.service';
import { UtilsService } from '../../../../../oneit/services/utils.service';
import { ConfirmationService } from 'primeng/api';
import { NgForm } from '@angular/forms';
import { BaseComponent } from '../../../base/base.component';
import { takeUntil } from 'rxjs/operators';
import { EducationModel } from '../../../models/education.model';
@Component({ @Component({
selector: 'app-education', selector: 'app-education',
templateUrl: './education.component.html', templateUrl: './education.component.html',
styleUrls: ['./education.component.scss'] styleUrls: ['./education.component.scss']
}) })
export class EducationComponent implements OnInit { export class EducationComponent extends BaseComponent implements OnInit {
constructor() { assocs = ['EducationCertificates'];
careerProfile = new CareerProfileModel();
@ViewChild('form') form: NgForm;
@Output() workSaved = new EventEmitter();
constructor(
private ps: PersonalDetailsService,
private us: UtilsService,
private cs: ConfirmationService,
private hs: HelperService
) {
super();
} }
ngOnInit() { ngOnInit() {
this.getCareerProfile();
}
getCareerProfile(): void {
this.isLoading = true;
this.ps.getCareerProfile(this.assocs)
.pipe(takeUntil(this.componentInView))
.subscribe(response => {
this.isLoading = false;
this.careerProfile = response;
if (this.careerProfile.EducationCertificates) {
this.careerProfile.EducationCertificates.forEach(edu => {
edu.WhenCompletedField = UtilsService.convertStringToDate(edu.WhenCompleted);
})
}
this.us.addObjsToJSONByObjectID(this.updatedObjs, this.careerProfile.EducationCertificates);
this.addEducation(true);
this.isLoading = false;
}, err => {
this.hs.handleHttpError(err);
this.isLoading = false;
})
}
addEducation(initLoad = false): void {
const newModel = new EducationModel();
newModel.CareerProfile = this.careerProfile.ObjectID;
if (initLoad && (!this.careerProfile.EducationCertificates || this.careerProfile.EducationCertificates.length === 0)) {
this.us.addMultiRefObject(newModel, this.careerProfile, 'EducationCertificates', this.createdObjs);
} else if (!initLoad) {
this.us.addMultiRefObject(newModel, this.careerProfile, 'EducationCertificates', this.createdObjs);
}
}
removeEducation(exp): void {
this.cs.confirm({
message:'Are you sure you want to remove this education?',
accept: () => {
this.us.removeMultiRefObject(exp, this.careerProfile, 'EducationCertificates', this.createdObjs, this.updatedObjs, this.deletedObjs);
}
})
}
saveEducation(): void {
this.hs.validateAllFormFields(this.form);
if (this.form.invalid) {
return ;
}
this.careerProfile.EducationCertificates.forEach(exp => {
exp.WhenCompleted = UtilsService.convertDateToString(exp.WhenCompletedField);
});
this.isSaving = true;
this.ps.saveProfile(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView))
.subscribe(res => {
this.isSaving = false;
this.hs.oneItHttpResponse(res);
this.workSaved.emit();
}, err => {
this.hs.handleHttpError(err);
this.isSaving = false;
})
} }
} }
...@@ -102,7 +102,6 @@ export class WorkHistoryComponent extends BaseComponent implements OnInit { ...@@ -102,7 +102,6 @@ export class WorkHistoryComponent extends BaseComponent implements OnInit {
this.isSaving = false; this.isSaving = false;
this.hs.oneItHttpResponse(res); this.hs.oneItHttpResponse(res);
this.workSaved.emit(); this.workSaved.emit();
console.log('SENT');
}, err => { }, err => {
this.hs.handleHttpError(err); this.hs.handleHttpError(err);
this.isSaving = false; this.isSaving = false;
......
...@@ -20,6 +20,8 @@ export const CLASSES = { ...@@ -20,6 +20,8 @@ export const CLASSES = {
DIVERSITY_QUESTION: 'performa.orm.DiversityQuestion', DIVERSITY_QUESTION: 'performa.orm.DiversityQuestion',
DIVERSITY_ANSWER: 'performa.orm.DiversityAnswer', DIVERSITY_ANSWER: 'performa.orm.DiversityAnswer',
WORK_EXPERIENCE: 'performa.orm.WorkExperience', WORK_EXPERIENCE: 'performa.orm.WorkExperience',
CERTIFICATION: 'performa.orm.Certification',
EDUCATION: 'performa.orm.EducationCertificate',
QUESTION: 'performa.orm.Question' QUESTION: 'performa.orm.Question'
}; };
......
...@@ -2,6 +2,7 @@ import { BaseModel } from './base.model'; ...@@ -2,6 +2,7 @@ import { BaseModel } from './base.model';
import { CandidateModel } from './candidate.model'; import { CandidateModel } from './candidate.model';
import { CLASSES } from '../config/constants'; import { CLASSES } from '../config/constants';
import { WorkExperienceModel } from './work-experience.model'; import { WorkExperienceModel } from './work-experience.model';
import { EducationModel } from './education.model';
export class CareerProfileModel extends BaseModel { export class CareerProfileModel extends BaseModel {
ObjectClass = CLASSES.CAREER_PROFILE; ObjectClass = CLASSES.CAREER_PROFILE;
...@@ -15,5 +16,7 @@ export class CareerProfileModel extends BaseModel { ...@@ -15,5 +16,7 @@ export class CareerProfileModel extends BaseModel {
IsGoogleConnected: boolean; IsGoogleConnected: boolean;
IsLinkedInConnected: boolean; IsLinkedInConnected: boolean;
WorkExperiences: WorkExperienceModel[] = []; WorkExperiences: WorkExperienceModel[] = [];
EducationCertificates: EducationModel[] = [];
NoWorkExperience: boolean; NoWorkExperience: boolean;
NoEducationQualification: boolean;
} }
import { BaseModel } from './base.model';
import { CLASSES } from '../config/constants';
export class EducationModel extends BaseModel {
ObjectClass = CLASSES.EDUCATION;
IsIncluded: boolean;
WhereStudied: string;
WhereIssued: string;
Outcome: string;
WhenCompleted: string;
WhenCompletedField: Date;
Certificate: any;
CareerProfile: string;
Certification: Certification;
}
class Certification extends BaseModel {
ObjectClass = CLASSES.CERTIFICATION;
CertificateName: string;
}
...@@ -10,7 +10,7 @@ export class ToasterService { ...@@ -10,7 +10,7 @@ export class ToasterService {
) { } ) { }
error(txt, title = 'Error'): void { error(txt, title = 'Error'): void {
this.ms.add({severity: 'error', summary: title, detail: txt, life: 3000}); this.ms.add({severity: 'error', summary: title, detail: txt, life: 300000});
} }
success(txt, title = 'Success'): void { success(txt, title = 'Success'): void {
......
...@@ -25,6 +25,19 @@ ...@@ -25,6 +25,19 @@
.experience-wrapper, .education-wrapper, .skill-wrapper, .reference-wrapper { .experience-wrapper, .education-wrapper, .skill-wrapper, .reference-wrapper {
margin-bottom: 32px; margin-bottom: 32px;
border-bottom: 1px solid #f2f2f2;
position: relative;
.remove-record {
padding: 3px 6px;
border-radius: 3px;
background: #e62a10;
color: #fff;
position: absolute;
right: 0;
cursor: pointer;
top: 0;
}
} }
.add-more { .add-more {
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
left: 20%; left: 20%;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column;
p-toastItem { p-toastItem {
width: 100%; width: 100%;
font-family: $bodyFont; font-family: $bodyFont;
margin-bottom: 10px;
} }
.ui-toast-message { .ui-toast-message {
......
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