mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 09:35:36 -05:00
Fixing the update issue with backup default name (#15082)
* Fixing the update issue with backup default name * Avoiding to call select again since that fires an event * Fixing comment and backup name
This commit is contained in:
@@ -216,6 +216,14 @@ export class SelectBox extends vsSelectBox {
|
||||
let selectOptions: SelectOptionItemSQL[] = SelectBox.createOptions(options);
|
||||
this.populateOptionsDictionary(selectOptions);
|
||||
super.setOptions(selectOptions, selected);
|
||||
// Adding following since setOptions from super alone is not setting this._selectedOption
|
||||
let selectedOptionIndex = this._optionsDictionary.get(this._selectedOption);
|
||||
if (selectedOptionIndex === selected) {
|
||||
return;
|
||||
}
|
||||
if (this._dialogOptions !== undefined) {
|
||||
this._selectedOption = this._dialogOptions[selected]?.value;
|
||||
}
|
||||
}
|
||||
|
||||
public get value(): string {
|
||||
|
||||
@@ -740,9 +740,10 @@ export class BackupComponent extends AngularDisposable {
|
||||
}
|
||||
|
||||
private setDefaultBackupName(): void {
|
||||
if (this.backupNameBox && (!this.backupNameBox.value || this.backupNameBox.value.trim().length === 0)) {
|
||||
const suggestedNamePrefix = this.databaseName + '-' + this.getSelectedBackupType().replace(' ', '-');
|
||||
if (this.backupNameBox && (!this.backupNameBox.value || this.backupNameBox.value.trim().length === 0 || !this.backupNameBox.value.startsWith(suggestedNamePrefix))) {
|
||||
let utc = new Date().toJSON().slice(0, 19);
|
||||
this.backupNameBox.value = this.databaseName + '-' + this.getSelectedBackupType() + '-' + utc;
|
||||
this.backupNameBox.value = suggestedNamePrefix + '-' + utc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user