[Notebook] Run Parameters Action openNotebook Functionality in Core (#14978)

* NotebookService update

* openNotebook functionality in NbService

* Add tests for RunParametersAction
This commit is contained in:
Vasu Bhog
2021-04-08 14:48:37 -07:00
committed by GitHub
parent 4f67f32262
commit d76a6698a9
18 changed files with 245 additions and 101 deletions

View File

@@ -0,0 +1,36 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import { URI } from 'vs/base/common/uri';
import { Event } from 'vs/base/common/event';
import { IContentManager } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
import { IStandardKernelWithProvider } from 'sql/workbench/services/notebook/browser/models/notebookUtils';
export interface INotebookInput {
defaultKernel: azdata.nb.IKernelSpec,
connectionProfile: azdata.IConnectionProfile,
isDirty(): boolean;
setDirty(boolean);
readonly notebookUri: URI;
updateModel(): void;
readonly editorOpenedTimestamp: number;
readonly layoutChanged: Event<void>;
readonly contentManager: IContentManager;
readonly standardKernels: IStandardKernelWithProvider[];
}
export function isINotebookInput(value: any): value is INotebookInput {
if (typeof value.defaultKernel === 'object' &&
typeof value.connectionProfile === 'object' &&
typeof value.isDirty === 'boolean' &&
value.notebookUri instanceof URI &&
typeof value.editorOpenedTimestamp === 'number' &&
typeof value.layoutChanged === 'object' &&
typeof value.contentManager === 'object' &&
typeof value.standardKernels === 'object') {
return true;
}
return false;
}