Enable script to notebook actions under preview flag (#13164)

This commit is contained in:
Charles Gagnon
2020-10-30 15:24:35 -07:00
committed by GitHub
parent 8717a03466
commit 341f7aa7ad
3 changed files with 4 additions and 21 deletions

View File

@@ -474,7 +474,7 @@
"notebook/toolbar": [ "notebook/toolbar": [
{ {
"command": "mssql.exportNotebookToSql", "command": "mssql.exportNotebookToSql",
"when": "config.notebook.showNotebookConvertActions && providerId == sql" "when": "config.workbench.enablePreviewFeatures && providerId == sql"
} }
] ]
}, },

View File

@@ -211,11 +211,6 @@ configurationRegistry.registerConfiguration({
'default': false, 'default': false,
'description': localize('notebook.showAllKernels', "(Preview) show all kernels for the current notebook provider.") 'description': localize('notebook.showAllKernels', "(Preview) show all kernels for the current notebook provider.")
}, },
'notebook.showNotebookConvertActions': {
'type': 'boolean',
'default': false,
'description': localize('notebook.showNotebookConvertActions', "(Preview) Show buttons for converting a Notebook to and from SQL.")
},
'notebook.allowAzureDataStudioCommands': { 'notebook.allowAzureDataStudioCommands': {
'type': 'boolean', 'type': 'boolean',
'default': false, 'default': false,

View File

@@ -299,14 +299,11 @@ export class QueryEditor extends EditorPane {
if (providerId === 'MSSQL') { if (providerId === 'MSSQL') {
content.push({ element: separator }, content.push({ element: separator },
{ action: this._estimatedQueryPlanAction }, // Preview { action: this._estimatedQueryPlanAction },
{ action: this._toggleSqlcmdMode } // Preview) { action: this._toggleSqlcmdMode }
); );
const notebookConvertActionsEnabled = this.configurationService.getValue('notebook')['showNotebookConvertActions']; content.push({ action: this._exportAsNotebookAction });
if (notebookConvertActionsEnabled) {
content.push({ action: this._exportAsNotebookAction });
}
} }
} else { } else {
content = [ content = [
@@ -317,15 +314,6 @@ export class QueryEditor extends EditorPane {
{ action: this._changeConnectionAction }, { action: this._changeConnectionAction },
{ action: this._listDatabasesAction } { action: this._listDatabasesAction }
]; ];
if (providerId === 'MSSQL') {
const notebookConvertActionsEnabled = this.configurationService.getValue('notebook')['notebook.showNotebookConvertActions'];
if (notebookConvertActionsEnabled) {
content.push(
{ element: separator },
{ action: this._exportAsNotebookAction });
}
}
} }
} }