mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 01:25:38 -05:00
@@ -103,13 +103,6 @@ export function getDatabaseStateDisplayText(state: string): string {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens an input box prompting the user to enter in the name of a resource to delete
|
||||
* @param namespace The namespace of the resource to delete
|
||||
* @param name The name of the resource to delete
|
||||
* @returns Promise resolving to true if the user confirmed the name, false if the input box was closed for any other reason
|
||||
*/
|
||||
|
||||
/**
|
||||
* Opens an input box prompting and validating the user's input.
|
||||
* @param options Options for the input box
|
||||
@@ -173,9 +166,9 @@ export async function promptForResourceDeletion(namespace: string, name: string)
|
||||
* Opens an input box prompting the user to enter and confirm a password
|
||||
* @param validate A function that accepts the password and returns an error message if it's invalid
|
||||
* @returns Promise resolving to the password if it passed validation,
|
||||
* or false if the input box was closed for any other reason
|
||||
* or undefined if the input box was closed for any other reason
|
||||
*/
|
||||
export async function promptAndConfirmPassword(validate: (input: string) => string): Promise<string | false> {
|
||||
export async function promptAndConfirmPassword(validate: (input: string) => string): Promise<string | undefined> {
|
||||
const title = loc.resetPassword;
|
||||
const options: vscode.InputBoxOptions = {
|
||||
prompt: loc.enterNewPassword,
|
||||
@@ -190,7 +183,7 @@ export async function promptAndConfirmPassword(validate: (input: string) => stri
|
||||
return promptInputBox(title, options);
|
||||
}
|
||||
|
||||
return false;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -198,7 +191,7 @@ export async function promptAndConfirmPassword(validate: (input: string) => stri
|
||||
* @param error The error object
|
||||
*/
|
||||
export function getErrorMessage(error: any): string {
|
||||
if (error?.body?.reason) {
|
||||
if (error.body?.reason) {
|
||||
// For HTTP Errors with a body pull out the reason message since that's usually the most helpful
|
||||
return error.body.reason;
|
||||
} else if (error.message) {
|
||||
|
||||
Reference in New Issue
Block a user