File tree 3 files changed +40
-22
lines changed
3 files changed +40
-22
lines changed Original file line number Diff line number Diff line change @@ -398,26 +398,29 @@ export default function () {
398
398
</ a >
399
399
< ItemFieldContextMenu
400
400
className = "py-0.5"
401
- menuEntries = {
401
+ menuEntries = { [
402
+ {
403
+ title : "New Workspace ..." ,
404
+ href : gitpodHostUrl
405
+ . withContext ( `${ branch . url } ` , { showOptions : true } )
406
+ . toString ( ) ,
407
+ separator : true ,
408
+ } ,
402
409
prebuild ?. status === "queued" || prebuild ?. status === "building"
403
- ? [
404
- {
405
- title : "Cancel Prebuild" ,
406
- customFontStyle :
407
- "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300" ,
408
- onClick : ( ) =>
409
- prebuild && cancelPrebuild ( prebuild . info . id ) ,
410
- } ,
411
- ]
412
- : [
413
- {
414
- title : `${ prebuild ? "Rerun" : "Run" } Prebuild (${
415
- branch . name
416
- } )`,
417
- onClick : ( ) => triggerPrebuild ( branch ) ,
418
- } ,
419
- ]
420
- }
410
+ ? {
411
+ title : "Cancel Prebuild" ,
412
+ customFontStyle :
413
+ "text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300" ,
414
+ onClick : ( ) =>
415
+ prebuild && cancelPrebuild ( prebuild . info . id ) ,
416
+ }
417
+ : {
418
+ title : `${ prebuild ? "Rerun" : "Run" } Prebuild (${
419
+ branch . name
420
+ } )`,
421
+ onClick : ( ) => triggerPrebuild ( branch ) ,
422
+ } ,
423
+ ] }
421
424
/>
422
425
</ ItemField >
423
426
</ Item >
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { useCurrentTeam } from "../teams/teams-context";
13
13
import { RemoveProjectModal } from "./RemoveProjectModal" ;
14
14
import { toRemoteURL } from "./render-utils" ;
15
15
import { prebuildStatusIcon } from "./Prebuilds" ;
16
+ import { gitpodHostUrl } from "../service/service" ;
16
17
17
18
type ProjectListItemProps = {
18
19
project : Project ;
@@ -40,7 +41,14 @@ export const ProjectListItem: FunctionComponent<ProjectListItemProps> = ({ proje
40
41
menuEntries = { [
41
42
{
42
43
title : "New Workspace" ,
43
- href : `/#${ project . cloneUrl } ` ,
44
+ href : gitpodHostUrl . withContext ( `${ project . cloneUrl } ` ) . toString ( ) ,
45
+ separator : true ,
46
+ } ,
47
+ {
48
+ title : "New Workspace ..." ,
49
+ href : gitpodHostUrl
50
+ . withContext ( `${ project . cloneUrl } ` , { showOptions : true } )
51
+ . toString ( ) ,
44
52
separator : true ,
45
53
} ,
46
54
{
Original file line number Diff line number Diff line change @@ -77,8 +77,15 @@ export class GitpodHostUrl {
77
77
return updated . with ( ( url ) => ( { pathname : `/api${ url . pathname } ` } ) ) ;
78
78
}
79
79
80
- withContext ( contextUrl : string ) {
81
- return this . with ( ( url ) => ( { hash : contextUrl } ) ) ;
80
+ withContext (
81
+ contextUrl : string ,
82
+ startOptions ?: { showOptions ?: boolean ; editor ?: string ; workspaceClass ?: string } ,
83
+ ) {
84
+ const searchParams = new URLSearchParams ( ) ;
85
+ if ( startOptions ?. showOptions ) {
86
+ searchParams . append ( "showOptions" , "true" ) ;
87
+ }
88
+ return this . with ( ( url ) => ( { hash : contextUrl , search : searchParams . toString ( ) } ) ) ;
82
89
}
83
90
84
91
asWebsocket ( ) : GitpodHostUrl {
You can’t perform that action at this time.
0 commit comments