File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
components/ide/jetbrains/gateway-plugin/src/main/kotlin/io/gitpod/jetbrains/gateway Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import com.intellij.ui.dsl.builder.TopGap
1515import com.intellij.ui.dsl.builder.panel
1616import com.intellij.ui.dsl.gridLayout.HorizontalAlign
1717import com.intellij.ui.layout.ComponentPredicate
18+ import com.intellij.ui.layout.enteredTextSatisfies
1819import com.intellij.util.EventDispatcher
1920import com.jetbrains.rd.util.concurrentMapOf
2021import com.jetbrains.rd.util.lifetime.Lifetime
@@ -72,20 +73,14 @@ class GitpodStartWorkspaceView(
7273 this .text = " https://github.com/gitpod-io/spring-petclinic"
7374 }
7475 button(" New Workspace" ) {
75- // TODO(ak) disable button if blank
7676 if (contextUrl.component.text.isNotBlank()) {
77- val backend = backendsModel.selectedItem
78- val selectedBackendId = if (backend != null ) {
79- backendToId[backend]
80- } else null
81- val backendParam = if (selectedBackendId != null ) {
82- " :$selectedBackendId "
83- } else {
84- " "
77+ backendsModel.selectedItem?.let {
78+ backendToId[it]?.let { backend ->
79+ BrowserUtil .browse(" https://${settings.gitpodHost} #referrer:jetbrains-gateway:${backend} /${contextUrl.component.text} " )
80+ }
8581 }
86- BrowserUtil .browse(" https://${settings.gitpodHost} #referrer:jetbrains-gateway$backendParam /${contextUrl.component.text} " )
8782 }
88- }
83+ }.enabledIf(contextUrl.component.enteredTextSatisfies { it.isNotBlank() })
8984 cell()
9085 }.topGap(TopGap .NONE )
9186 .rowComment(
You can’t perform that action at this time.
0 commit comments