mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 01:25:38 -05:00
Notebooks: Add Placeholder Cell, Fix Link Styling (#3728)
* Placeholder cell to add new real cells * Fix links in notebooks to show correct color, rely on angular ngif for placeholder * Fix failing test where one cell was expected by default * Remove unnecessary TODO
This commit is contained in:
@@ -217,7 +217,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
}
|
||||
let factory = this.notebookOptions.factory;
|
||||
// if cells already exist, create them with language info (if it is saved)
|
||||
this._cells = undefined;
|
||||
this._cells = [];
|
||||
this._defaultLanguageInfo = {
|
||||
name: this._providerId === SQL_NOTEBOOK_PROVIDER ? 'sql' : 'python',
|
||||
version: ''
|
||||
@@ -230,9 +230,6 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
this._cells = contents.cells.map(c => factory.createCell(c, { notebook: this, isTrusted: isTrusted }));
|
||||
}
|
||||
}
|
||||
if (!this._cells) {
|
||||
this._cells = [this.createCell(CellTypes.Code)];
|
||||
}
|
||||
} catch (error) {
|
||||
this._inErrorState = true;
|
||||
throw error;
|
||||
@@ -244,7 +241,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
}
|
||||
|
||||
public addCell(cellType: CellType, index?: number): ICellModel {
|
||||
if (this.inErrorState || !this._cells) {
|
||||
if (this.inErrorState) {
|
||||
return null;
|
||||
}
|
||||
let cell = this.createCell(cellType);
|
||||
|
||||
Reference in New Issue
Block a user