Add separate config for enabling nb convert and fix css (#11811)

This commit is contained in:
Charles Gagnon
2020-08-15 17:15:28 -07:00
committed by GitHub
parent e90578694b
commit 273f6b658a
3 changed files with 20 additions and 13 deletions

View File

@@ -210,15 +210,12 @@ configurationRegistry.registerConfiguration({
'type': 'boolean',
'default': false,
'description': localize('notebook.showAllKernels', "(Preview) show all kernels for the current notebook provider.")
}
}
});
configurationRegistry.registerConfiguration({
'id': 'notebook',
'title': 'Notebook',
'type': 'object',
'properties': {
},
'notebook.showNotebookConvertActions': {
'type': 'boolean',
'default': false,
'description': localize('notebook.showNotebookConvertActions', "(Preview) Show buttons for converting a Notebook to and from SQL.")
},
'notebook.allowAzureDataStudioCommands': {
'type': 'boolean',
'default': false,

View File

@@ -259,6 +259,7 @@ export class QueryEditor extends BaseEditor {
const separator = Taskbar.createTaskbarSeparator();
let content: ITaskbarContent[];
const previewFeaturesEnabled = this.configurationService.getValue('workbench')['enablePreviewFeatures'];
const notebookConvertActionsEnabled = this.configurationService.getValue('notebook')['showNotebookConvertActions'];
if (previewFeaturesEnabled) {
content = [
{ action: this._runQueryAction },
@@ -270,8 +271,11 @@ export class QueryEditor extends BaseEditor {
{ element: separator },
{ action: this._estimatedQueryPlanAction }, // Preview
{ action: this._toggleSqlcmdMode }, // Preview
{ action: this._exportAsNotebookAction } // Preview
];
if (notebookConvertActionsEnabled) {
content.push({ action: this._exportAsNotebookAction });
}
} else {
content = [
{ action: this._runQueryAction },
@@ -281,6 +285,12 @@ export class QueryEditor extends BaseEditor {
{ action: this._changeConnectionAction },
{ action: this._listDatabasesAction }
];
const notebookConvertActionsEnabled = this.configurationService.getValue('notebook')['notebook.showNotebookConvertActions'];
if (notebookConvertActionsEnabled) {
content.push(
{ element: separator },
{ action: this._exportAsNotebookAction });
}
}
this.taskbar.setContent(content);