Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
Resin
Client
Commits
bf5db27c
Commit
bf5db27c
authored
3 years ago
by
Rémi PAILHAREY
Browse files
Options
Downloads
Patches
Plain Diff
fix(profile): conditional display of the job and the employer in profile
parent
0f4b5608
Branches
Branches containing commit
Tags
Tags containing commit
4 merge requests
!418
V2.1.0
,
!400
V2.0
,
!270
Fix/display job employer in profile
,
!230
V2.0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/profile/profile.component.html
+1
-1
1 addition, 1 deletion
src/app/profile/profile.component.html
src/app/profile/profile.component.ts
+3
-1
3 additions, 1 deletion
src/app/profile/profile.component.ts
src/app/utils/utils.ts
+10
-0
10 additions, 0 deletions
src/app/utils/utils.ts
with
14 additions
and
2 deletions
src/app/profile/profile.component.html
+
1
−
1
View file @
bf5db27c
...
...
@@ -36,7 +36,7 @@
></app-svg-icon>
<div
class=
"information"
>
<div
class=
"name"
>
{{ userProfile.name }} {{ userProfile.surname }}
</div>
<div
class=
"job"
>
{{ userProfile.job.name }}, {{ userProfile.employer.name
}}
</div>
<div
*ngIf=
"utils.getJobEmployer(userProfile)"
class=
"job"
>
{{ utils.getJobEmployer(userProfile)
}}
</div>
<div
class=
"phone"
>
{{ userProfile.phone | phone }}
</div>
<a
class=
"email"
href=
"mailto:{{ userProfile.email }}"
>
{{ userProfile.email }}
</a>
<div
class=
"description"
*ngIf=
"userProfile.description"
>
{{ userProfile.description }}
</div>
...
...
This diff is collapsed.
Click to expand it.
src/app/profile/profile.component.ts
+
3
−
1
View file @
bf5db27c
...
...
@@ -5,6 +5,7 @@ import { User } from '../models/user.model';
import
{
StructureService
}
from
'
../services/structure.service
'
;
import
{
ButtonType
}
from
'
../shared/components/button/buttonType.enum
'
;
import
{
ProfileService
}
from
'
./services/profile.service
'
;
import
{
Utils
}
from
'
../utils/utils
'
;
@
Component
({
selector
:
'
app-profile
'
,
...
...
@@ -19,7 +20,8 @@ export class ProfileComponent implements OnInit {
constructor
(
private
profileService
:
ProfileService
,
private
structureService
:
StructureService
,
private
router
:
Router
private
router
:
Router
,
public
utils
:
Utils
)
{}
ngOnInit
():
void
{
...
...
This diff is collapsed.
Click to expand it.
src/app/utils/utils.ts
+
10
−
0
View file @
bf5db27c
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
FormGroup
}
from
'
@angular/forms
'
;
import
{
User
}
from
'
../models/user.model
'
;
@
Injectable
({
providedIn
:
'
root
'
,
...
...
@@ -25,4 +26,13 @@ export class Utils {
}
return
phoneNumber
;
}
public
getJobEmployer
(
userProfile
:
User
):
string
{
const
jobName
=
userProfile
.
job
?.
name
;
const
employerName
=
userProfile
.
employer
?.
name
;
if
(
!
jobName
&&
!
employerName
)
return
''
;
if
(
!
jobName
&&
employerName
)
return
employerName
;
if
(
jobName
&&
!
employerName
)
return
jobName
;
if
(
jobName
&&
employerName
)
return
`
${
jobName
}
,
${
employerName
}
`
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment