Skip to content

Commit 0936a9b

Browse files
committed
Impl: remove recent workspace connection
1 parent 7b31363 commit 0936a9b

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

src/main/kotlin/com/coder/gateway/icons/CoderIcons.kt

+2
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ object CoderIcons {
1616
val GREEN_CIRCLE = IconLoader.getIcon("green_circle.svg", javaClass)
1717
val GRAY_CIRCLE = IconLoader.getIcon("gray_circle.svg", javaClass)
1818
val RED_CIRCLE = IconLoader.getIcon("red_circle.svg", javaClass)
19+
20+
val DELETE = IconLoader.getIcon("delete.svg", javaClass)
1921
}

src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package com.coder.gateway.views
33
import com.coder.gateway.CoderGatewayBundle
44
import com.coder.gateway.icons.CoderIcons
55
import com.coder.gateway.services.CoderRecentWorkspaceConnectionsService
6+
import com.intellij.openapi.actionSystem.AnActionEvent
67
import com.intellij.openapi.components.service
8+
import com.intellij.openapi.project.DumbAwareAction
79
import com.intellij.openapi.ui.panel.ComponentPanelBuilder
810
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenUIManager
911
import com.intellij.ui.components.ActionLink
@@ -82,10 +84,16 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections {
8284
}
8385
})
8486
label("").resizableColumn().horizontalAlign(HorizontalAlign.FILL)
85-
label("Last opened: ${connectionDetails.lastOpened}").horizontalAlign(HorizontalAlign.RIGHT).applyToComponent {
87+
label("Last opened: ${connectionDetails.lastOpened}").applyToComponent {
8688
foreground = JBUI.CurrentTheme.ContextHelp.FOREGROUND
8789
font = ComponentPanelBuilder.getCommentFont(font)
8890
}
91+
actionButton(object : DumbAwareAction("", "", CoderIcons.DELETE) {
92+
override fun actionPerformed(e: AnActionEvent) {
93+
recentConnectionsService.removeConnection(connectionDetails)
94+
updateContentView()
95+
}
96+
})
8997
}
9098
}
9199
}

src/main/resources/delete.svg

+7
Loading

src/main/resources/delete_dark.svg

+7
Loading

0 commit comments

Comments
 (0)