@@ -79,9 +79,6 @@ import javax.swing.JComponent
79
79
import software.aws.toolkits.telemetry.Result as TelemetryResult
80
80
81
81
class CawsSettings (
82
- // ui initialization params
83
- var initialSpace : String? = null ,
84
-
85
82
// core bindings
86
83
var project : CawsProject ? = null ,
87
84
var productType : GatewayProduct ? = null ,
@@ -334,7 +331,6 @@ class EnvironmentDetailsPanel(private val context: CawsSettings, lifetime: Lifet
334
331
.columns(COLUMNS_MEDIUM )
335
332
}
336
333
337
- // TODO: might want to show linked repos as disabled to reduce confusion
338
334
val linkedRepoCombo = AsyncComboBox <SourceRepository > { label, value, _ -> label.text = value?.name }
339
335
val linkedBranchCombo = AsyncComboBox <BranchSummary > { label, value, _ -> label.text = value?.name }
340
336
Disposer .register(disposable, linkedRepoCombo)
@@ -347,7 +343,7 @@ class EnvironmentDetailsPanel(private val context: CawsSettings, lifetime: Lifet
347
343
{ i, v -> i.selectedItem = i.model.find { it.name == v } },
348
344
context::linkedRepoName.toMutableProperty()
349
345
)
350
- .errorOnApply(message(" caws.workspace.details.repository_validation" )) { it.selectedItem == null }
346
+ .errorOnApply(message(" caws.workspace.details.repository_validation" )) { it.isVisible && it. selectedItem == null }
351
347
.columns(COLUMNS_MEDIUM )
352
348
projectCombo.addActionListener {
353
349
linkedRepoCombo.proposeModelUpdate { model ->
@@ -406,7 +402,7 @@ class EnvironmentDetailsPanel(private val context: CawsSettings, lifetime: Lifet
406
402
row(message(" caws.workspace.details.branch_existing" )) {
407
403
cell(linkedBranchCombo)
408
404
.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 }
410
406
.columns(COLUMNS_MEDIUM )
411
407
412
408
linkedRepoCombo.addActionListener {
@@ -437,7 +433,9 @@ class EnvironmentDetailsPanel(private val context: CawsSettings, lifetime: Lifet
437
433
// need here to force comboboxes to load
438
434
getProjects(client, spaces).apply {
439
435
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()
441
439
}
442
440
443
441
val propertyGraph = PropertyGraph ()
0 commit comments