mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
Add separate config for enabling nb convert and fix css (#11811)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user