File tree 6 files changed +15
-4
lines changed
6 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -509,6 +509,7 @@ export interface User {
509
509
readonly username : string
510
510
readonly email : string
511
511
readonly created_at : string
512
+ readonly last_seen_at : string
512
513
readonly status : UserStatus
513
514
readonly organization_ids : string [ ]
514
515
readonly roles : Role [ ]
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ import { colors } from "theme/colors"
8
8
9
9
dayjs . extend ( relativeTime )
10
10
11
- interface WorkspaceLastUsedProps {
11
+ interface LastUsedProps {
12
12
lastUsedAt : string
13
13
}
14
14
15
- export const WorkspaceLastUsed : FC < WorkspaceLastUsedProps > = ( { lastUsedAt } ) => {
15
+ export const LastUsed : FC < LastUsedProps > = ( { lastUsedAt } ) => {
16
16
const theme : Theme = useTheme ( )
17
17
const styles = useStyles ( )
18
18
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export const Language = {
14
14
usernameLabel : "User" ,
15
15
rolesLabel : "Roles" ,
16
16
statusLabel : "Status" ,
17
+ lastSeenLabel : "Last Seen" ,
17
18
}
18
19
19
20
export interface UsersTableProps {
@@ -50,6 +51,7 @@ export const UsersTable: FC<React.PropsWithChildren<UsersTableProps>> = ({
50
51
< TableRow >
51
52
< TableCell width = "50%" > { Language . usernameLabel } </ TableCell >
52
53
< TableCell width = "25%" > { Language . statusLabel } </ TableCell >
54
+ < TableCell width = "50%" > { Language . lastSeenLabel } </ TableCell >
53
55
< TableCell width = "25%" >
54
56
< Stack direction = "row" spacing = { 1 } alignItems = "center" >
55
57
< span > { Language . rolesLabel } </ span >
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import Box from "@material-ui/core/Box"
2
2
import { makeStyles } from "@material-ui/core/styles"
3
3
import TableCell from "@material-ui/core/TableCell"
4
4
import TableRow from "@material-ui/core/TableRow"
5
+ import { LastUsed } from "components/LastUsed/LastUsed"
5
6
import { FC } from "react"
6
7
import * as TypesGen from "../../api/typesGenerated"
7
8
import { combineClasses } from "../../util/combineClasses"
@@ -101,6 +102,9 @@ export const UsersTableBody: FC<React.PropsWithChildren<UsersTableBodyProps>> =
101
102
>
102
103
{ user . status }
103
104
</ TableCell >
105
+ < TableCell >
106
+ < LastUsed lastUsedAt = { user . last_seen_at } />
107
+ </ TableCell >
104
108
< TableCell >
105
109
{ canEditUsers ? (
106
110
< RoleSelect
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ import { WorkspaceStatusBadge } from "components/WorkspaceStatusBadge/WorkspaceS
8
8
import { FC } from "react"
9
9
import { useNavigate } from "react-router-dom"
10
10
import { WorkspaceItemMachineRef } from "../../xServices/workspaces/workspacesXService"
11
+ import { LastUsed } from "../LastUsed/LastUsed"
11
12
import { TableCellData , TableCellDataPrimary } from "../TableCellData/TableCellData"
12
13
import { TableCellLink } from "../TableCellLink/TableCellLink"
13
14
import { OutdatedHelpTooltip } from "../Tooltips"
14
- import { WorkspaceLastUsed } from "./WorkspaceLastUsed"
15
15
16
16
const Language = {
17
17
upToDateLabel : "Up to date" ,
@@ -61,7 +61,7 @@ export const WorkspacesRow: FC<
61
61
</ TableCellLink >
62
62
< TableCellLink to = { workspacePageLink } >
63
63
< TableCellData >
64
- < WorkspaceLastUsed lastUsedAt = { workspace . last_used_at } />
64
+ < LastUsed lastUsedAt = { workspace . last_used_at } />
65
65
</ TableCellData >
66
66
</ TableCellLink >
67
67
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ export const MockUser: TypesGen.User = {
71
71
organization_ids : [ "fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0" ] ,
72
72
roles : [ MockOwnerRole ] ,
73
73
avatar_url : "https://github.com/coder.png" ,
74
+ last_seen_at : "" ,
74
75
}
75
76
76
77
export const MockUserAdmin : TypesGen . User = {
@@ -82,6 +83,7 @@ export const MockUserAdmin: TypesGen.User = {
82
83
organization_ids : [ "fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0" ] ,
83
84
roles : [ MockUserAdminRole ] ,
84
85
avatar_url : "" ,
86
+ last_seen_at : "" ,
85
87
}
86
88
87
89
export const MockUser2 : TypesGen . User = {
@@ -93,6 +95,7 @@ export const MockUser2: TypesGen.User = {
93
95
organization_ids : [ "fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0" ] ,
94
96
roles : [ ] ,
95
97
avatar_url : "" ,
98
+ last_seen_at : "2022-09-14T19:12:21Z" ,
96
99
}
97
100
98
101
export const SuspendedMockUser : TypesGen . User = {
@@ -104,6 +107,7 @@ export const SuspendedMockUser: TypesGen.User = {
104
107
organization_ids : [ "fc0774ce-cc9e-48d4-80ae-88f7a4d4a8b0" ] ,
105
108
roles : [ ] ,
106
109
avatar_url : "" ,
110
+ last_seen_at : "" ,
107
111
}
108
112
109
113
export const MockOrganization : TypesGen . Organization = {
You can’t perform that action at this time.
0 commit comments