@@ -10,7 +10,7 @@ import { useContext, useEffect, useState } from "react";
10
10
import { useLocation , useRouteMatch } from "react-router" ;
11
11
import Header from "../components/Header" ;
12
12
import DropDown , { DropDownEntry } from "../components/DropDown" ;
13
- import { ItemsList , Item , ItemField , ItemFieldContextMenu } from "../components/ItemsList" ;
13
+ import { ItemsList , Item , ItemField } from "../components/ItemsList" ;
14
14
import Spinner from "../icons/Spinner.svg" ;
15
15
import StatusDone from "../icons/StatusDone.svg" ;
16
16
import StatusFailed from "../icons/StatusFailed.svg" ;
@@ -19,7 +19,6 @@ import StatusPaused from "../icons/StatusPaused.svg";
19
19
import StatusRunning from "../icons/StatusRunning.svg" ;
20
20
import { getGitpodService } from "../service/service" ;
21
21
import { TeamsContext , getCurrentTeam } from "../teams/teams-context" ;
22
- import { ContextMenuEntry } from "../components/ContextMenu" ;
23
22
import { shortCommitMessage } from "./render-utils" ;
24
23
import { Link } from "react-router-dom" ;
25
24
import { Disposable } from "vscode-jsonrpc" ;
@@ -104,27 +103,6 @@ export default function (props: { project?: Project; isAdminDashboard?: boolean
104
103
}
105
104
} , [ prebuilds ] ) ;
106
105
107
- const prebuildContextMenu = ( p : PrebuildWithStatus ) => {
108
- const isFailed = p . status === "aborted" || p . status === "timeout" || p . status === "failed" || ! ! p . error ;
109
- const isRunning = p . status === "building" ;
110
- const entries : ContextMenuEntry [ ] = [ ] ;
111
- if ( isFailed ) {
112
- entries . push ( {
113
- title : `Rerun Prebuild (${ p . info . branch } )` ,
114
- onClick : ( ) => triggerPrebuild ( p . info . branch ) ,
115
- separator : isRunning ,
116
- } ) ;
117
- }
118
- if ( isRunning ) {
119
- entries . push ( {
120
- title : "Cancel Prebuild" ,
121
- customFontStyle : "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300" ,
122
- onClick : ( ) => cancelPrebuild ( p . info . id ) ,
123
- } ) ;
124
- }
125
- return entries ;
126
- } ;
127
-
128
106
const statusFilterEntries = ( ) => {
129
107
const entries : DropDownEntry [ ] = [ ] ;
130
108
entries . push ( {
@@ -168,13 +146,6 @@ export default function (props: { project?: Project; isAdminDashboard?: boolean
168
146
getGitpodService ( ) . server . triggerPrebuild ( project . id , branchName ) ;
169
147
} ;
170
148
171
- const cancelPrebuild = ( prebuildId : string ) => {
172
- if ( ! project ) {
173
- return ;
174
- }
175
- getGitpodService ( ) . server . cancelPrebuild ( project . id , prebuildId ) ;
176
- } ;
177
-
178
149
const formatDate = ( date : string | undefined ) => {
179
150
return date ? moment ( date ) . fromNow ( ) : "" ;
180
151
} ;
@@ -218,14 +189,14 @@ export default function (props: { project?: Project; isAdminDashboard?: boolean
218
189
) }
219
190
</ div >
220
191
< ItemsList className = "mt-2" >
221
- < Item header = { true } className = "grid grid-cols-3" >
222
- < ItemField className = "my-auto" >
192
+ < Item header = { true } >
193
+ < ItemField className = "my-auto w-5/12 " >
223
194
< span > Prebuild</ span >
224
195
</ ItemField >
225
- < ItemField className = "my-auto" >
196
+ < ItemField className = "my-auto w-5/12 " >
226
197
< span > Commit</ span >
227
198
</ ItemField >
228
- < ItemField className = "my-auto" >
199
+ < ItemField className = "my-auto w-3/12 " >
229
200
< span > Branch</ span >
230
201
</ ItemField >
231
202
</ Item >
@@ -239,74 +210,73 @@ export default function (props: { project?: Project; isAdminDashboard?: boolean
239
210
. filter ( filter )
240
211
. sort ( prebuildSorter )
241
212
. map ( ( p , index ) => (
242
- < Item key = { `prebuild- ${ p . info . id } ` } className = "grid grid-cols-3" >
243
- < ItemField
244
- className = { `flex items-center my-auto ${
245
- props . isAdminDashboard ? "pointer-events-none" : ""
246
- } `}
247
- >
248
- < Link
249
- to = { `/ ${ ! ! team ? "t/" + team . slug : "projects" } / ${ projectSlug } / ${ p . info . id } ` }
250
- className = "cursor-pointer"
213
+ < Link
214
+ to = { `/ ${ ! ! team ? "t/" + team . slug : "projects" } / ${ projectSlug } / ${ p . info . id } ` }
215
+ className = "cursor-pointer"
216
+ >
217
+ < Item key = { `prebuild- ${ p . info . id } `} >
218
+ < ItemField
219
+ className = { `flex items-center my-auto w-5/12 ${
220
+ props . isAdminDashboard ? "pointer-events-none" : ""
221
+ } ` }
251
222
>
252
- < div className = "text-base text-gray-900 dark:text-gray-50 font-medium uppercase mb-1" >
253
- < div className = "inline-block align-text-bottom mr-2 w-4 h-4" >
254
- { prebuildStatusIcon ( p ) }
223
+ < div >
224
+ < div className = "text-base text-gray-900 dark:text-gray-50 font-medium uppercase mb-1" >
225
+ < div className = "inline-block align-text-bottom mr-2 w-4 h-4" >
226
+ { prebuildStatusIcon ( p ) }
227
+ </ div >
228
+ { prebuildStatusLabel ( p ) }
255
229
</ div >
256
- { prebuildStatusLabel ( p ) }
230
+ < p >
231
+ { p . info . startedByAvatar && (
232
+ < img
233
+ className = "rounded-full w-4 h-4 inline-block align-text-bottom mr-2"
234
+ src = { p . info . startedByAvatar || "" }
235
+ alt = { p . info . startedBy }
236
+ />
237
+ ) }
238
+ Triggered { formatDate ( p . info . startedAt ) }
239
+ </ p >
240
+ </ div >
241
+ </ ItemField >
242
+ < ItemField className = "flex items-center my-auto w-5/12" >
243
+ < div className = "truncate" >
244
+ < a href = { p . info . changeUrl } className = "cursor-pointer" >
245
+ < div
246
+ className = "text-base text-gray-500 dark:text-gray-50 font-medium mb-1 truncate"
247
+ title = { shortCommitMessage ( p . info . changeTitle ) }
248
+ >
249
+ { shortCommitMessage ( p . info . changeTitle ) }
250
+ </ div >
251
+ </ a >
252
+ < p >
253
+ { p . info . changeAuthorAvatar && (
254
+ < img
255
+ className = "rounded-full w-4 h-4 inline-block align-text-bottom mr-2 overflow-hidden"
256
+ src = { p . info . changeAuthorAvatar || "" }
257
+ alt = { p . info . changeAuthor }
258
+ />
259
+ ) }
260
+ Authored { formatDate ( p . info . changeDate ) } ·{ " " }
261
+ { p . info . changeHash ?. substring ( 0 , 8 ) }
262
+ </ p >
257
263
</ div >
258
- < p >
259
- { p . info . startedByAvatar && (
260
- < img
261
- className = "rounded-full w-4 h-4 inline-block align-text-bottom mr-2"
262
- src = { p . info . startedByAvatar || "" }
263
- alt = { p . info . startedBy }
264
- />
265
- ) }
266
- Triggered { formatDate ( p . info . startedAt ) }
267
- </ p >
268
- </ Link >
269
- </ ItemField >
270
- < ItemField className = "flex items-center my-auto" >
271
- < div className = "truncate" >
264
+ </ ItemField >
265
+ < ItemField className = "flex w-3/12" >
272
266
< a href = { p . info . changeUrl } className = "cursor-pointer" >
273
- < div
274
- className = "text-base text-gray-500 dark:text-gray-50 font-medium mb-1 truncate"
275
- title = { shortCommitMessage ( p . info . changeTitle ) }
276
- >
277
- { shortCommitMessage ( p . info . changeTitle ) }
267
+ < div className = "flex space-x-2 truncate" >
268
+ < span
269
+ className = "font-medium text-gray-500 dark:text-gray-50 truncate"
270
+ title = { p . info . branch }
271
+ >
272
+ { p . info . branch }
273
+ </ span >
278
274
</ div >
279
275
</ a >
280
- < p >
281
- { p . info . changeAuthorAvatar && (
282
- < img
283
- className = "rounded-full w-4 h-4 inline-block align-text-bottom mr-2 overflow-hidden"
284
- src = { p . info . changeAuthorAvatar || "" }
285
- alt = { p . info . changeAuthor }
286
- />
287
- ) }
288
- Authored { formatDate ( p . info . changeDate ) } ·{ " " }
289
- { p . info . changeHash ?. substring ( 0 , 8 ) }
290
- </ p >
291
- </ div >
292
- </ ItemField >
293
- < ItemField className = "flex" >
294
- < a href = { p . info . changeUrl } className = "cursor-pointer" >
295
- < div className = "flex space-x-2 truncate" >
296
- < span
297
- className = "font-medium text-gray-500 dark:text-gray-50 truncate"
298
- title = { p . info . branch }
299
- >
300
- { p . info . branch }
301
- </ span >
302
- </ div >
303
- </ a >
304
- < span className = "flex-grow" />
305
- { ! props . isAdminDashboard && (
306
- < ItemFieldContextMenu menuEntries = { prebuildContextMenu ( p ) } />
307
- ) }
308
- </ ItemField >
309
- </ Item >
276
+ < span className = "flex-grow" />
277
+ </ ItemField >
278
+ </ Item >
279
+ </ Link >
310
280
) ) }
311
281
</ ItemsList >
312
282
{ ! isLoadingPrebuilds && prebuilds . length === 0 && (
0 commit comments