@@ -33,7 +33,6 @@ import {
3333 QuestionCircleIcon ,
3434 CodeIcon ,
3535} from '@patternfly/react-icons' ;
36- import { useState } from 'react' ;
3736import { Workspace , WorkspacesColumnNames , WorkspaceState } from '~/shared/types' ;
3837import { WorkspaceDetails } from '~/app/pages/Workspaces/Details/WorkspaceDetails' ;
3938import { ExpandedWorkspaceRow } from '~/app/pages/Workspaces/ExpandedWorkspaceRow' ;
@@ -44,7 +43,7 @@ import {
4443} from '~/app/actions/WorkspaceKindsActions' ;
4544import useWorkspaces from '~/app/hooks/useWorkspaces' ;
4645import { useNamespaceContext } from '~/app/context/NamespaceContextProvider' ;
47- import { buildKindLogoDictionary } from '~/app/actions/WorkspaceKindsActions' ;
46+
4847import useWorkspaceKinds from '~/app/hooks/useWorkspaceKinds' ;
4948import { WorkspaceConnectAction } from '~/app/pages/Workspaces/WorkspaceConnectAction' ;
5049import { WorkspaceStartActionModal } from '~/app/pages/Workspaces/workspaceActions/WorkspaceStartActionModal' ;
@@ -187,18 +186,19 @@ export const Workspaces: React.FunctionComponent = () => {
187186 const [ activeSortDirection , setActiveSortDirection ] = React . useState < 'asc' | 'desc' | null > ( null ) ;
188187
189188 const getSortableRowValues = ( workspace : Workspace ) : ( string | number | undefined ) [ ] => {
190- const { name, kind, image, podConfig, state, homeVol, cpu, ram, lastActivity } = {
189+ const { redirectStatus, name, kind, image, podConfig, state, homeVol, cpu, ram, lastActivity } =
190+ {
191191 redirectStatus : '' ,
192- name : workspace . name ,
193- kind : workspace . workspace_kind . name ,
194- image : workspace . pod_template . options . image_config . current . display_name ,
195- podConfig : workspace . pod_template . pod_config . current ,
196- state : workspace . state ,
197- homeVol : workspace . pod_template . volumes . home . pvc_name ,
198- cpu : getCpuValue ( workspace ) ,
199- ram : getRamValue ( workspace ) ,
200- lastActivity : workspace . activity . last_activity ,
201- } ;
192+ name : workspace . name ,
193+ kind : workspace . workspace_kind . name ,
194+ image : workspace . pod_template . options . image_config . current . display_name ,
195+ podConfig : workspace . pod_template . pod_config . current ,
196+ state : workspace . state ,
197+ homeVol : workspace . pod_template . volumes . home . pvc_name ,
198+ cpu : getCpuValue ( workspace ) ,
199+ ram : getRamValue ( workspace ) ,
200+ lastActivity : workspace . activity . last_activity ,
201+ } ;
202202 return [ redirectStatus , name , kind , image , podConfig , state , homeVol , cpu , ram , lastActivity ] ;
203203 } ;
204204
@@ -469,12 +469,12 @@ export const Workspaces: React.FunctionComponent = () => {
469469 < Tr >
470470 < Th />
471471 { Object . values ( columnNames ) . map ( ( columnName , index ) => (
472- < Th
473- key = { `${ columnName } -col-name` }
474- sort = { columnName !== 'Redirect Status' ? getSortParams ( index ) : undefined }
475- >
476- { columnName }
477- </ Th >
472+ < Th
473+ key = { `${ columnName } -col-name` }
474+ sort = { columnName !== 'Redirect Status' ? getSortParams ( index ) : undefined }
475+ >
476+ { columnName }
477+ </ Th >
478478 ) ) }
479479 < Th screenReaderText = "Primary action" />
480480 </ Tr >
@@ -498,15 +498,15 @@ export const Workspaces: React.FunctionComponent = () => {
498498 setWorkspaceExpanded ( workspace , ! isWorkspaceExpanded ( workspace ) ) ,
499499 } }
500500 />
501- < Td dataLabel = { columnNames . redirectStatus } >
502- { workspaceRedirectStatus [ workspace . kind ]
503- ? getRedirectStatusIcon (
504- workspaceRedirectStatus [ workspace . kind ] ?. level ,
505- workspaceRedirectStatus [ workspace . kind ] ?. message ||
506- 'No API response available' ,
507- )
508- : getRedirectStatusIcon ( undefined , 'No API response available' ) }
509- </ Td >
501+ < Td dataLabel = { columnNames . redirectStatus } >
502+ { workspaceRedirectStatus [ workspace . workspace_kind . name ]
503+ ? getRedirectStatusIcon (
504+ workspaceRedirectStatus [ workspace . workspace_kind . name ] ?. level ,
505+ workspaceRedirectStatus [ workspace . workspace_kind . name ] ?. message ||
506+ 'No API response available' ,
507+ )
508+ : getRedirectStatusIcon ( undefined , 'No API response available' ) }
509+ </ Td >
510510 < Td data-testid = "workspace-name" dataLabel = { columnNames . name } >
511511 { workspace . name }
512512 </ Td >
0 commit comments