Skip to content

Implement hostname bar in workspace view #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 27 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->

# coder-gateway Changelog

## [Unreleased]

## [2.0.1]
# coder-gateway Changelog

## [Unreleased]
### Fixed

- left panel is no longer visible when a new connection is triggered from Coder's "Recent Workspaces" panel.
This provides consistency with other plugins compatible with Gateway

### Changed

- the authentication view is now merged with the "Coder Workspaces" view allowing users to quickly change the host

## [2.0.1]

### Fixed

- `Recent Coder Workspaces` label overlaps with the search bar in the `Connections` view
- working workspaces are now listed when there are issues with resolving agents
- list only workspaces owned by the logged user



### Changed

- links to documentation now point to the latest Coder OSS
- simplified main action link text from `Connect to Coder Workspaces` to `Connect to Coder`
- minimum supported Gateway build is now 222.3739.24

## [2.0.0]
### Added
- minimum supported Gateway build is now 222.3739.24
## [2.0.0]
### Added
- support for Gateway 2022.2



### Changed
### Changed
- Java 17 is now required to run the plugin
- adapted the code to the new SSH API provided by Gateway

## [1.0.0]
### Added
- adapted the code to the new SSH API provided by Gateway
## [1.0.0]
### Added
- initial scaffold for Gateway plugin
- browser based authentication on Coder environments
- REST client for Coder V2 public API
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/coder/gateway/CoderGatewayMainView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CoderGatewayMainView : GatewayConnector {
}

override fun getRecentConnections(setContentCallback: (Component) -> Unit): GatewayRecentConnections {
return CoderGatewayRecentWorkspaceConnectionsView()
return CoderGatewayRecentWorkspaceConnectionsView(setContentCallback)
}

override fun getTitle(): String {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.coder.gateway.views

import com.coder.gateway.models.CoderWorkspacesWizardModel
import com.coder.gateway.views.steps.CoderAuthStepView
import com.coder.gateway.views.steps.CoderLocateRemoteProjectStepView
import com.coder.gateway.views.steps.CoderWorkspacesStepView
import com.coder.gateway.views.steps.CoderWorkspacesWizardStep
Expand All @@ -11,10 +10,11 @@ import com.intellij.ui.dsl.builder.RightGap
import com.intellij.ui.dsl.builder.panel
import com.intellij.ui.dsl.gridLayout.HorizontalAlign
import com.intellij.util.ui.components.BorderLayoutPanel
import com.jetbrains.gateway.api.GatewayUI
import java.awt.Component
import javax.swing.JButton

class CoderGatewayConnectorWizardView(private val recentWorkspacesReset: () -> Unit) : BorderLayoutPanel(), Disposable {
class CoderGatewayConnectorWizardView : BorderLayoutPanel(), Disposable {
private var steps = arrayListOf<CoderWorkspacesWizardStep>()
private var currentStep = 0
private val model = CoderWorkspacesWizardModel()
Expand All @@ -29,7 +29,6 @@ class CoderGatewayConnectorWizardView(private val recentWorkspacesReset: () -> U
private fun setupWizard() {
background = WelcomeScreenUIManager.getMainAssociatedComponentBackground()

registerStep(CoderAuthStepView { next() })
registerStep(CoderWorkspacesStepView())
registerStep(CoderLocateRemoteProjectStepView {
nextButton.isVisible = false
Expand All @@ -53,7 +52,7 @@ class CoderGatewayConnectorWizardView(private val recentWorkspacesReset: () -> U

private fun previous() {
if (currentStep == 0) {
recentWorkspacesReset()
GatewayUI.getInstance().reset()
} else {
remove(steps[currentStep].component)
updateUI()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package com.coder.gateway.views
import com.intellij.ui.components.panels.Wrapper
import com.intellij.util.ui.JBUI
import com.jetbrains.gateway.api.GatewayConnectorView
import com.jetbrains.gateway.api.GatewayUI
import javax.swing.JComponent

class CoderGatewayConnectorWizardWrapperView(private val recentWorkspacesReset: () -> Unit = { GatewayUI.Companion.getInstance().reset() }) : GatewayConnectorView {
class CoderGatewayConnectorWizardWrapperView : GatewayConnectorView {
override val component: JComponent
get() = Wrapper(CoderGatewayConnectorWizardView(recentWorkspacesReset)).apply { border = JBUI.Borders.empty() }
get() = Wrapper(CoderGatewayConnectorWizardView()).apply { border = JBUI.Borders.empty() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
import com.intellij.openapi.project.DumbAwareAction
import com.intellij.openapi.ui.DialogPanel
import com.intellij.openapi.ui.panel.ComponentPanelBuilder
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenUIManager
import com.intellij.ui.DocumentAdapter
Expand All @@ -28,7 +27,6 @@ import com.intellij.ui.dsl.gridLayout.HorizontalAlign
import com.intellij.ui.dsl.gridLayout.VerticalAlign
import com.intellij.util.ui.JBFont
import com.intellij.util.ui.JBUI
import com.intellij.util.ui.components.BorderLayoutPanel
import com.jetbrains.gateway.api.GatewayRecentConnections
import com.jetbrains.gateway.api.GatewayUI
import com.jetbrains.gateway.ssh.IntelliJPlatformProduct
Expand All @@ -37,17 +35,16 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import java.awt.Component
import java.awt.Dimension
import javax.swing.JComponent
import javax.swing.JLabel
import javax.swing.event.DocumentEvent

class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Disposable {
class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback: (Component) -> Unit) : GatewayRecentConnections, Disposable {
private val recentConnectionsService = service<CoderRecentWorkspaceConnectionsService>()
private val cs = CoroutineScope(Dispatchers.Main)

private val rootPanel = BorderLayoutPanel()
private lateinit var contentPanel: DialogPanel
private val recentWorkspacesContentPanel = JBScrollPane()

private lateinit var searchBar: SearchTextField
Expand All @@ -57,7 +54,7 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Dis
override val recentsIcon = CoderIcons.LOGO_16

override fun createRecentsView(lifetime: Lifetime): JComponent {
contentPanel = panel {
return panel {
indent {
row {
label(CoderGatewayBundle.message("gateway.connector.recentconnections.title")).applyToComponent {
Expand All @@ -82,17 +79,7 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Dis
actionButton(
object : DumbAwareAction(CoderGatewayBundle.message("gateway.connector.recentconnections.new.wizard.button.tooltip"), null, AllIcons.General.Add) {
override fun actionPerformed(e: AnActionEvent) {
rootPanel.apply {
removeAll()
addToCenter(CoderGatewayConnectorWizardWrapperView {
rootPanel.apply {
removeAll()
addToCenter(contentPanel)
updateUI()
}
}.component)
updateUI()
}
setContentCallback(CoderGatewayConnectorWizardWrapperView().component)
}
},
).gap(RightGap.SMALL)
Expand All @@ -110,8 +97,6 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Dis
background = WelcomeScreenUIManager.getMainAssociatedComponentBackground()
border = JBUI.Borders.empty(12, 0, 0, 12)
}

return rootPanel.addToCenter(contentPanel)
}

override fun getRecentsTitle() = CoderGatewayBundle.message("gateway.connector.title")
Expand Down
167 changes: 0 additions & 167 deletions src/main/kotlin/com/coder/gateway/views/steps/CoderAuthStepView.kt

This file was deleted.

Loading