Skip to content

Commit

Permalink
Expose Open Studio Settings through the command palette (#3399)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Mar 6, 2023
1 parent c83eb2a commit e10ca30
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@
"command": "dvc.showConnect",
"category": "DVC"
},
{
"title": "Open Studio Settings",
"command": "dvc.showStudioSettings",
"category": "DVC"
},
{
"title": "Show Experiments",
"command": "dvc.showExperiments",
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions extension/src/commands/external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 5 additions & 0 deletions extension/src/connect/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions extension/src/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit e10ca30

Please sign in to comment.