Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cf-online-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
cf-online-ui
Commits
f8dc5b6a
Commit
f8dc5b6a
authored
4 years ago
by
xaralis
Browse files
Options
Downloads
Patches
Plain Diff
feat: show proper user pic in Navbar
parent
a0d7a22e
No related branches found
No related tags found
No related merge requests found
Pipeline
#1794
passed
4 years ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/App.jsx
+1
-0
1 addition, 0 deletions
src/App.jsx
src/components/Navbar.jsx
+1
-1
1 addition, 1 deletion
src/components/Navbar.jsx
src/keycloak.js
+0
-4
0 additions, 4 deletions
src/keycloak.js
typings/cf2021.d.ts
+1
-0
1 addition, 0 deletions
typings/cf2021.d.ts
with
3 additions
and
5 deletions
src/App.jsx
+
1
−
0
View file @
f8dc5b6a
...
@@ -30,6 +30,7 @@ const onKeycloakEvent = (event) => {
...
@@ -30,6 +30,7 @@ const onKeycloakEvent = (event) => {
state
.
isAuthenticated
=
true
;
state
.
isAuthenticated
=
true
;
state
.
user
=
{
state
.
user
=
{
name
:
keycloak
.
tokenParsed
.
name
,
name
:
keycloak
.
tokenParsed
.
name
,
username
:
keycloak
.
tokenParsed
.
preferred_username
,
groups
:
keycloak
.
tokenParsed
.
groups
,
groups
:
keycloak
.
tokenParsed
.
groups
,
accessToken
:
keycloak
.
token
,
accessToken
:
keycloak
.
token
,
};
};
...
...
This diff is collapsed.
Click to expand it.
src/components/Navbar.jsx
+
1
−
1
View file @
f8dc5b6a
...
@@ -66,7 +66,7 @@ const Navbar = () => {
...
@@ -66,7 +66,7 @@ const Navbar = () => {
<
span
className
=
"head-heavy-2xs"
>
{
user
.
name
}
</
span
>
<
span
className
=
"head-heavy-2xs"
>
{
user
.
name
}
</
span
>
<
div
className
=
"avatar avatar--2xs"
>
<
div
className
=
"avatar avatar--2xs"
>
<
img
<
img
src
=
"
http://
placeimg.com/100/100/people"
src
=
{
`
http
s
://
a.pirati.cz/piratar/
${
user
.
username
}
.jpg`
}
alt
=
"Avatar"
alt
=
"Avatar"
/>
/>
</
div
>
</
div
>
...
...
This diff is collapsed.
Click to expand it.
src/keycloak.js
+
0
−
4
View file @
f8dc5b6a
...
@@ -8,8 +8,4 @@ const keycloak = Keycloak({
...
@@ -8,8 +8,4 @@ const keycloak = Keycloak({
clientId
:
"
cf-online
"
,
clientId
:
"
cf-online
"
,
});
});
// keycloak.init({
// onLoad: "check-sso",
// });
export
default
keycloak
;
export
default
keycloak
;
This diff is collapsed.
Click to expand it.
typings/cf2021.d.ts
+
1
−
0
View file @
f8dc5b6a
...
@@ -28,6 +28,7 @@ declare namespace CF2021 {
...
@@ -28,6 +28,7 @@ declare namespace CF2021 {
isAuthenticated
:
true
;
isAuthenticated
:
true
;
user
:
{
user
:
{
name
:
string
;
name
:
string
;
username
:
string
;
groups
:
string
[];
groups
:
string
[];
accessToken
:
string
;
accessToken
:
string
;
};
};
...
...
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