Skip to content

Commit c7ad882

Browse files
authored
Add view with Gitpod Flex instructions (#118)
* Add view with Gitpod Flex instructions * Feedback * 🆙 bump version
1 parent 2bd32f8 commit c7ad882

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Gitpod",
44
"description": "Required to connect to Classic workspaces",
55
"publisher": "gitpod",
6-
"version": "0.0.180",
6+
"version": "0.0.181",
77
"license": "MIT",
88
"icon": "resources/gitpod.png",
99
"repository": {
@@ -379,6 +379,12 @@
379379
"name": "Workspace",
380380
"icon": "$(squirrel)",
381381
"when": "false"
382+
},
383+
{
384+
"id": "gitpod-flex-help",
385+
"name": "Looking for Gitpod Flex?",
386+
"icon": "$(squirrel)",
387+
"when": "gitpod.host === 'https://gitpod.io'"
382388
}
383389
]
384390
},
@@ -387,6 +393,10 @@
387393
"view": "gitpod-login",
388394
"when": "gitpod.authenticated != true && !gitpod.inGitpodFlexRemoteWindow",
389395
"contents": "You have not yet signed in with Gitpod\n[Sign in](command:gitpod.signIn)"
396+
},
397+
{
398+
"view": "gitpod-flex-help",
399+
"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."
390400
}
391401
]
392402
},

src/services/hostService.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class HostService extends Disposable implements IHostService {
3838
super();
3939

4040
this._gitpodHost = Configuration.getGitpodHost();
41+
this.updateGitpodHostContextKey();
4142

4243
this._register(vscode.workspace.onDidChangeConfiguration(e => {
4344
if (e.affectsConfiguration('gitpod.host')) {
@@ -50,12 +51,22 @@ export class HostService extends Disposable implements IHostService {
5051
const newGitpodHost = Configuration.getGitpodHost();
5152
if (new URL(this._gitpodHost).host !== new URL(newGitpodHost).host) {
5253
this._gitpodHost = newGitpodHost;
54+
this.updateGitpodHostContextKey();
5355
this._onDidChangeHost.fire();
5456
}
5557
}
5658
}));
5759
}
5860

61+
private updateGitpodHostContextKey() {
62+
try {
63+
const origin = new URL(this.gitpodHost).origin;
64+
vscode.commands.executeCommand('setContext', 'gitpod.host', origin);
65+
} catch (e) {
66+
vscode.commands.executeCommand('setContext', 'gitpod.host', undefined);
67+
}
68+
}
69+
5970
async changeHost(newHost: string, skipRemoteWindowCheck: boolean = false) {
6071
if (new URL(this._gitpodHost).host !== new URL(newHost).host) {
6172
const flow: UserFlowTelemetryProperties = { flow: 'changeHost', gitpodHost: newHost };

0 commit comments

Comments
 (0)