@@ -13,7 +13,11 @@ import { getGitpodService } from '../service/service';
13
13
import Modal from '../components/Modal' ;
14
14
import { MouseEvent , useState } from 'react' ;
15
15
import { WorkspaceModel } from './workspace-model' ;
16
+ import Tooltip from '../components/Tooltip' ;
16
17
18
+ function getLabel ( state : WorkspaceInstancePhase ) {
19
+ return state . substr ( 0 , 1 ) . toLocaleUpperCase ( ) + state . substr ( 1 ) ;
20
+ }
17
21
18
22
export function WorkspaceEntry ( { desc, model } : { desc : WorkspaceInfo , model : WorkspaceModel } ) {
19
23
const [ isModalVisible , setModalVisible ] = useState ( false ) ;
@@ -100,20 +104,23 @@ export function WorkspaceEntry({ desc, model }: { desc: WorkspaceInfo, model: Wo
100
104
setChangesModalVisible ( true ) ;
101
105
}
102
106
return < div >
103
- < a className = "rounded-xl whitespace-nowrap flex space-x-2 py-6 px-6 w-full justify-between hover:bg-gray-100 focus:bg-gitpod-kumquat-light cursor-pointer group" href = { startUrl . toString ( ) } >
107
+ < div className = "rounded-xl whitespace-nowrap flex space-x-2 py-6 px-6 w-full justify-between hover:bg-gray-100 focus:bg-gitpod-kumquat-light group" >
104
108
< div className = "pr-3 self-center" >
105
- < div className = { stateClassName } >
106
-
107
- </ div >
109
+ < Tooltip content = { getLabel ( state ) } >
110
+ < div className = { stateClassName } >
111
+ </ div >
112
+ </ Tooltip >
108
113
</ div >
109
114
< div className = "flex flex-col w-3/12" >
110
- < div className = "font-medium text-gray-800 truncate" > { ws . id } </ div >
111
- < a href = { project ? 'https://' + project : undefined } > < div className = "text-sm overflow-ellipsis truncate text-gray-400" > { project || 'Unknown' } </ div > </ a >
115
+ < a href = { startUrl . toString ( ) } > < div className = "font-medium text-gray-800 truncate hover:text-blue-600 " > { ws . id } </ div > </ a >
116
+ < a href = { project ? 'https://' + project : undefined } > < div className = "text-sm overflow-ellipsis truncate text-gray-400 hover:text-blue-600 " > { project || 'Unknown' } </ div > </ a >
112
117
</ div >
113
118
< div className = "flex w-4/12 truncate overflow-ellipsis" >
114
119
< div className = "flex flex-col" >
115
120
< div className = "font-medium text-gray-500 overflow-ellipsis truncate" > { ws . description } </ div >
116
- < div className = "text-sm text-gray-400 overflow-ellipsis truncate" > { ws . contextURL } </ div >
121
+ < a href = { ws . contextURL } >
122
+ < div className = "text-sm text-gray-400 overflow-ellipsis truncate hover:text-blue-600" > { ws . contextURL } </ div >
123
+ </ a >
117
124
</ div >
118
125
</ div >
119
126
< div className = "flex w-2/12 truncate" onClick = { numberOfChanges > 0 ? showChanges : undefined } >
@@ -127,19 +134,21 @@ export function WorkspaceEntry({ desc, model }: { desc: WorkspaceInfo, model: Wo
127
134
}
128
135
</ div >
129
136
</ div >
130
- < div className = "flex w-2/12 self-center space-x-2 truncate" >
131
- < div className = "text-sm text-gray-400 truncate" > { moment ( WorkspaceInfo . lastActiveISODate ( desc ) ) . fromNow ( ) } </ div >
137
+ < div className = "flex w-2/12 self-center" >
138
+ < Tooltip content = { `Created ${ moment ( desc . workspace . creationTime ) . fromNow ( ) } ` } >
139
+ < div className = "text-sm w-full text-gray-400 truncate" > { moment ( WorkspaceInfo . lastActiveISODate ( desc ) ) . fromNow ( ) } </ div >
140
+ </ Tooltip >
132
141
</ div >
133
142
< div className = "flex w-8 self-center hover:bg-gray-200 rounded-md cursor-pointer" >
134
143
< ContextMenu menuEntries = { menuEntries } >
135
144
< img className = "w-8 h-8 p-1" src = { ThreeDots } alt = "Actions" />
136
145
</ ContextMenu >
137
146
</ div >
138
- </ a >
147
+ </ div >
139
148
< Modal visible = { isChangesModalVisible } onClose = { ( ) => setChangesModalVisible ( false ) } >
140
149
{ getChangesPopup ( pendingChanges ) }
141
150
</ Modal >
142
- < Modal visible = { isModalVisible } onClose = { ( ) => setModalVisible ( false ) } onEnter = { ( ) => { model . deleteWorkspace ( ws . id ) ; return true ; } } >
151
+ < Modal visible = { isModalVisible } onClose = { ( ) => setModalVisible ( false ) } onEnter = { ( ) => { model . deleteWorkspace ( ws . id ) ; return true ; } } >
143
152
< div >
144
153
< h3 className = "pb-2" > Delete Workspace</ h3 >
145
154
< div className = "border-t border-b border-gray-200 mt-2 -mx-6 px-6 py-2" >
0 commit comments