Skip to content

Commit 493fb0a

Browse files
authored
Fix create empty dev environment (#3599)
1 parent 82d8b79 commit 493fb0a

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix issue where nothing happens when trying to create an empty Dev Environment"
4+
}

jetbrains-gateway/src/software/aws/toolkits/jetbrains/gateway/CawsConnectorViewPanels.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ import javax.swing.JComponent
7979
import software.aws.toolkits.telemetry.Result as TelemetryResult
8080

8181
class CawsSettings(
82-
// ui initialization params
83-
var initialSpace: String? = null,
84-
8582
// core bindings
8683
var project: CawsProject? = null,
8784
var productType: GatewayProduct? = null,
@@ -334,7 +331,6 @@ class EnvironmentDetailsPanel(private val context: CawsSettings, lifetime: Lifet
334331
.columns(COLUMNS_MEDIUM)
335332
}
336333

337-
// TODO: might want to show linked repos as disabled to reduce confusion
338334
val linkedRepoCombo = AsyncComboBox<SourceRepository> { label, value, _ -> label.text = value?.name }
339335
val linkedBranchCombo = AsyncComboBox<BranchSummary> { label, value, _ -> label.text = value?.name }
340336
Disposer.register(disposable, linkedRepoCombo)
@@ -347,7 +343,7 @@ class EnvironmentDetailsPanel(private val context: CawsSettings, lifetime: Lifet
347343
{ i, v -> i.selectedItem = i.model.find { it.name == v } },
348344
context::linkedRepoName.toMutableProperty()
349345
)
350-
.errorOnApply(message("caws.workspace.details.repository_validation")) { it.selectedItem == null }
346+
.errorOnApply(message("caws.workspace.details.repository_validation")) { it.isVisible && it.selectedItem == null }
351347
.columns(COLUMNS_MEDIUM)
352348
projectCombo.addActionListener {
353349
linkedRepoCombo.proposeModelUpdate { model ->
@@ -406,7 +402,7 @@ class EnvironmentDetailsPanel(private val context: CawsSettings, lifetime: Lifet
406402
row(message("caws.workspace.details.branch_existing")) {
407403
cell(linkedBranchCombo)
408404
.bindItem(context::linkedRepoBranch.toMutableProperty())
409-
.errorOnApply(message("caws.workspace.details.branch_validation")) { it.selectedItem == null }
405+
.errorOnApply(message("caws.workspace.details.branch_validation")) { it.isVisible && it.selectedItem == null }
410406
.columns(COLUMNS_MEDIUM)
411407

412408
linkedRepoCombo.addActionListener {
@@ -437,7 +433,9 @@ class EnvironmentDetailsPanel(private val context: CawsSettings, lifetime: Lifet
437433
// need here to force comboboxes to load
438434
getProjects(client, spaces).apply {
439435
forEach { projectCombo.addItem(it) }
440-
projectCombo.selectedItem = firstOrNull { it.space == CawsSpaceTracker.getInstance().lastSpaceName() }
436+
projectCombo.selectedItem = existingProject
437+
?: firstOrNull { it.space == CawsSpaceTracker.getInstance().lastSpaceName() }
438+
?: firstOrNull()
441439
}
442440

443441
val propertyGraph = PropertyGraph()

jetbrains-gateway/src/software/aws/toolkits/jetbrains/gateway/CawsLoadingPanel.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import software.aws.toolkits.jetbrains.gateway.welcomescreen.PANEL_TOP_INSET
4040
import software.aws.toolkits.jetbrains.gateway.welcomescreen.recursivelySetBackground
4141
import software.aws.toolkits.jetbrains.services.caws.CawsLetterBadge
4242
import software.aws.toolkits.jetbrains.services.caws.CawsResources
43-
import software.aws.toolkits.jetbrains.settings.CawsSpaceTracker
4443
import software.aws.toolkits.jetbrains.ui.connection.SonoLoginOverlay
4544
import software.aws.toolkits.resources.message
4645
import java.awt.BorderLayout
@@ -144,9 +143,7 @@ abstract class CawsLoadingPanel(protected val lifetime: Lifetime, private val se
144143
callback(
145144
cawsWizard(
146145
lifetime,
147-
CawsSettings().also {
148-
it.initialSpace = CawsSpaceTracker.getInstance().lastSpaceName()
149-
}
146+
CawsSettings()
150147
)
151148
)
152149
}

jetbrains-gateway/src/software/aws/toolkits/jetbrains/gateway/welcomescreen/WorkspaceGroupsPanel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class WorkspaceGroupsPanel(
171171
lifetime,
172172
CawsSettings().also {
173173
it.project = project
174-
it.linkedRepoName = workspaceGroup.repoName ?: ""
174+
it.linkedRepoName = workspaceGroup.repoName
175175
}
176176
)
177177
)

0 commit comments

Comments
 (0)