Skip to content

Commit

Permalink
Adjust the Workspace Start URL in JetBrains Gateway workspaces list
Browse files Browse the repository at this point in the history
This is now aligned with the URL used in WebApp workspaces list.

Also, instructions about how to test the Gateway Plugin from a PR were are added to the Readme.
  • Loading branch information
felladrin committed Jul 21, 2022
1 parent 9a409ec commit a41eb99
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
16 changes: 16 additions & 0 deletions components/ide/jetbrains/gateway-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,19 @@ This project is not yet Gitpodified as testing it requires running the local Gat

---
Plugin based on the [IntelliJ Platform Plugin Template][template].


## How to test from a Pull Request

- Ensure you have the latest JetBrains Gateway installed: https://www.jetbrains.com/remote-development/gateway/
- Download this Gateway Plugin build, from Gitpod's Plugin Dev Channel: https://plugins.jetbrains.com/plugin/18438-gitpod-gateway/versions/dev
- Install it on the Gateway following these instructions: https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_disk
- Do the checks requested by the pull request creator or do a full manual test as instructed below.

## Checklist for a Full Manual Test

- Check if you can create a new workspace
- Check if you can connect to a running workspace
- Check if you can connect to a stopped workspace
- Check if changing the "Gitpod Host" in Preferences >> Tools >> Gitpod takes effect
- Check if the info displayed in the workspaces list is matching what you see on the Web App Dashboard
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import kotlinx.coroutines.channels.actor
import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.future.await
import kotlinx.coroutines.launch
import org.apache.http.client.utils.URIBuilder
import java.time.OffsetDateTime
import java.time.ZonedDateTime
import java.time.temporal.ChronoUnit
Expand Down Expand Up @@ -276,7 +277,7 @@ class GitpodWorkspacesView(
browserLink(info.workspace.id, info.latestInstance.ideUrl)
}
info.workspace.context.normalizedContextURL.ifPresent {
contextUrlRow.rowComment("<a href='${it}'>${it}</a>")
contextUrlRow.rowComment("<a href='$it'>$it</a>")
}
}
label("").resizableColumn().horizontalAlign(HorizontalAlign.FILL)
Expand All @@ -286,7 +287,7 @@ class GitpodWorkspacesView(
it.totalUncommitedFiles + it.totalUntrackedFiles + it.totalUnpushedCommits
} ?: 0
row {
info.workspace.context.ref.ifPresentOrElse({ label(it) },{ label("(detached)") })
info.workspace.context.ref.ifPresentOrElse({ label(it) }, { label("(detached)") })
}.rowComment(
when {
changes == 1 -> "<b>$changes Change</b>"
Expand All @@ -298,7 +299,14 @@ class GitpodWorkspacesView(
label(getRelativeTimeSpan(info.latestInstance.creationTime))
button("Connect") {
if (!canConnect) {
BrowserUtil.browse(info.latestInstance.ideUrl)
val startUrl = URIBuilder()
.setScheme("https")
.setHost(gitpodHost)
.setPath("start")
.setFragment(info.workspace.id)
.build()
.toString()
BrowserUtil.browse(startUrl)
} else {
GatewayUI.getInstance().connect(
mapOf(
Expand Down

0 comments on commit a41eb99

Please sign in to comment.