@@ -64,7 +64,6 @@ import {
64
64
import { useAppLink } from "modules/apps/useAppLink" ;
65
65
import { useDashboard } from "modules/dashboard/useDashboard" ;
66
66
import { abilitiesByWorkspaceStatus } from "modules/workspaces/actions" ;
67
- import { WorkspaceAppStatus } from "modules/workspaces/WorkspaceAppStatus/WorkspaceAppStatus" ;
68
67
import { WorkspaceBuildCancelDialog } from "modules/workspaces/WorkspaceBuildCancelDialog/WorkspaceBuildCancelDialog" ;
69
68
import { WorkspaceDormantBadge } from "modules/workspaces/WorkspaceDormantBadge/WorkspaceDormantBadge" ;
70
69
import { WorkspaceMoreActions } from "modules/workspaces/WorkspaceMoreActions/WorkspaceMoreActions" ;
@@ -79,7 +78,6 @@ import {
79
78
type FC ,
80
79
type PropsWithChildren ,
81
80
type ReactNode ,
82
- useMemo ,
83
81
useState ,
84
82
} from "react" ;
85
83
import { useMutation , useQuery , useQueryClient } from "react-query" ;
@@ -116,51 +114,12 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
116
114
onActionError,
117
115
} ) => {
118
116
const dashboard = useDashboard ( ) ;
119
- const workspaceIDToAppByStatus = useMemo ( ( ) => {
120
- return (
121
- workspaces ?. reduce (
122
- ( acc , workspace ) => {
123
- if ( ! workspace . latest_app_status ) {
124
- return acc ;
125
- }
126
- for ( const resource of workspace . latest_build . resources ) {
127
- for ( const agent of resource . agents ?? [ ] ) {
128
- for ( const app of agent . apps ?? [ ] ) {
129
- if ( app . id === workspace . latest_app_status . app_id ) {
130
- acc [ workspace . id ] = { app, agent } ;
131
- break ;
132
- }
133
- }
134
- }
135
- }
136
- return acc ;
137
- } ,
138
- { } as Record <
139
- string ,
140
- {
141
- app : WorkspaceApp ;
142
- agent : WorkspaceAgent ;
143
- }
144
- > ,
145
- ) || { }
146
- ) ;
147
- } , [ workspaces ] ) ;
148
- const hasActivity = useMemo (
149
- ( ) => Object . keys ( workspaceIDToAppByStatus ) . length > 0 ,
150
- [ workspaceIDToAppByStatus ] ,
151
- ) ;
152
- const tableColumnSize = {
153
- name : "w-2/6" ,
154
- template : hasActivity ? "w-1/6" : "w-2/6" ,
155
- status : hasActivity ? "w-1/6" : "w-2/6" ,
156
- activity : "w-2/6" ,
157
- } ;
158
117
159
118
return (
160
119
< Table >
161
120
< TableHeader >
162
121
< TableRow >
163
- < TableHead className = { tableColumnSize . name } >
122
+ < TableHead className = "w-1/3" >
164
123
< div className = "flex items-center gap-2" >
165
124
{ canCheckWorkspaces && (
166
125
< Checkbox
@@ -184,11 +143,8 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
184
143
Name
185
144
</ div >
186
145
</ TableHead >
187
- < TableHead className = { tableColumnSize . template } > Template</ TableHead >
188
- < TableHead className = { tableColumnSize . status } > Status</ TableHead >
189
- { hasActivity && (
190
- < TableHead className = { tableColumnSize . activity } > Activity</ TableHead >
191
- ) }
146
+ < TableHead className = "w-1/3" > Template</ TableHead >
147
+ < TableHead className = "w-1/3" > Status</ TableHead >
192
148
< TableHead className = "w-0" >
193
149
< span className = "sr-only" > Actions</ span >
194
150
</ TableHead >
@@ -302,15 +258,6 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
302
258
303
259
< WorkspaceStatusCell workspace = { workspace } />
304
260
305
- { hasActivity && (
306
- < TableCell >
307
- < WorkspaceAppStatus
308
- status = { workspace . latest_app_status }
309
- disabled = { workspace . latest_build . status !== "running" }
310
- />
311
- </ TableCell >
312
- ) }
313
-
314
261
< WorkspaceActionsCell
315
262
workspace = { workspace }
316
263
onActionSuccess = { onActionSuccess }
0 commit comments