Skip to content

Commit dcabf3e

Browse files
committed
[ide] desktop client installation steps
1 parent d81517d commit dcabf3e

34 files changed

+519
-272
lines changed

chart/templates/server-ide-configmap.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,32 @@ defaultIde: "code"
106106
defaultDesktopIde: "code-desktop"
107107

108108
clients:
109+
vscode:
110+
defaultDesktopIDE: "code-desktop"
111+
desktopIDEs: ["code-desktop"]
112+
installationSteps: [
113+
"Click <b>Allow</b> in the dialog by your browser.",
114+
"If you don't see the dialog, make sure you have <a class='gp-link' href='https://code.visualstudio.com/download'>VS Code</a> installed on your machine.",
115+
"After that, click the <b>${OPEN_LINK_LABEL}</b> button below."
116+
]
117+
vscode-insiders:
118+
defaultDesktopIDE: "code-desktop-insiders"
119+
desktopIDEs: ["code-desktop-insiders"]
120+
installationSteps: [
121+
"Click <b>Allow</b> in the dialog by your browser.",
122+
"If you don't see the dialog, make sure you have <a class='gp-link' href='https://code.visualstudio.com/insiders'>VS Code Insiders</a> installed on your machine.",
123+
"After that, click the <b>${OPEN_LINK_LABEL}</b> button below."
124+
]
109125
jetbrains-gateway:
110126
defaultDesktopIDE: "intellij"
111127
desktopIDEs: ["intellij", "goland", "pycharm", "phpstorm"]
128+
installationSteps: [
129+
"Click <b>Allow</b> in the dialog by your browser.",
130+
"If you don't see the dialog, make sure you have JetBrains Gateway with Gitpod plugin installed on your machine:",
131+
" - To install JetBrains Gateway, use <a class='gp-link' href='https://www.jetbrains.com/toolbox-app/'>JetBrains Toolbox App</a>.",
132+
" - <a class='gp-link' href='https://plugins.jetbrains.com/plugin/download?rel=true&updateId=154074'>Download the plugin</a> and <a class='gp-link' href='https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_disk'>install it from the disk</a>.",
133+
"After that, click the <b>${OPEN_LINK_LABEL}</b> button below."
134+
]
112135
{{ end }}
113136

114137
{{- if $comp.serverIdeConfigDeploy.enabled }}

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { ContextURL, DisposableCollection, WithPrebuild, Workspace, WorkspaceImageBuild, WorkspaceInstance } from "@gitpod/gitpod-protocol";
8+
import { IDEOptions } from "@gitpod/gitpod-protocol/lib/ide-protocol";
89
import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
910
import EventEmitter from "events";
1011
import React, { Suspense, useEffect } from "react";
@@ -32,7 +33,9 @@ export interface StartWorkspaceState {
3233
desktopIde?: {
3334
link: string
3435
label: string
36+
clientID?: string
3537
}
38+
ideOptions?: IDEOptions
3639
}
3740

3841
export default class StartWorkspace extends React.Component<StartWorkspaceProps, StartWorkspaceState> {
@@ -54,7 +57,8 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
5457
}
5558
if (event.data.state.desktopIdeLink) {
5659
const label = event.data.state.desktopIdeLabel || "Open Desktop IDE";
57-
this.setState({ desktopIde: { link: event.data.state.desktopIdeLink, label } });
60+
const clientID = event.data.state.desktopIdeClientID;
61+
this.setState({ desktopIde: { link: event.data.state.desktopIdeLink, label, clientID } });
5862
}
5963
}
6064
}
@@ -72,6 +76,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
7276
}
7377

7478
this.startWorkspace();
79+
getGitpodService().server.getIDEOptions().then(ideOptions => this.setState({ ideOptions }))
7580
}
7681

7782
componentWillUnmount() {
@@ -284,6 +289,12 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
284289
statusMessage = <p className="text-base text-gray-400">Opening IDE …</p>;
285290
} else {
286291
phase = StartPhase.IdeReady;
292+
const openLinkLabel = this.state.desktopIde.label;
293+
const clientID = this.state.desktopIde.clientID
294+
const client = clientID ? this.state.ideOptions?.clients?.[clientID] : undefined;
295+
const installationSteps = client?.installationSteps?.length && <div className="flex flex-col text-left m-auto text-base w-fit text-gray-400">
296+
{client.installationSteps.map(step => <div dangerouslySetInnerHTML={{__html: step.replaceAll('${OPEN_LINK_LABEL}', openLinkLabel)}} />)}
297+
</div>
287298
statusMessage = <div>
288299
<div className="flex space-x-3 items-center text-left rounded-xl m-auto px-4 h-16 w-72 mt-4 mb-2 bg-gray-100 dark:bg-gray-800">
289300
<div className="rounded-full w-3 h-3 text-sm bg-green-500">&nbsp;</div>
@@ -292,6 +303,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
292303
<a target="_parent" href={this.state.workspace?.contextURL}><p className="w-56 truncate hover:text-blue-600 dark:hover:text-blue-400" >{this.state.workspace?.contextURL}</p></a>
293304
</div>
294305
</div>
306+
{installationSteps}
295307
<div className="mt-10 justify-center flex space-x-2">
296308
<ContextMenu menuEntries={[
297309
{

components/gitpod-protocol/src/ide-protocol.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export interface IDEClient {
4646
* Desktop IDEs supported by the client.
4747
*/
4848
desktopIDEs?: string[]
49+
50+
/**
51+
* Steps to install the client on user machine.
52+
*/
53+
installationSteps?: string[]
4954
}
5055

5156
export interface IDEOption {

components/ide/code-desktop/status/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func main() {
7272
response := make(map[string]string)
7373
response["link"] = link.String()
7474
response["label"] = label
75+
response["clientID"] = schema
7576
w.Header().Set("Content-Type", "application/json")
7677
json.NewEncoder(w).Encode(response)
7778
})

components/supervisor-api/go/info.pb.gw.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/supervisor-api/go/info_grpc.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/supervisor-api/go/notification.pb.gw.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/supervisor-api/go/notification_grpc.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/supervisor-api/go/port.pb.gw.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/supervisor-api/go/port_grpc.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)