From 2fdc9b26f0de248fc1490b343780fc649deac786 Mon Sep 17 00:00:00 2001 From: Ramin Tadayon <67011668+axosoft-ramint@users.noreply.github.com> Date: Thu, 15 Jun 2023 01:46:54 +0900 Subject: [PATCH] Adds info button to Workspaces View title with link to help page (#2737) Adds info button to Workspaces View title with link to help page --- package.json | 15 +++++++++++++++ src/constants.ts | 1 + src/views/workspacesView.ts | 7 ++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d794c1..331a4e6 100644 --- a/package.json +++ b/package.json @@ -6903,6 +6903,12 @@ "icon": "$(add)" }, { + "command": "gitlens.views.workspaces.info", + "title": "Learn more about GitKraken Workspaces...", + "category": "GitLens", + "icon": "$(info)" + }, + { "command": "gitlens.views.workspaces.convert", "title": "Convert to Cloud Workspace...", "category": "GitLens", @@ -9451,6 +9457,10 @@ "when": "false" }, { + "command": "gitlens.views.workspaces.info", + "when": "false" + }, + { "command": "gitlens.views.workspaces.convert", "when": "false" }, @@ -10930,6 +10940,11 @@ "group": "navigation@99" }, { + "command": "gitlens.views.workspaces.info", + "when": "view =~ /^gitlens\\.views\\.workspaces/", + "group": "8_info@1" + }, + { "command": "gitlens.views.workspaces.create", "when": "view =~ /^gitlens\\.views\\.workspaces/ && gitlens:plus", "group": "navigation@1" diff --git a/src/constants.ts b/src/constants.ts index 22276ef..a469223 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -399,6 +399,7 @@ export type TreeViewCommands = `gitlens.views.${ | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}` | `setShowAvatars${'On' | 'Off'}`}` | `workspaces.${ + | 'info' | 'copy' | 'refresh' | 'addRepos' diff --git a/src/views/workspacesView.ts b/src/views/workspacesView.ts index 5ee3ea4..59122bd 100644 --- a/src/views/workspacesView.ts +++ b/src/views/workspacesView.ts @@ -1,5 +1,5 @@ import type { Disposable } from 'vscode'; -import { ProgressLocation, window } from 'vscode'; +import { env, ProgressLocation, Uri, window } from 'vscode'; import type { WorkspacesViewConfig } from '../config'; import { Commands } from '../constants'; import type { Container } from '../container'; @@ -57,6 +57,11 @@ export class WorkspacesView extends ViewBase<'workspaces', WorkspacesViewNode, W return [ registerViewCommand( + this.getQualifiedCommand('info'), + () => env.openExternal(Uri.parse('https://help.gitkraken.com/gitlens/side-bar/#workspaces-☁%ef%b8%8f')), + this, + ), + registerViewCommand( this.getQualifiedCommand('copy'), () => executeCommand(Commands.ViewsCopy, this.activeSelection, this.selection), this,