diff --git a/i18n/sample/src/Profiles.i18n.json b/i18n/sample/src/Profiles.i18n.json index 916f1dc256..6923ea8ecc 100644 --- a/i18n/sample/src/Profiles.i18n.json +++ b/i18n/sample/src/Profiles.i18n.json @@ -4,18 +4,20 @@ "loadNamedProfile.warn.noDefaultProfile": "Unable to locate a default profile. CLI may not be installed. ", "createNewConnection.option.prompt.url.placeholder": "https://url:port", "createNewConnection.option.prompt.url": "Enter a z/OSMF URL in the format 'https://url:port'.", - "createNewConnection.enterzosmfURL": "No valid value for z/OSMF URL. Operation Cancelled", - "createNewConnection.option.prompt.userName.placeholder": "Optional: User Name", - "createNewConnection.option.prompt.userName": "Enter the user name for the connection", + "createNewConnection.zosmfURL": "No valid value for z/OSMF URL. Operation Cancelled", + "createNewConnection.option.prompt.username.placeholder": "Optional: User Name", + "createNewConnection.option.prompt.username": "Enter the user name for the connection. Leave blank to not store.", + "createNewConnection.undefined.username": "Operation Cancelled", "createNewConnection.option.prompt.password.placeholder": "Optional: Password", - "createNewConnection.option.prompt.password": "Enter a password for the connection", + "createNewConnection.option.prompt.password": "Enter the password for the connection. Leave blank to not store.", + "createNewConnection.undefined.password": "Operation Cancelled", "createNewConnection.option.prompt.ru.placeholder": "Reject Unauthorized Connections", "createNewConnection.rejectUnauthorize": "Operation Cancelled", "createNewConnection.duplicateProfileName": "Profile name already exists. Please create a profile using a different name", - "promptcredentials.option.prompt.userName.placeholder": "User Name", - "promptcredentials.option.prompt.userName": "Enter the user name for the connection", + "promptcredentials.option.prompt.username.placeholder": "User Name", + "promptcredentials.option.prompt.username": "Enter the user name for the connection", "promptcredentials.invalidusername": "Please enter your z/OS username. Operation Cancelled", - "promptcredentials.option.prompt.passWord.placeholder": "Password", + "promptcredentials.option.prompt.password.placeholder": "Password", "promptcredentials.option.prompt.password": "Enter a password for the connection", "promptcredentials.invalidpassword": "Please enter your z/OS password. Operation Cancelled" } \ No newline at end of file diff --git a/src/Profiles.ts b/src/Profiles.ts index 13b5c9dcae..0bd0ae6926 100644 --- a/src/Profiles.ts +++ b/src/Profiles.ts @@ -155,7 +155,7 @@ export class Profiles { // Processing stops if there are no profiles detected }); if (!zosmfURL) { - vscode.window.showInformationMessage(localize("createNewConnection.enterzosmfURL", + vscode.window.showInformationMessage(localize("createNewConnection.zosmfURL", "No valid value for z/OSMF URL. Operation Cancelled")); return undefined; } @@ -163,20 +163,32 @@ export class Profiles { // Processing stops if there are no profiles detected const zosmfUrlParsed = this.validateAndParseUrl(zosmfURL); options = { - placeHolder: localize("createNewConnection.option.prompt.userName.placeholder", "Optional: User Name"), - prompt: localize("createNewConnection.option.prompt.userName", "Enter the user name for the connection"), + placeHolder: localize("createNewConnection.option.prompt.username.placeholder", "Optional: User Name"), + prompt: localize("createNewConnection.option.prompt.username", "Enter the user name for the connection. Leave blank to not store."), value: userName }; userName = await vscode.window.showInputBox(options); + if (userName === undefined) { + vscode.window.showInformationMessage(localize("createNewConnection.undefined.username", + "Operation Cancelled")); + return; + } + options = { placeHolder: localize("createNewConnection.option.prompt.password.placeholder", "Optional: Password"), - prompt: localize("createNewConnection.option.prompt.password", "Enter a password for the connection"), + prompt: localize("createNewConnection.option.prompt.password", "Enter the password for the connection. Leave blank to not store."), password: true, value: passWord }; passWord = await vscode.window.showInputBox(options); + if (passWord === undefined) { + vscode.window.showInformationMessage(localize("createNewConnection.undefined.passWord", + "Operation Cancelled")); + return; + } + const quickPickOptions: vscode.QuickPickOptions = { placeHolder: localize("createNewConnection.option.prompt.ru.placeholder", "Reject Unauthorized Connections"), ignoreFocusOut: true, @@ -240,8 +252,8 @@ export class Profiles { // Processing stops if there are no profiles detected if (!loadSession.user) { options = { - placeHolder: localize("promptcredentials.option.prompt.userName.placeholder", "User Name"), - prompt: localize("promptcredentials.option.prompt.userName", "Enter the user name for the connection"), + placeHolder: localize("promptcredentials.option.prompt.username.placeholder", "User Name"), + prompt: localize("promptcredentials.option.prompt.username", "Enter the user name for the connection"), value: userName }; userName = await vscode.window.showInputBox(options);