mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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: '',
|
value: '',
|
||||||
placeHolder: this.SearchPlaceholder(this.dialog.currentPkgType)
|
placeHolder: this.SearchPlaceholder(this.dialog.currentPkgType)
|
||||||
});
|
});
|
||||||
await this.newPackagesName.updateProperties({ value: this.InvalidTextPlaceholder });
|
await this.setFieldsToEmpty();
|
||||||
await this.newPackagesVersions.updateProperties({
|
|
||||||
values: [this.InvalidTextPlaceholder],
|
|
||||||
value: this.InvalidTextPlaceholder
|
|
||||||
});
|
|
||||||
await this.newPackagesSummary.updateProperties({ value: this.InvalidTextPlaceholder });
|
|
||||||
} finally {
|
} finally {
|
||||||
await this.toggleNewPackagesFields(true);
|
await this.toggleNewPackagesFields(true);
|
||||||
}
|
}
|
||||||
@@ -127,6 +122,19 @@ export class AddNewPackageTab {
|
|||||||
await this.newPackagesSummaryLoader.updateProperties({ loading: !enable });
|
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> {
|
private async loadNewPackageInfo(): Promise<void> {
|
||||||
await this.packageInstallButton.updateProperties({ enabled: false });
|
await this.packageInstallButton.updateProperties({ enabled: false });
|
||||||
await this.toggleNewPackagesFields(false);
|
await this.toggleNewPackagesFields(false);
|
||||||
@@ -146,6 +154,7 @@ export class AddNewPackageTab {
|
|||||||
this.dialog.showErrorMessage(
|
this.dialog.showErrorMessage(
|
||||||
localize('managePackages.noVersionsFound',
|
localize('managePackages.noVersionsFound',
|
||||||
"Could not find any valid versions for the specified package"));
|
"Could not find any valid versions for the specified package"));
|
||||||
|
await this.setFieldsToEmpty();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,17 +173,7 @@ export class AddNewPackageTab {
|
|||||||
await this.packageInstallButton.updateProperties({ enabled: true });
|
await this.packageInstallButton.updateProperties({ enabled: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.dialog.showErrorMessage(utils.getErrorMessage(err));
|
this.dialog.showErrorMessage(utils.getErrorMessage(err));
|
||||||
|
await this.setFieldsToEmpty();
|
||||||
await this.newPackagesName.updateProperties({
|
|
||||||
value: this.InvalidTextPlaceholder
|
|
||||||
});
|
|
||||||
await this.newPackagesVersions.updateProperties({
|
|
||||||
value: this.InvalidTextPlaceholder,
|
|
||||||
values: [this.InvalidTextPlaceholder],
|
|
||||||
});
|
|
||||||
await this.newPackagesSummary.updateProperties({
|
|
||||||
value: this.InvalidTextPlaceholder
|
|
||||||
});
|
|
||||||
} finally {
|
} finally {
|
||||||
await this.toggleNewPackagesFields(true);
|
await this.toggleNewPackagesFields(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user