mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Update sqlcmd table to use dataValues instead of deprecated data (#13121)
* Update sqlcmd table to use dataValues instead of deprecated data * fix in declarativeTableComponent
This commit is contained in:
@@ -460,8 +460,7 @@ export class PublishDatabaseDialog {
|
|||||||
|
|
||||||
const data = this.convertSqlCmdVarsToTableFormat(this.sqlCmdVars!);
|
const data = this.convertSqlCmdVarsToTableFormat(this.sqlCmdVars!);
|
||||||
(<azdata.DeclarativeTableComponent>this.sqlCmdVariablesTable)!.updateProperties({
|
(<azdata.DeclarativeTableComponent>this.sqlCmdVariablesTable)!.updateProperties({
|
||||||
dataValues: data,
|
dataValues: data
|
||||||
data: [] // data is deprecated, but the table gets updated incorrectly if this isn't set to an empty array
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tryEnableGenerateScriptAndOkButtons();
|
this.tryEnableGenerateScriptAndOkButtons();
|
||||||
@@ -569,7 +568,7 @@ export class PublishDatabaseDialog {
|
|||||||
|
|
||||||
const data = this.convertSqlCmdVarsToTableFormat(this.getSqlCmdVariablesForPublish());
|
const data = this.convertSqlCmdVarsToTableFormat(this.getSqlCmdVariablesForPublish());
|
||||||
await (<azdata.DeclarativeTableComponent>this.sqlCmdVariablesTable).updateProperties({
|
await (<azdata.DeclarativeTableComponent>this.sqlCmdVariablesTable).updateProperties({
|
||||||
data: data
|
dataValues: data
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Object.keys(result.sqlCmdVariables).length) {
|
if (Object.keys(result.sqlCmdVariables).length) {
|
||||||
|
|||||||
@@ -139,7 +139,13 @@ export default class DeclarativeTableComponent extends ContainerBase<any, azdata
|
|||||||
|
|
||||||
private onCellDataChanged(newValue: string | number | boolean | any, rowIdx: number, colIdx: number): void {
|
private onCellDataChanged(newValue: string | number | boolean | any, rowIdx: number, colIdx: number): void {
|
||||||
this.data[rowIdx][colIdx].value = newValue;
|
this.data[rowIdx][colIdx].value = newValue;
|
||||||
this.setPropertyFromUI<any[][]>((props, value) => props.data = value, this.data);
|
|
||||||
|
if (this.properties.data) {
|
||||||
|
this.setPropertyFromUI<any[][]>((props, value) => props.data = value, this.data);
|
||||||
|
} else {
|
||||||
|
this.setPropertyFromUI<any[][]>((props, value) => props.dataValues = value, this.data);
|
||||||
|
}
|
||||||
|
|
||||||
let newCellData: azdata.TableCell = {
|
let newCellData: azdata.TableCell = {
|
||||||
row: rowIdx,
|
row: rowIdx,
|
||||||
column: colIdx,
|
column: colIdx,
|
||||||
|
|||||||
Reference in New Issue
Block a user