Commit e16d05d1 by Muhammad Usman

personal details fixes

parent 420fffb8
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<div class="col-md-12 d-flex justify-content-end mt-5"> <div class="col-md-12 d-flex justify-content-end mt-5">
<button (click)="updateProfile()" pButton [icon]="isSaving ? 'pi pi-spin pi-spinner' : 'pi pi-save'" label="Update Information" class="ui-button-info" [disabled]="isLoading || isSaving"> <button (click)="updateProfile()" pButton [icon]="isSaving ? 'pi pi-spin pi-spinner' : 'pi pi-save'" label="Update Information" class="ui-button-info update-info" [disabled]="isLoading || isSaving">
</button> </button>
</div> </div>
</form> </form>
......
...@@ -56,4 +56,9 @@ ...@@ -56,4 +56,9 @@
.personal-details { .personal-details {
padding: 5%; padding: 5%;
} }
.update-info {
width: 100%;
display: block;
}
} }
...@@ -75,7 +75,7 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit { ...@@ -75,7 +75,7 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
this.ps.getJobTitles({JobTitle: $event.query}) this.ps.getJobTitles({JobTitle: $event.query})
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(response => { .subscribe(response => {
this.jobTitles = response; this.jobTitles = response.filter(r => r.JobTitle);
}, err => { }, err => {
this.hs.handleHttpError(err); this.hs.handleHttpError(err);
}) })
...@@ -93,6 +93,7 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit { ...@@ -93,6 +93,7 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
if (this.careerProfile.Candidate.EmploymentPreference) { if (this.careerProfile.Candidate.EmploymentPreference) {
this.careerProfile.Candidate.EmploymentPreference = this.careerProfile.Candidate.EmploymentPreference.map(p => p.Value); this.careerProfile.Candidate.EmploymentPreference = this.careerProfile.Candidate.EmploymentPreference.map(p => p.Value);
} }
this.ps.careerProfileUpdated = this.careerProfile;
this.isLoading = false; this.isLoading = false;
}, err => { }, err => {
this.hs.handleHttpError(err); this.hs.handleHttpError(err);
...@@ -119,8 +120,8 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit { ...@@ -119,8 +120,8 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
} }
updateAddress($event): void { updateAddress($event): void {
this.careerProfile = {...this.careerProfile, ...{GoogleAddress: $event.address}}; console.log($event);
this.cdr.detectChanges(); this.careerProfile.GoogleAddress = $event.address;
} }
changedAddress(): void { changedAddress(): void {
......
...@@ -16,11 +16,11 @@ export class GooglePlacesAutocompleteDirective implements OnInit { ...@@ -16,11 +16,11 @@ export class GooglePlacesAutocompleteDirective implements OnInit {
googleLocation.lat = place.geometry.location.lat(); googleLocation.lat = place.geometry.location.lat();
googleLocation.lng = place.geometry.location.lng(); googleLocation.lng = place.geometry.location.lng();
for (const i in place.address_components) { googleLocation.address = `${place.name} ${place.formatted_address}`;
if (place.address_components.hasOwnProperty(i)) { // for (const i in place.address_components) {
const item = place.address_components[i]; // if (place.address_components.hasOwnProperty(i)) {
// const item = place.address_components[i];
googleLocation.address = place.formatted_address; // googleLocation.address = place.formatted_address;
// if (item.types.indexOf('administrative_area_level_1') > -1) { // if (item.types.indexOf('administrative_area_level_1') > -1) {
// googleLocation.city = item.long_name; // googleLocation.city = item.long_name;
// } else if (item.types.indexOf('administrative_area_level_2') > -1) { // } else if (item.types.indexOf('administrative_area_level_2') > -1) {
...@@ -40,9 +40,8 @@ export class GooglePlacesAutocompleteDirective implements OnInit { ...@@ -40,9 +40,8 @@ export class GooglePlacesAutocompleteDirective implements OnInit {
// } else if (item.types.indexOf('street_number') > -1) { // } else if (item.types.indexOf('street_number') > -1) {
// googleLocation.building_no = item.long_name; // googleLocation.building_no = item.long_name;
// } // }
} // }
// }
}
return googleLocation; return googleLocation;
} }
......
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