From c04aec6fb654372318d9970542e104d20fb93139 Mon Sep 17 00:00:00 2001 From: jeanp413 Date: Thu, 5 Dec 2024 12:59:53 +0700 Subject: [PATCH 1/3] Add view with Gitpod Flex instructions --- package.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package.json b/package.json index 7c2aeea..45f6a04 100644 --- a/package.json +++ b/package.json @@ -379,6 +379,11 @@ "name": "Workspace", "icon": "$(squirrel)", "when": "false" + }, + { + "id": "gitpod-flex-help", + "name": "Help", + "icon": "$(squirrel)" } ] }, @@ -387,6 +392,10 @@ "view": "gitpod-login", "when": "gitpod.authenticated != true && !gitpod.inGitpodFlexRemoteWindow", "contents": "You have not yet signed in with Gitpod\n[Sign in](command:gitpod.signIn)" + }, + { + "view": "gitpod-flex-help", + "contents": "Connecting to Gitpod Flex environments requires installing the [Gitpod Flex extension](https://marketplace.visualstudio.com/items?itemName=gitpod.gitpod-flex) and opening them through the [Gitpod Flex](https://app.gitpod.io/). This view is only to manage [Gitpod Classic](https://gitpod.io/workspaces) workspaces." } ] }, From 4e827fff1a8c8f20d615a8a31a52ce9b8275cfd3 Mon Sep 17 00:00:00 2001 From: jeanp413 Date: Thu, 5 Dec 2024 16:11:54 +0700 Subject: [PATCH 2/3] Feedback --- package.json | 7 ++++--- src/services/hostService.ts | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 45f6a04..6800e8a 100644 --- a/package.json +++ b/package.json @@ -382,8 +382,9 @@ }, { "id": "gitpod-flex-help", - "name": "Help", - "icon": "$(squirrel)" + "name": "Looking for Gitpod Flex?", + "icon": "$(squirrel)", + "when": "gitpod.host === 'https://gitpod.io'" } ] }, @@ -395,7 +396,7 @@ }, { "view": "gitpod-flex-help", - "contents": "Connecting to Gitpod Flex environments requires installing the [Gitpod Flex extension](https://marketplace.visualstudio.com/items?itemName=gitpod.gitpod-flex) and opening them through the [Gitpod Flex](https://app.gitpod.io/). This view is only to manage [Gitpod Classic](https://gitpod.io/workspaces) workspaces." + "contents": "Connecting to Gitpod Flex environments requires installing the [Gitpod Flex extension](https://marketplace.visualstudio.com/items?itemName=gitpod.gitpod-flex) and opening them through the [Gitpod Flex](https://app.gitpod.io/).\nThis view is only to manage [Gitpod Classic](https://gitpod.io/workspaces) workspaces." } ] }, diff --git a/src/services/hostService.ts b/src/services/hostService.ts index 923c07e..9b72a9c 100644 --- a/src/services/hostService.ts +++ b/src/services/hostService.ts @@ -38,6 +38,7 @@ export class HostService extends Disposable implements IHostService { super(); this._gitpodHost = Configuration.getGitpodHost(); + this.updateGitpodHostContextKey(); this._register(vscode.workspace.onDidChangeConfiguration(e => { if (e.affectsConfiguration('gitpod.host')) { @@ -50,12 +51,22 @@ export class HostService extends Disposable implements IHostService { const newGitpodHost = Configuration.getGitpodHost(); if (new URL(this._gitpodHost).host !== new URL(newGitpodHost).host) { this._gitpodHost = newGitpodHost; + this.updateGitpodHostContextKey(); this._onDidChangeHost.fire(); } } })); } + private updateGitpodHostContextKey() { + try { + const origin = new URL(this.gitpodHost).origin; + vscode.commands.executeCommand('setContext', 'gitpod.host', origin); + } catch (e) { + vscode.commands.executeCommand('setContext', 'gitpod.host', undefined); + } + } + async changeHost(newHost: string, skipRemoteWindowCheck: boolean = false) { if (new URL(this._gitpodHost).host !== new URL(newHost).host) { const flow: UserFlowTelemetryProperties = { flow: 'changeHost', gitpodHost: newHost }; From 1a94fa739969724c7e38c992365403a6c0d78a94 Mon Sep 17 00:00:00 2001 From: jeanp413 Date: Thu, 5 Dec 2024 20:51:58 +0700 Subject: [PATCH 3/3] :up: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6800e8a..3065d84 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Gitpod", "description": "Required to connect to Classic workspaces", "publisher": "gitpod", - "version": "0.0.180", + "version": "0.0.181", "license": "MIT", "icon": "resources/gitpod.png", "repository": {