mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 01:25:39 -05:00
Clear fields on Add New Package page after getting No Valid Versions error. (#6261)
This commit is contained in:
@@ -109,12 +109,7 @@ export class AddNewPackageTab {
|
||||
value: '',
|
||||
placeHolder: this.SearchPlaceholder(this.dialog.currentPkgType)
|
||||
});
|
||||
await this.newPackagesName.updateProperties({ value: this.InvalidTextPlaceholder });
|
||||
await this.newPackagesVersions.updateProperties({
|
||||
values: [this.InvalidTextPlaceholder],
|
||||
value: this.InvalidTextPlaceholder
|
||||
});
|
||||
await this.newPackagesSummary.updateProperties({ value: this.InvalidTextPlaceholder });
|
||||
await this.setFieldsToEmpty();
|
||||
} finally {
|
||||
await this.toggleNewPackagesFields(true);
|
||||
}
|
||||
@@ -127,6 +122,19 @@ export class AddNewPackageTab {
|
||||
await this.newPackagesSummaryLoader.updateProperties({ loading: !enable });
|
||||
}
|
||||
|
||||
private async setFieldsToEmpty(): Promise<void> {
|
||||
await this.newPackagesName.updateProperties({
|
||||
value: this.InvalidTextPlaceholder
|
||||
});
|
||||
await this.newPackagesVersions.updateProperties({
|
||||
values: [this.InvalidTextPlaceholder],
|
||||
value: this.InvalidTextPlaceholder
|
||||
});
|
||||
await this.newPackagesSummary.updateProperties({
|
||||
value: this.InvalidTextPlaceholder
|
||||
});
|
||||
}
|
||||
|
||||
private async loadNewPackageInfo(): Promise<void> {
|
||||
await this.packageInstallButton.updateProperties({ enabled: false });
|
||||
await this.toggleNewPackagesFields(false);
|
||||
@@ -146,6 +154,7 @@ export class AddNewPackageTab {
|
||||
this.dialog.showErrorMessage(
|
||||
localize('managePackages.noVersionsFound',
|
||||
"Could not find any valid versions for the specified package"));
|
||||
await this.setFieldsToEmpty();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -164,17 +173,7 @@ export class AddNewPackageTab {
|
||||
await this.packageInstallButton.updateProperties({ enabled: true });
|
||||
} catch (err) {
|
||||
this.dialog.showErrorMessage(utils.getErrorMessage(err));
|
||||
|
||||
await this.newPackagesName.updateProperties({
|
||||
value: this.InvalidTextPlaceholder
|
||||
});
|
||||
await this.newPackagesVersions.updateProperties({
|
||||
value: this.InvalidTextPlaceholder,
|
||||
values: [this.InvalidTextPlaceholder],
|
||||
});
|
||||
await this.newPackagesSummary.updateProperties({
|
||||
value: this.InvalidTextPlaceholder
|
||||
});
|
||||
await this.setFieldsToEmpty();
|
||||
} finally {
|
||||
await this.toggleNewPackagesFields(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user