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

@@ -120,7 +120,7 @@
} }
.carbon-taskbar .codicon.export { .carbon-taskbar .codicon.export {
background-origin: initial; background-origin: initial !important;
background-position: left; background-position: left !important;
background-size: 11px background-size: 11px !important;
} }

View File

@@ -210,15 +210,12 @@ configurationRegistry.registerConfiguration({
'type': 'boolean', 'type': 'boolean',
'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,
configurationRegistry.registerConfiguration({ 'description': localize('notebook.showNotebookConvertActions', "(Preview) Show buttons for converting a Notebook to and from SQL.")
'id': 'notebook', },
'title': 'Notebook',
'type': 'object',
'properties': {
'notebook.allowAzureDataStudioCommands': { 'notebook.allowAzureDataStudioCommands': {
'type': 'boolean', 'type': 'boolean',
'default': false, 'default': false,

View File

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