Spark features with dashboard are enabled (#3883)

* Spark features are enabled

* Fixed as PR comments

* minor change

* PR comments fixed

* minor fix

* change constant name to avoid conflicts with sqlopsextension

* sqlContext to context

* Changed tab name to SQL Server Big Data Cluster

* Added isCluster to ContextProvider to control display big data cluster dashboard tab
Ported New/open Notebook code to mssql extension and enable them in dashboard

* Fixed tslint
This commit is contained in:
Gene Lee
2019-02-06 11:54:25 -08:00
committed by Yurong He
parent 327a5f5fae
commit 8b9ce3e8de
36 changed files with 2090 additions and 477 deletions

View File

@@ -7,6 +7,7 @@ import * as vscode from 'vscode';
import * as sqlops from 'sqlops';
import * as types from './types';
import * as Constants from './constants';
export enum BuiltInCommands {
SetContext = 'setContext',
@@ -14,7 +15,8 @@ export enum BuiltInCommands {
export enum ContextKeys {
ISCLOUD = 'mssql:iscloud',
EDITIONID = 'mssql:engineedition'
EDITIONID = 'mssql:engineedition',
ISCLUSTER = 'mssql:iscluster'
}
const isCloudEditions = [
@@ -37,6 +39,7 @@ export default class ContextProvider {
public onDashboardOpen(e: sqlops.DashboardDocument): void {
let iscloud: boolean;
let edition: number;
let isCluster: boolean = false;
if (e.profile.providerName.toLowerCase() === 'mssql' && !types.isUndefinedOrNull(e.serverInfo) && !types.isUndefinedOrNull(e.serverInfo.engineEditionId)) {
if (isCloudEditions.some(i => i === e.serverInfo.engineEditionId)) {
iscloud = true;
@@ -45,6 +48,13 @@ export default class ContextProvider {
}
edition = e.serverInfo.engineEditionId;
if (!types.isUndefinedOrNull(e.serverInfo.options)) {
let isBigDataCluster = e.serverInfo.options[Constants.isBigDataClusterProperty];
if (isBigDataCluster) {
isCluster = isBigDataCluster;
}
}
}
if (iscloud === true || iscloud === false) {
@@ -54,6 +64,10 @@ export default class ContextProvider {
if (!types.isUndefinedOrNull(edition)) {
setCommandContext(ContextKeys.EDITIONID, edition);
}
if (!types.isUndefinedOrNull(isCluster)) {
setCommandContext(ContextKeys.ISCLUSTER, isCluster);
}
}
dispose(): void {