Skip to content

Commit 61b4439

Browse files
Remove misleading prompt when credentials manager disabled and autoStore is false (#3670)
* Remove misleading prompt when SC disabled and autoStore is false Signed-off-by: likhithanimma1 <[email protected]> * Remove unused imports Signed-off-by: likhithanimma1 <[email protected]> * Update changelog Signed-off-by: likhithanimma1 <[email protected]> * Modify Changelog Signed-off-by: likhithanimma1 <[email protected]> --------- Signed-off-by: likhithanimma1 <[email protected]>
1 parent f627ddb commit 61b4439

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

packages/zowe-explorer-api/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t
2727
### Bug fixes
2828

2929
- Fixed an issue where using functions such as `ZoweVsCodeExtension.updateCredentials` caused extender log4js configurations to be overwritten. [#3587](https://github.com/zowe/zowe-explorer-vscode/issues/3587)
30+
- Fixed an issue to avoid prompting the user with the dialog of 'Save credentials' or 'Cancel' when the credential manager is disabled and the `autoStore` setting is set to False. [#3557](https://github.com/zowe/zowe-explorer-vscode/issues/3557)
3031

3132
## `3.2.0`
3233

packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ describe("ZoweVsCodeExtension", () => {
713713
profile: {},
714714
}),
715715
getProfileInfo: jest.fn().mockReturnValue({
716+
getTeamConfig: jest.fn().mockReturnValue({ properties: { autoStore: true } }),
716717
isSecured: jest.fn().mockReturnValue(true),
717718
updateProperty: mockUpdateProperty,
718719
}),
@@ -743,6 +744,7 @@ describe("ZoweVsCodeExtension", () => {
743744
profile: { user: "badUser", password: "badPassword" },
744745
}),
745746
getProfileInfo: jest.fn().mockReturnValue({
747+
getTeamConfig: jest.fn().mockReturnValue({ properties: { autoStore: true } }),
746748
isSecured: jest.fn().mockReturnValue(true),
747749
updateProperty: mockUpdateProperty,
748750
}),
@@ -776,6 +778,7 @@ describe("ZoweVsCodeExtension", () => {
776778
profile: {},
777779
}),
778780
getProfileInfo: jest.fn().mockReturnValue({
781+
getTeamConfig: jest.fn().mockReturnValue({ properties: { autoStore: true } }),
779782
isSecured: jest.fn().mockReturnValue(false),
780783
updateProperty: mockUpdateProperty,
781784
}),
@@ -807,6 +810,7 @@ describe("ZoweVsCodeExtension", () => {
807810
profile: {},
808811
}),
809812
getProfileInfo: jest.fn().mockReturnValue({
813+
getTeamConfig: jest.fn().mockReturnValue({ properties: { autoStore: true } }),
810814
isSecured: jest.fn().mockReturnValue(false),
811815
updateProperty: mockUpdateProperty,
812816
}),

packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export class ZoweVsCodeExtension {
101101
loadProfile.profile.password = loadSession.password = creds[1];
102102

103103
let shouldSave = true;
104-
if (!setSecure) {
104+
const autoStoreValue = (await this.profilesCache.getProfileInfo()).getTeamConfig().properties.autoStore;
105+
if (!setSecure && autoStoreValue) {
105106
shouldSave = await ZoweVsCodeExtension.saveCredentials(loadProfile);
106107
}
107108

0 commit comments

Comments
 (0)