From 3deb1632100f33e9cca1f88258766bd2a8d2a622 Mon Sep 17 00:00:00 2001 From: Kim Santiago <31145923+kisantia@users.noreply.github.com> Date: Thu, 13 Apr 2023 16:27:59 -0700 Subject: [PATCH] replace deprecated onDidClick() handler in sql projects (#22721) --- .../src/dialogs/addDatabaseReferenceDialog.ts | 18 ++++++++++++------ .../dialogs/updateProjectFromDatabaseDialog.ts | 16 ++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/extensions/sql-database-projects/src/dialogs/addDatabaseReferenceDialog.ts b/extensions/sql-database-projects/src/dialogs/addDatabaseReferenceDialog.ts index b80f505bdf..369e43cc41 100644 --- a/extensions/sql-database-projects/src/dialogs/addDatabaseReferenceDialog.ts +++ b/extensions/sql-database-projects/src/dialogs/addDatabaseReferenceDialog.ts @@ -206,8 +206,10 @@ export class AddDatabaseReferenceDialog { label: constants.projectLabel }).component(); - this.projectRadioButton.onDidClick(() => { - this.projectRadioButtonClick(); + this.projectRadioButton.onDidChangeCheckedState((checked) => { + if (checked) { + this.projectRadioButtonClick(); + } }); this.systemDatabaseRadioButton = this.view!.modelBuilder.radioButton() @@ -216,8 +218,10 @@ export class AddDatabaseReferenceDialog { label: constants.systemDatabase }).component(); - this.systemDatabaseRadioButton.onDidClick(() => { - this.systemDbRadioButtonClick(); + this.systemDatabaseRadioButton.onDidChangeCheckedState((checked) => { + if (checked) { + this.systemDbRadioButtonClick(); + } }); const dacpacRadioButton = this.view!.modelBuilder.radioButton() @@ -226,8 +230,10 @@ export class AddDatabaseReferenceDialog { label: constants.dacpacText }).component(); - dacpacRadioButton.onDidClick(() => { - this.dacpacRadioButtonClick(); + dacpacRadioButton.onDidChangeCheckedState((checked) => { + if (checked) { + this.dacpacRadioButtonClick(); + } }); if (this.projectDropdown?.values?.length) { diff --git a/extensions/sql-database-projects/src/dialogs/updateProjectFromDatabaseDialog.ts b/extensions/sql-database-projects/src/dialogs/updateProjectFromDatabaseDialog.ts index 80de9bfe56..d8d98581f1 100644 --- a/extensions/sql-database-projects/src/dialogs/updateProjectFromDatabaseDialog.ts +++ b/extensions/sql-database-projects/src/dialogs/updateProjectFromDatabaseDialog.ts @@ -481,14 +481,18 @@ export class UpdateProjectFromDatabaseDialog { await this.compareActionRadioButton.updateProperties({ checked: true }); this.action = UpdateProjectAction.Compare; - this.compareActionRadioButton.onDidClick(async () => { - this.action = UpdateProjectAction.Compare; - this.tryEnableUpdateButton(); + this.compareActionRadioButton.onDidChangeCheckedState((checked) => { + if (checked) { + this.action = UpdateProjectAction.Compare; + this.tryEnableUpdateButton(); + } }); - this.updateActionRadioButton.onDidClick(async () => { - this.action = UpdateProjectAction.Update; - this.tryEnableUpdateButton(); + this.updateActionRadioButton.onDidChangeCheckedState((checked) => { + if (checked) { + this.action = UpdateProjectAction.Update; + this.tryEnableUpdateButton(); + } }); let radioButtons = view.modelBuilder.flexContainer()