mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add compile options to a few extensions (#8252)
* add compile options to a few extensions * move dep to dev dep * fix return types
This commit is contained in:
@@ -159,6 +159,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/kerberos": "^1.1.0",
|
||||
"@types/request": "^2.48.3",
|
||||
"vscode": "^1.1.36"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,15 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { ClusterController, ControllerError } from '../controller/clusterControllerApi';
|
||||
import { ControllerTreeDataProvider } from '../tree/controllerTreeDataProvider';
|
||||
import { TreeNode } from '../tree/treeNode';
|
||||
import { AuthType } from '../constants';
|
||||
import { ManageControllerCommand } from '../../extension';
|
||||
import { BdcDashboardOptions } from './bdcDashboardModel';
|
||||
import { ControllerNode } from '../tree/controllerTreeNode';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -33,7 +31,7 @@ export class AddControllerDialogModel {
|
||||
private _authTypes: azdata.CategoryValue[];
|
||||
constructor(
|
||||
public treeDataProvider: ControllerTreeDataProvider,
|
||||
public node?: TreeNode,
|
||||
public node?: ControllerNode,
|
||||
public prefilledUrl?: string,
|
||||
public prefilledAuth?: azdata.CategoryValue,
|
||||
public prefilledUsername?: string,
|
||||
|
||||
@@ -192,7 +192,7 @@ export class BdcDashboard extends BdcDashboardPage {
|
||||
* @param serviceName The name of the service to switch to the tab of
|
||||
*/
|
||||
public switchToServiceTab(serviceName: string): void {
|
||||
const tabPageMapping = this.serviceTabPageMapping[serviceName];
|
||||
const tabPageMapping = this.serviceTabPageMapping.get(serviceName);
|
||||
if (!tabPageMapping) {
|
||||
return;
|
||||
}
|
||||
@@ -213,7 +213,7 @@ export class BdcDashboard extends BdcDashboardPage {
|
||||
if (services) {
|
||||
// Add a nav item for each service
|
||||
services.forEach(s => {
|
||||
const existingTabPage = this.serviceTabPageMapping[s.serviceName];
|
||||
const existingTabPage = this.serviceTabPageMapping.get(s.serviceName);
|
||||
if (existingTabPage) {
|
||||
// We've already created the tab and page for this service, just update the tab health status dot
|
||||
existingTabPage.navTab.dot.value = getHealthStatusDot(s.healthStatus);
|
||||
@@ -221,7 +221,7 @@ export class BdcDashboard extends BdcDashboardPage {
|
||||
// New service - create the page and tab
|
||||
const navItem = createServiceNavTab(this.modelView.modelBuilder, s);
|
||||
const serviceStatusPage = new BdcServiceStatusPage(s.serviceName, this.model, this.modelView).container;
|
||||
this.serviceTabPageMapping[s.serviceName] = { navTab: navItem, servicePage: serviceStatusPage };
|
||||
this.serviceTabPageMapping.set(s.serviceName, { navTab: navItem, servicePage: serviceStatusPage });
|
||||
navItem.div.onDidClick(() => {
|
||||
this.switchToServiceTab(s.serviceName);
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ export class BdcServiceStatusPage extends BdcDashboardPage {
|
||||
private createResourceNavTabs(resources: ResourceStatusModel[]) {
|
||||
let tabIndex = this.createdTabs.size;
|
||||
resources.forEach(resource => {
|
||||
const existingTab: ServiceTab = this.createdTabs[resource.resourceName];
|
||||
const existingTab: ServiceTab = this.createdTabs.get(resource.resourceName);
|
||||
if (existingTab) {
|
||||
// We already created this tab so just update the status
|
||||
existingTab.dot.value = getHealthStatusDot(resource.healthStatus);
|
||||
@@ -87,7 +87,7 @@ export class BdcServiceStatusPage extends BdcDashboardPage {
|
||||
// New tab - create and add to the end of the container
|
||||
const currentIndex = tabIndex++;
|
||||
const resourceHeaderTab = createResourceHeaderTab(this.modelView.modelBuilder, resource);
|
||||
this.createdTabs[resource.resourceName] = resourceHeaderTab;
|
||||
this.createdTabs.set(resource.resourceName, resourceHeaderTab);
|
||||
const resourceStatusPage: azdata.FlexContainer = new BdcDashboardResourceStatusPage(this.model, this.modelView, this.serviceName, resource.resourceName).container;
|
||||
resourceHeaderTab.div.onDidClick(() => {
|
||||
// Don't need to do anything if this is already the currently selected tab
|
||||
|
||||
@@ -22,7 +22,7 @@ function convertCredsToJson(creds: string): { credentials: {} } {
|
||||
if (!creds) {
|
||||
return undefined;
|
||||
}
|
||||
let credObj = { 'credentials': {} };
|
||||
let credObj: { 'credentials': { [key: string]: any } } = { 'credentials': {} };
|
||||
let pairs = creds.split(',');
|
||||
let validPairs: string[] = [];
|
||||
for (let i = 0; i < pairs.length; i++) {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { TreeNode } from './treeNode';
|
||||
|
||||
export interface IControllerTreeChangeHandler {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import { TreeNode } from './treeNode';
|
||||
@@ -77,7 +75,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
|
||||
this.notifyNodeChanged();
|
||||
}
|
||||
|
||||
public deleteController(url: string, auth: AuthType, username: string): ControllerNode {
|
||||
public deleteController(url: string, auth: AuthType, username: string): ControllerNode[] {
|
||||
let deleted = this.root.deleteControllerNode(url, auth, username);
|
||||
if (deleted) {
|
||||
this.notifyNodeChanged();
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
|
||||
@@ -129,20 +127,20 @@ export class ControllerRootNode extends ControllerTreeNode {
|
||||
}
|
||||
}
|
||||
|
||||
public deleteControllerNode(url: string, auth: AuthType, username: string): ControllerNode {
|
||||
public deleteControllerNode(url: string, auth: AuthType, username: string): ControllerNode[] | undefined {
|
||||
if (!url || (auth === 'basic' && !username)) {
|
||||
return undefined;
|
||||
}
|
||||
let nodes = this.children as ControllerNode[];
|
||||
let index = nodes.findIndex(e => isControllerMatch(e, url, auth, username));
|
||||
let deleted = undefined;
|
||||
let deleted: ControllerNode[] | undefined;
|
||||
if (index >= 0) {
|
||||
deleted = nodes.splice(index, 1);
|
||||
}
|
||||
return deleted;
|
||||
}
|
||||
|
||||
private getExistingControllerNode(url: string, auth: AuthType, username: string): ControllerNode {
|
||||
private getExistingControllerNode(url: string, auth: AuthType, username: string): ControllerNode | undefined {
|
||||
if (!url || !username) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -169,7 +167,7 @@ export class ControllerNode extends ControllerTreeNode {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public async getChildren(): Promise<ControllerTreeNode[]> {
|
||||
public async getChildren(): Promise<ControllerTreeNode[] | undefined> {
|
||||
if (this.children && this.children.length > 0) {
|
||||
this.clearChildren();
|
||||
}
|
||||
@@ -178,11 +176,12 @@ export class ControllerNode extends ControllerTreeNode {
|
||||
vscode.commands.executeCommand('bigDataClusters.command.addController', this);
|
||||
return this.children as ControllerTreeNode[];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public static toIpAndPort(url: string): string {
|
||||
public static toIpAndPort(url: string): string | undefined {
|
||||
if (!url) {
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
return url.trim().replace(/ /g, '').replace(/^.+\:\/\//, '');
|
||||
}
|
||||
@@ -245,4 +244,3 @@ export class ControllerNode extends ControllerTreeNode {
|
||||
function isControllerMatch(node: ControllerNode, url: string, auth: string, username: string): unknown {
|
||||
return node.url === url && node.auth === auth && node.username === username;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { generateGuid } from '../utils';
|
||||
|
||||
@@ -73,7 +73,7 @@ export function showErrorMessage(error: any, prefixText?: string): void {
|
||||
* Mappings of the different expected state values to their localized friendly names.
|
||||
* These are defined in aris/projects/controller/src/Microsoft.SqlServer.Controller/StateMachines
|
||||
*/
|
||||
const stateToDisplayTextMap = {
|
||||
const stateToDisplayTextMap: { [key: string]: string } = {
|
||||
// K8sScaledSetStateMachine
|
||||
'creating': localize('state.creating', "Creating"),
|
||||
'waiting': localize('state.waiting', "Waiting"),
|
||||
@@ -287,5 +287,3 @@ export function getIgnoreSslVerificationConfigSetting(): boolean {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -156,14 +154,14 @@ async function lookupController(explorerContext?: azdata.ObjectExplorerContext):
|
||||
}
|
||||
|
||||
function addBdcController(treeDataProvider: ControllerTreeDataProvider, node?: TreeNode): void {
|
||||
let model = new AddControllerDialogModel(treeDataProvider, node);
|
||||
let model = new AddControllerDialogModel(treeDataProvider, node as ControllerNode);
|
||||
let dialog = new AddControllerDialog(model);
|
||||
dialog.showDialog();
|
||||
}
|
||||
|
||||
async function deleteBdcController(treeDataProvider: ControllerTreeDataProvider, node: TreeNode): Promise<boolean> {
|
||||
async function deleteBdcController(treeDataProvider: ControllerTreeDataProvider, node: TreeNode): Promise<boolean | undefined> {
|
||||
if (!node && !(node instanceof ControllerNode)) {
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let controllerNode = node as ControllerNode;
|
||||
|
||||
@@ -15,10 +15,7 @@
|
||||
"./node_modules/@types"
|
||||
],
|
||||
"strict": false,
|
||||
"noImplicitAny": false,
|
||||
"noUnusedParameters": false,
|
||||
"noImplicitReturns": false,
|
||||
"noUnusedLocals": false,
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
|
||||
@@ -2,11 +2,36 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/caseless@*":
|
||||
version "0.12.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8"
|
||||
integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==
|
||||
|
||||
"@types/kerberos@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/kerberos/-/kerberos-1.1.0.tgz#fb1e5bc4f7272d152f67714deb100d5de7cb3e48"
|
||||
integrity sha512-ixpV6PSSMnIVpMNCLQ0gWguC2+pBxc0LeUCv9Ugj54opVSVFXfPNYP6sMa7UHvicYGDXAyHQSAzQC8VYEIgdFQ==
|
||||
|
||||
"@types/node@*":
|
||||
version "12.12.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.6.tgz#a47240c10d86a9a57bb0c633f0b2e0aea9ce9253"
|
||||
integrity sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==
|
||||
|
||||
"@types/request@^2.48.3":
|
||||
version "2.48.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.3.tgz#970b8ed2317568c390361d29c555a95e74bd6135"
|
||||
integrity sha512-3Wo2jNYwqgXcIz/rrq18AdOZUQB8cQ34CXZo+LUwPJNpvRAL86+Kc2wwI8mqpz9Cr1V+enIox5v+WZhy/p3h8w==
|
||||
dependencies:
|
||||
"@types/caseless" "*"
|
||||
"@types/node" "*"
|
||||
"@types/tough-cookie" "*"
|
||||
form-data "^2.5.0"
|
||||
|
||||
"@types/tough-cookie@*":
|
||||
version "2.3.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.5.tgz#9da44ed75571999b65c37b60c9b2b88db54c585d"
|
||||
integrity sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg==
|
||||
|
||||
agent-base@4, agent-base@^4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee"
|
||||
@@ -285,6 +310,15 @@ forever-agent@~0.6.1:
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
|
||||
|
||||
form-data@^2.5.0:
|
||||
version "2.5.1"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4"
|
||||
integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
form-data@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
|
||||
|
||||
Reference in New Issue
Block a user