File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
main/kotlin/com/coder/gateway/views/steps
test/kotlin/com/coder/gateway/sdk Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -993,13 +993,19 @@ class WorkspacesTable : TableView<WorkspaceAgentListModel>(WorkspacesTableModel(
993
993
if (oldSelection == null ) {
994
994
return - 1
995
995
}
996
- val index = listTableModel.items.indexOfFirst { it.name == oldSelection.name }
996
+ val index = listTableModel.items.indexOfFirst {
997
+ it.workspace.ownerName == oldSelection.workspace.ownerName &&
998
+ it.name == oldSelection.name
999
+ }
997
1000
if (index > - 1 ) {
998
1001
return index
999
1002
}
1000
1003
// If there is no matching agent, try matching on just the workspace.
1001
1004
// It is possible it turned off so it no longer has agents displaying;
1002
1005
// in this case we want to keep it highlighted.
1003
- return listTableModel.items.indexOfFirst { it.workspace.name == oldSelection.workspace.name }
1006
+ return listTableModel.items.indexOfFirst {
1007
+ it.workspace.ownerName == oldSelection.workspace.ownerName &&
1008
+ it.workspace.name == oldSelection.workspace.name
1009
+ }
1004
1010
}
1005
1011
}
Original file line number Diff line number Diff line change @@ -20,9 +20,14 @@ class DataGen {
20
20
// Create a list of random agents for a random workspace.
21
21
fun agentList (
22
22
workspaceName : String ,
23
+ ownerName : String = "tester",
23
24
vararg agentName : String ,
24
25
): List <WorkspaceAgentListModel > {
25
- val workspace = workspace(workspaceName, agents = agentName.associateWith { UUID .randomUUID().toString() })
26
+ val workspace = workspace(
27
+ workspaceName,
28
+ ownerName = ownerName,
29
+ agents = agentName.associateWith { UUID .randomUUID().toString() },
30
+ )
26
31
return workspace.toAgentList()
27
32
}
28
33
You can’t perform that action at this time.
0 commit comments