Part 2 - Make Model view components disposable + dispose all emitters (#24097)

This commit is contained in:
Cheena Malhotra 2023-08-23 12:46:09 -07:00 коммит произвёл GitHub
Родитель 25a658775c
Коммит 6c6464e772
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
58 изменённых файлов: 435 добавлений и 195 удалений

Просмотреть файл

@ -117,7 +117,7 @@
"mocha": "^7.1.1",
"should": "^13.2.3",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
},
"__metadata": {
"id": "41",

Просмотреть файл

@ -203,10 +203,10 @@
tmp "^0.0.33"
yauzl "^2.10.0"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -94,7 +94,7 @@
"should": "^13.2.1",
"typemoq": "^2.1.0",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
},
"__metadata": {
"id": "10",

Просмотреть файл

@ -182,10 +182,10 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -886,8 +886,7 @@
"defaultValue": "2",
"optionsType": "radio"
},
"dynamicOptions":
{
"dynamicOptions": {
"target": "AZDATA_NB_VAR_SQL_REPLICAS",
"alternates": [
{
@ -949,8 +948,7 @@
"defaultValue": "-1",
"optionsType": "radio"
},
"dynamicOptions":
{
"dynamicOptions": {
"target": "AZDATA_NB_VAR_SQL_REPLICAS",
"alternates": [
{
@ -1414,7 +1412,10 @@
"type": "options",
"required": true,
"options": {
"values": ["NodePort", "LoadBalancer"],
"values": [
"NodePort",
"LoadBalancer"
],
"defaultValue": "NodePort",
"optionsType": "radio"
}
@ -1599,7 +1600,7 @@
"@types/sinon": "^9.0.4",
"@types/uuid": "^8.3.0",
"@types/yamljs": "^0.2.31",
"@microsoft/azdata-test": "^3.0.1",
"@microsoft/azdata-test": "^3.0.3",
"mocha": "^7.1.1",
"should": "^13.2.3",
"sinon": "^9.0.2",

Просмотреть файл

@ -182,10 +182,10 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -107,7 +107,7 @@
"sinon": "^9.0.2",
"typemoq": "^2.1.0",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
},
"__metadata": {
"id": "84",

Просмотреть файл

@ -181,10 +181,10 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -122,8 +122,11 @@
"items": {
"type": "object",
"description": "%config.providerSettingsTitle%",
"required": ["name", "settings"],
"properties":{
"required": [
"name",
"settings"
],
"properties": {
"name": {
"type": "string",
"default": "Azure Public",
@ -132,11 +135,16 @@
"settings": {
"type": "object",
"description": "%config.providerSettingsDescription%",
"required": ["metadata"],
"required": [
"metadata"
],
"properties": {
"metadata": {
"type": "object",
"required": ["displayName", "id"],
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"type": "string",
@ -150,7 +158,16 @@
},
"endpoints": {
"type": "object",
"required": ["host", "clientId", "scopes", "sqlResource", "microsoftResource", "armResource", "graphResource", "azureStorageResource"],
"required": [
"host",
"clientId",
"scopes",
"sqlResource",
"microsoftResource",
"armResource",
"graphResource",
"azureStorageResource"
],
"properties": {
"type": "object",
"host": {
@ -516,8 +533,8 @@
"ws": "^7.4.6"
},
"devDependencies": {
"@microsoft/azdata-test": "^3.0.1",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.3",
"@types/keytar": "4.4.0",
"@types/lockfile": "^1.0.2",
"@types/mocha": "^7.0.2",

Просмотреть файл

@ -334,10 +334,10 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -787,7 +787,7 @@
"should": "^13.2.1",
"@microsoft/vscodetestcover": "^1.2.2",
"typemoq": "^2.1.0",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
},
"__metadata": {
"id": "40",

Просмотреть файл

@ -182,10 +182,10 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -97,8 +97,8 @@
"vscode-nls": "^4.0.0"
},
"devDependencies": {
"@microsoft/azdata-test": "^3.0.1",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.3",
"@types/htmlparser2": "^3.10.1",
"@types/mocha": "^7.0.2",
"@types/node": "^12.11.7",

Просмотреть файл

@ -82,7 +82,8 @@ export function createViewContext(): ViewTestContext {
onValidityChanged: undefined!,
valid: true,
validate: undefined!,
focus: () => Promise.resolve()
focus: () => Promise.resolve(),
dispose() { }
};
let button: azdata.ButtonComponent = Object.assign({}, componentBase, {
onDidClick: onClick.event
@ -283,6 +284,7 @@ export function createViewContext(): ViewTestContext {
onValidityChanged: undefined!,
validate: undefined!,
initializeModel: () => { return Promise.resolve(); },
dispose() { },
modelBuilder: {
listView: undefined!,
radioCardGroup: undefined!,

Просмотреть файл

@ -189,10 +189,10 @@
dependencies:
"@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -190,6 +190,6 @@
"sinon": "^9.0.2",
"typemoq": "^2.1.0",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
}
}

Просмотреть файл

@ -189,10 +189,10 @@
dependencies:
"@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -111,8 +111,8 @@
"vscode-nls": "^5.2.0"
},
"devDependencies": {
"@microsoft/azdata-test": "^3.0.2",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.3",
"should": "^13.2.1",
"typemoq": "^2.1.0"
}

Просмотреть файл

@ -115,7 +115,7 @@ export class MockWizardPage implements azdata.window.WizardPage {
modelView: azdata.ModelView;
valid: boolean;
onValidityChanged: vscode.Event<boolean>;
dispose() { }
registerContent(handler: (view: azdata.ModelView) => void): void {
throw new Error('Method not implemented.');
}
@ -221,6 +221,18 @@ export class MockDataSourceService implements DataSourceWizardService {
}
export class MockUIComponent implements azdata.Component {
height?: string | number;
width?: string | number;
position?: azdata.PositionType;
display?: azdata.DisplayType;
ariaLabel?: string;
ariaRole?: string;
ariaSelected?: boolean;
ariaHidden?: boolean;
CSSStyles?: azdata.CssStyles;
dispose() {
throw new Error('Method not implemented.');
}
id: string;
enabled: boolean;
onValidityChanged: vscode.Event<boolean>;
@ -245,6 +257,17 @@ export class MockUIComponent implements azdata.Component {
}
export class MockInputBoxComponent extends MockUIComponent implements azdata.InputBoxComponent {
display?: azdata.DisplayType;
ariaRole?: string;
ariaSelected?: boolean;
ariaHidden?: boolean;
dispose() {
throw new Error('Method not implemented.');
}
validationErrorMessage?: string;
readOnly?: boolean;
title?: string;
maxLength?: number;
onEnterKeyPressed: vscode.Event<string>;
value?: string;
ariaLabel?: string;
@ -266,6 +289,25 @@ export class MockInputBoxComponent extends MockUIComponent implements azdata.Inp
}
export class MockDropdownComponent extends MockUIComponent implements azdata.DropDownComponent {
position?: azdata.PositionType;
display?: azdata.DisplayType;
ariaLabel?: string;
ariaRole?: string;
ariaSelected?: boolean;
ariaHidden?: boolean;
CSSStyles?: azdata.CssStyles;
dispose() {
throw new Error('Method not implemented.');
}
fireOnTextChange?: boolean;
required?: boolean;
placeholder?: string;
validationErrorMessages?: string[];
strictSelection?: boolean;
loading?: boolean;
showText?: boolean;
loadingText?: string;
loadingCompletedText?: string;
onValueChanged: vscode.Event<any>;
value: string | azdata.CategoryValue;
values: string[] | azdata.CategoryValue[];
@ -275,6 +317,9 @@ export class MockDropdownComponent extends MockUIComponent implements azdata.Dro
}
export class MockTableComponent extends MockUIComponent implements azdata.TableComponent {
dispose() {
throw new Error('Method not implemented.');
}
display?: azdata.DisplayType;
ariaLabel?: string;
ariaSelected?: boolean;
@ -307,6 +352,9 @@ export class MockTableComponent extends MockUIComponent implements azdata.TableC
}
export class MockDeclarativeTableComponent extends MockUIComponent implements azdata.DeclarativeTableComponent {
dispose() {
throw new Error('Method not implemented.');
}
enableRowSelection?: boolean;
selectedRow?: number;
onRowSelected: vscode.Event<azdata.DeclarativeTableRowSelectedEvent>;
@ -333,6 +381,16 @@ export class MockDeclarativeTableComponent extends MockUIComponent implements az
}
export class MockTreeComponent extends MockUIComponent implements azdata.TreeComponent<any> {
position?: azdata.PositionType;
display?: azdata.DisplayType;
ariaLabel?: string;
ariaRole?: string;
ariaSelected?: boolean;
ariaHidden?: boolean;
CSSStyles?: azdata.CssStyles;
dispose() {
throw new Error('Method not implemented.');
}
withCheckbox: boolean;
height?: number | string;
width?: number | string;
@ -349,6 +407,25 @@ export class MockTreeComponentView extends vscode.Disposable implements azdata.T
}
export class MockTextComponent extends MockUIComponent implements azdata.TextComponent {
height?: string | number;
width?: string | number;
position?: azdata.PositionType;
display?: azdata.DisplayType;
ariaLabel?: string;
ariaRole?: string;
ariaSelected?: boolean;
ariaHidden?: boolean;
CSSStyles?: azdata.CssStyles;
dispose() {
throw new Error('Method not implemented.');
}
links?: azdata.LinkArea[];
description?: string;
requiredIndicator?: boolean;
headingLevel?: azdata.HeadingLevel;
textType?: azdata.TextType;
ariaLive?: azdata.AriaLiveValue;
title?: string;
value: string;
id: string;
enabled: boolean;
@ -358,6 +435,9 @@ export class MockTextComponent extends MockUIComponent implements azdata.TextCom
}
export class MockContainer<TLayout, TItemLayout> extends MockUIComponent implements azdata.Container<TLayout, TItemLayout> {
dispose() {
throw new Error('Method not implemented.');
}
setItemLayout(component: azdata.Component, layout: TItemLayout): void {
throw new Error('Method not implemented.');
}
@ -391,6 +471,9 @@ export class MockContainer<TLayout, TItemLayout> extends MockUIComponent impleme
}
}
export class MockToolbarContainer extends MockContainer<any, any> implements azdata.ToolbarContainer {
dispose() {
throw new Error('Method not implemented.');
}
setItemLayout(component: azdata.Component, layout: any): void {
throw new Error('Method not implemented.');
}
@ -406,6 +489,10 @@ export class MockToolbarContainer extends MockContainer<any, any> implements azd
}
export class MockDivContainer extends MockContainer<azdata.DivLayout, azdata.DivItemLayout> implements azdata.DivContainer {
dispose() {
throw new Error('Method not implemented.');
}
ariaLive?: azdata.AriaLiveValue;
setItemLayout(component: azdata.Component, layout: azdata.DivItemLayout): void {
throw new Error('Method not implemented.');
}
@ -425,6 +512,9 @@ export class MockDivContainer extends MockContainer<azdata.DivLayout, azdata.Div
}
export class MockFlexContainer extends MockContainer<azdata.FlexLayout, azdata.FlexItemLayout> implements azdata.FlexContainer {
dispose() {
throw new Error('Method not implemented.');
}
setItemLayout(component: azdata.Component, layout: azdata.FlexItemLayout): void {
throw new Error('Method not implemented.');
}
@ -440,6 +530,9 @@ export class MockFlexContainer extends MockContainer<azdata.FlexLayout, azdata.F
}
export class MockFormContainer extends MockContainer<azdata.FormLayout, azdata.FormItemLayout> implements azdata.FormContainer {
dispose() {
throw new Error('Method not implemented.');
}
setItemLayout(component: azdata.Component, layout: azdata.FormItemLayout): void {
throw new Error('Method not implemented.');
}
@ -455,6 +548,21 @@ export class MockFormContainer extends MockContainer<azdata.FormLayout, azdata.F
}
export class MockLoadingComponent extends MockUIComponent implements azdata.LoadingComponent {
height?: string | number;
width?: string | number;
position?: azdata.PositionType;
display?: azdata.DisplayType;
ariaLabel?: string;
ariaRole?: string;
ariaSelected?: boolean;
ariaHidden?: boolean;
CSSStyles?: azdata.CssStyles;
dispose() {
throw new Error('Method not implemented.');
}
showText?: boolean;
loadingText?: string;
loadingCompletedText?: string;
loading: boolean;
component: azdata.Component;
}
@ -588,6 +696,9 @@ export class MockModelBuilder implements azdata.ModelBuilder {
}
export class MockModelViewEditor implements azdata.workspace.ModelViewEditor {
dispose() {
throw new Error('Method not implemented.');
}
contentHandler: (view: azdata.ModelView) => void;
saveHandler: () => Thenable<boolean>;
openEditor(position?: vscode.ViewColumn): Thenable<void> {
@ -606,6 +717,9 @@ export class MockModelViewEditor implements azdata.workspace.ModelViewEditor {
}
export class MockModelView implements azdata.ModelView {
dispose() {
throw new Error('Method not implemented.');
}
private onClosedEmitter = new vscode.EventEmitter<any>();
public get onClosed(): vscode.Event<any> {
return this.onClosedEmitter.event;
@ -634,6 +748,20 @@ export class MockModelView implements azdata.ModelView {
}
export class MockButtonComponent extends MockUIComponent implements azdata.ButtonComponent {
position?: azdata.PositionType;
display?: azdata.DisplayType;
ariaLabel?: string;
ariaRole?: string;
ariaSelected?: boolean;
ariaHidden?: boolean;
CSSStyles?: azdata.CssStyles;
dispose() {
throw new Error('Method not implemented.');
}
buttonType?: azdata.ButtonType;
description?: string;
secondary?: boolean;
fileType?: string;
label: string;
title: string;
iconPath: string | vscode.Uri | { light: string | vscode.Uri; dark: string | vscode.Uri; };
@ -650,6 +778,17 @@ export class MockButtonComponent extends MockUIComponent implements azdata.Butto
}
export class MockEditorComponent extends MockUIComponent implements azdata.EditorComponent {
height?: string | number;
width?: string | number;
position?: azdata.PositionType;
display?: azdata.DisplayType;
ariaLabel?: string;
ariaRole?: string;
ariaSelected?: boolean;
ariaHidden?: boolean;
dispose() {
throw new Error('Method not implemented.');
}
content: string;
languageMode: string;
editorUri: string;

Просмотреть файл

@ -227,10 +227,10 @@
tmp "^0.0.33"
yauzl "^2.10.0"
"@microsoft/azdata-test@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.2.tgz#71cfbbc2ee9c1805311f3a5828b50679a5e6d73c"
integrity sha512-NMoSKp/Zgs+1ZIe07w+FeKhqMaxgViLGmLTQHPfYN7RRTFErJBd8JgskxYoLZbgcctfVsV+Yw+zQEn1+g2mPKg==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -92,7 +92,7 @@
"sinon": "^9.0.2",
"typemoq": "^2.1.0",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
},
"__metadata": {
"id": "23",

Просмотреть файл

@ -203,10 +203,10 @@
tmp "^0.0.33"
yauzl "^2.10.0"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -42,7 +42,7 @@
"chai": "3.5.0",
"mocha": "^7.1.1",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
},
"resolutions": {
"jsonwebtoken": "9.0.0"

Просмотреть файл

@ -354,10 +354,10 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -153,7 +153,7 @@
"should": "^13.2.1",
"typemoq": "^2.1.0",
"lodash": "^4.17.21",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
},
"__metadata": {
"id": "65",

Просмотреть файл

@ -27,7 +27,8 @@ export function createViewContext(): ViewTestContext {
onValidityChanged: undefined!,
valid: true,
validate: undefined!,
focus: undefined!
focus: undefined!,
dispose() { }
};
let button: azdata.ButtonComponent = Object.assign({}, componentBase, {
onDidClick: onClick.event
@ -266,7 +267,8 @@ export function createViewContext(): ViewTestContext {
infoBox: undefined!,
slider: undefined!,
executionPlan: undefined!,
}
},
dispose() { }
};
let tab: azdata.window.DialogTab = {
title: '',
@ -280,7 +282,8 @@ export function createViewContext(): ViewTestContext {
},
onValidityChanged: undefined!,
valid: true,
modelView: undefined!
modelView: undefined!,
dispose() { }
};
let dialogButton: azdata.window.Button = {
@ -310,7 +313,8 @@ export function createViewContext(): ViewTestContext {
valid: true,
loading: false,
loadingText: '',
loadingCompletedText: ''
loadingCompletedText: '',
dispose() { }
};
let wizard: azdata.window.Wizard = {
title: '',
@ -351,7 +355,8 @@ export function createViewContext(): ViewTestContext {
}
},
modelView: undefined!,
valid: true
valid: true,
dispose() { }
};
apiWrapper.setup(x => x.createButton(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => dialogButton);
apiWrapper.setup(x => x.createTab(TypeMoq.It.isAny())).returns(() => tab);

Просмотреть файл

@ -230,10 +230,10 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -1566,7 +1566,7 @@
"devDependencies": {
"@types/mocha": "^7.0.2",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.1",
"@microsoft/azdata-test": "^3.0.3",
"mocha": "^7.1.1",
"should": "^13.2.3",
"typemoq": "^2.1.0"

Просмотреть файл

@ -81,6 +81,7 @@ export abstract class DialogBase<DialogResult> {
this.dialogObject.registerContent(async view => {
this._modelView = view;
this._formContainer = this.createFormContainer([]);
this.disposables.push(this._formContainer);
this._loadingComponent = view.modelBuilder.loadingComponent().withItem(this._formContainer).withProps({
loading: true,
loadingText: uiLoc.LoadingDialogText,

Просмотреть файл

@ -203,10 +203,10 @@
tmp "^0.0.33"
yauzl "^2.10.0"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -700,7 +700,7 @@
"sinon": "^9.0.2",
"typemoq": "^2.1.0",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
},
"resolutions": {
"url-parse": "^1.5.8",

Просмотреть файл

@ -335,6 +335,7 @@ class TestComponentBase implements azdata.Component {
focus(): Thenable<void> {
return Promise.resolve();
}
dispose() { }
}
export class TestDropdownComponent extends TestComponentBase implements azdata.DropDownComponent {
@ -528,6 +529,7 @@ export function createViewContext(): TestContext {
onValidityChanged: undefined!,
validate: undefined!,
initializeModel: () => { return Promise.resolve(); },
dispose() { },
modelBuilder: <azdata.ModelBuilder>{
radioButton: () => radioButtonBuilder,
text: () => textBuilder,

Просмотреть файл

@ -127,7 +127,8 @@ describe('Manage Package Dialog', () => {
onValidityChanged: undefined!,
valid: true,
validate: undefined!,
focus: undefined!
focus: undefined!,
dispose() { }
};
let button: azdata.ButtonComponent = Object.assign({}, componentBase, {
onDidClick: onClick.event
@ -269,6 +270,7 @@ describe('Manage Package Dialog', () => {
onValidityChanged: undefined!,
validate: undefined!,
initializeModel: () => { return Promise.resolve(); },
dispose() { },
modelBuilder: {
listView: undefined!,
radioCardGroup: undefined!,

Просмотреть файл

@ -228,10 +228,10 @@
dependencies:
"@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -25,7 +25,7 @@
"supported": true
}
},
"extensionDependencies": [ ],
"extensionDependencies": [],
"contributes": {
"configuration": [
{
@ -212,8 +212,8 @@
"vscode-nls": "^4.1.2"
},
"devDependencies": {
"@microsoft/azdata-test": "^3.0.1",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.3",
"@types/mocha": "^7.0.2",
"@types/node": "^12.11.7",
"should": "^13.2.3",

Просмотреть файл

@ -235,10 +235,10 @@
dependencies:
"@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -44,20 +44,17 @@
}
],
"menus": {
"objectExplorer/item/context": [
],
"dataExplorer/context": [
],
"commandPalette": [
]
"objectExplorer/item/context": [],
"dataExplorer/context": [],
"commandPalette": []
}
},
"dependencies": {
"vscode-nls": "^4.0.0"
},
"devDependencies": {
"@microsoft/azdata-test": "^3.0.1",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.3",
"@types/mocha": "^7.0.2",
"should": "^13.2.1",
"typemoq": "^2.1.0"

Просмотреть файл

@ -19,7 +19,8 @@ export function createViewContext(): TestContext {
onValidityChanged: undefined!,
valid: true,
validate: undefined!,
focus: undefined!
focus: undefined!,
dispose() { }
};
const components: azdata.Component[] = [];
@ -67,6 +68,7 @@ export function createViewContext(): TestContext {
onValidityChanged: undefined!,
validate: undefined!,
initializeModel: () => { return Promise.resolve(); },
dispose() { },
modelBuilder: {
listView: undefined!,
radioCardGroup: undefined!,

Просмотреть файл

@ -233,10 +233,10 @@
"@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14"
"@microsoft/azdata-test@^3.0.1":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.2.tgz#71cfbbc2ee9c1805311f3a5828b50679a5e6d73c"
integrity sha512-NMoSKp/Zgs+1ZIe07w+FeKhqMaxgViLGmLTQHPfYN7RRTFErJBd8JgskxYoLZbgcctfVsV+Yw+zQEn1+g2mPKg==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -538,7 +538,7 @@
"@types/semver": "^7.3.1",
"@types/sinon": "^9.0.8",
"@types/yamljs": "0.2.30",
"@microsoft/azdata-test": "^3.0.2",
"@microsoft/azdata-test": "^3.0.3",
"mocha": "^7.1.1",
"should": "^13.2.3",
"sinon": "^9.2.0",

Просмотреть файл

@ -196,10 +196,10 @@
dependencies:
"@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.2.tgz#71cfbbc2ee9c1805311f3a5828b50679a5e6d73c"
integrity sha512-NMoSKp/Zgs+1ZIe07w+FeKhqMaxgViLGmLTQHPfYN7RRTFErJBd8JgskxYoLZbgcctfVsV+Yw+zQEn1+g2mPKg==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -115,8 +115,8 @@
"vscode-nls": "^4.0.0"
},
"devDependencies": {
"@microsoft/azdata-test": "^3.0.1",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.3",
"@types/mocha": "^7.0.2",
"@types/node": "^12.11.7",
"@types/sinon": "^9.0.4",

Просмотреть файл

@ -81,7 +81,8 @@ export function createViewContext(): ViewTestContext {
onValidityChanged: undefined!,
valid: true,
validate: undefined!,
focus: () => Promise.resolve()
focus: () => Promise.resolve(),
dispose() { }
};
let container = {
@ -325,6 +326,7 @@ export function createViewContext(): ViewTestContext {
onValidityChanged: undefined!,
validate: undefined!,
initializeModel: () => { return Promise.resolve(); },
dispose() { },
modelBuilder: {
listView: undefined!,
radioCardGroup: undefined!,

Просмотреть файл

@ -189,10 +189,10 @@
dependencies:
"@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -79,6 +79,6 @@
"typemoq": "^2.1.0",
"@microsoft/vscodetestcover": "^1.2.2",
"mocha": "^7.1.1",
"@microsoft/azdata-test": "^3.0.1"
"@microsoft/azdata-test": "^3.0.3"
}
}

Просмотреть файл

@ -229,10 +229,10 @@
dependencies:
"@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

Просмотреть файл

@ -542,8 +542,8 @@
"xml-formatter": "2.1.0"
},
"devDependencies": {
"@microsoft/azdata-test": "^3.0.1",
"@microsoft/vscodetestcover": "^1.2.2",
"@microsoft/azdata-test": "^3.0.3",
"@types/fs-extra": "^5.0.0",
"@types/mocha": "^7.0.2",
"@types/request": "^2.48.8",

Просмотреть файл

@ -229,10 +229,10 @@
dependencies:
"@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw==
"@microsoft/azdata-test@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.3.tgz#a1b5bbead5412ac7925129e6199d724bfc8117ee"
integrity sha512-Whit8+MpNN/Kkx3R9CGT26FhYNzkjNyOb6dsaqkMq1scpO3JCeNJqhcSqTTsSbkRVdAKoYrJcpLZdoO9D1X/yw==
dependencies:
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"

3
src/sql/azdata.d.ts поставляемый
Просмотреть файл

@ -4895,6 +4895,9 @@ declare module 'azdata' {
/**
* Register model view content for the dialog.
* Doesn't do anything if model view is already registered
*
* IMPORTANT: Model View is a disposable, all components created in the model view
* MUST be registered for disposal using the 'vscode.Disposable._register' API on ModelView.
*/
registerContent(handler: (view: ModelView) => Thenable<void>): void;

18
src/sql/azdata.proposed.d.ts поставляемый
Просмотреть файл

@ -661,6 +661,8 @@ declare module 'azdata' {
type?: ExtensionNodeType;
}
export interface Component extends vscode.Disposable { }
export namespace workspace {
/**
* Creates and enters a workspace at the specified location
@ -1971,12 +1973,18 @@ declare module 'azdata' {
NotEndsWith = 13
}
export namespace window {
export interface Wizard extends LoadingComponentBase {
}
export interface ModelView extends vscode.Disposable { }
export interface Dialog extends LoadingComponentBase {
}
export interface DeclarativeTableMenuCellValue extends vscode.Disposable { }
export namespace window {
export interface Wizard extends LoadingComponentBase { }
export interface Dialog extends LoadingComponentBase, vscode.Disposable { }
export interface ModelViewPanel extends vscode.Disposable { }
export interface ModelViewDashboard extends vscode.Disposable { }
/**
* Opens the error dialog with customization options provided.

Просмотреть файл

@ -20,6 +20,7 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'
import { ILogService } from 'vs/platform/log/common/log';
import { onUnexpectedError } from 'vs/base/common/errors';
import { SqlMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/base/common/lifecycle';
class ModelBuilderImpl implements azdata.ModelBuilder {
private nextComponentId: number;
@ -594,16 +595,16 @@ class InternalItemConfig {
}
}
class ComponentWrapper implements azdata.Component {
class ComponentWrapper extends Disposable implements azdata.Component {
public properties: { [key: string]: any } = {};
public layout: any;
public itemConfigs: InternalItemConfig[];
public customValidations: ((component: ThisType<ComponentWrapper>) => boolean | Thenable<boolean>)[] = [];
private _valid: boolean = true;
private _onValidityChangedEmitter = new Emitter<boolean>();
private _onValidityChangedEmitter = this._register(new Emitter<boolean>());
public readonly onValidityChanged = this._onValidityChangedEmitter.event;
private _onErrorEmitter = new Emitter<Error>();
private _onErrorEmitter = this._register(new Emitter<Error>());
public readonly onError: vscode.Event<Error> = this._onErrorEmitter.event;
protected _emitterMap = new Map<ComponentEventType, Emitter<any>>();
@ -613,10 +614,17 @@ class ComponentWrapper implements azdata.Component {
protected _id: string,
protected _logService: ILogService
) {
super();
this.properties = {};
this.itemConfigs = [];
}
public getRegisteredEmitter<T>(): Emitter<T> {
let emitter = new Emitter<T>();
this._register(emitter);
return emitter;
}
public get id(): string {
return this._id;
}
@ -729,6 +737,7 @@ class ComponentWrapper implements azdata.Component {
this._logService.warn(`Trying to add duplicate component ${item.id} to container ${this.id}`);
return false;
}
this._register(item);
return true;
});
if (items.length === 0) {
@ -769,6 +778,7 @@ class ComponentWrapper implements azdata.Component {
this._logService.warn(`Trying to add duplicate component ${item.id} to container ${this.id}`);
return;
}
this._register(item);
const config = this.createAndAddItemConfig(item, itemLayout, index);
this._proxy.$addToContainer(this._handle, this.id, [{ itemConfig: config.toIItemConfig(), index }]).then(undefined, (err) => this.handleError(err));
}
@ -784,6 +794,7 @@ class ComponentWrapper implements azdata.Component {
if (!itemImpl) {
throw new Error(nls.localize('unknownComponentType', "Unknown component type. Must use ModelBuilder to create objects"));
}
this._register(itemImpl);
const config = new InternalItemConfig(itemImpl, itemLayout);
if (index !== undefined && index >= 0 && index <= this.items.length) {
this.itemConfigs.splice(index, 0, config);
@ -932,7 +943,7 @@ class CardWrapper extends ComponentWrapper implements azdata.CardComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.Card, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidClick, this.getRegisteredEmitter<any>());
}
public get label(): string {
@ -1001,8 +1012,8 @@ class InputBoxWrapper extends ComponentWrapper implements azdata.InputBoxCompone
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.InputBox, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onEnterKeyPressed, new Emitter<string>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<any>());
this._emitterMap.set(ComponentEventType.onEnterKeyPressed, this.getRegisteredEmitter<string>());
}
public get value(): string {
@ -1113,7 +1124,7 @@ class CheckBoxWrapper extends ComponentWrapper implements azdata.CheckBoxCompone
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.CheckBox, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<any>());
}
public get checked(): boolean {
@ -1142,7 +1153,7 @@ class WebViewWrapper extends ComponentWrapper implements azdata.WebViewComponent
this.properties = {
'extensionLocation': this._extensionLocation
};
this._emitterMap.set(ComponentEventType.onMessage, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onMessage, this.getRegisteredEmitter<any>());
}
public get message(): any {
@ -1176,8 +1187,8 @@ class EditorWrapper extends ComponentWrapper implements azdata.EditorComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.Editor, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onComponentCreated, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<any>());
this._emitterMap.set(ComponentEventType.onComponentCreated, this.getRegisteredEmitter<any>());
}
public get content(): string {
@ -1229,8 +1240,8 @@ class DiffEditorWrapper extends ComponentWrapper implements azdata.DiffEditorCom
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.DiffEditor, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onComponentCreated, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<any>());
this._emitterMap.set(ComponentEventType.onComponentCreated, this.getRegisteredEmitter<any>());
}
public get contentLeft(): string {
@ -1316,8 +1327,8 @@ class RadioButtonWrapper extends ComponentWrapper implements azdata.RadioButtonC
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.RadioButton, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<boolean>());
this._emitterMap.set(ComponentEventType.onDidClick, this.getRegisteredEmitter<any>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<boolean>());
}
public get name(): string {
@ -1422,8 +1433,8 @@ class TableComponentWrapper extends ComponentWrapper implements azdata.TableComp
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.Table, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onSelectedRowChanged, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onCellAction, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onSelectedRowChanged, this.getRegisteredEmitter<any>());
this._emitterMap.set(ComponentEventType.onCellAction, this.getRegisteredEmitter<any>());
}
public get data(): any[][] {
@ -1522,7 +1533,7 @@ class DropDownWrapper extends ComponentWrapper implements azdata.DropDownCompone
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.DropDown, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<any>());
}
public get value(): string | azdata.CategoryValue {
@ -1600,8 +1611,8 @@ class DeclarativeTableWrapper extends ComponentWrapper implements azdata.Declara
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.DeclarativeTable, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onSelectedRowChanged, new Emitter<azdata.DeclarativeTableRowSelectedEvent>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<any>());
this._emitterMap.set(ComponentEventType.onSelectedRowChanged, this.getRegisteredEmitter<azdata.DeclarativeTableRowSelectedEvent>());
}
@ -1736,7 +1747,7 @@ class ListBoxWrapper extends ComponentWrapper implements azdata.ListBoxComponent
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.ListBox, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onSelectedRowChanged, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onSelectedRowChanged, this.getRegisteredEmitter<any>());
}
public get selectedRow(): number {
@ -1764,7 +1775,7 @@ class ButtonWrapper extends ComponentWithIconWrapper implements azdata.ButtonCom
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.Button, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidClick, this.getRegisteredEmitter<any>());
}
public get label(): string {
@ -1841,7 +1852,7 @@ class FileBrowserTreeComponentWrapper extends ComponentWrapper implements azdata
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.FileBrowserTree, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<any>());
}
public get ownerUri(): string {
@ -1868,7 +1879,7 @@ class DivContainerWrapper extends ComponentWrapper implements azdata.DivContaine
constructor(proxy: MainThreadModelViewShape, handle: number, type: ModelComponentTypes, id: string, logService: ILogService) {
super(proxy, handle, type, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidClick, this.getRegisteredEmitter<any>());
}
public get overflowY(): string {
@ -1920,7 +1931,7 @@ class HyperlinkComponentWrapper extends ComponentWrapper implements azdata.Hyper
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.Hyperlink, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidClick, this.getRegisteredEmitter<any>());
}
public get label(): string {
@ -1948,8 +1959,8 @@ class RadioCardGroupComponentWrapper extends ComponentWrapper implements azdata.
super(proxy, handle, ModelComponentTypes.RadioCardGroup, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<azdata.RadioCardSelectionChangedEvent>());
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<azdata.RadioCardLinkClickEvent>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<azdata.RadioCardSelectionChangedEvent>());
this._emitterMap.set(ComponentEventType.onDidClick, this.getRegisteredEmitter<azdata.RadioCardLinkClickEvent>());
}
public get iconWidth(): string | undefined {
@ -2023,7 +2034,7 @@ class ListViewComponentWrapper extends ComponentWrapper implements azdata.ListVi
super(proxy, handle, ModelComponentTypes.ListView, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<azdata.ListViewClickEvent>());
this._emitterMap.set(ComponentEventType.onDidClick, this.getRegisteredEmitter<azdata.ListViewClickEvent>());
}
public get title(): azdata.ListViewTitle {
@ -2059,7 +2070,7 @@ class TabbedPanelComponentWrapper extends ComponentWrapper implements azdata.Tab
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.TabbedPanel, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<string>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<string>());
}
updateTabs(tabs: (azdata.Tab | azdata.TabGroup)[]): void {
@ -2112,8 +2123,8 @@ class InfoBoxComponentWrapper extends ComponentWrapper implements azdata.InfoBox
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.InfoBox, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onChildClick, new Emitter<any>());
this._emitterMap.set(ComponentEventType.onDidClick, this.getRegisteredEmitter<any>());
this._emitterMap.set(ComponentEventType.onChildClick, this.getRegisteredEmitter<any>());
}
public get style(): azdata.InfoBoxStyle {
@ -2179,8 +2190,8 @@ class SliderComponentWrapper extends ComponentWrapper implements azdata.SliderCo
constructor(proxy: MainThreadModelViewShape, handle: number, id: string, logService: ILogService) {
super(proxy, handle, ModelComponentTypes.Slider, id, logService);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<number>());
this._emitterMap.set(ComponentEventType.onInput, new Emitter<number>());
this._emitterMap.set(ComponentEventType.onDidChange, this.getRegisteredEmitter<number>());
this._emitterMap.set(ComponentEventType.onInput, this.getRegisteredEmitter<number>());
}
public get min(): number | undefined {
@ -2262,10 +2273,10 @@ class GroupContainerComponentWrapper extends ComponentWrapper implements azdata.
}
}
class ModelViewImpl implements azdata.ModelView {
class ModelViewImpl extends Disposable implements azdata.ModelView {
public onClosedEmitter = new Emitter<any>();
private _onValidityChangedEmitter = new Emitter<boolean>();
public onClosedEmitter = this._register(new Emitter<any>());
private _onValidityChangedEmitter = this._register(new Emitter<boolean>());
public readonly onValidityChanged = this._onValidityChangedEmitter.event;
private _modelBuilder: ModelBuilderImpl;
@ -2280,6 +2291,7 @@ class ModelViewImpl implements azdata.ModelView {
_extension: IExtensionDescription,
logService: ILogService
) {
super();
this._modelBuilder = new ModelBuilderImpl(this._proxy, this._handle, this._extHostModelViewTree, _extension, logService);
}
@ -2328,7 +2340,6 @@ class ModelViewImpl implements azdata.ModelView {
export class ExtHostModelView implements ExtHostModelViewShape {
private readonly _proxy: MainThreadModelViewShape;
private readonly _modelViews = new Map<number, ModelViewImpl>();
private readonly _handlers = new Map<string, (view: azdata.ModelView) => void>();
private readonly _handlerToExtension = new Map<string, IExtensionDescription>();

Просмотреть файл

@ -15,6 +15,9 @@ import { ExtHostModelViewDialogShape, MainThreadModelViewDialogShape, ExtHostMod
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { TabOrientation, DialogWidth, DialogStyle, DialogPosition, IDialogProperties } from 'sql/workbench/api/common/sqlExtHostTypes';
import { SqlMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/base/common/lifecycle';
import { DashboardTab } from 'azdata';
import { DashboardTabGroup } from 'azdata';
const DONE_LABEL = nls.localize('dialogDoneLabel', "Done");
const CANCEL_LABEL = nls.localize('dialogCancelLabel', "Cancel");
@ -22,7 +25,7 @@ const GENERATE_SCRIPT_LABEL = nls.localize('generateScriptLabel', "Generate scri
const NEXT_LABEL = nls.localize('dialogNextLabel', "Next");
const PREVIOUS_LABEL = nls.localize('dialogPreviousLabel', "Previous");
class ModelViewPanelImpl implements azdata.window.ModelViewPanel {
class ModelViewPanelImpl extends Disposable implements azdata.window.ModelViewPanel {
private _modelView: azdata.ModelView;
public handle: number;
protected _modelViewId: string;
@ -33,6 +36,7 @@ class ModelViewPanelImpl implements azdata.window.ModelViewPanel {
protected _extHostModelViewDialog: ExtHostModelViewDialog,
protected _extHostModelView: ExtHostModelViewShape,
protected _extension: IExtensionDescription) {
super();
this._onValidityChanged = this._extHostModelViewDialog.getValidityChangedEvent(this);
this._onValidityChanged(valid => this._valid = valid);
}
@ -43,6 +47,7 @@ class ModelViewPanelImpl implements azdata.window.ModelViewPanel {
this.setModelViewId(viewId);
this._extHostModelView.$registerProvider(viewId, modelView => {
this._modelView = modelView;
this._register(this._modelView);
handler(modelView);
}, this._extension);
}
@ -460,6 +465,10 @@ export interface WizardPageEventInfo {
pages?: azdata.window.WizardPage[];
}
interface DisposableTab extends azdata.Tab, vscode.Disposable { }
interface DisposableTabGroup extends azdata.TabGroup, vscode.Disposable { }
class WizardImpl implements azdata.window.Wizard {
private _currentPage: number = undefined;
public pages: azdata.window.WizardPage[] = [];
@ -600,7 +609,7 @@ class WizardImpl implements azdata.window.Wizard {
}
}
class ModelViewDashboardImpl implements azdata.window.ModelViewDashboard {
class ModelViewDashboardImpl extends Disposable implements azdata.window.ModelViewDashboard {
private _tabbedPanel: azdata.TabbedPanelComponent;
private _view: azdata.ModelView;
@ -608,9 +617,11 @@ class ModelViewDashboardImpl implements azdata.window.ModelViewDashboard {
private _editor: ModelViewEditorImpl,
private _options?: azdata.ModelViewDashboardOptions
) {
super();
this._register(this._editor);
}
updateTabs(tabs: (azdata.DashboardTab | azdata.DashboardTabGroup)[]): void {
updateTabs(tabs: (DashboardTab | DashboardTabGroup)[]): void {
if (this._tabbedPanel === undefined || this._view === undefined) {
throw new Error(nls.localize('dashboardNotInitialized', "Tabs are not initialized"));
}
@ -618,7 +629,7 @@ class ModelViewDashboardImpl implements azdata.window.ModelViewDashboard {
this._tabbedPanel.updateTabs(this.createTabs(tabs, this._view));
}
registerTabs(handler: (view: azdata.ModelView) => Thenable<(azdata.DashboardTab | azdata.DashboardTabGroup)[]>): void {
registerTabs(handler: (view: azdata.ModelView) => Thenable<(DashboardTab | DashboardTabGroup)[]>): void {
this._editor.registerContent(async (view) => {
this._view = view;
const dashboardTabs = await handler(view);
@ -628,6 +639,7 @@ class ModelViewDashboardImpl implements azdata.window.ModelViewDashboard {
showIcon: this._options?.showIcon ?? true,
alwaysShowTabs: this._options?.alwaysShowTabs ?? false
}).component();
this._register(this._tabbedPanel);
return view.initializeModel(this._tabbedPanel);
});
}
@ -640,31 +652,46 @@ class ModelViewDashboardImpl implements azdata.window.ModelViewDashboard {
return this._editor.closeEditor();
}
createTab(tab: azdata.DashboardTab, view: azdata.ModelView): azdata.Tab {
if (tab.toolbar) {
createTab(dashboardTab: DashboardTab, view: azdata.ModelView): DisposableTab {
let tab: DisposableTab;
if (dashboardTab.toolbar) {
const flexContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component();
flexContainer.addItem(tab.toolbar, { flex: '0 0 auto' });
flexContainer.addItem(tab.content, { flex: '1 1 auto' });
return {
title: tab.title,
id: tab.id,
flexContainer.addItem(dashboardTab.toolbar, { flex: '0 0 auto' });
flexContainer.addItem(dashboardTab.content, { flex: '1 1 auto' });
tab = {
title: dashboardTab.title,
id: dashboardTab.id,
content: flexContainer,
icon: tab.icon
icon: dashboardTab.icon,
dispose: () => flexContainer.dispose(),
};
} else {
return tab;
let content = dashboardTab.content;
tab = {
content: content,
id: dashboardTab.id,
title: dashboardTab.title,
icon: dashboardTab.icon,
dispose: () => content.dispose()
}
}
this._register(tab);
return tab;
}
createTabs(dashboardTabs: (azdata.DashboardTab | azdata.DashboardTabGroup)[], view: azdata.ModelView): (azdata.TabGroup | azdata.Tab)[] {
const tabs: (azdata.TabGroup | azdata.Tab)[] = [];
dashboardTabs.forEach((item: azdata.DashboardTab | azdata.DashboardTabGroup) => {
createTabs(dashboardTabs: (DashboardTab | DashboardTabGroup)[], view: azdata.ModelView): (DisposableTabGroup | DisposableTab)[] {
const tabs: (DisposableTabGroup | DisposableTab)[] = [];
dashboardTabs.forEach((item: DashboardTab | DashboardTabGroup) => {
if ('tabs' in item) {
tabs.push(<azdata.TabGroup>{
let disposableTabs = item.tabs.map(tab => {
return this.createTab(tab, view);
});
tabs.push(<DisposableTabGroup>{
title: item.title,
tabs: item.tabs.map(tab => {
return this.createTab(tab, view);
})
tabs: disposableTabs,
dispose: () => {
disposableTabs.forEach(t => t.dispose());
},
});
} else {
tabs.push(this.createTab(item, view));

Просмотреть файл

@ -387,6 +387,8 @@ suite('ExtHostModelView Validation Tests', () => {
rootComponent.properties.data &&
rootComponent.properties.data.length === 0;
})), Times.once());
declarativeTable.dispose();
});
test('initialized with string data has correct properties', async () => {
@ -401,6 +403,8 @@ suite('ExtHostModelView Validation Tests', () => {
rootComponent.properties.data &&
rootComponent.properties.data[0][0] === testData;
})), Times.once());
declarativeTable.dispose();
});
test('initialized with component data converts to id', async () => {
@ -416,6 +420,8 @@ suite('ExtHostModelView Validation Tests', () => {
rootComponent.properties.data &&
rootComponent.properties.data[0][0] === button.id;
})), Times.once());
declarativeTable.dispose();
});
test('when added to container with component data converts to id', async () => {
@ -442,6 +448,8 @@ suite('ExtHostModelView Validation Tests', () => {
item.componentShape.properties.data &&
item.componentShape.properties.data[0][0] === button.id;
})), Times.once());
declarativeTable.dispose();
});
});
});

Просмотреть файл

@ -81,6 +81,11 @@ export abstract class ComponentBase<TPropertyBag extends azdata.ComponentPropert
return this._el.nativeElement;
}
public override dispose(): void {
super.dispose();
this.getHtml().remove();
}
public setDataProvider(handle: number, componentId: string, context: any): void {
}

Просмотреть файл

@ -29,9 +29,9 @@ import { ILogService } from 'vs/platform/log/common/log';
export class ModelViewContent extends ViewBase implements OnInit, IModelView {
@Input() private modelViewId: string;
private _onResize = new Emitter<void>();
private _onResize = this._register(new Emitter<void>());
public readonly onResize: Event<void> = this._onResize.event;
private _onMessage = new Emitter<string>();
private _onMessage = this._register(new Emitter<string>());
public readonly onMessage: Event<string> = this._onMessage.event;
constructor(

Просмотреть файл

@ -77,8 +77,8 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
private _contextMenuColumns: ContextMenuColumn<{}>[] = [];
private _pluginsRegisterStatus: boolean[] = [];
private _filterPlugin: HeaderFilter<Slick.SlickData>;
private _onCheckBoxChanged = new Emitter<ICheckboxCellActionEventArgs>();
private _onButtonClicked = new Emitter<TableCellClickEventArgs<{}>>();
private _onCheckBoxChanged = this._register(new Emitter<ICheckboxCellActionEventArgs>());
private _onButtonClicked = this._register(new Emitter<TableCellClickEventArgs<{}>>());
public readonly onCheckBoxChanged: vsEvent<ICheckboxCellActionEventArgs> = this._onCheckBoxChanged.event;
public readonly onButtonClicked: vsEvent<TableCellClickEventArgs<{}>> = this._onButtonClicked.event;
private _iconCssMap: { [iconKey: string]: string } = {};

Просмотреть файл

@ -25,7 +25,7 @@ export class TreeDataTemplate extends Disposable {
icon: HTMLElement;
private _checkbox: HTMLInputElement;
model: ITreeComponentItem;
private _onChange = new Emitter<boolean>();
private _onChange = this._register(new Emitter<boolean>());
public readonly onChange: Event<boolean> = this._onChange.event;
@ -47,6 +47,14 @@ export class TreeDataTemplate extends Disposable {
}
}
public override dispose(): void {
super.dispose();
this._checkbox.remove();
this.root.remove();
this.label.remove();
this.icon.remove();
}
public set checkboxState(value: TreeCheckboxState) {
if (this.checkboxState !== value) {
switch (value) {

Просмотреть файл

@ -26,7 +26,7 @@ const componentRegistry = <IComponentRegistry>Registry.as(Extensions.ComponentCo
export abstract class ViewBase extends AngularDisposable implements IModelView {
protected readonly modelStore: IModelStore;
protected rootDescriptor: IComponentDescriptor;
protected _onDestroy = new Emitter<void>();
protected _onDestroy = this._register(new Emitter<void>());
public readonly onDestroy = this._onDestroy.event;
constructor(protected changeRef: ChangeDetectorRef, protected logService: ILogService) {
super();
@ -37,7 +37,7 @@ export abstract class ViewBase extends AngularDisposable implements IModelView {
abstract id: string;
abstract connection: azdata.connection.Connection;
abstract serverInfo: azdata.ServerInfo;
private _onEventEmitter = new Emitter<IModelViewEventArgs>();
private _onEventEmitter = this._register(new Emitter<IModelViewEventArgs>());
initializeModel(rootComponent: IComponentShape, validationCallback: (componentId: string) => Thenable<boolean>): void {
let descriptor = this.defineComponent(rootComponent);