mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add BDC/Arc welcome views (#11020)
* add BDC/Arc welcome views * remove en-us
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { TreeNode } from './treeNode';
|
||||
import { BdcItemType } from '../constants';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class ConnectControllerNode extends TreeNode {
|
||||
private readonly nodeType: string;
|
||||
|
||||
constructor() {
|
||||
super(localize('textBigDataClusterControllerWithDots', "Connect to SQL Server Big Data Cluster controller..."));
|
||||
this.nodeType = BdcItemType.connectController;
|
||||
}
|
||||
|
||||
public async getChildren(): Promise<TreeNode[]> {
|
||||
return [];
|
||||
}
|
||||
|
||||
public getTreeItem(): vscode.TreeItem {
|
||||
let item = new vscode.TreeItem(this.label, vscode.TreeItemCollapsibleState.None);
|
||||
item.command = {
|
||||
title: localize('textConnectToController', "Connect to Controller"),
|
||||
command: 'bigDataClusters.command.connectController',
|
||||
arguments: [this]
|
||||
};
|
||||
item.contextValue = this.nodeType;
|
||||
return item;
|
||||
}
|
||||
|
||||
public getNodeInfo(): azdata.NodeInfo {
|
||||
return {
|
||||
label: this.label,
|
||||
isLeaf: this.isLeaf,
|
||||
errorMessage: undefined,
|
||||
metadata: undefined,
|
||||
nodePath: this.nodePath,
|
||||
nodeStatus: undefined,
|
||||
nodeType: this.nodeType,
|
||||
iconType: this.nodeType,
|
||||
nodeSubType: undefined
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { TreeNode } from './treeNode';
|
||||
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
|
||||
import { ConnectControllerNode } from './connectControllerNode';
|
||||
import { ControllerRootNode, ControllerNode } from './controllerTreeNode';
|
||||
import { showErrorMessage } from '../utils';
|
||||
import { LoadingControllerNode } from './loadingControllerNode';
|
||||
@@ -79,12 +78,12 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
this.notifyNodeChanged();
|
||||
}
|
||||
|
||||
public deleteController(url: string, auth: AuthType, username: string): ControllerNode[] {
|
||||
let deleted = this.root.deleteControllerNode(url, auth, username);
|
||||
if (deleted) {
|
||||
public removeController(url: string, auth: AuthType, username: string): ControllerNode[] {
|
||||
let removed = this.root.removeControllerNode(url, auth, username);
|
||||
if (removed) {
|
||||
this.notifyNodeChanged();
|
||||
}
|
||||
return deleted;
|
||||
return removed;
|
||||
}
|
||||
|
||||
private removeNonControllerNodes(): void {
|
||||
@@ -95,8 +94,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
private removePlaceholderNodes(nodes: TreeNode[]): void {
|
||||
if (nodes.length > 0) {
|
||||
for (let i = 0; i < nodes.length; ++i) {
|
||||
if (nodes[i] instanceof ConnectControllerNode ||
|
||||
nodes[i] instanceof LoadingControllerNode
|
||||
if (nodes[i] instanceof LoadingControllerNode
|
||||
) {
|
||||
nodes.splice(i--, 1);
|
||||
}
|
||||
@@ -142,11 +140,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
}
|
||||
|
||||
this.root.clearChildren();
|
||||
if (treeNodes.length === 0) {
|
||||
this.root.addChild(new ConnectControllerNode());
|
||||
} else {
|
||||
treeNodes.forEach(node => this.root.addChild(node));
|
||||
}
|
||||
treeNodes.forEach(node => this.root.addChild(node));
|
||||
this.notifyNodeChanged();
|
||||
} catch (err) {
|
||||
// Reset so we can try again if the tree refreshes
|
||||
|
||||
@@ -128,7 +128,7 @@ export class ControllerRootNode extends ControllerTreeNode {
|
||||
}
|
||||
}
|
||||
|
||||
public deleteControllerNode(url: string, auth: AuthType, username: string): ControllerNode[] | undefined {
|
||||
public removeControllerNode(url: string, auth: AuthType, username: string): ControllerNode[] | undefined {
|
||||
if (!url || (auth === 'basic' && !username)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user