mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix sql proj sqlcmd table showing after loading profile when it shouldn't (#11479)
This commit is contained in:
@@ -29,6 +29,7 @@ export class PublishDatabaseDialog {
|
|||||||
private dataSourcesRadioButton: azdata.RadioButtonComponent | undefined;
|
private dataSourcesRadioButton: azdata.RadioButtonComponent | undefined;
|
||||||
private loadProfileButton: azdata.ButtonComponent | undefined;
|
private loadProfileButton: azdata.ButtonComponent | undefined;
|
||||||
private sqlCmdVariablesTable: azdata.TableComponent | undefined;
|
private sqlCmdVariablesTable: azdata.TableComponent | undefined;
|
||||||
|
private sqlCmdVariablesFormComponent: azdata.FormComponent | undefined;
|
||||||
private formBuilder: azdata.FormBuilder | undefined;
|
private formBuilder: azdata.FormBuilder | undefined;
|
||||||
|
|
||||||
private connectionId: string | undefined;
|
private connectionId: string | undefined;
|
||||||
@@ -106,6 +107,11 @@ export class PublishDatabaseDialog {
|
|||||||
height: 400
|
height: 400
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
|
this.sqlCmdVariablesFormComponent = {
|
||||||
|
title: constants.sqlCmdTableLabel,
|
||||||
|
component: <azdata.TableComponent>this.sqlCmdVariablesTable
|
||||||
|
};
|
||||||
|
|
||||||
this.formBuilder = <azdata.FormBuilder>view.modelBuilder.formContainer()
|
this.formBuilder = <azdata.FormBuilder>view.modelBuilder.formContainer()
|
||||||
.withFormItems([
|
.withFormItems([
|
||||||
{
|
{
|
||||||
@@ -418,13 +424,14 @@ export class PublishDatabaseDialog {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (Object.keys(result.sqlCmdVariables).length) {
|
||||||
// add SQLCMD Variables table if it wasn't there before
|
// add SQLCMD Variables table if it wasn't there before
|
||||||
if (Object.keys(this.project.sqlCmdVariables).length === 0) {
|
if (Object.keys(this.project.sqlCmdVariables).length === 0) {
|
||||||
this.formBuilder?.insertFormItem({
|
this.formBuilder?.insertFormItem(<azdata.FormComponent>this.sqlCmdVariablesFormComponent, 6);
|
||||||
title: constants.sqlCmdTableLabel,
|
}
|
||||||
component: <azdata.TableComponent>this.sqlCmdVariablesTable
|
} else if (Object.keys(this.project.sqlCmdVariables).length === 0) {
|
||||||
},
|
// remove the table if there are no SQLCMD variables in the project and loaded profile
|
||||||
6);
|
this.formBuilder?.removeFormItem(<azdata.FormComponent>this.sqlCmdVariablesFormComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user