From e10ca304fa5cceaa3ef751177a4af5e713fe6c4a Mon Sep 17 00:00:00 2001 From: Matt Seddon <37993418+mattseddon@users.noreply.github.com> Date: Tue, 7 Mar 2023 05:07:27 +1100 Subject: [PATCH] Expose Open Studio Settings through the command palette (#3399) --- extension/package.json | 9 +++++++++ extension/src/commands/external.ts | 1 + extension/src/connect/register.ts | 5 +++++ extension/src/telemetry/constants.ts | 1 + 4 files changed, 16 insertions(+) diff --git a/extension/package.json b/extension/package.json index 27fc71d345..6f3ec58e5b 100644 --- a/extension/package.json +++ b/extension/package.json @@ -399,6 +399,11 @@ "command": "dvc.showConnect", "category": "DVC" }, + { + "title": "Open Studio Settings", + "command": "dvc.showStudioSettings", + "category": "DVC" + }, { "title": "Show Experiments", "command": "dvc.showExperiments", @@ -804,6 +809,10 @@ "command": "dvc.showConnect", "when": "dvc.commands.available && dvc.project.available && !dvc.studio.connected" }, + { + "command": "dvc.showStudioSettings", + "when": "dvc.commands.available && dvc.project.available && dvc.studio.connected" + }, { "command": "dvc.selectForCompare", "when": "false" diff --git a/extension/src/commands/external.ts b/extension/src/commands/external.ts index b3ec900ffd..ba8899f4ab 100644 --- a/extension/src/commands/external.ts +++ b/extension/src/commands/external.ts @@ -97,6 +97,7 @@ export enum RegisteredCommands { SELECT_FOCUSED_PROJECTS = 'dvc.selectFocusedProjects', CONNECT_SHOW = 'dvc.showConnect', + OPEN_STUDIO_SETTINGS = 'dvc.showStudioSettings', ADD_STUDIO_ACCESS_TOKEN = 'dvc.addStudioAccessToken', REMOVE_STUDIO_ACCESS_TOKEN = 'dvc.removeStudioAccessToken', EXPERIMENT_VIEW_SHARE_TO_STUDIO = 'dvc.views.experiments.shareExperimentToStudio' diff --git a/extension/src/connect/register.ts b/extension/src/connect/register.ts index 12d9d3422d..ef618aacf6 100644 --- a/extension/src/connect/register.ts +++ b/extension/src/connect/register.ts @@ -11,6 +11,11 @@ export const registerConnectCommands = ( () => connect.showWebview() ) + internalCommands.registerExternalCommand( + RegisteredCommands.OPEN_STUDIO_SETTINGS, + () => connect.showWebview() + ) + internalCommands.registerExternalCommand( RegisteredCommands.ADD_STUDIO_ACCESS_TOKEN, () => connect.saveStudioAccessToken() diff --git a/extension/src/telemetry/constants.ts b/extension/src/telemetry/constants.ts index 981ba81103..0932e9e91f 100644 --- a/extension/src/telemetry/constants.ts +++ b/extension/src/telemetry/constants.ts @@ -285,6 +285,7 @@ export interface IEventNamePropertyMapping { [EventName.SELECT_FOCUSED_PROJECTS]: undefined [EventName.CONNECT_SHOW]: undefined + [EventName.OPEN_STUDIO_SETTINGS]: undefined [EventName.ADD_STUDIO_ACCESS_TOKEN]: undefined [EventName.REMOVE_STUDIO_ACCESS_TOKEN]: undefined }