mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Fix enable/disable script button behavior (#24437)
This commit is contained in:
@@ -63,13 +63,16 @@ export abstract class ScriptableDialogBase<OptionsType extends ScriptableDialogO
|
||||
protected abstract get isDirty(): boolean;
|
||||
|
||||
protected override onFormFieldChange(): void {
|
||||
this._scriptButton.enabled = this.isDirty;
|
||||
this.updateScriptButtonState();
|
||||
this.dialogObject.okButton.enabled = this.isDirty;
|
||||
}
|
||||
|
||||
protected override async initialize(): Promise<void> {
|
||||
await this.initializeData();
|
||||
await this.initializeUI();
|
||||
this.disposables.push(this.modelView.onValidityChanged(() => {
|
||||
this.updateScriptButtonState();
|
||||
}));
|
||||
}
|
||||
|
||||
protected override updateLoadingStatus(isLoading: boolean, loadingText?: string, loadingCompletedText?: string): void {
|
||||
@@ -131,4 +134,8 @@ export abstract class ScriptableDialogBase<OptionsType extends ScriptableDialogO
|
||||
this.updateLoadingStatus(false, localizedConstants.GeneratingScriptText, localizedConstants.GeneratingScriptCompletedText);
|
||||
}
|
||||
}
|
||||
|
||||
private updateScriptButtonState(): void {
|
||||
this._scriptButton.enabled = this.isDirty && this.modelView.valid;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user