Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
e16d05d1
Commit
e16d05d1
authored
Jun 17, 2020
by
Muhammad Usman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
personal details fixes
parent
420fffb8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
50 deletions
+55
-50
personal-details.component.html
...ashboard/personal-details/personal-details.component.html
+1
-1
personal-details.component.scss
...ashboard/personal-details/personal-details.component.scss
+5
-0
personal-details.component.ts
.../dashboard/personal-details/personal-details.component.ts
+4
-3
google-places-autocomplete.directive.ts
...eer-web/mc-shared/google-places-autocomplete.directive.ts
+45
-46
No files found.
frontend/angular/src/app/components/my-career-web/dashboard/personal-details/personal-details.component.html
View file @
e16d05d1
...
...
@@ -98,7 +98,7 @@
<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>
</div>
</form>
...
...
frontend/angular/src/app/components/my-career-web/dashboard/personal-details/personal-details.component.scss
View file @
e16d05d1
...
...
@@ -56,4 +56,9 @@
.personal-details
{
padding
:
5%
;
}
.update-info
{
width
:
100%
;
display
:
block
;
}
}
frontend/angular/src/app/components/my-career-web/dashboard/personal-details/personal-details.component.ts
View file @
e16d05d1
...
...
@@ -75,7 +75,7 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
this
.
ps
.
getJobTitles
({
JobTitle
:
$event
.
query
})
.
pipe
(
takeUntil
(
this
.
componentInView
))
.
subscribe
(
response
=>
{
this
.
jobTitles
=
response
;
this
.
jobTitles
=
response
.
filter
(
r
=>
r
.
JobTitle
)
;
},
err
=>
{
this
.
hs
.
handleHttpError
(
err
);
})
...
...
@@ -93,6 +93,7 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
if
(
this
.
careerProfile
.
Candidate
.
EmploymentPreference
)
{
this
.
careerProfile
.
Candidate
.
EmploymentPreference
=
this
.
careerProfile
.
Candidate
.
EmploymentPreference
.
map
(
p
=>
p
.
Value
);
}
this
.
ps
.
careerProfileUpdated
=
this
.
careerProfile
;
this
.
isLoading
=
false
;
},
err
=>
{
this
.
hs
.
handleHttpError
(
err
);
...
...
@@ -119,8 +120,8 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
}
updateAddress
(
$event
):
void
{
this
.
careerProfile
=
{...
this
.
careerProfile
,
...{
GoogleAddress
:
$event
.
address
}}
;
this
.
c
dr
.
detectChanges
()
;
console
.
log
(
$event
)
;
this
.
c
areerProfile
.
GoogleAddress
=
$event
.
address
;
}
changedAddress
():
void
{
...
...
frontend/angular/src/app/components/my-career-web/mc-shared/google-places-autocomplete.directive.ts
View file @
e16d05d1
...
...
@@ -3,59 +3,58 @@ import { Directive, ElementRef, EventEmitter, OnInit, Output } from '@angular/co
declare
var
google
:
any
;
@
Directive
({
selector
:
'[appGooglePlacesAutocomplete]'
selector
:
'[appGooglePlacesAutocomplete]'
})
export
class
GooglePlacesAutocompleteDirective
implements
OnInit
{
@
Output
()
readonly
addressSelected
:
EventEmitter
<
any
>
=
new
EventEmitter
();
private
readonly
element
:
HTMLInputElement
;
static
getFormattedAddress
(
place
):
any
{
const
googleLocation
:
any
=
{};
googleLocation
.
lat
=
place
.
geometry
.
location
.
lat
();
googleLocation
.
lng
=
place
.
geometry
.
location
.
lng
();
for
(
const
i
in
place
.
address_components
)
{
if
(
place
.
address_components
.
hasOwnProperty
(
i
))
{
const
item
=
place
.
address_components
[
i
];
googleLocation
.
address
=
place
.
formatted_address
;
// if (item.types.indexOf('administrative_area_level_1') > -1) {
// googleLocation.city = item.long_name;
// } else if (item.types.indexOf('administrative_area_level_2') > -1) {
// googleLocation.town_area = item.long_name;
// } else if (item.types.indexOf('administrative_area_level_3') > -1) {
// if (!googleLocation.town_area) {
// googleLocation.town_area = item.long_name;
// }
// } else if (item.types.indexOf('country') > -1) {
// googleLocation.country = item.long_name;
// } else if (item.types.indexOf('postal_code') > -1) {
// googleLocation.zipcode = item.short_name;
// } else if (item.types.indexOf('route') > -1) {
// googleLocation.street = item.long_name;
// } else if (item.types.indexOf('route') > -1) {
// googleLocation.street = item.long_name;
// } else if (item.types.indexOf('street_number') > -1) {
// googleLocation.building_no = item.long_name;
@
Output
()
readonly
addressSelected
:
EventEmitter
<
any
>
=
new
EventEmitter
();
private
readonly
element
:
HTMLInputElement
;
static
getFormattedAddress
(
place
):
any
{
const
googleLocation
:
any
=
{};
googleLocation
.
lat
=
place
.
geometry
.
location
.
lat
();
googleLocation
.
lng
=
place
.
geometry
.
location
.
lng
();
googleLocation
.
address
=
`
${
place
.
name
}
${
place
.
formatted_address
}
`
;
// for (const i in place.address_components) {
// if (place.address_components.hasOwnProperty(i)) {
// const item = place.address_components[i];
// googleLocation.address = place.formatted_address;
// if (item.types.indexOf('administrative_area_level_1') > -1) {
// googleLocation.city = item.long_name;
// } else if (item.types.indexOf('administrative_area_level_2') > -1) {
// googleLocation.town_area = item.long_name;
// } else if (item.types.indexOf('administrative_area_level_3') > -1) {
// if (!googleLocation.town_area) {
// googleLocation.town_area = item.long_name;
// }
// } else if (item.types.indexOf('country') > -1) {
// googleLocation.country = item.long_name;
// } else if (item.types.indexOf('postal_code') > -1) {
// googleLocation.zipcode = item.short_name;
// } else if (item.types.indexOf('route') > -1) {
// googleLocation.street = item.long_name;
// } else if (item.types.indexOf('route') > -1) {
// googleLocation.street = item.long_name;
// } else if (item.types.indexOf('street_number') > -1) {
// googleLocation.building_no = item.long_name;
// }
// }
// }
}
return
googleLocation
;
}
return
googleLocation
;
}
constructor
(
private
elRef
:
ElementRef
)
{
this
.
element
=
elRef
.
nativeElement
;
}
constructor
(
private
elRef
:
ElementRef
)
{
this
.
element
=
elRef
.
nativeElement
;
}
ngOnInit
():
void
{
const
autocomplete
=
new
google
.
maps
.
places
.
Autocomplete
(
this
.
element
);
google
.
maps
.
event
.
addListener
(
autocomplete
,
'place_changed'
,
()
=>
{
this
.
addressSelected
.
emit
(
GooglePlacesAutocompleteDirective
.
getFormattedAddress
(
autocomplete
.
getPlace
()));
});
}
ngOnInit
():
void
{
const
autocomplete
=
new
google
.
maps
.
places
.
Autocomplete
(
this
.
element
);
google
.
maps
.
event
.
addListener
(
autocomplete
,
'place_changed'
,
()
=>
{
this
.
addressSelected
.
emit
(
GooglePlacesAutocompleteDirective
.
getFormattedAddress
(
autocomplete
.
getPlace
()));
});
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment