Skip to content

Stabilize flows #50

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 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Fix overlaping components in the Connections view
- `Recent Coder Workspaces` overlaps with the search bar.
- reworked the first row to workaround the DSL limitations.
- resolves #44
  • Loading branch information
fioan89 committed Aug 2, 2022
commit cfeace1a4bfcd1e6463adfe262cd7e1564fcd811
24 changes: 13 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->

# coder-gateway Changelog

## [Unreleased]

## [2.0.0]
# coder-gateway Changelog

## [Unreleased]
### Fixed
- `Recent Coder Workspaces` label overlaps with the search bar in the `Connections` view

## [2.0.0]
### Added
- support for Gateway 2022.2


### 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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import java.awt.Dimension
import javax.swing.JComponent
import javax.swing.JLabel
import javax.swing.event.DocumentEvent

class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Disposable {
Expand All @@ -62,36 +63,42 @@ class CoderGatewayRecentWorkspaceConnectionsView : GatewayRecentConnections, Dis
label(CoderGatewayBundle.message("gateway.connector.recentconnections.title")).applyToComponent {
font = JBFont.h3().asBold()
}
label("").resizableColumn().horizontalAlign(HorizontalAlign.FILL)
searchBar = cell(SearchTextField(false)).applyToComponent {
minimumSize = Dimension(350, -1)
textEditor.border = JBUI.Borders.empty(2, 5, 2, 0)
addDocumentListener(object : DocumentAdapter() {
override fun textChanged(e: DocumentEvent) {
val toSearchFor = this@applyToComponent.text
val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ?: false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ?: false }
updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
}
})
}.component
panel {
indent {
row {
cell(JLabel()).resizableColumn().horizontalAlign(HorizontalAlign.FILL)
searchBar = cell(SearchTextField(false)).resizableColumn().horizontalAlign(HorizontalAlign.FILL).applyToComponent {
minimumSize = Dimension(350, -1)
textEditor.border = JBUI.Borders.empty(2, 5, 2, 0)
addDocumentListener(object : DocumentAdapter() {
override fun textChanged(e: DocumentEvent) {
val toSearchFor = this@applyToComponent.text
val filteredConnections = recentConnectionsService.getAllRecentConnections().filter { it.coderWorkspaceHostname?.toLowerCase()?.contains(toSearchFor) ?: false || it.projectPath?.toLowerCase()?.contains(toSearchFor) ?: false }
updateContentView(filteredConnections.groupBy { it.coderWorkspaceHostname })
}
})
}.component

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()
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()
}
}
}.component)
updateUI()
}
},
).gap(RightGap.SMALL)
}
},
).gap(RightGap.SMALL)
}
}
}.bottomGap(BottomGap.MEDIUM)
separator(background = WelcomeScreenUIManager.getSeparatorColor())
row {
Expand Down