diff --git a/extensions/mssql/package.json b/extensions/mssql/package.json index 157ea5ec4b..66055ab74d 100644 --- a/extensions/mssql/package.json +++ b/extensions/mssql/package.json @@ -435,7 +435,6 @@ }, { "name": "%title.books%", - "when": "notebookQuality != stable", "row": 0, "col": 2, "colspan": 1, diff --git a/extensions/notebook/package.json b/extensions/notebook/package.json index 1bfee6141c..af6dd1794e 100644 --- a/extensions/notebook/package.json +++ b/extensions/notebook/package.json @@ -155,6 +155,14 @@ "dark": "resources/dark/search_inverse.svg", "light": "resources/light/search.svg" } + }, + { + "command": "notebook.command.searchUntitledBook", + "title": "%title.searchJupyterBook%", + "icon": { + "dark": "resources/dark/search_inverse.svg", + "light": "resources/light/search.svg" + } } ], "languages": [ @@ -235,7 +243,7 @@ }, { "command": "books.sqlserver2019", - "when": "sqlserver2019 && notebookQuality != stable" + "when": "sqlserver2019" } ], "touchBar": [ @@ -270,12 +278,17 @@ "view/item/context": [ { "command": "notebook.command.searchBook", - "when": "view =~ /^(untitledBookTreeView|bookTreeView)$/ && viewItem =~ /^(untitledBook|savedBook)$/ && notebookQuality != stable", + "when": "view == bookTreeView && viewItem == savedBook", + "group": "inline" + }, + { + "command": "notebook.command.searchUntitledBook", + "when": "view == unsavedBookTreeView && viewItem == unsavedBook && unsavedBooks", "group": "inline" }, { "command": "notebook.command.saveBook", - "when": "view == untitledBookTreeView && viewItem == untitledBook && untitledBooks && notebookQuality != stable", + "when": "view == unsavedBookTreeView && viewItem == unsavedBook && unsavedBooks", "group": "inline" } ], @@ -397,8 +410,8 @@ "name": "%title.SavedBooks%" }, { - "id": "untitledBookTreeView", - "name": "%title.UntitledBooks%" + "id": "unsavedBookTreeView", + "name": "%title.UnsavedBooks%" } ] } diff --git a/extensions/notebook/package.nls.json b/extensions/notebook/package.nls.json index 4821920386..2fc2391f2b 100644 --- a/extensions/notebook/package.nls.json +++ b/extensions/notebook/package.nls.json @@ -32,5 +32,5 @@ "title.saveJupyterBook": "Save Book", "title.searchJupyterBook": "Search Book", "title.SavedBooks": "Saved Books", - "title.UntitledBooks": "Untitled Books" + "title.UnsavedBooks": "Unsaved Books" } diff --git a/extensions/notebook/src/book/bookTreeItem.ts b/extensions/notebook/src/book/bookTreeItem.ts index 29111b5746..d3a7c65e47 100644 --- a/extensions/notebook/src/book/bookTreeItem.ts +++ b/extensions/notebook/src/book/bookTreeItem.ts @@ -41,7 +41,7 @@ export class BookTreeItem extends vscode.TreeItem { this.collapsibleState = book.treeItemCollapsibleState; this._sections = book.page; if (book.isUntitled) { - this.contextValue = 'untitledBook'; + this.contextValue = 'unsavedBook'; } else { this.contextValue = 'savedBook'; } diff --git a/extensions/notebook/src/book/bookTreeView.ts b/extensions/notebook/src/book/bookTreeView.ts index f06d93bd8a..17df14203d 100644 --- a/extensions/notebook/src/book/bookTreeView.ts +++ b/extensions/notebook/src/book/bookTreeView.ts @@ -46,7 +46,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider { - await vscode.commands.executeCommand('setContext', 'untitledBooks', this._openAsUntitled); + await vscode.commands.executeCommand('setContext', 'unsavedBooks', this._openAsUntitled); await Promise.all(bookPaths.map(async (bookPath) => { let book: BookModel = new BookModel(bookPath, this._openAsUntitled, this._extensionContext); await book.initializeContents(); diff --git a/extensions/notebook/src/extension.ts b/extensions/notebook/src/extension.ts index 3cfd7be951..15021eb9ab 100644 --- a/extensions/notebook/src/extension.ts +++ b/extensions/notebook/src/extension.ts @@ -23,7 +23,7 @@ const JUPYTER_NOTEBOOK_PROVIDER = 'jupyter'; const msgSampleCodeDataFrame = localize('msgSampleCodeDataFrame', "This sample code loads the file into a data frame and shows the first 10 results."); const noNotebookVisible = localize('noNotebookVisible', "No notebook editor is active"); const BOOKS_VIEWID = 'bookTreeView'; -const READONLY_BOOKS_VIEWID = 'untitledBookTreeView'; +const READONLY_BOOKS_VIEWID = 'unsavedBookTreeView'; let controller: JupyterController; type ChooseCellType = { label: string, id: CellType }; @@ -35,6 +35,7 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi extensionContext.subscriptions.push(vscode.commands.registerCommand('bookTreeView.openExternalLink', (resource) => bookTreeViewProvider.openExternalLink(resource))); extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.saveBook', () => untitledBookTreeViewProvider.saveJupyterBooks())); extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.searchBook', () => bookTreeViewProvider.searchJupyterBooks())); + extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.searchUntitledBook', () => untitledBookTreeViewProvider.searchJupyterBooks())); extensionContext.subscriptions.push(vscode.commands.registerCommand('_notebook.command.new', (context?: azdata.ConnectedContext) => { let connectionProfile: azdata.IConnectionProfile = undefined; diff --git a/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts index 46d8813039..e6ef0f7c2c 100644 --- a/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts @@ -169,8 +169,6 @@ export class NotebookService extends Disposable implements INotebookService { lifecycleService.onWillShutdown(() => this.shutdown()); this.hookContextKeyListeners(); this.hookNotebookThemesAndConfigListener(); - // Temporary (issue #6427 will remove): Add a product quality key so we can only show books on Insiders - this._contextKeyService.createKey('notebookQuality', environmentService.appQuality); }