File tree 3 files changed +25
-10
lines changed
3 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,16 @@ export async function updateSelectedZaken(
27
27
/**
28
28
* Returns the correct format for a user.
29
29
* @param user
30
+ * @param showRole
30
31
*/
31
- export function formatUser ( user : User ) {
32
- if ( user . firstName && user . lastName )
33
- return `${ user . firstName } ${ user . lastName } (${ user . username } )` ;
34
- return user . username ;
32
+ export function formatUser ( user : User , showRole = false ) {
33
+ const displayName =
34
+ user . firstName && user . lastName
35
+ ? `${ user . firstName } ${ user . lastName } (${ user . username } )`
36
+ : user . username ;
37
+
38
+ if ( showRole && user . role . name ) {
39
+ return `${ displayName } (${ user . role . name } )` ;
40
+ }
41
+ return displayName ;
35
42
}
Original file line number Diff line number Diff line change 1
- .LandingPage {
2
- /* Rules here. */
1
+ .LandingPage__assignees-count {
2
+ color : var (--page-color-primary );
3
+ font-weight : var (--typography-font-weight-bold );
3
4
}
Original file line number Diff line number Diff line change @@ -111,13 +111,18 @@ export const Landing = () => {
111
111
112
112
const objectLists : AttributeData [ ] [ ] = Object . values ( statusMap ) . map ( ( lists ) =>
113
113
lists . map ( ( list ) => {
114
- const firstAssignee = list . assignees [ 0 ] ;
114
+ const currentAssignee = list . assignee ;
115
115
const otherAssignees = [ ...list . assignees ] . splice ( 1 ) ;
116
116
117
117
const footer = (
118
118
< P muted size = "xs" >
119
- { formatUser ( firstAssignee . user ) }
120
- { otherAssignees . length && < strong > +{ otherAssignees . length } </ strong > }
119
+ { formatUser ( currentAssignee , true ) }
120
+ { otherAssignees . length && (
121
+ < strong className = "LandingPage__assignees-count" >
122
+ { " " }
123
+ +{ otherAssignees . length }
124
+ </ strong >
125
+ ) }
121
126
</ P >
122
127
) ;
123
128
@@ -128,7 +133,9 @@ export const Landing = () => {
128
133
timeAgo : timeAgo ( list . created ) ,
129
134
assignees : otherAssignees . length ? (
130
135
< Tooltip
131
- content = { otherAssignees . map ( ( a ) => formatUser ( a . user ) ) . join ( ", " ) }
136
+ content = { otherAssignees
137
+ . map ( ( a ) => formatUser ( a . user , true ) )
138
+ . join ( ", " ) }
132
139
placement = "top"
133
140
>
134
141
< span > { footer } </ span >
You can’t perform that action at this time.
0 commit comments