diff --git a/lerna.json b/lerna.json index e5666da8e0..c6e4b4889b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.11.0-SNAPSHOT", + "version": "2.12.0-SNAPSHOT", "command": { "version": { "forcePublish": true, diff --git a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md index 0a624a46ea..60068cda3a 100644 --- a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md +++ b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen ### Bug fixes +## `2.11.0` + +### New features and enhancements + +### Bug fixes + ## `2.10.0` ### New features and enhancements diff --git a/packages/eslint-plugin-zowe-explorer/package.json b/packages/eslint-plugin-zowe-explorer/package.json index b695c7afbc..5f07b57d56 100644 --- a/packages/eslint-plugin-zowe-explorer/package.json +++ b/packages/eslint-plugin-zowe-explorer/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-zowe-explorer", - "version": "2.11.0-SNAPSHOT", + "version": "2.12.0-SNAPSHOT", "description": "Custom ESLint Rules for ZOWE Explorer", "keywords": [ "eslint", diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index f20aae61bd..f3d025e88f 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t ### New features and enhancements +### Bug fixes + +## `2.11.0` + +### New features and enhancements + - Added optional `pendingActions` record to `IZoweTreeNode` to allow nodes to track pending promises. - Added optional `wasDoubleClicked` variable to `IZoweTreeNode` to track whether a node was double-clicked during an action. diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index c2f80e87a2..9db6de5187 100644 --- a/packages/zowe-explorer-api/package.json +++ b/packages/zowe-explorer-api/package.json @@ -1,6 +1,6 @@ { "name": "@zowe/zowe-explorer-api", - "version": "2.11.0-SNAPSHOT", + "version": "2.12.0-SNAPSHOT", "description": "Extensibility API for Zowe Explorer.", "publisher": "Zowe", "author": "Zowe", diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index 3b940ff212..955460b2a1 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum ### Bug fixes +## `2.11.0` + +### Bug fixes + +- Bump `@zowe/zowe-explorer-api` to pick up latest, including `@zowe/secrets-for-zowe-sdk` 7.18.4 to handle install errors gracefully and to allow running without MSVC redistributables. + ## `2.10.0` ### New features and enhancements diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index 39d49e53ad..db66761841 100644 --- a/packages/zowe-explorer-ftp-extension/package.json +++ b/packages/zowe-explorer-ftp-extension/package.json @@ -5,7 +5,7 @@ "author": "Zowe", "license": "EPL-2.0", "description": "Adds zFTP support to Zowe Explorer demonstrating how to extend the Zowe Explorer using its extensibility API.", - "version": "2.11.0-SNAPSHOT", + "version": "2.12.0-SNAPSHOT", "icon": "resources/zowe-ftp-color.png", "repository": { "url": "https://github.com/zowe/vscode-extension-for-zowe" @@ -48,7 +48,7 @@ }, "dependencies": { "@zowe/zos-ftp-for-zowe-cli": "2.1.2", - "@zowe/zowe-explorer-api": "2.11.0-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.12.0-SNAPSHOT", "tmp": "0.2.1" }, "devDependencies": { diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index fd4b0c1258..03974e6c1e 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### New features and enhancements +### Bug fixes + +## `2.11.0` + +### New features and enhancements + - Allow deleting migrated datasets [#2447](https://github.com/zowe/vscode-extension-for-zowe/issues/2447) ### Bug fixes @@ -16,6 +22,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Bump `@zowe/secrets-for-zowe-sdk` to 7.18.4 to handle install errors gracefully and to allow running without MSVC redistributables. - Fixed issue where data set content does not always appear as soon as the editor is opened. [#2427](https://github.com/zowe/vscode-extension-for-zowe/issues/2427) - Adjust scope of "Security: Secure Credentials Enabled" setting to `machine-overridable` so it appears again in certain cloud IDEs. +- Fixed issue where disabling "Automatic Profile Validation" caused the search prompts to stop appearing for all tree views. [#2454](https://github.com/zowe/vscode-extension-for-zowe/issues/2454) ## `2.10.0` diff --git a/packages/zowe-explorer/__tests__/__unit__/job/ZosJobsProvider.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/job/ZosJobsProvider.unit.test.ts index cfe46ec068..da5b74ffa7 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZosJobsProvider.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZosJobsProvider.unit.test.ts @@ -272,17 +272,6 @@ describe("ZosJobsProvider unit tests - Function getChildren", () => { expect(elementGetChildrenSpy).toHaveBeenCalledTimes(1); }); - it("Tests that getChildren returns the empty array if status of profile is unverified", async () => { - const globalMocks = await createGlobalMocks(); - jest.spyOn(Profiles.getInstance(), "checkCurrentProfile").mockResolvedValueOnce({ status: "unverified" } as any); - const blockMocks = createBlockMocks(globalMocks); - mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); - const testTree = new ZosJobsProvider(); - testTree.mSessionNodes.push(blockMocks.jobSessionNode); - testTree.mSessionNodes[1].dirty = true; - - await expect(testTree.getChildren(testTree.mSessionNodes[1])).resolves.toEqual([]); - }); }); describe("ZosJobsProvider unit tests - Function initializeFavChildNodeForProfile", () => { diff --git a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts index 9191013f51..2ab7070292 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -819,6 +819,7 @@ describe("ZosJobsProvider - getJobs", () => { value: () => ({ getJobsByParameters: false, getJobsByOwnerAndPrefix: () => ["test"], + getSession: () => globalMocks.testSession, }), }); jest.spyOn(Gui, "warningMessage").mockImplementation(); diff --git a/packages/zowe-explorer/__tests__/__unit__/uss/USSTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/uss/USSTree.unit.test.ts index 183b95b24d..56d20ad5b0 100644 --- a/packages/zowe-explorer/__tests__/__unit__/uss/USSTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/uss/USSTree.unit.test.ts @@ -1424,29 +1424,7 @@ describe("USSTree Unit Tests - Function USSTree.getChildren()", () => { expect(loadProfilesForFavoritesSpy).toHaveBeenCalledWith(log, favProfileNode); }); - - it("Testing that getChildren() returns the empty array if the profile has unverified status", async () => { - const globalMocks = await createGlobalMocks(); - - const testDir = new ZoweUSSNode("aDir", vscode.TreeItemCollapsibleState.Collapsed, globalMocks.testTree.mSessionNodes[1], null, "test"); - globalMocks.testTree.mSessionNodes[1].children.push(testDir); - const mockApiResponseItems = { - items: [ - { - mode: "d", - mSessionName: "sestest", - name: "aDir", - }, - ], - }; - const mockApiResponseWithItems = createFileResponse(mockApiResponseItems); - globalMocks.withProgress.mockReturnValue(mockApiResponseWithItems); - jest.spyOn(Profiles.getInstance(), "checkCurrentProfile").mockResolvedValueOnce({ status: "unverified" } as any); - const sessChildren = await globalMocks.testTree.getChildren(globalMocks.testTree.mSessionNodes[1]); - expect(sessChildren.length).toEqual(0); - }); }); - // Idea is borrowed from: https://github.com/kulshekhar/ts-jest/blob/master/src/util/testing.ts const mocked = any>(fn: T): jest.Mock> => fn as any; diff --git a/packages/zowe-explorer/i18n/sample/src/Profiles.i18n.json b/packages/zowe-explorer/i18n/sample/src/Profiles.i18n.json index 5885df7642..8c54f161a0 100644 --- a/packages/zowe-explorer/i18n/sample/src/Profiles.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/Profiles.i18n.json @@ -27,9 +27,8 @@ "validateProfiles.cancelled": "Validating {0} was cancelled.", "validateProfiles.error": "Profile validation failed for {0}.", "ssoAuth.noBase": "This profile does not support token authentication.", - "ssoLogin.error": "Unable to log in with {0}. {1}", - "ssoLogin.unableToLogin": "Unable to log in with {0}. {1}", "ssoLogin.successful": "Login to authentication service was successful.", + "ssoLogin.error": "Unable to log in with {0}. {1}", "ssoLogout.successful": "Logout from authentication service was successful for {0}.", "ssoLogout.error": "Unable to log out with {0}. {1}", "getConfigLocationPrompt.placeholder.create": "Select the location where the config file will be initialized", diff --git a/packages/zowe-explorer/i18n/sample/src/dataset/ZoweDatasetNode.i18n.json b/packages/zowe-explorer/i18n/sample/src/dataset/ZoweDatasetNode.i18n.json index 71b5af74f2..32dfe9ccbe 100644 --- a/packages/zowe-explorer/i18n/sample/src/dataset/ZoweDatasetNode.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/dataset/ZoweDatasetNode.i18n.json @@ -3,5 +3,7 @@ "getChildren.error.invalidNode": "Invalid node", "getChildren.responses.error": "The response from Zowe CLI was not successful", "getChildren.invalidMember": "Cannot access member with control characters in the name: {0}", - "getChildren.noDataset": "No data sets found" + "getChildren.noDataset": "No data sets found", + "getDataSets.error.sessionMissing": "Profile auth error", + "getDataSets.error.additionalDetails": "Profile is not authenticated, please log in to continue" } diff --git a/packages/zowe-explorer/i18n/sample/src/dataset/actions.i18n.json b/packages/zowe-explorer/i18n/sample/src/dataset/actions.i18n.json index dc19e2af70..aa1718439c 100644 --- a/packages/zowe-explorer/i18n/sample/src/dataset/actions.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/dataset/actions.i18n.json @@ -29,9 +29,9 @@ "createMember.member.validation": "Enter valid member name", "createMember.creating": "Creating new data set member {0}", "createMember.error": "Unable to create member.", + "dataSet.opening": "$(sync~spin) Opening data set...", "openPS.error": "Invalid data set or member.", "openPS.openDataSet": "Opening {0}", - "dataSet.opening": "$(sync~spin) Opening data set...", "createFile.allocatingNewDataSet": "Attempting to allocate new data set", "handleUserSelection.qp.prompt": "Click on parameters to change them", "createFile.inputBox.placeHolder": "Name of Data Set", diff --git a/packages/zowe-explorer/i18n/sample/src/job/ZoweJobNode.i18n.json b/packages/zowe-explorer/i18n/sample/src/job/ZoweJobNode.i18n.json index 569bf3852e..9e9e04a0f1 100644 --- a/packages/zowe-explorer/i18n/sample/src/job/ZoweJobNode.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/job/ZoweJobNode.i18n.json @@ -3,5 +3,7 @@ "getChildren.noSpoolFiles": "There are no JES spool messages to display", "getChildren.noJobs": "No jobs found", "getJobs.status.not.supported": "Filtering by job status is not yet supported with this profile type. Will show jobs with all statuses.", + "getJobs.error.sessionMissing": "Profile auth error", + "getJobs.error.additionalDetails": "Profile is not authenticated, please log in to continue", "getChildren.error.response": "Retrieving response from " } diff --git a/packages/zowe-explorer/i18n/sample/src/uss/ZoweUSSNode.i18n.json b/packages/zowe-explorer/i18n/sample/src/uss/ZoweUSSNode.i18n.json index f613e8b554..12ae0c3133 100644 --- a/packages/zowe-explorer/i18n/sample/src/uss/ZoweUSSNode.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/uss/ZoweUSSNode.i18n.json @@ -1,5 +1,7 @@ { "getChildren.error.invalidNode": "Invalid node", + "getChildren.error.sessionMissing": "Profile auth error", + "getChildren.error.additionalDetails": "Profile is not authenticated, please log in to continue", "getChildren.responses.error.response": "The response from Zowe CLI was not successful", "getChildren.error.response": "Retrieving response from ", "getChildren.responses.open": "Open", diff --git a/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json b/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json index 265cf6e210..2ed2cbc4ff 100644 --- a/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json @@ -1,7 +1,7 @@ { "errorHandling.invalid.host": "Required parameter 'host' must not be blank.", "errorHandling.invalid.credentials": "Invalid Credentials for profile '{0}'. Please ensure the username and password are valid or this may lead to a lock-out.", - "errorHandling.invalid.token": "Your connection is no longer active. Please log in to an authentication service to restore the connection.", + "errorHandling.invalid.token": "Your connection is no longer active for profile '{0}'. Please log in to an authentication service to restore the connection.", "errorHandling.authentication.login": "Log in to Authentication Service", "errorHandling.checkCredentials.button": "Update Credentials", "errorHandling.checkCredentials.cancelled": "Operation Cancelled", diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 5e02a87893..fb6bd6c2f2 100644 --- a/packages/zowe-explorer/package.json +++ b/packages/zowe-explorer/package.json @@ -2,7 +2,7 @@ "name": "vscode-extension-for-zowe", "displayName": "%displayName%", "description": "%description%", - "version": "2.11.0-SNAPSHOT", + "version": "2.12.0-SNAPSHOT", "publisher": "Zowe", "author": "Zowe", "license": "EPL-2.0", @@ -1996,7 +1996,7 @@ "copy-webpack-plugin": "^6.4.1", "cross-env": "^5.2.0", "del": "^4.1.1", - "eslint-plugin-zowe-explorer": "2.11.0-SNAPSHOT", + "eslint-plugin-zowe-explorer": "2.12.0-SNAPSHOT", "event-stream": "^4.0.1", "expect": "^24.8.0", "geckodriver": "^1.19.1", @@ -2022,7 +2022,7 @@ }, "dependencies": { "@zowe/secrets-for-zowe-sdk": "7.18.4", - "@zowe/zowe-explorer-api": "2.11.0-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.12.0-SNAPSHOT", "fs-extra": "8.0.1", "isbinaryfile": "4.0.4", "js-yaml": "3.13.1", diff --git a/packages/zowe-explorer/src/Profiles.ts b/packages/zowe-explorer/src/Profiles.ts index 8c1070b583..1cdf3bd059 100644 --- a/packages/zowe-explorer/src/Profiles.ts +++ b/packages/zowe-explorer/src/Profiles.ts @@ -1244,9 +1244,16 @@ export class Profiles extends ProfilesCache { * @returns {string[]} an array with the secure properties */ public async getSecurePropsForProfile(profileName: string): Promise { + if (!profileName) { + return []; + } + if ((await this.getProfileInfo()).usingTeamConfig) { + const config = (await this.getProfileInfo()).getTeamConfig(); + return config.api.secure.securePropsForProfile(profileName); + } const profAttrs = await this.getProfileFromConfig(profileName); const mergedArgs = (await this.getProfileInfo()).mergeArgsForProfile(profAttrs); - return [...mergedArgs.knownArgs, ...mergedArgs.missingArgs].filter((arg) => arg.secure).map((arg) => arg.argName); + return mergedArgs.knownArgs.filter((arg) => arg.secure).map((arg) => arg.argName); } private async loginWithBaseProfile(serviceProfile: zowe.imperative.IProfileLoaded, loginTokenType: string, node?: IZoweNodeType): Promise { diff --git a/packages/zowe-explorer/src/dataset/DatasetTree.ts b/packages/zowe-explorer/src/dataset/DatasetTree.ts index 8cb3771aff..41e428768d 100644 --- a/packages/zowe-explorer/src/dataset/DatasetTree.ts +++ b/packages/zowe-explorer/src/dataset/DatasetTree.ts @@ -157,11 +157,6 @@ export class DatasetTree extends ZoweTreeProvider implements IZoweTree 0) { diff --git a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts index 48be0efaf9..2e966abb34 100644 --- a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts +++ b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts @@ -305,6 +305,13 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod ), ]; const mvsApi = ZoweExplorerApiRegister.getMvsApi(cachedProfile); + if (!mvsApi.getSession(mvsApi?.profile)) { + throw new zowe.imperative.ImperativeError({ + msg: localize("getDataSets.error.sessionMissing", "Profile auth error"), + additionalDetails: localize("getDataSets.error.additionalDetails", "Profile is not authenticated, please log in to continue"), + errorCode: `${zowe.imperative.RestConstants.HTTP_STATUS_401}`, + }); + } if (mvsApi.dataSetsMatchingPattern) { responses.push(await mvsApi.dataSetsMatchingPattern(dsPatterns)); } else { diff --git a/packages/zowe-explorer/src/job/ZosJobsProvider.ts b/packages/zowe-explorer/src/job/ZosJobsProvider.ts index 15001ee6bf..3333724e6f 100644 --- a/packages/zowe-explorer/src/job/ZosJobsProvider.ts +++ b/packages/zowe-explorer/src/job/ZosJobsProvider.ts @@ -197,11 +197,6 @@ export class ZosJobsProvider extends ZoweTreeProvider implements IZoweTree 0) { jobsInternal.push(await ZoweExplorerApiRegister.getJesApi(cachedProfile).getJob(searchId)); } else { + if (!ZoweExplorerApiRegister.getJesApi(cachedProfile).getSession(cachedProfile)) { + throw new zowe.imperative.ImperativeError({ + msg: localize("getJobs.error.sessionMissing", "Profile auth error"), + additionalDetails: localize("getJobs.error.additionalDetails", "Profile is not authenticated, please log in to continue"), + errorCode: `${zowe.imperative.RestConstants.HTTP_STATUS_401}`, + }); + } if (ZoweExplorerApiRegister.getJesApi(cachedProfile).getJobsByParameters) { jobsInternal = await ZoweExplorerApiRegister.getJesApi(cachedProfile).getJobsByParameters({ owner, diff --git a/packages/zowe-explorer/src/uss/USSTree.ts b/packages/zowe-explorer/src/uss/USSTree.ts index be393857b9..c53a3b3fd3 100644 --- a/packages/zowe-explorer/src/uss/USSTree.ts +++ b/packages/zowe-explorer/src/uss/USSTree.ts @@ -296,10 +296,6 @@ export class USSTree extends ZoweTreeProvider implements IZoweTree { const baseProfile = Profiles.getInstance().getDefaultProfile("base"); - const isUsingZosmf = (await Profiles.getInstance().getLoadedProfConfig(profileName)).type === "zosmf"; const secureProfileProps = await Profiles.getInstance().getSecurePropsForProfile(profileName); const secureBaseProfileProps = await Profiles.getInstance().getSecurePropsForProfile(baseProfile?.name); - if (isUsingZosmf && baseProfile) { - return secureProfileProps.includes("tokenValue") || secureBaseProfileProps.includes("tokenValue"); - } - return secureProfileProps.includes("tokenValue"); + const profileUsesBasicAuth = secureProfileProps.includes("user") && secureProfileProps.includes("password"); + return (secureProfileProps.includes("tokenValue") || secureBaseProfileProps.includes("tokenValue")) && !profileUsesBasicAuth; } /** diff --git a/packages/zowe-explorer/webviews/edit-attributes/package.json b/packages/zowe-explorer/webviews/edit-attributes/package.json index 1bedd9b14c..f26f971a75 100644 --- a/packages/zowe-explorer/webviews/edit-attributes/package.json +++ b/packages/zowe-explorer/webviews/edit-attributes/package.json @@ -2,7 +2,7 @@ "name": "edit-attributes", "private": true, "type": "module", - "version": "2.10.0-SNAPSHOT", + "version": "2.12.0-SNAPSHOT", "main": "index.js", "license": "EPL-2.0", "scripts": {