mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 01:25:38 -05:00
Notebooks: Improvements to Connection Profile Passing (#8105)
* Fix relative images on notebook markdown pc * PR feedback around replace ordering * update databaseName when it's set to master * usinng query as example
This commit is contained in:
@@ -70,7 +70,7 @@ CommandsRegistry.registerCommand({
|
||||
handler: (accessor, args: TreeViewItemHandleArg) => {
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
const connectedContext: ConnectedContext = { connectionProfile: args.$treeItem.payload };
|
||||
return instantiationService.createInstance(NewNotebookAction, NewNotebookAction.ID, NewNotebookAction.LABEL).run(connectedContext);
|
||||
return instantiationService.createInstance(NewNotebookAction, NewNotebookAction.ID, NewNotebookAction.LABEL).run({ connectionProfile: connectedContext.connectionProfile, isConnectionNode: false, nodeInfo: undefined });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -91,10 +91,9 @@ const OE_NEW_NOTEBOOK_COMMAND_ID = 'objectExplorer.newNotebook';
|
||||
// New Notebook
|
||||
CommandsRegistry.registerCommand({
|
||||
id: OE_NEW_NOTEBOOK_COMMAND_ID,
|
||||
handler: (accessor, args: ObjectExplorerActionsContext) => {
|
||||
handler: (accessor, actionContext: ObjectExplorerActionsContext) => {
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
const connectedContext: ConnectedContext = { connectionProfile: args.connectionProfile };
|
||||
return instantiationService.createInstance(NewNotebookAction, NewNotebookAction.ID, NewNotebookAction.LABEL).run(connectedContext);
|
||||
return instantiationService.createInstance(NewNotebookAction, NewNotebookAction.ID, NewNotebookAction.LABEL).run(actionContext);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -112,7 +111,7 @@ const ExplorerNotebookActionID = 'explorer.notebook';
|
||||
CommandsRegistry.registerCommand(ExplorerNotebookActionID, (accessor, context: ManageActionContext) => {
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
const connectedContext: ConnectedContext = { connectionProfile: context.profile };
|
||||
instantiationService.createInstance(NewNotebookAction, NewNotebookAction.ID, NewNotebookAction.LABEL).run(connectedContext);
|
||||
instantiationService.createInstance(NewNotebookAction, NewNotebookAction.ID, NewNotebookAction.LABEL).run({ connectionProfile: connectedContext.connectionProfile, isConnectionNode: false, nodeInfo: undefined });
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.ExplorerWidgetContext, {
|
||||
|
||||
Reference in New Issue
Block a user