mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user