mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-10 21:51:47 -04:00
Ports to release/1.13 for 10/21 (#7879)
* Add (dummy) IPyWidgets Renderer (#7849) * Updates to package.json to show books on stable (#7836) * Updates to package.json to show books on stable * remove notebookQuality context key * renamed untitiled to unsaved * fix the wizard opened twice issue #7866 (#7869) * fix a typo (#7871)
This commit is contained in:
@@ -435,7 +435,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "%title.books%",
|
"name": "%title.books%",
|
||||||
"when": "notebookQuality != stable",
|
|
||||||
"row": 0,
|
"row": 0,
|
||||||
"col": 2,
|
"col": 2,
|
||||||
"colspan": 1,
|
"colspan": 1,
|
||||||
|
|||||||
@@ -155,6 +155,14 @@
|
|||||||
"dark": "resources/dark/search_inverse.svg",
|
"dark": "resources/dark/search_inverse.svg",
|
||||||
"light": "resources/light/search.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": [
|
"languages": [
|
||||||
@@ -235,7 +243,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "books.sqlserver2019",
|
"command": "books.sqlserver2019",
|
||||||
"when": "sqlserver2019 && notebookQuality != stable"
|
"when": "sqlserver2019"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"touchBar": [
|
"touchBar": [
|
||||||
@@ -270,12 +278,17 @@
|
|||||||
"view/item/context": [
|
"view/item/context": [
|
||||||
{
|
{
|
||||||
"command": "notebook.command.searchBook",
|
"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"
|
"group": "inline"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "notebook.command.saveBook",
|
"command": "notebook.command.saveBook",
|
||||||
"when": "view == untitledBookTreeView && viewItem == untitledBook && untitledBooks && notebookQuality != stable",
|
"when": "view == unsavedBookTreeView && viewItem == unsavedBook && unsavedBooks",
|
||||||
"group": "inline"
|
"group": "inline"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -397,8 +410,8 @@
|
|||||||
"name": "%title.SavedBooks%"
|
"name": "%title.SavedBooks%"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "untitledBookTreeView",
|
"id": "unsavedBookTreeView",
|
||||||
"name": "%title.UntitledBooks%"
|
"name": "%title.UnsavedBooks%"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,5 @@
|
|||||||
"title.saveJupyterBook": "Save Book",
|
"title.saveJupyterBook": "Save Book",
|
||||||
"title.searchJupyterBook": "Search Book",
|
"title.searchJupyterBook": "Search Book",
|
||||||
"title.SavedBooks": "Saved Books",
|
"title.SavedBooks": "Saved Books",
|
||||||
"title.UntitledBooks": "Untitled Books"
|
"title.UnsavedBooks": "Unsaved Books"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export class BookTreeItem extends vscode.TreeItem {
|
|||||||
this.collapsibleState = book.treeItemCollapsibleState;
|
this.collapsibleState = book.treeItemCollapsibleState;
|
||||||
this._sections = book.page;
|
this._sections = book.page;
|
||||||
if (book.isUntitled) {
|
if (book.isUntitled) {
|
||||||
this.contextValue = 'untitledBook';
|
this.contextValue = 'unsavedBook';
|
||||||
} else {
|
} else {
|
||||||
this.contextValue = 'savedBook';
|
this.contextValue = 'savedBook';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async initialize(bookPaths: string[]): Promise<void> {
|
private async initialize(bookPaths: string[]): Promise<void> {
|
||||||
await vscode.commands.executeCommand('setContext', 'untitledBooks', this._openAsUntitled);
|
await vscode.commands.executeCommand('setContext', 'unsavedBooks', this._openAsUntitled);
|
||||||
await Promise.all(bookPaths.map(async (bookPath) => {
|
await Promise.all(bookPaths.map(async (bookPath) => {
|
||||||
let book: BookModel = new BookModel(bookPath, this._openAsUntitled, this._extensionContext);
|
let book: BookModel = new BookModel(bookPath, this._openAsUntitled, this._extensionContext);
|
||||||
await book.initializeContents();
|
await book.initializeContents();
|
||||||
|
|||||||
@@ -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 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 noNotebookVisible = localize('noNotebookVisible', "No notebook editor is active");
|
||||||
const BOOKS_VIEWID = 'bookTreeView';
|
const BOOKS_VIEWID = 'bookTreeView';
|
||||||
const READONLY_BOOKS_VIEWID = 'untitledBookTreeView';
|
const READONLY_BOOKS_VIEWID = 'unsavedBookTreeView';
|
||||||
let controller: JupyterController;
|
let controller: JupyterController;
|
||||||
type ChooseCellType = { label: string, id: CellType };
|
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('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.saveBook', () => untitledBookTreeViewProvider.saveJupyterBooks()));
|
||||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.searchBook', () => bookTreeViewProvider.searchJupyterBooks()));
|
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) => {
|
extensionContext.subscriptions.push(vscode.commands.registerCommand('_notebook.command.new', (context?: azdata.ConnectedContext) => {
|
||||||
let connectionProfile: azdata.IConnectionProfile = undefined;
|
let connectionProfile: azdata.IConnectionProfile = undefined;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export class SummaryPage extends WizardPageBase<DeployClusterWizard> {
|
|||||||
if (this.wizard.model.deploymentTarget === BdcDeploymentType.NewAKS) {
|
if (this.wizard.model.deploymentTarget === BdcDeploymentType.NewAKS) {
|
||||||
this.wizard.wizardObject.message = {
|
this.wizard.wizardObject.message = {
|
||||||
level: azdata.window.MessageLevel.Information,
|
level: azdata.window.MessageLevel.Information,
|
||||||
text: localize('resourceDeployment.NewAKSBrowserWindowPrompt', "A browser window for logging to Azure will be opened during the SQL Server Big Data Cluster deployment.")
|
text: localize('resourceDeployment.NewAKSBrowserWindowPrompt', "A browser window for signing into Azure will be opened during the SQL Server Big Data Cluster deployment.")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
this.wizard.saveConfigButton.hidden = false;
|
this.wizard.saveConfigButton.hidden = false;
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ export class ResourceTypePickerDialog extends DialogBase {
|
|||||||
resourceType: ResourceType) {
|
resourceType: ResourceType) {
|
||||||
super(localize('resourceTypePickerDialog.title', "Select the deployment options"), 'ResourceTypePickerDialog', true);
|
super(localize('resourceTypePickerDialog.title', "Select the deployment options"), 'ResourceTypePickerDialog', true);
|
||||||
this._selectedResourceType = resourceType;
|
this._selectedResourceType = resourceType;
|
||||||
this._dialogObject.okButton.onClick(() => this.onComplete());
|
|
||||||
this._installToolButton = azdata.window.createButton(localize('deploymentDialog.InstallToolsButton', "Install tools"));
|
this._installToolButton = azdata.window.createButton(localize('deploymentDialog.InstallToolsButton', "Install tools"));
|
||||||
this._toDispose.push(this._installToolButton.onClick(() => {
|
this._toDispose.push(this._installToolButton.onClick(() => {
|
||||||
this.installTools();
|
this.installTools();
|
||||||
|
|||||||
@@ -292,4 +292,17 @@ registerComponentType({
|
|||||||
selector: MarkdownOutputComponent.SELECTOR
|
selector: MarkdownOutputComponent.SELECTOR
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mime renderer for IPyWidgets
|
||||||
|
*/
|
||||||
|
registerComponentType({
|
||||||
|
mimeTypes: [
|
||||||
|
'application/vnd.jupyter.widget-view',
|
||||||
|
'application/vnd.jupyter.widget-view+json'
|
||||||
|
],
|
||||||
|
rank: 47,
|
||||||
|
safe: true,
|
||||||
|
ctor: MimeRendererComponent,
|
||||||
|
selector: MimeRendererComponent.SELECTOR
|
||||||
|
});
|
||||||
registerCellComponent(TextCellComponent);
|
registerCellComponent(TextCellComponent);
|
||||||
|
|||||||
@@ -80,6 +80,16 @@ export const dataResourceRendererFactory: IRenderMime.IRendererFactory = {
|
|||||||
createRenderer: options => new widgets.RenderedDataResource(options)
|
createRenderer: options => new widgets.RenderedDataResource(options)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ipywidgetFactory: IRenderMime.IRendererFactory = {
|
||||||
|
safe: false,
|
||||||
|
mimeTypes: [
|
||||||
|
'application/vnd.jupyter.widget-view',
|
||||||
|
'application/vnd.jupyter.widget-view+json'
|
||||||
|
],
|
||||||
|
defaultRank: 45,
|
||||||
|
createRenderer: options => new widgets.RenderedIPyWidget(options)
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The standard factories provided by the rendermime package.
|
* The standard factories provided by the rendermime package.
|
||||||
*/
|
*/
|
||||||
@@ -90,5 +100,6 @@ export const standardRendererFactories: ReadonlyArray<IRenderMime.IRendererFacto
|
|||||||
imageRendererFactory,
|
imageRendererFactory,
|
||||||
javaScriptRendererFactory,
|
javaScriptRendererFactory,
|
||||||
textRendererFactory,
|
textRendererFactory,
|
||||||
dataResourceRendererFactory
|
dataResourceRendererFactory,
|
||||||
|
ipywidgetFactory
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import * as renderers from './renderers';
|
|||||||
import { IRenderMime } from '../models/renderMimeInterfaces';
|
import { IRenderMime } from '../models/renderMimeInterfaces';
|
||||||
import { ReadonlyJSONObject } from '../../common/models/jsonext';
|
import { ReadonlyJSONObject } from '../../common/models/jsonext';
|
||||||
import * as tableRenderers from 'sql/workbench/parts/notebook/browser/outputs/tableRenderers';
|
import * as tableRenderers from 'sql/workbench/parts/notebook/browser/outputs/tableRenderers';
|
||||||
|
import { Deferred } from 'sql/base/common/promise';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A common base class for mime renderers.
|
* A common base class for mime renderers.
|
||||||
@@ -376,3 +377,31 @@ export class RenderedDataResource extends RenderedCommon {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A dummy widget for (not) displaying ipywidgets.
|
||||||
|
*/
|
||||||
|
export class RenderedIPyWidget extends RenderedCommon {
|
||||||
|
/**
|
||||||
|
* Construct a new rendered widget.
|
||||||
|
*
|
||||||
|
* @param options - The options for initializing the widget.
|
||||||
|
*/
|
||||||
|
constructor(options: IRenderMime.IRendererOptions) {
|
||||||
|
super(options);
|
||||||
|
this.addClass('jp-RenderedIPyWidget');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render a mime model.
|
||||||
|
*
|
||||||
|
* @param model - The mime model to render.
|
||||||
|
*
|
||||||
|
* @returns A promise which resolves when rendering is complete.
|
||||||
|
*/
|
||||||
|
render(model: IRenderMime.IMimeModel): Promise<void> {
|
||||||
|
let deferred = new Deferred<void>();
|
||||||
|
deferred.resolve();
|
||||||
|
return deferred.promise;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -169,8 +169,6 @@ export class NotebookService extends Disposable implements INotebookService {
|
|||||||
lifecycleService.onWillShutdown(() => this.shutdown());
|
lifecycleService.onWillShutdown(() => this.shutdown());
|
||||||
this.hookContextKeyListeners();
|
this.hookContextKeyListeners();
|
||||||
this.hookNotebookThemesAndConfigListener();
|
this.hookNotebookThemesAndConfigListener();
|
||||||
// Temporary (issue #6427 will remove): Add a product quality key so we can only show books on Insiders
|
|
||||||
this._contextKeyService.createKey<string>('notebookQuality', environmentService.appQuality);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user