Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
invControl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
DevTeam
invControl
Commits
20ee2176
Commit
20ee2176
authored
4 years ago
by
Rafael László
Browse files
Options
Downloads
Patches
Plain Diff
Own profile
parent
ed69e0dc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#5520
passed
4 years ago
Stage: Build
Stage: Docker build
Stage: Deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/src/components/user/OwnProfile.tsx
+61
-2
61 additions, 2 deletions
client/src/components/user/OwnProfile.tsx
with
61 additions
and
2 deletions
client/src/components/user/OwnProfile.tsx
+
61
−
2
View file @
20ee2176
import
{
Card
,
CardContent
}
from
'
@material-ui/core
'
;
import
{
Box
,
Card
,
CardContent
,
Table
,
TableBody
,
TableCell
,
TableHead
,
TableRow
,
Typography
,
}
from
'
@material-ui/core
'
;
import
{
IOwnUserGQL
,
ownUserGQL
}
from
'
../../graphql/queries/user/ownUser
'
;
import
{
Loading
}
from
'
../utils/Loading
'
;
import
PersonIcon
from
'
@material-ui/icons/Person
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
UserRole
}
from
'
../../types/graphqlSchema
'
;
import
{
useQuery
}
from
'
@apollo/client
'
;
const
TableRowWithData
:
React
.
FC
<
{
field
:
string
;
value
?:
string
|
number
}
>
=
({
field
,
value
=
'
-
'
})
=>
{
return
(
<
TableRow
>
<
TableCell
component
=
"th"
scope
=
"row"
>
<
Typography
variant
=
"subtitle1"
>
{
field
}
</
Typography
>
</
TableCell
>
<
TableCell
align
=
"right"
>
<
Typography
variant
=
"subtitle1"
>
{
value
}
</
Typography
>
</
TableCell
>
</
TableRow
>
);
};
const
userRoleAdminString
=
'
Admin
'
;
const
userRoleNormalString
=
'
Normál
'
;
const
getUserRoleString
=
(
role
:
UserRole
|
undefined
=
undefined
)
=>
{
return
role
===
UserRole
.
Admin
?
userRoleAdminString
:
userRoleNormalString
;
};
export
const
OwnProfile
:
React
.
FC
=
()
=>
{
export
const
OwnProfile
:
React
.
FC
=
()
=>
{
const
{
loading
:
userDataIsLoading
,
data
:
userData
}
=
useQuery
<
IOwnUserGQL
>
(
ownUserGQL
);
return
(
return
(
<
Card
>
<
Card
>
<
CardContent
>
apple
</
CardContent
>
<
CardContent
style
=
{
{
padding
:
0
}
}
>
<
Loading
isLoading
=
{
userDataIsLoading
}
>
<
Table
aria-label
=
"simple table"
>
<
TableHead
>
<
TableRow
>
<
TableCell
>
<
Box
display
=
"flex"
alignItems
=
"center"
>
<
PersonIcon
style
=
{
{
marginRight
:
'
0.7rem
'
}
}
/>
<
Typography
variant
=
"h5"
>
Profilom
</
Typography
>
</
Box
>
</
TableCell
>
<
TableCell
align
=
"right"
></
TableCell
>
</
TableRow
>
</
TableHead
>
<
TableBody
>
<
TableRowWithData
field
=
"Név"
value
=
{
`
${
userData
?.
me
.
familyName
}
${
userData
?.
me
.
givenName
}
`
}
/>
<
TableRowWithData
field
=
"E-mail"
value
=
{
userData
?.
me
.
googleEmail
}
/>
<
TableRowWithData
field
=
"ID"
value
=
{
userData
?.
me
.
id
}
/>
<
TableRowWithData
field
=
"Jogkör"
value
=
{
getUserRoleString
(
userData
?.
me
.
role
)
}
/>
</
TableBody
>
</
Table
>
</
Loading
>
</
CardContent
>
</
Card
>
</
Card
>
);
);
};
};
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