Put export as SQL/Notebook under preview flag (#11726)

* Put export as SQL/Notebook under preview flag

* add sqlcmd under preview

* Remove comment
This commit is contained in:
Charles Gagnon
2020-08-09 16:09:51 -07:00
committed by GitHub
parent 2b0b529b21
commit 858c1e826d
2 changed files with 26 additions and 21 deletions

View File

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

View File

@@ -256,10 +256,11 @@ export class QueryEditor extends BaseEditor {
private setTaskbarContent(): void { private setTaskbarContent(): void {
// Create HTML Elements for the taskbar // Create HTML Elements for the taskbar
let separator = Taskbar.createTaskbarSeparator(); const separator = Taskbar.createTaskbarSeparator();
let content: ITaskbarContent[];
// Set the content in the order we desire const previewFeaturesEnabled = this.configurationService.getValue('workbench')['enablePreviewFeatures'];
let content: ITaskbarContent[] = [ if (previewFeaturesEnabled) {
content = [
{ action: this._runQueryAction }, { action: this._runQueryAction },
{ action: this._cancelQueryAction }, { action: this._cancelQueryAction },
{ element: separator }, { element: separator },
@@ -267,15 +268,19 @@ export class QueryEditor extends BaseEditor {
{ action: this._changeConnectionAction }, { action: this._changeConnectionAction },
{ action: this._listDatabasesAction }, { action: this._listDatabasesAction },
{ element: separator }, { element: separator },
{ action: this._estimatedQueryPlanAction }, { action: this._estimatedQueryPlanAction }, // Preview
{ action: this._toggleSqlcmdMode }, { action: this._toggleSqlcmdMode }, // Preview
{ action: this._exportAsNotebookAction } { action: this._exportAsNotebookAction } // Preview
];
} else {
content = [
{ action: this._runQueryAction },
{ action: this._cancelQueryAction },
{ element: separator },
{ action: this._toggleConnectDatabaseAction },
{ action: this._changeConnectionAction },
{ action: this._listDatabasesAction }
]; ];
// Remove the estimated query plan action if preview features are not enabled
let previewFeaturesEnabled = this.configurationService.getValue('workbench')['enablePreviewFeatures'];
if (!previewFeaturesEnabled) {
content.splice(7, 1);
} }
this.taskbar.setContent(content); this.taskbar.setContent(content);