Skip to content

Commit

Permalink
Add action to copy share workspace link
Browse files Browse the repository at this point in the history
Add copy url action to share ws notification

Consume new getWorkspaceUrl api

Update supervisor-api-grpc
  • Loading branch information
jeanp413 committed Sep 17, 2021
1 parent 2f7510f commit 3c6a47a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion extensions/gitpod-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@gitpod/gitpod-protocol": "main",
"@gitpod/supervisor-api-grpc": "main",
"@gitpod/supervisor-api-grpc": "jeanp413-your-workspace-is-currently-5313",
"bufferutil": "^4.0.1",
"reconnecting-websocket": "^4.4.0",
"utf-8-validate": "^5.0.2",
Expand Down
7 changes: 6 additions & 1 deletion extensions/gitpod-shared/src/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,12 @@ export async function registerWorkspaceSharing(context: GitpodExtensionContext):
});
setWorkspaceShared(level === 'everyone');
if (level === 'everyone') {
await vscode.window.showInformationMessage(`Your workspace is currently shared. Anyone with the link can access this workspace.`);
const uri = context.info.getWorkspaceUrl();
const copyToClipboard = 'Copy URL to Clipboard';
const res = await vscode.window.showInformationMessage(`Your workspace is currently shared. Anyone with [the link](${uri}) can access this workspace.`, copyToClipboard);
if (res === copyToClipboard) {
await vscode.env.clipboard.writeText(uri);
}
} else {
await vscode.window.showInformationMessage(`Your workspace is currently not shared. Only you can access it.`);
}
Expand Down
8 changes: 4 additions & 4 deletions extensions/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"@improbable-eng/grpc-web" "0.14.0"
google-protobuf "^3.17.0"

"@gitpod/supervisor-api-grpc@main":
version "0.1.5-main.1291"
resolved "https://registry.yarnpkg.com/@gitpod/supervisor-api-grpc/-/supervisor-api-grpc-0.1.5-main.1291.tgz#4b30571d6e5934fefceec8bc9c34506904d05e6c"
integrity sha512-+N6kFrpzB+Ljk2CO/2XZB7btgBdnx5LiiyjSnwJShn9XHju+eao9rzH/ZrChUbDVb/POFnwl1zfsBpISQChV3Q==
"@gitpod/supervisor-api-grpc@jeanp413-your-workspace-is-currently-5313":
version "0.1.5-jeanp413-your-workspace-is-currently-5313.0"
resolved "https://registry.yarnpkg.com/@gitpod/supervisor-api-grpc/-/supervisor-api-grpc-0.1.5-jeanp413-your-workspace-is-currently-5313.0.tgz#dae4e6c93d324f8df72d34320c6a9281c82a2c86"
integrity sha512-/4Y5bQ1braB4yxD5C5m9+2kdpqj5xwP0d9eUXqZ5i6S16uV1Qr0jqinKDOFRo0XT3/jdrvZyhU9THmOGNHzVGQ==
dependencies:
"@grpc/grpc-js" "^1.3.6"
google-protobuf "^3.17.3"
Expand Down

0 comments on commit 3c6a47a

Please sign in to comment.