Integrate notebook service with notebook UI (#3143)

Port notebookView code over to notebook.component.ts.
Integrate loading of notebook contents into the UI
This commit is contained in:
Kevin Cunnane
2018-11-06 16:31:37 -08:00
committed by GitHub
parent 5da89ac05b
commit ecd40de7ec
13 changed files with 168 additions and 43 deletions

View File

@@ -20,6 +20,7 @@ import { INotebookManager } from 'sql/services/notebook/notebookService';
import { SparkMagicContexts } from 'sql/parts/notebook/models/sparkMagicContexts';
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
import { NotebookConnection } from 'sql/parts/notebook/models/notebookConnection';
import { INotification, Severity } from 'vs/platform/notification/common/notification';
/*
* Used to control whether a message in a dialog/wizard is displayed as an error,
@@ -71,7 +72,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
private _cells: ICellModel[];
private _defaultLanguageInfo: nb.ILanguageInfo;
private onErrorEmitter = new Emitter<ErrorInfo>();
private onErrorEmitter = new Emitter<INotification>();
private _savedKernelInfo: nb.IKernelInfo;
private readonly _nbformat: number = nbversion.MAJOR_VERSION;
private readonly _nbformatMinor: number = nbversion.MINOR_VERSION;
@@ -147,7 +148,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
return this._inErrorState;
}
public get onError(): Event<ErrorInfo> {
public get onError(): Event<INotification> {
return this.onErrorEmitter.event;
}
@@ -242,7 +243,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
}
private notifyError(error: string): void {
this.onErrorEmitter.fire(new ErrorInfo(error, MessageLevel.Error));
this.onErrorEmitter.fire({ message: error, severity: Severity.Error });
}
public backgroundStartSession(): void {