Skip to content

Commit

Permalink
reload after installing
Browse files Browse the repository at this point in the history
Signed-off-by: Rudy Flores <[email protected]>
  • Loading branch information
rudyflores committed Oct 3, 2023
1 parent abc276e commit 9767258
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
"activateCredentialManagerOverride.failedToActivate": "Custom credential manager failed to activate",
"ProfilesUtils.setupCustomCredentialManager.usingCustom": "Custom credential manager {0} found, attempting to activate.",
"ProfilesUtils.setupDefaultCredentialManager.usingDefault": "No custom credential managers found, using the default instead.",
"ProfilesUtils.fetchRegisteredPlugins.customCredentialManagerFound": "Custom credential manager {0} found",
"ProfilesUtils.fetchRegisteredPlugins.message": "Do you wish to use this credential manager instead?",
"ProfilesUtils.fetchRegisteredPlugins.yes": "Yes",
"ProfilesUtils.fetchRegisteredPlugins.dontAskAgain": "Don't ask again",
"ProfilesUtils.promptAndHandleMissingCredentialManager.suggestInstallHeader": "Plugin of name \"{0}\" was defined for custom credential management on imperative.json file.",
"ProfilesUtils.promptAndHandleMissingCredentialManager.suggestInstallMessage": "Please install associated VS Code extension for\n custom credential manager or revert to default.",
"ProfilesUtils.promptAndHandleMissingCredentialManager.revertToDefault": "Use Default",
"ProfilesUtils.promptAndHandleMissingCredentialManager.install": "Install",
"ProfilesUtils.fetchRegisteredPlugins.customCredentialManagerFound": "Custom credential manager {0} found",
"ProfilesUtils.fetchRegisteredPlugins.message": "Do you wish to use this credential manager instead?",
"ProfilesUtils.fetchRegisteredPlugins.yes": "Yes",
"ProfilesUtils.fetchRegisteredPlugins.no": "No",
"ProfilesUtils.promptAndHandleMissingCredentialManager.refreshMessage": "After installing the extension, please make sure to reload\n your VS Code window in order to start using the installed credential manager",
"ProfilesUtils.promptAndHandleMissingCredentialManager.refreshButton": "Refresh",
"zowe.promptCredentials.notSupported": "\"Update Credentials\" operation not supported when \"autoStore\" is false",
"createNewConnection.option.prompt.profileName.placeholder": "Connection Name",
"createNewConnection.option.prompt.profileName": "Enter a name for the connection.",
Expand Down
18 changes: 13 additions & 5 deletions packages/zowe-explorer/src/utils/ProfilesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,22 +406,30 @@ export class ProfilesUtils {
`Plugin of name "{0}" was defined for custom credential management on imperative.json file.`,
credentialManager.credMgrDisplayName
);
const message = localize(
const installMessage = localize(
"ProfilesUtils.promptAndHandleMissingCredentialManager.suggestInstallMessage",
`Please install associated VS Code extension for
custom credential manager or revert to default.`
);
const revertToDefaultButton = localize("ProfilesUtils.promptAndHandleMissingCredentialManager.revertToDefault", "Use Default");
const installButton = localize("ProfilesUtils.promptAndHandleMissingCredentialManager.install", "Install");
await Gui.infoMessage(header, { items: [installButton, revertToDefaultButton], vsCodeOpts: { modal: true, detail: message } }).then(
await Gui.infoMessage(header, { items: [installButton, revertToDefaultButton], vsCodeOpts: { modal: true, detail: installMessage } }).then(
async (selection) => {
if (selection === installButton) {
const credentialManagerInstallURL = vscode.Uri.parse(
`https://marketplace.visualstudio.com/items?itemName=${credentialManager.credMgrZEName}`
);
await vscode.env.openExternal(credentialManagerInstallURL);
} else {
await this.setupDefaultCredentialManager();
if (await vscode.env.openExternal(credentialManagerInstallURL)) {
const refreshMessage = localize(
"ProfilesUtils.promptAndHandleMissingCredentialManager.refreshMessage",
`After installing the extension, please make sure to reload
your VS Code window in order to start using the installed credential manager`
);
const refreshButton = localize("ProfilesUtils.promptAndHandleMissingCredentialManager.refreshButton", "Refresh");
if ((await Gui.showMessage(refreshMessage, { items: [refreshButton] })) === refreshButton) {
await vscode.commands.executeCommand("workbench.action.reloadWindow");
}
}
}
}
);
Expand Down

0 comments on commit 9767258

Please sign in to comment.