mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 09:35:37 -05:00
Notebooks: Save cell connection name in cell metadata (#13208)
* save connection info in notebook metadata * update attachTo dropdown based on saved alias * add setting for saving connection (default=false) * save/read cell connection name to/from metadata * get started on toggling multi connection mode * add activeConnection property to cell model * add changeContext method for cell * add comments * add unit test for reading connection name * save connection mode in metadata * clean up code * address PR comments
This commit is contained in:
@@ -1024,4 +1024,20 @@ suite('Cell Model', function (): void {
|
||||
assert(!isEditMode);
|
||||
});
|
||||
|
||||
test('Should read connection name from notebook metadata', async function () {
|
||||
const connectionName = 'connectionName';
|
||||
let notebookModel = new NotebookModelStub({
|
||||
name: '',
|
||||
version: '',
|
||||
mimetype: ''
|
||||
});
|
||||
let contents: nb.ICellContents = {
|
||||
cell_type: CellTypes.Code,
|
||||
source: '',
|
||||
metadata: { connection_name: connectionName }
|
||||
};
|
||||
let model = factory.createCell(contents, { notebook: notebookModel, isTrusted: false });
|
||||
assert.equal(model.savedConnectionName, connectionName);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user