From 580227ce436b9434230663f0426719148dc80c71 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Wed, 14 Jun 2023 14:23:40 -0400 Subject: [PATCH 01/80] update version to "2.9.1-SNAPSHOT" Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/eslint-plugin-zowe-explorer/package.json | 2 +- packages/zowe-explorer-api/package.json | 2 +- packages/zowe-explorer-ftp-extension/package.json | 4 ++-- packages/zowe-explorer/package.json | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin-zowe-explorer/package.json b/packages/eslint-plugin-zowe-explorer/package.json index ce30dbad4d..14653eff4f 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.10.0-SNAPSHOT", + "version": "2.9.1-SNAPSHOT", "description": "Custom ESLint Rules for ZOWE Explorer", "keywords": [ "eslint", diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index 08415ea491..c8f42ee61c 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.10.0-SNAPSHOT", + "version": "2.9.1-SNAPSHOT", "description": "Extensibility API for Zowe Explorer.", "publisher": "Zowe", "author": "Zowe", diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index 233ed59271..062a1fbebf 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.10.0-SNAPSHOT", + "version": "2.9.1-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.10.0-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.9.1-SNAPSHOT", "tmp": "0.2.1" }, "devDependencies": { diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 4030b8b250..93d0fab52f 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.10.0-SNAPSHOT", + "version": "2.9.1-SNAPSHOT", "publisher": "Zowe", "author": "Zowe", "license": "EPL-2.0", @@ -1945,7 +1945,7 @@ "chalk": "^2.4.1", "cross-env": "^5.2.0", "del": "^4.1.1", - "eslint-plugin-zowe-explorer": "2.10.0-SNAPSHOT", + "eslint-plugin-zowe-explorer": "2.9.1-SNAPSHOT", "event-stream": "^4.0.1", "expect": "^24.8.0", "geckodriver": "^1.19.1", @@ -1971,7 +1971,7 @@ "webpack-cli": "^3.3.11" }, "dependencies": { - "@zowe/zowe-explorer-api": "2.10.0-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.9.1-SNAPSHOT", "fs-extra": "8.0.1", "isbinaryfile": "4.0.4", "js-yaml": "3.13.1", From 62fac4dcce37a4681b66f0a632412722b346e0c5 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Fri, 16 Jun 2023 09:39:21 -0400 Subject: [PATCH 02/80] update lerna Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 43b0635765..be38e36318 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.10.0-SNAPSHOT", + "version": "2.9.1-SNAPSHOT", "command": { "version": { "forcePublish": true, From 722d9424a5d25803600d0f0c9083e573689c875b Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 13 Jun 2023 09:59:04 -0400 Subject: [PATCH 03/80] Patchwork fix to use VSCode keytar Signed-off-by: Andrew W. Harn --- packages/zowe-explorer-api/src/profiles/ProfilesCache.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts b/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts index 857d67783f..ca57331240 100644 --- a/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts +++ b/packages/zowe-explorer-api/src/profiles/ProfilesCache.ts @@ -16,6 +16,7 @@ import { URL } from "url"; import * as zowe from "@zowe/cli"; import { ZoweExplorerApi } from "./ZoweExplorerApi"; +import { getSecurityModules } from "../security"; // TODO: find a home for constants export const CONTEXT_PREFIX = "_"; @@ -72,8 +73,10 @@ export class ProfilesCache { this.cwd = cwd != null ? getFullPath(cwd) : undefined; } - public async getProfileInfo(): Promise { - const mProfileInfo = new zowe.imperative.ProfileInfo("zowe"); + public async getProfileInfo(envTheia = false): Promise { + const mProfileInfo = new zowe.imperative.ProfileInfo("zowe", { + credMgrOverride: zowe.imperative.ProfileCredentials.defaultCredMgrWithKeytar(() => getSecurityModules("keytar", envTheia)), + }); await mProfileInfo.readProfilesFromDisk({ homeDir: getZoweDir(), projectDir: this.cwd ?? undefined }); return mProfileInfo; } From 8456ecac0b7b8bd23ebab631bc30c2711fba15f8 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 13 Jun 2023 10:17:40 -0400 Subject: [PATCH 04/80] Update changelog Signed-off-by: Andrew W. Harn --- packages/zowe-explorer-api/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index cee55f45db..502cf68ba8 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added z/OSMF API implementation for `cancelJob` function. - Added optional `id` variable to `IZoweTreeNode` interface, which can be used to designate a unique ID for a tree node. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) +- Fixed error when an extender's extension attempts to access the keyring in a remote VSCode session [#324](https://github.com/zowe/vscode-extension-for-cics/issues/324). - Fixed error shown by API when accessing the `name` and `type` property of a profile when updating the profile arrays [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334). ## `2.8.1` From 49b41a3dbf0f68f3ce7613780388e3620cc47ee3 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 15 Jun 2023 08:10:41 -0400 Subject: [PATCH 05/80] Add condition to initialization test Signed-off-by: Andrew W. Harn --- .../__tests__/__unit__/profiles/ProfilesCache.unit.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts index b7b5567805..c091c46f63 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts @@ -14,6 +14,8 @@ import * as path from "path"; import * as zowe from "@zowe/cli"; import { ProfilesCache } from "../../../src/profiles/ProfilesCache"; import { ZoweExplorerApi } from "../../../src"; +import { getSecurityModules } from "../../../src/security/KeytarCredentialManager"; +jest.mock("../../../src/security/KeytarCredentialManager"); jest.mock("fs"); jest.mock("@zowe/cli", () => { @@ -124,6 +126,7 @@ describe("ProfilesCache", () => { const fakeLogger = { debug: jest.fn() }; const fakeZoweDir = zowe.getZoweDir(); const readProfilesFromDiskSpy = jest.spyOn(zowe.imperative.ProfileInfo.prototype, "readProfilesFromDisk"); + const defaultCredMgrWithKeytarSpy = jest.spyOn(zowe.imperative.ProfileCredentials, "defaultCredMgrWithKeytar"); afterEach(() => { jest.clearAllMocks(); @@ -132,6 +135,7 @@ describe("ProfilesCache", () => { it("getProfileInfo should initialize ProfileInfo API", async () => { const profInfo = await new ProfilesCache(fakeLogger as unknown as zowe.imperative.Logger, __dirname).getProfileInfo(); expect(readProfilesFromDiskSpy).toHaveBeenCalledTimes(1); + expect(defaultCredMgrWithKeytarSpy).toHaveBeenCalledTimes(1); const teamConfig = profInfo.getTeamConfig(); expect(teamConfig.appName).toBe("zowe"); expect(teamConfig.paths).toEqual([ From 856acf50b4109d72c70d4e77f1f69c9260ede3d9 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Thu, 15 Jun 2023 08:44:15 -0400 Subject: [PATCH 06/80] Removed unused import Signed-off-by: Andrew W. Harn --- .../__tests__/__unit__/profiles/ProfilesCache.unit.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts index c091c46f63..ac1aa333cb 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ProfilesCache.unit.test.ts @@ -14,8 +14,6 @@ import * as path from "path"; import * as zowe from "@zowe/cli"; import { ProfilesCache } from "../../../src/profiles/ProfilesCache"; import { ZoweExplorerApi } from "../../../src"; -import { getSecurityModules } from "../../../src/security/KeytarCredentialManager"; -jest.mock("../../../src/security/KeytarCredentialManager"); jest.mock("fs"); jest.mock("@zowe/cli", () => { From 67fbcc0870458cf1c127be02d9d840bb6e27721c Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 20 Jun 2023 08:57:43 -0400 Subject: [PATCH 07/80] fix location of CHANGELOG item Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer-api/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 502cf68ba8..1d1566b2cf 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t ### Bug fixes +- Fixed error when an extender's extension attempts to access the keyring in a remote VSCode session [#324](https://github.com/zowe/vscode-extension-for-cics/issues/324). + ## `2.9.0` ### New features and enhancements @@ -17,8 +19,6 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added optional `cancelJob` function to `ZoweExplorerApi.IJes` interface. - Added z/OSMF API implementation for `cancelJob` function. - Added optional `id` variable to `IZoweTreeNode` interface, which can be used to designate a unique ID for a tree node. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) - -- Fixed error when an extender's extension attempts to access the keyring in a remote VSCode session [#324](https://github.com/zowe/vscode-extension-for-cics/issues/324). - Fixed error shown by API when accessing the `name` and `type` property of a profile when updating the profile arrays [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334). ## `2.8.1` From 952227c3dddd159c1507dd1f1ea1f19d34f65391 Mon Sep 17 00:00:00 2001 From: Rudy Flores <68666202+rudyflores@users.noreply.github.com> Date: Tue, 20 Jun 2023 10:56:25 -0400 Subject: [PATCH 08/80] Fix watcher on browser based environments Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com> --- .../__unit__/Profiles.extended.unit.test.ts | 12 -------- .../__unit__/shared/init.unit.test.ts | 11 ------- .../i18n/sample/src/Profiles.i18n.json | 2 -- .../i18n/sample/src/shared/init.i18n.json | 5 ++-- packages/zowe-explorer/src/Profiles.ts | 21 ++----------- packages/zowe-explorer/src/shared/init.ts | 30 ++++++++----------- 6 files changed, 17 insertions(+), 64 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/Profiles.extended.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/Profiles.extended.unit.test.ts index 7bc48174f2..aa8bd1fd34 100644 --- a/packages/zowe-explorer/__tests__/__unit__/Profiles.extended.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/Profiles.extended.unit.test.ts @@ -1671,18 +1671,6 @@ describe("Profiles Unit Tests - function validationArraySetup", () => { }); }); -describe("Profiles Unit Tests - function promptToRefreshForProfiles", () => { - it("should reload extension", async () => { - jest.spyOn(Gui, "showMessage").mockResolvedValueOnce("Refresh Zowe Explorer"); - Object.defineProperty(globals, "ISTHEIA", { - value: true, - }); - const refreshSpy = jest.spyOn(vscode.commands, "executeCommand").mockImplementation(); - await expect((Profiles.getInstance() as any).promptToRefreshForProfiles("./test")).resolves.not.toThrow(); - expect(refreshSpy).toBeCalledTimes(1); - }); -}); - describe("Profiles Unit Tests - function loginCredentialPrompt", () => { afterEach(() => { jest.resetAllMocks(); diff --git a/packages/zowe-explorer/__tests__/__unit__/shared/init.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/shared/init.unit.test.ts index 7c30c457e1..db5e85e888 100644 --- a/packages/zowe-explorer/__tests__/__unit__/shared/init.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/shared/init.unit.test.ts @@ -268,17 +268,6 @@ describe("Test src/shared/extension", () => { jest.restoreAllMocks(); }); - it("Test assuming we are in a Theia environment", async () => { - Object.defineProperty(globals, "ISTHEIA", { value: true }); - await extRefreshCallback(); - expect(spyExecuteCommand).toHaveBeenCalledWith("workbench.action.reloadWindow"); - expect(spyExecuteCommand).toHaveBeenCalledTimes(1); - expect(deactivate).not.toHaveBeenCalled(); - expect(dispose).not.toHaveBeenCalled(); - expect(spyLogError).not.toHaveBeenCalled(); - expect(activate).not.toHaveBeenCalled(); - }); - it("Test assuming we are NOT in a Theia environment", async () => { Object.defineProperty(globals, "ISTHEIA", { value: false }); await extRefreshCallback(); diff --git a/packages/zowe-explorer/i18n/sample/src/Profiles.i18n.json b/packages/zowe-explorer/i18n/sample/src/Profiles.i18n.json index 28af856977..5d6ec7e6b4 100644 --- a/packages/zowe-explorer/i18n/sample/src/Profiles.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/Profiles.i18n.json @@ -36,8 +36,6 @@ "getConfigLocationPrompt.showQuickPick.project": "Project: in the current working directory", "checkExistingConfig.createNew.button": "Create New", "checkExistingConfig.createNew.message": "A Team Configuration File already exists in this location\n{0}\nContinuing may alter the existing file, would you like to proceed?", - "createZoweSchema.reload.button": "Refresh Zowe Explorer", - "createZoweSchema.reload.infoMessage": "Team Configuration file created. Location: {0}. \n Please update file and refresh Zowe Explorer via button or command palette.", "deletePrompt.deleting": "Deleting profile {0}", "deletePrompt.qp.placeholder": "Delete {0}? This will permanently remove it from your system.", "deletePrompt.qpButton.delete": "Delete", diff --git a/packages/zowe-explorer/i18n/sample/src/shared/init.i18n.json b/packages/zowe-explorer/i18n/sample/src/shared/init.i18n.json index de3a06b425..7151780841 100644 --- a/packages/zowe-explorer/i18n/sample/src/shared/init.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/shared/init.i18n.json @@ -6,8 +6,7 @@ "activate.didSaveText.isUSSFile": "File is a USS file -- saving", "activate.didSaveText.file": "File ", "activate.didSaveText.notDataSet": " is not a data set or USS file ", - "watchConfigProfile.theia": "Team config file watcher is disabled in Theia environment.", - "watchConfigProfile.create": "Team config file created, refreshing Zowe Expkorer.", - "watchConfigProfile.delete": "Team config file deleted, refreshing Zowe Expkorer.", + "watchConfigProfile.create": "Team config file created, refreshing Zowe Explorer.", + "watchConfigProfile.delete": "Team config file deleted, refreshing Zowe Explorer.", "watchConfigProfile.update": "Team config file updated." } diff --git a/packages/zowe-explorer/src/Profiles.ts b/packages/zowe-explorer/src/Profiles.ts index c6d4a0e9bf..8f639df852 100644 --- a/packages/zowe-explorer/src/Profiles.ts +++ b/packages/zowe-explorer/src/Profiles.ts @@ -649,6 +649,9 @@ export class Profiles extends ProfilesCache { config.api.layers.merge(newConfig); await config.save(false); + if (globals.ISTHEIA) { + vscode.commands.executeCommand("zowe.extRefresh"); + } let configName; if (user) { configName = config.userConfigName; @@ -656,7 +659,6 @@ export class Profiles extends ProfilesCache { configName = config.configName; } await this.openConfigFile(path.join(rootPath, configName)); - await this.promptToRefreshForProfiles(rootPath); return path.join(rootPath, configName); } catch (err) { ZoweLogger.error(err); @@ -1347,23 +1349,6 @@ export class Profiles extends ProfilesCache { return existingLayers; } - private async promptToRefreshForProfiles(rootPath: string): Promise { - ZoweLogger.trace("Profiles.promptToRefreshForProfiles called."); - if (globals.ISTHEIA) { - const reloadButton = localize("createZoweSchema.reload.button", "Refresh Zowe Explorer"); - const infoMsg = localize( - "createZoweSchema.reload.infoMessage", - "Team Configuration file created. Location: {0}. \n Please update file and refresh Zowe Explorer via button or command palette.", - rootPath - ); - await Gui.showMessage(infoMsg, { items: [reloadButton] }).then(async (selection) => { - if (selection === reloadButton) { - await vscode.commands.executeCommand("zowe.extRefresh"); - } - }); - } - } - private getProfileIcon(osLocInfo: zowe.imperative.IProfLocOsLoc[]): string[] { ZoweLogger.trace("Profiles.getProfileIcon called."); const ret: string[] = []; diff --git a/packages/zowe-explorer/src/shared/init.ts b/packages/zowe-explorer/src/shared/init.ts index 9225a32d10..04d06f7121 100644 --- a/packages/zowe-explorer/src/shared/init.ts +++ b/packages/zowe-explorer/src/shared/init.ts @@ -51,19 +51,15 @@ export function registerRefreshCommand( // set a command to silently reload extension context.subscriptions.push( vscode.commands.registerCommand("zowe.extRefresh", async () => { - if (globals.ISTHEIA) { - await vscode.commands.executeCommand("workbench.action.reloadWindow"); - } else { - await deactivate(); - for (const sub of context.subscriptions) { - try { - await sub.dispose(); - } catch (e) { - ZoweLogger.error(e); - } + await deactivate(); + for (const sub of context.subscriptions) { + try { + await sub.dispose(); + } catch (e) { + ZoweLogger.error(e); } - await activate(context); } + await activate(context); }) ); } @@ -209,11 +205,6 @@ export function registerCommonCommands(context: vscode.ExtensionContext, provide export function watchConfigProfile(context: vscode.ExtensionContext, providers: IZoweProviders): void { ZoweLogger.trace("shared.init.watchConfigProfile called."); - if (globals.ISTHEIA) { - ZoweLogger.warn(localize("watchConfigProfile.theia", "Team config file watcher is disabled in Theia environment.")); - return; - } - const watchers: vscode.FileSystemWatcher[] = []; watchers.push(vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(getZoweDir(), "{zowe.config,zowe.config.user}.json"))); @@ -229,11 +220,11 @@ export function watchConfigProfile(context: vscode.ExtensionContext, providers: watchers.forEach((watcher) => { watcher.onDidCreate(async () => { - ZoweLogger.info(localize("watchConfigProfile.create", "Team config file created, refreshing Zowe Expkorer.")); + ZoweLogger.info(localize("watchConfigProfile.create", "Team config file created, refreshing Zowe Explorer.")); await vscode.commands.executeCommand("zowe.extRefresh"); }); watcher.onDidDelete(async () => { - ZoweLogger.info(localize("watchConfigProfile.delete", "Team config file deleted, refreshing Zowe Expkorer.")); + ZoweLogger.info(localize("watchConfigProfile.delete", "Team config file deleted, refreshing Zowe Explorer.")); await vscode.commands.executeCommand("zowe.extRefresh"); }); watcher.onDidChange(async (uri: vscode.Uri) => { @@ -246,6 +237,9 @@ export function watchConfigProfile(context: vscode.ExtensionContext, providers: await refreshActions.refreshAll(providers.ds); await refreshActions.refreshAll(providers.uss); await refreshActions.refreshAll(providers.job); + if (globals.ISTHEIA) { + await vscode.commands.executeCommand("zowe.extRefresh"); + } }); }); } From 5272381e19bf8667054acfad46b7afad63b30edf Mon Sep 17 00:00:00 2001 From: Rudy Flores <68666202+rudyflores@users.noreply.github.com> Date: Tue, 20 Jun 2023 11:00:37 -0400 Subject: [PATCH 09/80] Add changes to CHANGELOG.md Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com> --- packages/zowe-explorer/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 0668897722..105b7340e4 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes +- Fixed profile watcher for browser based environments. [#2211](https://github.com/zowe/vscode-extension-for-zowe/issues/2211) + ## `2.9.0` ### New features and enhancements From 42bb64b5aad9bc14e7b189dc96053adbdf6db2ba Mon Sep 17 00:00:00 2001 From: Rudy Flores <68666202+rudyflores@users.noreply.github.com> Date: Tue, 20 Jun 2023 11:44:00 -0400 Subject: [PATCH 10/80] add coverage for new change Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com> --- .../__unit__/Profiles.extended.unit.test.ts | 1 + .../__unit__/shared/init.unit.test.ts | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/Profiles.extended.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/Profiles.extended.unit.test.ts index aa8bd1fd34..bd7ea23112 100644 --- a/packages/zowe-explorer/__tests__/__unit__/Profiles.extended.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/Profiles.extended.unit.test.ts @@ -772,6 +772,7 @@ describe("Profiles Unit Tests - Function createZoweSchema", () => { const globalMocks = await createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); + Object.defineProperty(globals, "ISTHEIA", { value: true, configurable: true }); Object.defineProperty(vscode.workspace, "workspaceFolders", { value: undefined, configurable: true, diff --git a/packages/zowe-explorer/__tests__/__unit__/shared/init.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/shared/init.unit.test.ts index db5e85e888..d6478f291c 100644 --- a/packages/zowe-explorer/__tests__/__unit__/shared/init.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/shared/init.unit.test.ts @@ -303,12 +303,12 @@ describe("Test src/shared/extension", () => { beforeEach(() => { context = { subscriptions: [] }; jest.clearAllMocks(); - Object.defineProperty(globals, "ISTHEIA", { value: false }); - Object.defineProperty(vscode.workspace, "createFileSystemWatcher", { value: () => watcher }); - Object.defineProperty(vscode.workspace, "workspaceFolders", { value: [{ uri: { fsPath: "fsPath" } }] }); - Object.defineProperty(vscode.commands, "executeCommand", { value: spyExecuteCommand }); - Object.defineProperty(vscode.workspace, "fs", { value: { readFile: spyReadFile } }); - Object.defineProperty(globals, "SAVED_PROFILE_CONTENTS", { value: "test" }); + Object.defineProperty(globals, "ISTHEIA", { value: false, configurable: true }); + Object.defineProperty(vscode.workspace, "createFileSystemWatcher", { value: () => watcher, configurable: true }); + Object.defineProperty(vscode.workspace, "workspaceFolders", { value: [{ uri: { fsPath: "fsPath" } }], configurable: true }); + Object.defineProperty(vscode.commands, "executeCommand", { value: spyExecuteCommand, configurable: true }); + Object.defineProperty(vscode.workspace, "fs", { value: { readFile: spyReadFile }, configurable: true }); + Object.defineProperty(globals, "SAVED_PROFILE_CONTENTS", { value: "test", configurable: true }); }); afterAll(() => { @@ -327,6 +327,20 @@ describe("Test src/shared/extension", () => { await sharedExtension.watchConfigProfile(context, { ds: "ds", uss: "uss", job: "job" } as any); expect(spyRefreshAll).toHaveBeenCalled(); }); + + it("should be able to refresh zowe explorer on theia after updating config file", async () => { + Object.defineProperty(globals, "ISTHEIA", { value: true, configurable: true }); + const spyRefreshAll = jest.spyOn(refreshActions, "refreshAll").mockImplementation(jest.fn()); + await sharedExtension.watchConfigProfile(context, { ds: "ds", uss: "uss", job: "job" } as any); + expect(context.subscriptions).toContain(watcher); + expect(spyReadFile).toHaveBeenCalledWith("uri"); + expect(spyRefreshAll).toHaveBeenCalled(); + + spyReadFile.mockReturnValue("other"); + await sharedExtension.watchConfigProfile(context, { ds: "ds", uss: "uss", job: "job" } as any); + expect(spyRefreshAll).toHaveBeenCalled(); + expect(spyExecuteCommand).toHaveBeenCalledWith("zowe.extRefresh"); + }); }); describe("initSubscribers", () => { From 2d15d23cc6da466425f83cf6dcc6a20d50aee748 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 20 Jun 2023 15:37:16 -0400 Subject: [PATCH 11/80] fix(ds,uss): optimize logic in getChildren function Signed-off-by: Trae Yelovich --- .../__unit__/uss/USSTree.unit.test.ts | 24 ++++++++++++++++++- .../ZoweUSSNode.unit.test.ts.snap | 3 +++ .../src/dataset/ZoweDatasetNode.ts | 7 ++++-- packages/zowe-explorer/src/uss/ZoweUSSNode.ts | 16 +++++++++++-- 4 files changed, 45 insertions(+), 5 deletions(-) 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 27fe4d982f..f66b043fe3 100644 --- a/packages/zowe-explorer/__tests__/__unit__/uss/USSTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/uss/USSTree.unit.test.ts @@ -1380,8 +1380,30 @@ describe("USSTree Unit Tests - Function USSTree.getChildren()", () => { const mockApiResponseWithItems = createFileResponse(mockApiResponseItems); globalMocks.withProgress.mockReturnValue(mockApiResponseWithItems); + jest.spyOn(zowe.List, "fileList").mockResolvedValueOnce({ + success: true, + apiResponse: { + items: [ + { + name: "myFile.txt", + mode: "-rw-r--r--", + size: 20, + uid: 0, + user: "WSADMIN", + gid: 1, + group: "OMVSGRP", + mtime: "2015-11-24T02:12:04", + }, + ], + returnedRows: 1, + totalRows: 1, + JSONversion: 1, + }, + commandResponse: undefined as any, + }); + const dirChildren = await globalMocks.testTree.getChildren(directory); - expect(dirChildren[1].label).toEqual(sampleChildren[0].label); + expect(dirChildren[0].label).toEqual(sampleChildren[0].label); }); it("Testing that getChildren() gets profile-loaded favorites for profile node in Favorites section", async () => { const globalMocks = await createGlobalMocks(); diff --git a/packages/zowe-explorer/__tests__/__unit__/uss/__snapshots__/ZoweUSSNode.unit.test.ts.snap b/packages/zowe-explorer/__tests__/__unit__/uss/__snapshots__/ZoweUSSNode.unit.test.ts.snap index 1a5dbb6f65..d77d14c250 100644 --- a/packages/zowe-explorer/__tests__/__unit__/uss/__snapshots__/ZoweUSSNode.unit.test.ts.snap +++ b/packages/zowe-explorer/__tests__/__unit__/uss/__snapshots__/ZoweUSSNode.unit.test.ts.snap @@ -43,6 +43,7 @@ ZoweUSSNode { "mParent": null, "mProfileName": "sestest", "parentPath": null, + "prevPath": "", "profile": undefined, "profileName": "", "session": Session { @@ -59,6 +60,7 @@ ZoweUSSNode { }, "mProfileName": "sestest", "parentPath": null, + "prevPath": "", "profile": undefined, "profileName": "", "session": null, @@ -66,6 +68,7 @@ ZoweUSSNode { }, "mProfileName": "sestest", "parentPath": null, + "prevPath": "", "profile": undefined, "profileName": "", "session": null, diff --git a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts index cca0cd24fc..3fa0a5a72f 100644 --- a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts +++ b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts @@ -240,9 +240,12 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod ), ]; } else { - this.children = Object.keys(elementChildren) + const newChildren = Object.keys(elementChildren) .sort() - .map((labels) => elementChildren[labels]); + .filter((label) => this.children.find((c) => (c.label as string) === label) == null) + .map((label) => elementChildren[label]); + + this.children = this.children.concat(newChildren).filter((c) => (c.label as string) in elementChildren); } return this.children; diff --git a/packages/zowe-explorer/src/uss/ZoweUSSNode.ts b/packages/zowe-explorer/src/uss/ZoweUSSNode.ts index d1803c0238..a30dc467aa 100644 --- a/packages/zowe-explorer/src/uss/ZoweUSSNode.ts +++ b/packages/zowe-explorer/src/uss/ZoweUSSNode.ts @@ -42,6 +42,7 @@ const localize: nls.LocalizeFunc = nls.loadMessageBundle(); */ export class ZoweUSSNode extends ZoweTreeNode implements IZoweUSSTreeNode { public command: vscode.Command; + public prevPath = ""; public fullPath = ""; public dirty = true; public children: IZoweUSSTreeNode[] = []; @@ -227,12 +228,23 @@ export class ZoweUSSNode extends ZoweTreeNode implements IZoweUSSTreeNode { } } }); + if (contextually.isSession(this)) { this.dirty = false; } - this.children = Object.keys(elementChildren) + + // If search path has changed, invalidate all children + if (this.fullPath?.length > 0 && this.prevPath !== this.fullPath) { + this.children = []; + } + + const newChildren = Object.keys(elementChildren) .sort() - .map((labels) => elementChildren[labels]); + .filter((label) => this.children.find((c) => (c.label as string) === label) == null) + .map((label) => elementChildren[label]); + + this.children = this.children.concat(newChildren).filter((c) => (c.label as string) in elementChildren); + this.prevPath = this.fullPath; return this.children; } From 7fe24b3d3c8a6bbae010c9510bbc604821e6ada3 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 21 Jun 2023 10:18:58 -0400 Subject: [PATCH 12/80] fix(jobs): optimize fetching children in Jobs view Signed-off-by: Trae Yelovich --- .../zowe-explorer/src/job/ZosJobsProvider.ts | 2 +- packages/zowe-explorer/src/job/ZoweJobNode.ts | 57 +++++++++++++------ 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZosJobsProvider.ts b/packages/zowe-explorer/src/job/ZosJobsProvider.ts index 6b9d868489..05978d76b1 100644 --- a/packages/zowe-explorer/src/job/ZosJobsProvider.ts +++ b/packages/zowe-explorer/src/job/ZosJobsProvider.ts @@ -821,8 +821,8 @@ export class ZosJobsProvider extends ZoweTreeProvider implements IZoweTree = {}; + let unmodifiedCount = this.children.length; if (contextually.isJob(this)) { + // Fetch spool files under job node const cachedProfile = Profiles.getInstance().loadNamedProfile(this.getProfileName()); const spools: zowe.IJobFile[] = ( (await ZoweExplorerApiRegister.getJesApi(cachedProfile).getSpoolFiles(this.job.jobname, this.job.jobid)) ?? [] @@ -150,9 +152,15 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } else { newLabel = `${spool.stepname}:${spool.ddname} - ${spool["record-count"]}`; } - const existing = this.children.find((element) => element.label.trim() === newLabel); + + // Only look for existing node w/ procstep if spool file has a procstep, + // otherwise look for the step:dd to update the record count in the label + const existing = this.children.find((element) => + element.label?.includes(`${spool.stepname}:${spool.ddname}${procstep ? ` - ${procstep}` : ""}`) + ); if (existing) { - elementChildren.push(existing); + existing.label = newLabel; + unmodifiedCount--; } else { const spoolNode = new Spool(newLabel, vscode.TreeItemCollapsibleState.None, this, this.session, spool, this.job, this); const icon = getIconByNode(spoolNode); @@ -164,10 +172,11 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { title: "", arguments: [sessionName, spool, refreshTimestamp], }; - elementChildren.push(spoolNode); + elementChildren[newLabel] = spoolNode; } }); } else { + // Fetch jobs under session node const jobs = await this.getJobs(this._owner, this._prefix, this._searchId, this._jobStatus); jobs.forEach((job) => { let nodeTitle: string; @@ -176,9 +185,12 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } else { nodeTitle = `${job.jobname}(${job.jobid}) - ${job.status}`; } - const existing = this.children.find((element) => element.label.trim() === nodeTitle); + // Do not look for status code as it might have changed from previous refresh + const existing = this.children.find((element) => element.label?.includes(`${job.jobname}(${job.jobid})`)); if (existing) { - elementChildren.push(existing); + // If matched, update the label to reflect latest retcode/status + existing.label = nodeTitle; + unmodifiedCount--; } else { const jobNode = new Job(nodeTitle, vscode.TreeItemCollapsibleState.Collapsed, this, this.session, job, this.getProfile()); jobNode.contextValue = globals.JOBS_JOB_CONTEXT; @@ -191,20 +203,31 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { jobNode.iconPath = icon.path; } } - elementChildren.push(jobNode); + elementChildren[nodeTitle] = jobNode; } }); } - elementChildren.sort((a, b) => { - if (a.job.jobid > b.job.jobid) { - return 1; - } - if (a.job.jobid < b.job.jobid) { - return -1; - } - return 0; - }); - this.children = elementChildren; + + // Child nodes already exist and every node was updated. + // Return cached list of child nodes + if (this.children.length && unmodifiedCount === 0) { + return this.children; + } + + // Only add new children that are not in the list of existing child nodes + const newChildren = Object.values(elementChildren) + .sort((a, b) => { + if (a.job.jobid > b.job.jobid) { + return 1; + } + if (a.job.jobid < b.job.jobid) { + return -1; + } + return 0; + }) + .filter((c) => this.children.find((ch) => ch.label === c.label) == null); + // Remove any children that are no longer present in the built record + this.children = this.children.concat(newChildren).filter((ch) => ch.label in elementChildren); } this.dirty = false; return this.children; From c97f8ceb2833b6f759df14dd4ee8ae194808d61a Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 21 Jun 2023 10:29:43 -0400 Subject: [PATCH 13/80] docs: Add fix to ZE changelog Signed-off-by: Trae Yelovich --- packages/zowe-explorer/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 0668897722..7eeeed216a 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes +- Optimized fetching and caching of child nodes across the primary tree views (Data Sets, Unix System Services, Jobs). + ## `2.9.0` ### New features and enhancements From 5c1641fcda0b2873b884711a4c9ac59dc53fff92 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 21 Jun 2023 12:55:42 -0400 Subject: [PATCH 14/80] fix: optimize sorting for tree items Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 12 ++---------- packages/zowe-explorer/src/shared/utils.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 245b59bd97..05ab4b8770 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -186,7 +186,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { nodeTitle = `${job.jobname}(${job.jobid}) - ${job.status}`; } // Do not look for status code as it might have changed from previous refresh - const existing = this.children.find((element) => element.label?.includes(`${job.jobname}(${job.jobid})`)); + const existing = this.children.find((element) => element.label?.startsWith(`${job.jobname}(${job.jobid})`)); if (existing) { // If matched, update the label to reflect latest retcode/status existing.label = nodeTitle; @@ -216,15 +216,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { // Only add new children that are not in the list of existing child nodes const newChildren = Object.values(elementChildren) - .sort((a, b) => { - if (a.job.jobid > b.job.jobid) { - return 1; - } - if (a.job.jobid < b.job.jobid) { - return -1; - } - return 0; - }) + .sort((a, b) => a.job.jobid - b.job.jobid) .filter((c) => this.children.find((ch) => ch.label === c.label) == null); // Remove any children that are no longer present in the built record this.children = this.children.concat(newChildren).filter((ch) => ch.label in elementChildren); diff --git a/packages/zowe-explorer/src/shared/utils.ts b/packages/zowe-explorer/src/shared/utils.ts index 312544a3db..98b6a293ad 100644 --- a/packages/zowe-explorer/src/shared/utils.ts +++ b/packages/zowe-explorer/src/shared/utils.ts @@ -91,12 +91,15 @@ export function sortTreeItems(favorites: vscode.TreeItem[], specificContext): vo if (a.contextValue === specificContext) { if (b.contextValue === specificContext) { return a.label.toString().toUpperCase() > b.label.toString().toUpperCase() ? 1 : -1; - } else { - return -1; } - } else if (b.contextValue === specificContext) { + + return -1; + } + + if (b.contextValue === specificContext) { return 1; } + return a.label.toString().toUpperCase() > b.label.toString().toUpperCase() ? 1 : -1; }); } From b02f401003f8c6147ca4ad6a22a64294636253dd Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 21 Jun 2023 16:22:50 -0400 Subject: [PATCH 15/80] test: Add test cases for sortTreeItems Signed-off-by: Trae Yelovich --- .../__unit__/shared/utils.unit.test.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/zowe-explorer/__tests__/__unit__/shared/utils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/shared/utils.unit.test.ts index 2360f90601..4fa7ad9190 100644 --- a/packages/zowe-explorer/__tests__/__unit__/shared/utils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/shared/utils.unit.test.ts @@ -534,3 +534,31 @@ describe("Shared Utils Unit Tests - Function getSelectedNodeList", () => { return node; } }); + +describe("Shared utils unit tests - function sortTreeItems", () => { + it("prioritizes context value when sorting", () => { + const toSort = [ + { label: "A", contextValue: "some_context" }, + { label: "Z", contextValue: "some_other_context" }, + { label: "Y", contextValue: "some_context" }, + { label: "X", contextValue: "some_context" }, + { label: "W", contextValue: "some_other_context" }, + { label: "V", contextValue: "some_context" }, + { label: "U", contextValue: "some_other_context" }, + { label: "T", contextValue: "some_other_context" }, + { label: "B", contextValue: "some_other_context" }, + ]; + sharedUtils.sortTreeItems(toSort, "some_context"); + expect(toSort).toStrictEqual([ + { label: "A", contextValue: "some_context" }, + { label: "V", contextValue: "some_context" }, + { label: "X", contextValue: "some_context" }, + { label: "Y", contextValue: "some_context" }, + { label: "B", contextValue: "some_other_context" }, + { label: "T", contextValue: "some_other_context" }, + { label: "U", contextValue: "some_other_context" }, + { label: "W", contextValue: "some_other_context" }, + { label: "Z", contextValue: "some_other_context" }, + ]); + }); +}); From 62ee0579c113e71223cace669d0cb0000501f11d Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Thu, 22 Jun 2023 10:16:20 -0400 Subject: [PATCH 16/80] test: add test case for ZoweJobNode.getChildren Signed-off-by: Trae Yelovich --- .../__unit__/job/ZoweJobNode.unit.test.ts | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) 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 182061309b..fcaf7377aa 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -29,6 +29,7 @@ import { } from "../../../__mocks__/mockCreators/shared"; import * as contextually from "../../../src/shared/context"; import { ZoweLogger } from "../../../src/utils/LoggerUtils"; +import { bindJesApi, createJesApi } from "../../../__mocks__/mockCreators/api"; async function createGlobalMocks() { const globalMocks = { @@ -51,7 +52,6 @@ async function createGlobalMocks() { mockLoadNamedProfile: jest.fn(), mockCreateQuickPick: jest.fn(), mockLoadDefaultProfile: jest.fn(), - mockGetJesApi: jest.fn(), mockShowQuickPick: jest.fn(), testJobsProvider: null, jesApi: null, @@ -161,9 +161,8 @@ async function createGlobalMocks() { globalMocks.mockProfileInstance.disableValidationContext = globalMocks.mockDisableValidationContext; // Jes API mocks - globalMocks.jesApi = ZoweExplorerApiRegister.getJesApi(globalMocks.testProfile); - globalMocks.mockGetJesApi.mockReturnValue(globalMocks.jesApi); - ZoweExplorerApiRegister.getJesApi = globalMocks.mockGetJesApi.bind(ZoweExplorerApiRegister); + globalMocks.jesApi = createJesApi(globalMocks.testProfile); + bindJesApi(globalMocks.jesApi); globalMocks.mockCreateSessCfgFromArgs.mockReturnValue(globalMocks.testSession); globalMocks.testSessionNode = createJobSessionNode(globalMocks.testSession, globalMocks.testProfile); @@ -323,6 +322,24 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { expect(spoolFiles[0].owner).toEqual("fake"); }); + it("Tests that getChildren updates existing spool nodes if called again on a job", async () => { + const globalMocks = await createGlobalMocks(); + + const spoolFiles = await globalMocks.testJobNode.getChildren(); + expect(spoolFiles.length).toBe(1); + expect(spoolFiles[0].label).toEqual("STEP:STDOUT - 1"); + expect(spoolFiles[0].owner).toEqual("fake"); + + jest.spyOn(ZoweExplorerApiRegister, "getJesApi").mockReturnValueOnce({ + getSpoolFiles: jest.fn().mockReturnValueOnce([{ ...globalMocks.mockIJobFile, "record-count": 2 }]), + } as any); + globalMocks.testJobNode.dirty = true; + const spoolFilesAfter = await globalMocks.testJobNode.getChildren(); + expect(spoolFilesAfter.length).toBe(1); + expect(spoolFilesAfter[0].label).toEqual("STEP:STDOUT - 2"); + expect(spoolFilesAfter[0].owner).toEqual("fake"); + }); + it("Tests that getChildren returns the spool files if user/owner is not defined", async () => { const globalMocks = await createGlobalMocks(); From 11b313eaadb58539529ebbd0a89782f6bdc67478 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Thu, 22 Jun 2023 10:24:24 -0400 Subject: [PATCH 17/80] docs: update fix in changelog w/ issue number Signed-off-by: Trae Yelovich --- packages/zowe-explorer/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 7eeeed216a..750df34756 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -8,7 +8,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes -- Optimized fetching and caching of child nodes across the primary tree views (Data Sets, Unix System Services, Jobs). +- Optimized fetching and caching of child nodes across the primary tree views (Data Sets, Unix System Services, Jobs). [#2347](https://github.com/zowe/vscode-extension-for-zowe/issues/2347) ## `2.9.0` From dd2f854269eaf37a2c551056ec04af79bb73f111 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Thu, 22 Jun 2023 10:37:01 -0400 Subject: [PATCH 18/80] fix: SonarCloud code smell (nested template literal) Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 05ab4b8770..9ccbde432c 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -154,10 +154,9 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } // Only look for existing node w/ procstep if spool file has a procstep, - // otherwise look for the step:dd to update the record count in the label - const existing = this.children.find((element) => - element.label?.includes(`${spool.stepname}:${spool.ddname}${procstep ? ` - ${procstep}` : ""}`) - ); + // otherwise look for only stepname:ddname to update the record count in the label + const spoolSuffix = procstep ? ` - ${procstep}` : ""; + const existing = this.children.find((element) => element.label?.includes(`${spool.stepname}:${spool.ddname}${spoolSuffix}`)); if (existing) { existing.label = newLabel; unmodifiedCount--; From a05b3ae0c30eeaeb4a1b45ffd80f58d4b10bf517 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 6 Jun 2023 15:52:40 -0400 Subject: [PATCH 19/80] fix: tokenType/tokenValue assigned to direct-to-service profiles Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/Profiles.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/zowe-explorer/src/Profiles.ts b/packages/zowe-explorer/src/Profiles.ts index c6d4a0e9bf..4ca2263088 100644 --- a/packages/zowe-explorer/src/Profiles.ts +++ b/packages/zowe-explorer/src/Profiles.ts @@ -883,8 +883,15 @@ export class Profiles extends ProfilesCache { return; // See https://github.com/zowe/vscode-extension-for-zowe/issues/1827 } - const updSession = promptInfo.profile as zowe.imperative.ISession; - const returnValue = [updSession.user, updSession.password, updSession.base64EncodedAuth]; + const isImperativeProfile = (prof: string | zowe.imperative.IProfileLoaded): prof is zowe.imperative.IProfileLoaded => + typeof prof !== "string"; + + if (isImperativeProfile(profile)) { + if (profile.profile?.tokenValue == null || profile.profile?.tokenType == null) { + promptInfo.profile.tokenType = promptInfo.profile.tokenValue = null; + } + } + const returnValue: string[] = [promptInfo.profile.user, promptInfo.profile.password, promptInfo.profile.base64EncodedAuth]; this.updateProfilesArrays(promptInfo); return returnValue; } @@ -1213,7 +1220,7 @@ export class Profiles extends ProfilesCache { }; await this.updateBaseProfileFileLogin(baseProfile, updBaseProfile); const baseIndex = this.allProfiles.findIndex((profile) => profile.name === baseProfile.name); - this.allProfiles[baseIndex] = { ...baseProfile, profile: { ...baseProfile, ...updBaseProfile } }; + this.allProfiles[baseIndex] = { ...baseProfile, profile: { ...baseProfile.profile, ...updBaseProfile } }; node.setProfileToChoice({ ...node.getProfile(), profile: { ...node.getProfile().profile, ...updBaseProfile }, From d187e2b31bf903e54e730577de6d636935d0564b Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 09:26:42 -0400 Subject: [PATCH 20/80] fix: do not rebuild prof. w/ ProfilesCache if already provided Signed-off-by: Trae Yelovich --- .../src/vscode/ZoweVsCodeExtension.ts | 13 +++++++++---- .../src/vscode/doc/IPromptCredentials.ts | 3 ++- packages/zowe-explorer/src/Profiles.ts | 11 +---------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts index 407bfb6ea6..e525a727e8 100644 --- a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts +++ b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts @@ -80,8 +80,8 @@ export class ZoweVsCodeExtension { * @deprecated */ public static async promptCredentials(options: IPromptCredentialsOptions): Promise { - const loadProfile = await this.profilesCache.getLoadedProfConfig(options.sessionName.trim()); - if (loadProfile == null) { + const loadProfile = options.sessionName ? await this.profilesCache.getLoadedProfConfig(options.sessionName.trim()) : options.profile; + if (typeof loadProfile === "string" || loadProfile == null) { return undefined; } const loadSession = loadProfile.profile as imperative.ISession; @@ -117,10 +117,15 @@ export class ZoweVsCodeExtension { const cache = this.profilesCache; const profInfo = await cache.getProfileInfo(); const setSecure = options.secure ?? profInfo.isSecured(); - const loadProfile = await cache.getLoadedProfConfig(options.sessionName, options.sessionType); - const loadSession = loadProfile.profile as imperative.ISession; + + const loadProfile = typeof options.profile === "string" ? await cache.getLoadedProfConfig(options.profile, undefined) : options.profile; + const loadSession = loadProfile?.profile as imperative.ISession; const creds = await ZoweVsCodeExtension.promptUserPass({ session: loadSession, ...options }); + if (loadProfile == null || loadSession == null) { + return; + } + if (creds && creds.length > 0) { loadProfile.profile.user = loadSession.user = creds[0]; loadProfile.profile.password = loadSession.password = creds[1]; diff --git a/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts b/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts index 4551993a66..ff78243a00 100644 --- a/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts +++ b/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts @@ -19,7 +19,8 @@ export interface IPromptCredentialsCommonOptions { } export interface IPromptCredentialsOptions extends IPromptCredentialsCommonOptions { - sessionName: string; + profile?: string | imperative.IProfileLoaded; + sessionName?: string; sessionType?: string; secure?: boolean; } diff --git a/packages/zowe-explorer/src/Profiles.ts b/packages/zowe-explorer/src/Profiles.ts index 4ca2263088..35e9701f0a 100644 --- a/packages/zowe-explorer/src/Profiles.ts +++ b/packages/zowe-explorer/src/Profiles.ts @@ -869,8 +869,7 @@ export class Profiles extends ProfilesCache { const promptInfo = await ZoweVsCodeExtension.updateCredentials( { - sessionName: typeof profile !== "string" ? profile.name : profile, - sessionType: typeof profile !== "string" ? profile.type : undefined, + profile, rePrompt, secure: (await this.getProfileInfo()).isSecured(), userInputBoxOptions, @@ -883,14 +882,6 @@ export class Profiles extends ProfilesCache { return; // See https://github.com/zowe/vscode-extension-for-zowe/issues/1827 } - const isImperativeProfile = (prof: string | zowe.imperative.IProfileLoaded): prof is zowe.imperative.IProfileLoaded => - typeof prof !== "string"; - - if (isImperativeProfile(profile)) { - if (profile.profile?.tokenValue == null || profile.profile?.tokenType == null) { - promptInfo.profile.tokenType = promptInfo.profile.tokenValue = null; - } - } const returnValue: string[] = [promptInfo.profile.user, promptInfo.profile.password, promptInfo.profile.base64EncodedAuth]; this.updateProfilesArrays(promptInfo); return returnValue; From 02a9f2198e900d220ed181e846ce8a56e6fe6fe6 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 09:33:02 -0400 Subject: [PATCH 21/80] docs: add changelogs Signed-off-by: Trae Yelovich --- packages/zowe-explorer-api/CHANGELOG.md | 3 +++ packages/zowe-explorer/CHANGELOG.md | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 1d1566b2cf..c168b8daad 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -18,9 +18,12 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added a new type `DataSetAllocTemplate` for data set attributes. - Added optional `cancelJob` function to `ZoweExplorerApi.IJes` interface. - Added z/OSMF API implementation for `cancelJob` function. +- Added optional `profile` parameter to `IPromptCredentialsOptions` so developers can choose to skip rebuilding the profile with ProfilesCache. - Added optional `id` variable to `IZoweTreeNode` interface, which can be used to designate a unique ID for a tree node. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) - Fixed error shown by API when accessing the `name` and `type` property of a profile when updating the profile arrays [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334). +- Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2111](https://github.com/zowe/vscode-extension-for-zowe/issues/2111) + ## `2.8.1` ### Bug fixes diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 0668897722..d44f69659a 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -27,6 +27,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed an issue where the mismatch etag error returned was not triggering the diff editor, resulting in possible loss of data due to the issue. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) - Fixed issue where refreshing views collapsed the respective trees. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) - Fixed an issue where user would not get prompted when authentication error is thrown. [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334) +- Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2111](https://github.com/zowe/vscode-extension-for-zowe/issues/2111) ## `2.8.2` From 875e535c6a1f550ba1c1ac6c16b96fe4ff9813d6 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 09:34:58 -0400 Subject: [PATCH 22/80] fix: move sanity check above ZoweVsCodeExtension.promptUserPass call Signed-off-by: Trae Yelovich --- packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts index e525a727e8..f05f1d08d4 100644 --- a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts +++ b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts @@ -120,11 +120,11 @@ export class ZoweVsCodeExtension { const loadProfile = typeof options.profile === "string" ? await cache.getLoadedProfConfig(options.profile, undefined) : options.profile; const loadSession = loadProfile?.profile as imperative.ISession; - const creds = await ZoweVsCodeExtension.promptUserPass({ session: loadSession, ...options }); if (loadProfile == null || loadSession == null) { - return; + return undefined; } + const creds = await ZoweVsCodeExtension.promptUserPass({ session: loadSession, ...options }); if (creds && creds.length > 0) { loadProfile.profile.user = loadSession.user = creds[0]; From 8aad1d07ac4093da74ee7eeda45704f83189d84f Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 09:45:15 -0400 Subject: [PATCH 23/80] fix: change IPromptCredentialsOptions.profile type to IProfileLoaded Signed-off-by: Trae Yelovich --- .../zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts | 8 ++++++-- .../src/vscode/doc/IPromptCredentials.ts | 2 +- packages/zowe-explorer/src/Profiles.ts | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts index f05f1d08d4..1009177da7 100644 --- a/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts +++ b/packages/zowe-explorer-api/src/vscode/ZoweVsCodeExtension.ts @@ -81,7 +81,7 @@ export class ZoweVsCodeExtension { */ public static async promptCredentials(options: IPromptCredentialsOptions): Promise { const loadProfile = options.sessionName ? await this.profilesCache.getLoadedProfConfig(options.sessionName.trim()) : options.profile; - if (typeof loadProfile === "string" || loadProfile == null) { + if (loadProfile == null) { return undefined; } const loadSession = loadProfile.profile as imperative.ISession; @@ -118,7 +118,11 @@ export class ZoweVsCodeExtension { const profInfo = await cache.getProfileInfo(); const setSecure = options.secure ?? profInfo.isSecured(); - const loadProfile = typeof options.profile === "string" ? await cache.getLoadedProfConfig(options.profile, undefined) : options.profile; + if (options.profile == null && options.sessionName == null) { + return undefined; + } + + const loadProfile = options.sessionName ? await cache.getLoadedProfConfig(options.sessionName) : options.profile; const loadSession = loadProfile?.profile as imperative.ISession; if (loadProfile == null || loadSession == null) { diff --git a/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts b/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts index ff78243a00..5c41c72e0f 100644 --- a/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts +++ b/packages/zowe-explorer-api/src/vscode/doc/IPromptCredentials.ts @@ -19,7 +19,7 @@ export interface IPromptCredentialsCommonOptions { } export interface IPromptCredentialsOptions extends IPromptCredentialsCommonOptions { - profile?: string | imperative.IProfileLoaded; + profile?: imperative.IProfileLoaded; sessionName?: string; sessionType?: string; secure?: boolean; diff --git a/packages/zowe-explorer/src/Profiles.ts b/packages/zowe-explorer/src/Profiles.ts index 35e9701f0a..5c3db45f5d 100644 --- a/packages/zowe-explorer/src/Profiles.ts +++ b/packages/zowe-explorer/src/Profiles.ts @@ -869,7 +869,8 @@ export class Profiles extends ProfilesCache { const promptInfo = await ZoweVsCodeExtension.updateCredentials( { - profile, + profile: typeof profile === "string" ? undefined : profile, + sessionName: typeof profile === "string" ? profile : undefined, rePrompt, secure: (await this.getProfileInfo()).isSecured(), userInputBoxOptions, From a00bb3a41ee735e81c8b5b3aeac5c03f6cf1e631 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 7 Jun 2023 15:03:45 -0400 Subject: [PATCH 24/80] test: add 2 unit tests for profile/sessionName args Signed-off-by: Trae Yelovich --- .../vscode/ZoweVsCodeExtension.unit.test.ts | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts index ef83041647..e6ebcad4eb 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/vscode/ZoweVsCodeExtension.unit.test.ts @@ -14,7 +14,8 @@ import { Gui } from "../../../src/globals/Gui"; import { MessageSeverity, IZoweLogger } from "../../../src/logger/IZoweLogger"; import { IProfileLoaded } from "@zowe/imperative"; import { IPromptCredentialsOptions, ZoweVsCodeExtension } from "../../../src/vscode"; -import { ZoweExplorerApi } from "../../../src"; +import { ProfilesCache, ZoweExplorerApi } from "../../../src"; +import { imperative } from "@zowe/cli"; describe("ZoweVsCodeExtension", () => { const fakeVsce = { @@ -328,5 +329,50 @@ describe("ZoweVsCodeExtension", () => { expect(showInputBoxSpy).toHaveBeenCalledTimes(2); expect(mockUpdateProperty).toHaveBeenCalledTimes(0); }); + + it("should do nothing if profile and sessionName args are not provided", async () => { + const mockUpdateProperty = jest.fn(); + jest.spyOn(ZoweVsCodeExtension as any, "profilesCache", "get").mockReturnValue({ + getLoadedProfConfig: jest.fn().mockReturnValue({ + profile: {}, + }), + getProfileInfo: jest.fn().mockReturnValue({ + isSecured: jest.fn().mockReturnValue(true), + updateProperty: mockUpdateProperty, + }), + refresh: jest.fn(), + }); + const showInputBoxSpy = jest.spyOn(Gui, "showInputBox").mockResolvedValueOnce("fakeUser").mockResolvedValueOnce(undefined); + const profileLoaded = await ZoweVsCodeExtension.updateCredentials({}, undefined as unknown as ZoweExplorerApi.IApiRegisterClient); + expect(profileLoaded).toBeUndefined(); + expect(showInputBoxSpy).not.toHaveBeenCalled(); + expect(mockUpdateProperty).not.toHaveBeenCalled(); + }); + + it("should not call ProfilesCache.getLoadedProfConfig if profile object is provided", async () => { + const mockUpdateProperty = jest.fn(); + jest.spyOn(ZoweVsCodeExtension as any, "profilesCache", "get").mockReturnValue({ + getLoadedProfConfig: jest.fn().mockReturnValue({ + profile: { + name: "someExampleProfile", + profile: { + user: "testUser", + password: "testPassword", + } as imperative.IProfile, + } as imperative.IProfileLoaded, + }), + getProfileInfo: jest.fn().mockReturnValue({ + isSecured: jest.fn().mockReturnValue(true), + updateProperty: mockUpdateProperty, + }), + refresh: jest.fn(), + }); + const getLoadedProfConfigSpy = jest.spyOn(ProfilesCache.prototype, "getLoadedProfConfig"); + const showInputBoxSpy = jest.spyOn(Gui, "showInputBox").mockResolvedValueOnce("fakeUser").mockResolvedValueOnce(undefined); + const profileLoaded = await ZoweVsCodeExtension.updateCredentials({}, undefined as unknown as ZoweExplorerApi.IApiRegisterClient); + expect(profileLoaded).toBeUndefined(); + expect(getLoadedProfConfigSpy).not.toHaveBeenCalled(); + expect(showInputBoxSpy).not.toHaveBeenCalled(); + }); }); }); From ad49f2f6c1e452870de1a86b72a8326d9d59ef54 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Thu, 8 Jun 2023 10:29:28 -0400 Subject: [PATCH 25/80] fix: only call `refreshAll` once in `ssoLogin, ssoLogout` Signed-off-by: Trae Yelovich --- .../src/abstract/ZoweTreeProvider.ts | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts b/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts index 2ab82bb8d1..2843b5766a 100644 --- a/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts +++ b/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts @@ -247,17 +247,25 @@ export class ZoweTreeProvider { public async ssoLogin(node: IZoweTreeNode): Promise { ZoweLogger.trace("ZoweTreeProvider.ssoLogin called."); await Profiles.getInstance().ssoLogin(node); - await vscode.commands.executeCommand("zowe.ds.refreshAll"); - await vscode.commands.executeCommand("zowe.uss.refreshAll"); - await vscode.commands.executeCommand("zowe.jobs.refreshAllJobs"); + if (contextually.isDsSession(node)) { + await vscode.commands.executeCommand("zowe.ds.refreshAll"); + } else if (contextually.isUssSession(node)) { + await vscode.commands.executeCommand("zowe.uss.refreshAll"); + } else { + await vscode.commands.executeCommand("zowe.jobs.refreshAllJobs"); + } } public async ssoLogout(node: IZoweTreeNode): Promise { ZoweLogger.trace("ZoweTreeProvider.ssoLogout called."); await Profiles.getInstance().ssoLogout(node); - await vscode.commands.executeCommand("zowe.ds.refreshAll"); - await vscode.commands.executeCommand("zowe.uss.refreshAll"); - await vscode.commands.executeCommand("zowe.jobs.refreshAllJobs"); + if (contextually.isDsSession(node)) { + await vscode.commands.executeCommand("zowe.ds.refreshAll"); + } else if (contextually.isUssSession(node)) { + await vscode.commands.executeCommand("zowe.uss.refreshAll"); + } else { + await vscode.commands.executeCommand("zowe.jobs.refreshAllJobs"); + } } public async createZoweSchema(zoweFileProvider: IZoweTree): Promise { From 2399bb94ffddfb238101187929d6907ccf211431 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Thu, 8 Jun 2023 10:56:50 -0400 Subject: [PATCH 26/80] tests: `ZoweTreeProvider.ssoLogin, ZoweTreeProvider.ssoLogout` Signed-off-by: Trae Yelovich --- packages/zowe-explorer-api/CHANGELOG.md | 1 - .../abstract/TreeProvider.unit.test.ts | 107 +++++++++++++++++- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index c168b8daad..14432d1b56 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -21,7 +21,6 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added optional `profile` parameter to `IPromptCredentialsOptions` so developers can choose to skip rebuilding the profile with ProfilesCache. - Added optional `id` variable to `IZoweTreeNode` interface, which can be used to designate a unique ID for a tree node. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) - Fixed error shown by API when accessing the `name` and `type` property of a profile when updating the profile arrays [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334). - - Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2111](https://github.com/zowe/vscode-extension-for-zowe/issues/2111) ## `2.8.1` diff --git a/packages/zowe-explorer/__tests__/__unit__/abstract/TreeProvider.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/abstract/TreeProvider.unit.test.ts index 8c172cec19..885b767471 100644 --- a/packages/zowe-explorer/__tests__/__unit__/abstract/TreeProvider.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/abstract/TreeProvider.unit.test.ts @@ -24,12 +24,13 @@ import { Profiles } from "../../../src/Profiles"; import { imperative } from "@zowe/cli"; import * as globals from "../../../src/globals"; import { createUSSTree } from "../../../src/uss/USSTree"; -import { createIJobObject } from "../../../__mocks__/mockCreators/jobs"; +import { createIJobObject, createJobSessionNode } from "../../../__mocks__/mockCreators/jobs"; import { Job } from "../../../src/job/ZoweJobNode"; import { createJobsTree } from "../../../src/job/ZosJobsProvider"; import { SettingsConfig } from "../../../src/utils/SettingsConfig"; import { ZoweTreeProvider } from "../../../src/abstract/ZoweTreeProvider"; import { ZoweLogger } from "../../../src/utils/LoggerUtils"; +import { createDatasetSessionNode } from "../../../__mocks__/mockCreators/datasets"; async function createGlobalMocks() { const globalMocks = { @@ -54,6 +55,8 @@ async function createGlobalMocks() { mockGetProfileSetting: jest.fn(), mockProfilesForValidation: jest.fn(), mockProfilesValidationSetting: jest.fn(), + mockSsoLogin: jest.fn(), + mockSsoLogout: jest.fn(), ProgressLocation: jest.fn().mockImplementation(() => { return { Notification: 15, @@ -115,6 +118,8 @@ async function createGlobalMocks() { name: globalMocks.testProfile.name, setting: true, }), + ssoLogin: globalMocks.mockSsoLogin, + ssoLogout: globalMocks.mockSsoLogout, getProfileInfo: () => globalMocks.mockProfileInfo, fetchAllProfiles: jest.fn(() => { return [{ name: "sestest" }, { name: "profile1" }, { name: "profile2" }]; @@ -405,3 +410,103 @@ describe("Tree Provider Unit Tests - function renameNode", () => { spy.mockClear(); }); }); + +describe("Tree Provider Unit Tests - function ssoLogin", () => { + const createBlockMocks = () => { + const executeCommandSpy = jest.spyOn(vscode.commands, "executeCommand"); + return { + executeCommandSpy, + }; + }; + + const blockMocks = createBlockMocks(); + + afterEach(() => { + blockMocks.executeCommandSpy.mockClear(); + }); + + it("should only call zowe.ds.refreshAll for a Data Set session node", async () => { + const globalMocks = await createGlobalMocks(); + const dsNode = createDatasetSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogin(dsNode); + expect(globalMocks.mockSsoLogin).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.ds.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + }); + + it("should only call zowe.uss.refreshAll for a USS session node", async () => { + const globalMocks = await createGlobalMocks(); + const ussNode = createUSSSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogin(ussNode); + expect(globalMocks.mockSsoLogin).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.ds.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + }); + + it("should only call zowe.jobs.refreshAllJobs for a Job session node", async () => { + const globalMocks = await createGlobalMocks(); + const jobNode = createJobSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogin(jobNode); + expect(globalMocks.mockSsoLogin).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.ds.refreshAll"); + }); +}); + +describe("Tree Provider Unit Tests - function ssoLogout", () => { + const createBlockMocks = () => { + const executeCommandSpy = jest.spyOn(vscode.commands, "executeCommand"); + return { + executeCommandSpy, + }; + }; + + const blockMocks = createBlockMocks(); + + afterEach(() => { + blockMocks.executeCommandSpy.mockClear(); + }); + + afterAll(() => { + blockMocks.executeCommandSpy.mockRestore(); + }); + + it("should only call zowe.ds.refreshAll for a Data Set session node", async () => { + const globalMocks = await createGlobalMocks(); + const dsNode = createDatasetSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogout(dsNode); + expect(globalMocks.mockSsoLogout).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.ds.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + }); + + it("should only call zowe.uss.refreshAll for a USS session node", async () => { + const globalMocks = await createGlobalMocks(); + const ussNode = createUSSSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogout(ussNode); + expect(globalMocks.mockSsoLogout).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.ds.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + }); + + it("should only call zowe.jobs.refreshAllJobs for a Job session node", async () => { + const globalMocks = await createGlobalMocks(); + const jobNode = createJobSessionNode(globalMocks.testSession, globalMocks.testProfile); + + await globalMocks.testTreeProvider.ssoLogout(jobNode); + expect(globalMocks.mockSsoLogout).toHaveBeenCalled(); + expect(blockMocks.executeCommandSpy).toHaveBeenCalledWith("zowe.jobs.refreshAllJobs"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.uss.refreshAll"); + expect(blockMocks.executeCommandSpy).not.toHaveBeenCalledWith("zowe.ds.refreshAll"); + }); +}); From 864e4a1ebf701a2d8c5bfdbab31ed5a5000b1fad Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 23 Jun 2023 09:14:58 -0400 Subject: [PATCH 27/80] docs: move updates to TBD release in changelogs Signed-off-by: Trae Yelovich --- packages/zowe-explorer-api/CHANGELOG.md | 5 +++-- packages/zowe-explorer/CHANGELOG.md | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 14432d1b56..d15124d35f 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -6,9 +6,12 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t ### New features and enhancements +- Added optional `profile` parameter to `IPromptCredentialsOptions` so developers can choose to skip rebuilding the profile with ProfilesCache. + ### Bug fixes - Fixed error when an extender's extension attempts to access the keyring in a remote VSCode session [#324](https://github.com/zowe/vscode-extension-for-cics/issues/324). +- Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2330](https://github.com/zowe/vscode-extension-for-zowe/issues/2330) ## `2.9.0` @@ -18,10 +21,8 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Added a new type `DataSetAllocTemplate` for data set attributes. - Added optional `cancelJob` function to `ZoweExplorerApi.IJes` interface. - Added z/OSMF API implementation for `cancelJob` function. -- Added optional `profile` parameter to `IPromptCredentialsOptions` so developers can choose to skip rebuilding the profile with ProfilesCache. - Added optional `id` variable to `IZoweTreeNode` interface, which can be used to designate a unique ID for a tree node. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) - Fixed error shown by API when accessing the `name` and `type` property of a profile when updating the profile arrays [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334). -- Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2111](https://github.com/zowe/vscode-extension-for-zowe/issues/2111) ## `2.8.1` diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index d44f69659a..65a352fab0 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes +- Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2330](https://github.com/zowe/vscode-extension-for-zowe/issues/2330) + ## `2.9.0` ### New features and enhancements @@ -27,7 +29,6 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Fixed an issue where the mismatch etag error returned was not triggering the diff editor, resulting in possible loss of data due to the issue. [#2277](https://github.com/zowe/vscode-extension-for-zowe/issues/2277) - Fixed issue where refreshing views collapsed the respective trees. [#2215](https://github.com/zowe/vscode-extension-for-zowe/issues/2215) - Fixed an issue where user would not get prompted when authentication error is thrown. [#2334](https://github.com/zowe/vscode-extension-for-zowe/issues/2334) -- Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2111](https://github.com/zowe/vscode-extension-for-zowe/issues/2111) ## `2.8.2` From 43e1bf0d51e8a5068fb123f7d7853f7045183a6e Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 23 Jun 2023 09:34:26 -0400 Subject: [PATCH 28/80] fix: bump semver to 7.5.3 to resolve audit Signed-off-by: Trae Yelovich --- packages/zowe-explorer-api/package.json | 4 ++-- yarn.lock | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index c8f42ee61c..e39276f1a5 100644 --- a/packages/zowe-explorer-api/package.json +++ b/packages/zowe-explorer-api/package.json @@ -13,11 +13,11 @@ "lib" ], "devDependencies": { - "@types/semver": "^7.3.6" + "@types/semver": "^7.5.0" }, "dependencies": { "@zowe/cli": "^7.16.2", - "semver": "^7.3.5" + "semver": "^7.5.3" }, "scripts": { "build": "yarn check-cli && yarn clean && tsc -p ./ && yarn license", diff --git a/yarn.lock b/yarn.lock index a688c434e4..cf519aea6f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1932,10 +1932,10 @@ resolved "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== -"@types/semver@^7.3.6": - version "7.3.9" - resolved "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc" - integrity sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ== +"@types/semver@^7.5.0": + version "7.5.0" + resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" + integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== "@types/stack-utils@^1.0.1": version "1.0.1" @@ -9624,6 +9624,13 @@ semver@^7.2.1: dependencies: lru-cache "^6.0.0" +semver@^7.5.3: + version "7.5.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== + dependencies: + lru-cache "^6.0.0" + serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" From dcac8bd085fd03c43128fda96b4504bff9aee4f1 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Fri, 23 Jun 2023 09:38:11 -0400 Subject: [PATCH 29/80] audit fix Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- package.json | 3 ++- yarn.lock | 42 ++++-------------------------------------- 2 files changed, 6 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 7d9ead32ff..db000897f1 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ "yarn": "1.22.19" }, "resolutions": { - "**/json5": "^2.2.2" + "**/json5": "^2.2.2", + "**/semver": "^7.5.2" }, "scripts": { "clean": "yarn workspaces run clean", diff --git a/yarn.lock b/yarn.lock index a688c434e4..f60f664883 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9583,44 +9583,10 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.5.0, semver@^5.6.0: - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@5.7.0: - version "5.7.0" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== - -semver@7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - -semver@7.x, semver@^7.3.7: - version "7.3.8" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" - integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== - dependencies: - lru-cache "^6.0.0" - -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.4, semver@^7.3.5: - version "7.3.7" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== - dependencies: - lru-cache "^6.0.0" - -semver@^7.2.1: - version "7.5.1" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" - integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== +"semver@2 || 3 || 4 || 5", semver@5.7.0, semver@7.0.0, semver@7.x, semver@^5.1.0, semver@^5.5.0, semver@^5.6.0, semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2: + version "7.5.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== dependencies: lru-cache "^6.0.0" From 47b2debd794f15755bc18a692910960ef47fad46 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Fri, 23 Jun 2023 09:38:11 -0400 Subject: [PATCH 30/80] audit fix Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- package.json | 3 ++- yarn.lock | 42 ++++-------------------------------------- 2 files changed, 6 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 7d9ead32ff..db000897f1 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ "yarn": "1.22.19" }, "resolutions": { - "**/json5": "^2.2.2" + "**/json5": "^2.2.2", + "**/semver": "^7.5.2" }, "scripts": { "clean": "yarn workspaces run clean", diff --git a/yarn.lock b/yarn.lock index cf519aea6f..626e9a07a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9583,44 +9583,10 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.5.0, semver@^5.6.0: - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@5.7.0: - version "5.7.0" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== - -semver@7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - -semver@7.x, semver@^7.3.7: - version "7.3.8" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" - integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== - dependencies: - lru-cache "^6.0.0" - -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.4, semver@^7.3.5: - version "7.3.7" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== - dependencies: - lru-cache "^6.0.0" - -semver@^7.2.1: - version "7.5.1" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" - integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== +"semver@2 || 3 || 4 || 5", semver@5.7.0, semver@7.0.0, semver@7.x, semver@^5.1.0, semver@^5.5.0, semver@^5.6.0, semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2: + version "7.5.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== dependencies: lru-cache "^6.0.0" From a003ccf3c242401c2aadd69008171436f585b4c9 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 26 Jun 2023 11:05:36 -0400 Subject: [PATCH 31/80] prepare 2.9.1 release Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- lerna.json | 2 +- packages/zowe-explorer-api/CHANGELOG.md | 2 -- packages/zowe-explorer/CHANGELOG.md | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lerna.json b/lerna.json index be38e36318..fc406a7038 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.1-SNAPSHOT", + "version": "2.9.1", "command": { "version": { "forcePublish": true, diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index 1d1566b2cf..c3416a9912 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -4,8 +4,6 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t ## TBD Release -### New features and enhancements - ### Bug fixes - Fixed error when an extender's extension attempts to access the keyring in a remote VSCode session [#324](https://github.com/zowe/vscode-extension-for-cics/issues/324). diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 105b7340e4..fa7d289e7b 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -4,8 +4,6 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ## TBD Release -### New features and enhancements - ### Bug fixes - Fixed profile watcher for browser based environments. [#2211](https://github.com/zowe/vscode-extension-for-zowe/issues/2211) From 111e082afac04f308df37735ba780bb244b5a1c9 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 26 Jun 2023 14:01:29 -0400 Subject: [PATCH 32/80] updates to ZE README Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/README.md | 422 ++++++++++++++++++------------- 1 file changed, 243 insertions(+), 179 deletions(-) diff --git a/packages/zowe-explorer/README.md b/packages/zowe-explorer/README.md index e17f8b8ee2..4b5f5e6d55 100644 --- a/packages/zowe-explorer/README.md +++ b/packages/zowe-explorer/README.md @@ -47,6 +47,200 @@ Review the following use cases and their procedures to understand how to work wi - [Submit a JCL](#submit-a-jcl): You can submit a jcl from a chose data set. - [Allocate Like](#allocate-like): Create a copy of a chosen data set with the same parameters. +## Prerequisite tasks + +- Configure TSO/E address space services, z/OS data set, file REST interface, and z/OS jobs REST interface. For more information, see [z/OS Requirements](https://docs.zowe.org/stable/user-guide/systemrequirements-zosmf.html#z-os-requirements). +- Create a Zowe Explorer profile. + +## Getting started + +This section includes steps for the tasks you need to complete to get started using Zowe Explorer. + +Configure Zowe Explorer, create a [team configuration file](#create-a-team-configuration-file) or a [v1 profile (deprecated)](#create-a-v1-profile) for profile manangement, review the [sample use cases](#sample-use-cases) to familiarize yourself with the capabilities of Zowe Explorer, and you are ready to use Zowe Explorer. + +### Configuring Zowe Explorer + +You can configure Zowe Explorer by changing the extension settings. For more information, see [Configuring Zowe Explorer](https://docs.zowe.org/stable/user-guide/ze-install#configuring-zowe-explorer). + +When environment conditions do not support the Zowe CLI built-in Credential Manager, see [Modifying the Secure Credentials Enabled Setting](https://docs.zowe.org/stable/user-guide/ze-install#modifying-the-secure-credentials-enabled-setting). + +### Multifactor authentication support (MFA) + +Zowe Explorer supports the use of MFA tokens for authentication. When using zOSMF profiles it is required to connect through the Zowe API Mediation Layer (API ML). Suggested use case for MFA authentication using Zowe Explorer is by logging into the API ML via the right-click login action in Zowe Explorer and when prompted for password enter the MFA token in place of user password, the API will return a JSON token (JWT) that will be used for further authentication. + +You can find more information regarding MFA support in Zowe's documentation on [integrating with API Mediation Layer](https://docs.zowe.org/stable/user-guide/cli-using-integrating-apiml/). + +### Create a team configuration file + +1. Navigate to the **Side Bar**. +2. Hover over **DATA SETS**, **USS**, or **JOBS**. +3. Click the **+** icon. +4. Select **Create a New Team Configuration File**. +5. If no workspace is open, a global configuration file is created. If a workspace is open, chose either a global configuration file or a project-level configuration file. +6. Edit the config file to include the host and other connection information, and save. + +Your team configuration file appears either in your .zowe folder if you chose the global configuration file option, or in your workspace directory if you chose the project-level configuration file option. The notification message that shows in VS Code after config file creation includes the path of the created file. + +### Create a v1 profile + +> v1 profiles are deprecated and planned to be removed in Zowe Explorer v3.0.0. + +**Note:** If a team configuration file is in place, v1 profile creation and use will not be available. + +1. Navigate to the **Side Bar**. +2. Hover over **DATA SETS**, **USS**, or **JOBS**. +3. Click the **+** icon. +4. Select **Create a New Connection to z/OS**. The user name and password fields are optional. +5. Follow the instructions, and enter all required information to complete the profile creation. + +![New Connection](/docs/images/ZE-newProfiles.gif?raw=true "New Connection") +

+ +You can now use all the functionalities of the extension. + +### Using profiles for the first time + +The first time profiles are used you will be prompted for user name and password for the profile's connection. The term password is used loosely to represent all supported authentication secrets like passphrases, passtickets, Multifactor Authentication (MFA) tokens, etc. + +### Updating securely stored credentials + +Securing credentials for v1 profiles and secure fields in the team configuration file are handled by the Zowe Imperative dependency. To update securely stored user names and passwords in Zowe Explorer, the user can right click the profile and select **Update Credentials**. This prompts the user for the new credentials and the secure credentials vault is updated. + +### Editing team configuration file + +1. Navigate to the **Side Bar**. +2. Hover over **DATA SETS**, **USS**, or **JOBS**. +3. Click the **+** icon. +4. If team configuration file is in place, the **Edit Team Configuration File** option displays. + ![Edit Team Configuration File](/docs/images/ZE-edit-config.png) +

+5. If only a global or project level config is in place, it opens to be edited. If both a global and project level config are in place, the user must select which file to edit. + ![Edit Config Location Option](/docs/images/ZE-edit-options.png) +

+ +### Profile validation + +**Note:** The following information applies to Zowe CLI V1 profiles (one yaml file for each user profile) and Zowe CLI team profiles (Zowe CLI V2). + +Zowe Explorer includes the profile validation feature that helps to ensure that the specified connection to z/OS is successfully established and your profile is ready for use. If a profile is valid, the profile is active and can be used. + +By default, this feature is automatically enabled. You can disable the feature by right-clicking on your profile and selecting the **Disable Validation for Profile** option. Alternatively, you can enable or disable the feature for all profiles in the VS Code settings + +1. In VS Code, navigate to **Settings**. +2. Navigate to Zowe Explorer settings. +3. Check the **Automatic Profile Validation** checkbox to enable the automatic validation of profiles option. Uncheck to disable. +4. Restart VS Code. + +### Use base profile and token with existing profiles + +As a Zowe user, you can leverage the base profile functionality to access multiple services through Single Sign-on. Base profiles enable you to authenticate using the Zowe API Mediation Layer (API ML). You can use base profiles with more than one service profile. For more information, see [Base Profiles](https://docs.zowe.org/stable/user-guide/cli-using-using-profiles/#base-profiles). + +**Note:** Before using the base profile functionality with v1 profiles, ensure that you have [Zowe CLI](https://docs.zowe.org/stable/user-guide/cli-installcli.html) v6.0.0 or higher installed. + +1. Zowe Explorer has a right click action for profiles to log in and log out of the authentication service for existing Base profiles. If a v1 Base profile hasn't been created, open a terminal and run the following Zowe CLI command: `zowe auth login apiml`. +2. Follow the instructions to complete the login. + A local base profile is created that contains your token. + + **Note:** For more information about the process, see [Token Management](https://docs.zowe.org/stable/user-guide/cli-using-integrating-apiml/#how-token-management-works). + +3. Open VS Code and select the **Zowe Explorer** icon in the **Side Bar**. + +4. Hover over **DATA SETS**, **USS**, or **JOBS**. + +5. Click the **+** icon. + +6. Select the profile you use with your base profile with the token. + + The profile appears in the tree and you can now use this profile to access z/OSMF via the API Mediation Layer. + +For more information, see [Integrating with API Mediation Layer](https://docs.zowe.org/stable/user-guide/cli-using-integrating-apiml). + +#### Log in to the Authentication Service + +If the token for your base profile is no longer valid, you can log in again to get a new token with the **Log in to Authentication Service** feature. + +**Notes:** + +- The feature is only available for base profiles. +- The feature supports only API Mediation Layer at the moment. Other extenders may use a different authentication service. + +1. Open VS Code and select the Zowe Explorer icon in the **Side Bar**. +2. Right-click your profile. +3. Select the **Log in to Authentication Service** option. + + You are prompted to enter your username and password. + +The token is stored in the corresponding base profile file, YAML file for v1 Profiles, or the team configuration file. + +If you do not want to store your token, you can request the server to end your session token. Use the **Log out from Authentication Service** feature to invalidate the token: + +1. Open Zowe Explorer. +2. Hover over **DATA SETS**, **USS**, or **JOBS**. +3. Click the **+** icon. +4. Right-click your profile. +5. Select the **Log out from Authentication Service** option. + +Your token has been successfully invalidated. + +## Usage tips + +- Use the **Add to Favorite** feature to permanently store chosen data sets, USS files, and jobs in the **Favorites** folder. Right-click on a data set, USS file or jobs and select **Add Favorite**. + +- **Syntax Highlighting:** Zowe Explorer supports syntax highlighting for data sets. You can search for and install such extensions in VS Code Marketplace. + +- **Update a profile**: Right-click a profile, select the **Update Profile** option, and modify the information inside the profile. + +- **Delete a profile**: For Zowe V1 profiles, right-click a profile and select the **Delete Profile** option to permanently delete the profile and delete the profile from your `.zowe` folder. + + For Zowe V2 profiles, **Delete Profile** opens the `zowe.config.json` file for the user to delete the profile manually: + + ![Delete a V2 profile](/docs/images/ZE-v2-delete-profile.gif) + +- **Hide a profile**: You can hide a profile from the profile tree by right-clicking the profile and selecting the **Hide Profile** option. To unhide the profile, click the **+** button and select the profile from the quick pick list. + +- **Open recent members**: Zowe Explorer lets you open a list of members you worked on earlier. You can access the list by pressing `Ctrl`+`Alt`+`R` (Windows) or `Command`+`Option`+`R` (Mac). + +For the comprehensive Zowe Explorer documentation that also includes information about USS and Jobs interactions, see [the Zowe Explorer documentation](https://docs.zowe.org/stable/user-guide/ze-install.html) in Zowe Docs. + +## Keyboard Shortcuts + +- Restart Zowe Explorer + + - Windows: `ctrl`+`alt`+`z` + - Mac: `⌘`+`⌥`+`z` + +- Open Recent Member + + - Windows: `ctrl`+`alt`+`r` + - Mac: `⌘`+`⌥`+`r` + +- Search in all Loaded Items + - Windows: `ctrl`+`alt`+`p` + - Mac: `⌘`+`⌥`+`p` + +## Extending Zowe Explorer + +You can add new functionalities to Zowe Explorer by creating your own extension. For more information, see [Extensions for Zowe Explorer](https://github.com/zowe/vscode-extension-for-zowe/blob/main/docs/README-Extending.md). + +**Tip:** View an example of a Zowe Explorer extension: [Zowe Explorer FTP extension documentation](https://github.com/zowe/zowe-explorer-ftp-extension#zowe-explorer-ftp-extension). + +## Known Issues + +### Bidirectional languages + +Files written in languages primarily read from right to left (Arabic, Hebrew, many Asian languages) can include portions of text that are written and read left to right, such as numbers. + +These bidirectional (BiDi) languages are not currently supported in Visual Studio Code. (See [Issue #86667](https://github.com/microsoft/vscode/issues/86667) for more information.) + +As a result, VS Code extensions like Zowe Explorer, Zowe Explorer CICS Extension, and Zowe Explorer FTP Extension are not able to support BiDi languages in files. + +## More information + +- For the complete Zowe Explorer documentation, see [Zowe Docs](https://docs.zowe.org/stable/user-guide/ze-install.html). +- Join the **#zowe-explorer** channel on [Slack](https://openmainframeproject.slack.com/) to stay in touch with the Zowe community. + +## Sample use cases extended + ### View data sets and use multiple filters 1. Navigate to the **Side Bar**. @@ -61,6 +255,10 @@ Review the following use cases and their procedures to understand how to work wi ![View Data Set](/docs/images/ZE-multiple-search.gif?raw=true "View Data Set")

+[Back to sample list](#sample-use-cases) + +--- + ### View data sets with member filters 1. Navigate to the **Side Bar**. @@ -74,11 +272,19 @@ Review the following use cases and their procedures to understand how to work wi **Note:** You cannot favorite a data set or member that includes a member filter search pattern.

+[Back to sample list](#sample-use-cases) + +--- + ### Refresh the list of data sets 1. Navigate to the **Side Bar**. 2. Click **Refresh All** button (circular arrow icon) on the right of the **DATA SETS** explorer bar. +[Back to sample list](#sample-use-cases) + +--- + ### Rename data sets 1. Navigate to the **Side Bar**. @@ -90,6 +296,10 @@ Review the following use cases and their procedures to understand how to work wi ![Rename Data Set](/docs/images/ZE-rename.gif?raw=true "Rename Data Set")

+[Back to sample list](#sample-use-cases) + +--- + ### Copy data set members 1. Navigate to the **Side Bar**. @@ -102,6 +312,10 @@ Review the following use cases and their procedures to understand how to work wi ![Copy Data Set](/docs/images/ZE-copy-member.gif?raw=true "Copy Data Set")

+[Back to sample list](#sample-use-cases) + +--- + ### Edit and upload a data set member 1. Navigate to the **Side Bar**. @@ -123,6 +337,10 @@ Review the following use cases and their procedures to understand how to work wi ![Edit](/docs/images/ZE-edit-upload.gif?raw=true "Edit")

+[Back to sample list](#sample-use-cases) + +--- + ### Use the save option to prevent merge conflicts 1. Navigate to the **Side Bar**. @@ -138,6 +356,10 @@ Review the following use cases and their procedures to understand how to work wi ![Save](/docs/images/ZE-safe-save.gif?raw=true "Save")

+[Back to sample list](#sample-use-cases) + +--- + ### Create a new data set and add a member 1. Navigate to the **Side Bar**. @@ -150,6 +372,10 @@ Review the following use cases and their procedures to understand how to work wi 8. Enter a name for your new data set member and press the `Enter` key. The member is created and opened in the workspace. +[Back to sample list](#sample-use-cases) + +--- + ### Create data sets and specify the parameters 1. Navigate to the **Side Bar**. @@ -204,6 +430,10 @@ Review the following use cases and their procedures to understand how to work wi ![Parameters](/docs/images/ZE-set-params.gif?raw=true "Parameters")

+[Back to sample list](#sample-use-cases) + +--- + ### Delete data sets and data set members 1. Navigate to the **Side Bar**. @@ -221,6 +451,10 @@ Review the following use cases and their procedures to understand how to work wi ![Delete Data Sets and Members](/docs/images/ZE-delete-ds2.gif?raw=true "Delete Data Sets and Members")

+[Back to sample list](#sample-use-cases) + +--- + ### View and access multiple profiles simultaneously 1. Navigate to the **Side Bar**. @@ -230,6 +464,10 @@ Review the following use cases and their procedures to understand how to work wi ![Add Profile](/docs/images/ze-access-multiple-profiles-simultaneously.gif?raw=true "Add Profile") +[Back to sample list](#sample-use-cases) + +--- + ### Submit a JCL 1. Navigate to the **Side Bar**. @@ -243,6 +481,10 @@ Review the following use cases and their procedures to understand how to work wi ![Submit a JCL](/docs/images/ZE-submit-jcl.gif?raw=true "Submit a JCL") +[Back to sample list](#sample-use-cases) + +--- + ### Allocate Like 1. Navigate to the **Side Bar**. @@ -252,182 +494,4 @@ Review the following use cases and their procedures to understand how to work wi ![Allocate Like](/docs/images/ZE-allocate.gif?raw=true "Allocate Like") -## Prerequisite tasks - -- Configure TSO/E address space services, z/OS data set, file REST interface, and z/OS jobs REST interface. For more information, see [z/OS Requirements](https://docs.zowe.org/stable/user-guide/systemrequirements-zosmf.html#z-os-requirements). -- Create a Zowe Explorer profile. - -## Getting started - -This section includes steps for the tasks you need to complete to get started using Zowe Explorer. - -Configure Zowe Explorer, create a [v1 profile](#create-a-v1-profile) or a [team configuration file](#create-a-team-configuration-file) for profile manangement, review the [sample use cases](#sample-use-cases) to familiarize yourself with the capabilities of Zowe Explorer, and you are ready to use Zowe Explorer. - -### Configuring Zowe Explorer - -You can configure Zowe Explorer by changing the extension settings. For more information, see [Configuring Zowe Explorer](https://docs.zowe.org/stable/user-guide/ze-install#configuring-zowe-explorer). - -When environment conditions do not support the Zowe CLI built-in Credential Manager, see [Modifying the Secure Credentials Enabled Setting](https://docs.zowe.org/stable/user-guide/ze-install#modifying-the-secure-credentials-enabled-setting). - -### Create a v1 profile - -**Note:** If a team configuration file is in place, v1 profile creation and use will not be available. - -1. Navigate to the **Side Bar**. -2. Hover over **DATA SETS**, **USS**, or **JOBS**. -3. Click the **+** icon. -4. Select **Create a New Connection to z/OS**. The user name and password fields are optional. -5. Follow the instructions, and enter all required information to complete the profile creation. - -![New Connection](/docs/images/ZE-newProfiles.gif?raw=true "New Connection") -

- -You can now use all the functionalities of the extension. - -### Create a team configuration file - -1. Navigate to the **Side Bar**. -2. Hover over **DATA SETS**, **USS**, or **JOBS**. -3. Click the **+** icon. -4. Select **Create a New Team Configuration File**. -5. If no workspace is open, a global configuration file is created. If a workspace is open, chose either a global configuration file or a project-level configuration file. -6. Edit the config file to include the host and other connection information, and save. - -Your team configuration file appears either in your .zowe folder if you chose the global configuration file option, or in your workspace directory if you chose the project-level configuration file option. The notification message that shows in VS Code after config file creation includes the path of the created file. - -### Updating securely stored credentials - -Securing credentials for v1 profiles and secure fields in the team configuration file are handled by the Zowe Imperative dependency. To update securely stored user names and passwords in Zowe Explorer, the user can right click the profile and select **Update Credentials**. This prompts the user for the new credentials and the secure credentials vault is updated. - -### Editing team configuration file - -1. Navigate to the **Side Bar**. -2. Hover over **DATA SETS**, **USS**, or **JOBS**. -3. Click the **+** icon. -4. If team configuration file is in place, the **Edit Team Configuration File** option displays. - ![Edit Team Configuration File](/docs/images/ZE-edit-config.png) -

-5. If only a global or project level config is in place, it opens to be edited. If both a global and project level config are in place, the user must select which file to edit. - ![Edit Config Location Option](/docs/images/ZE-edit-options.png) -

- -### Profile validation - -**Note:** The following information applies to Zowe CLI V1 profiles (one yaml file for each user profile) and Zowe CLI team profiles (Zowe CLI V2). - -Zowe Explorer includes the profile validation feature that helps to ensure that the specified connection to z/OS is successfully established and your profile is ready for use. If a profile is valid, the profile is active and can be used. - -By default, this feature is automatically enabled. You can disable the feature by right-clicking on your profile and selecting the **Disable Validation for Profile** option. Alternatively, you can enable or disable the feature for all profiles in the VS Code settings - -1. In VS Code, navigate to **Settings**. -2. Navigate to Zowe Explorer settings. -3. Check the **Automatic Profile Validation** checkbox to enable the automatic validation of profiles option. Uncheck to disable. -4. Restart VS Code. - -### Use base profile and token with existing profiles - -As a Zowe user, you can leverage the base profile functionality to access multiple services through Single Sign-on. Base profiles enable you to authenticate using the Zowe API Mediation Layer (API ML). You can use base profiles with more than one service profile. For more information, see [Base Profiles](https://docs.zowe.org/stable/user-guide/cli-using-using-profiles/#base-profiles). - -**Note:** Before using the base profile functionality with v1 profiles, ensure that you have [Zowe CLI](https://docs.zowe.org/stable/user-guide/cli-installcli.html) v6.0.0 or higher installed. - -1. Zowe Explorer has a right click action for profiles to log in and log out of the authentication service for existing Base profiles. If a v1 Base profile hasn't been created, open a terminal and run the following Zowe CLI command: `zowe auth login apiml`. -2. Follow the instructions to complete the login. - A local base profile is created that contains your token. - - **Note:** For more information about the process, see [Token Management](https://docs.zowe.org/stable/user-guide/cli-using-integrating-apiml/#how-token-management-works). - -3. Open VS Code and select the **Zowe Explorer** icon in the **Side Bar**. - -4. Hover over **DATA SETS**, **USS**, or **JOBS**. - -5. Click the **+** icon. - -6. Select the profile you use with your base profile with the token. - - The profile appears in the tree and you can now use this profile to access z/OSMF via the API Mediation Layer. - -For more information, see [Integrating with API Mediation Layer](https://docs.zowe.org/stable/user-guide/cli-using-integrating-apiml). - -#### Log in to the Authentication Service - -If the token for your base profile is no longer valid, you can log in again to get a new token with the **Log in to Authentication Service** feature. - -**Notes:** - -- The feature is only available for base profiles. -- The feature supports only API Mediation Layer at the moment. Other extenders may use a different authentication service. - -1. Open VS Code and select the Zowe Explorer icon in the **Side Bar**. -2. Right-click your profile. -3. Select the **Log in to Authentication Service** option. - - You are prompted to enter your username and password. - -The token is stored in the corresponding base profile file, YAML file for v1 Profiles, or the team configuration file. - -If you do not want to store your token, you can request the server to end your session token. Use the **Log out from Authentication Service** feature to invalidate the token: - -1. Open Zowe Explorer. -2. Hover over **DATA SETS**, **USS**, or **JOBS**. -3. Click the **+** icon. -4. Right-click your profile. -5. Select the **Log out from Authentication Service** option. - -Your token has been successfully invalidated. - -## Usage tips - -- Use the **Add to Favorite** feature to permanently store chosen data sets, USS files, and jobs in the **Favorites** folder. Right-click on a data set, USS file or jobs and select **Add Favorite**. - -- **Syntax Highlighting:** Zowe Explorer supports syntax highlighting for data sets. You can search for and install such extensions in VS Code Marketplace. - -- **Update a profile**: Right-click a profile, select the **Update Profile** option, and modify the information inside the profile. - -- **Delete a profile**: For Zowe V1 profiles, right-click a profile and select the **Delete Profile** option to permanently delete the profile and delete the profile from your `.zowe` folder. - - For Zowe V2 profiles, **Delete Profile** opens the `zowe.config.json` file for the user to delete the profile manually: - - ![Delete a V2 profile](/docs/images/ZE-v2-delete-profile.gif) - -- **Hide a profile**: You can hide a profile from the profile tree by right-clicking the profile and selecting the **Hide Profile** option. To unhide the profile, click the **+** button and select the profile from the quick pick list. - -- **Open recent members**: Zowe Explorer lets you open a list of members you worked on earlier. You can access the list by pressing `Ctrl`+`Alt`+`R` (Windows) or `Command`+`Option`+`R` (Mac). - -For the comprehensive Zowe Explorer documentation that also includes information about USS and Jobs interactions, see [the Zowe Explorer documentation](https://docs.zowe.org/stable/user-guide/ze-install.html) in Zowe Docs. - -## Keyboard Shortcuts - -- Restart Zowe Explorer - - - Windows: `ctrl`+`alt`+`z` - - Mac: `⌘`+`⌥`+`z` - -- Open Recent Member - - - Windows: `ctrl`+`alt`+`r` - - Mac: `⌘`+`⌥`+`r` - -- Search in all Loaded Items - - Windows: `ctrl`+`alt`+`p` - - Mac: `⌘`+`⌥`+`p` - -## Extending Zowe Explorer - -You can add new functionalities to Zowe Explorer by creating your own extension. For more information, see [Extensions for Zowe Explorer](https://github.com/zowe/vscode-extension-for-zowe/blob/main/docs/README-Extending.md). - -**Tip:** View an example of a Zowe Explorer extension: [Zowe Explorer FTP extension documentation](https://github.com/zowe/zowe-explorer-ftp-extension#zowe-explorer-ftp-extension). - -## Known Issues - -### Bidirectional languages - -Files written in languages primarily read from right to left (Arabic, Hebrew, many Asian languages) can include portions of text that are written and read left to right, such as numbers. - -These bidirectional (BiDi) languages are not currently supported in Visual Studio Code. (See [Issue #86667](https://github.com/microsoft/vscode/issues/86667) for more information.) - -As a result, VS Code extensions like Zowe Explorer, Zowe Explorer CICS Extension, and Zowe Explorer FTP Extension are not able to support BiDi languages in files. - -## More information - -- For the complete Zowe Explorer documentation, see [Zowe Docs](https://docs.zowe.org/stable/user-guide/ze-install.html). -- Join the **#zowe-explorer** channel on [Slack](https://openmainframeproject.slack.com/) to stay in touch with the Zowe community. +[Back to sample list](#sample-use-cases) From 03117efa8ffa8d5c236c525123b8b02a4b6a788d Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 26 Jun 2023 15:05:55 -0400 Subject: [PATCH 33/80] updated CHANGELOGS Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer-api/CHANGELOG.md | 1 + packages/zowe-explorer-ftp-extension/CHANGELOG.md | 4 ++-- packages/zowe-explorer/CHANGELOG.md | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index d15124d35f..30d7474f86 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t - Fixed error when an extender's extension attempts to access the keyring in a remote VSCode session [#324](https://github.com/zowe/vscode-extension-for-cics/issues/324). - Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2330](https://github.com/zowe/vscode-extension-for-zowe/issues/2330) +- Updated dependencies for security audits. ## `2.9.0` diff --git a/packages/zowe-explorer-ftp-extension/CHANGELOG.md b/packages/zowe-explorer-ftp-extension/CHANGELOG.md index 1f87547e4a..d6d9546055 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -2,10 +2,10 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be docum ## TBD Release -### New features and enhancements - ### Bug fixes +- Updated dependencies for security audits. + ## `2.9.0` ### Bug fixes diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 6c55298d1b..93b4ad715a 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Optimized fetching and caching of child nodes across the primary tree views (Data Sets, Unix System Services, Jobs). [#2347](https://github.com/zowe/vscode-extension-for-zowe/issues/2347) - Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2330](https://github.com/zowe/vscode-extension-for-zowe/issues/2330) - Fixed profile watcher for browser based environments. [#2211](https://github.com/zowe/vscode-extension-for-zowe/issues/2211) +- Updated dependencies for security audits. ## `2.9.0` From 5cad05c7c3941ccba9d5109017acd1fa92278349 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Thu, 29 Jun 2023 15:12:32 +0000 Subject: [PATCH 34/80] Bump version to 2.9.1 [ci skip] Signed-off-by: zowe-robot --- packages/eslint-plugin-zowe-explorer/CHANGELOG.md | 2 +- packages/eslint-plugin-zowe-explorer/package.json | 2 +- packages/zowe-explorer-api/CHANGELOG.md | 2 +- packages/zowe-explorer-api/package.json | 2 +- packages/zowe-explorer-ftp-extension/CHANGELOG.md | 2 +- packages/zowe-explorer-ftp-extension/package.json | 4 ++-- packages/zowe-explorer/CHANGELOG.md | 2 +- packages/zowe-explorer/package.json | 6 +++--- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md index bef26f8312..29a2d420a1 100644 --- a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md +++ b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md @@ -1,6 +1,6 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documented in this file. -## TBD Release +## `2.9.1` ### New features and enhancements diff --git a/packages/eslint-plugin-zowe-explorer/package.json b/packages/eslint-plugin-zowe-explorer/package.json index 14653eff4f..eef299c3f7 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.9.1-SNAPSHOT", + "version": "2.9.1", "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 30d7474f86..fe11461800 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in this file. -## TBD Release +## `2.9.1` ### New features and enhancements diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index e39276f1a5..178dc2e979 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.9.1-SNAPSHOT", + "version": "2.9.1", "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 d6d9546055..5420271a58 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -1,6 +1,6 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be documented in this file. -## TBD Release +## `2.9.1` ### Bug fixes diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index 062a1fbebf..521607fcc1 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.9.1-SNAPSHOT", + "version": "2.9.1", "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.9.1-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.9.1", "tmp": "0.2.1" }, "devDependencies": { diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 93b4ad715a..4149615786 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documented in this file. -## TBD Release +## `2.9.1` ### Bug fixes diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 93d0fab52f..a464d5a2af 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.9.1-SNAPSHOT", + "version": "2.9.1", "publisher": "Zowe", "author": "Zowe", "license": "EPL-2.0", @@ -1945,7 +1945,7 @@ "chalk": "^2.4.1", "cross-env": "^5.2.0", "del": "^4.1.1", - "eslint-plugin-zowe-explorer": "2.9.1-SNAPSHOT", + "eslint-plugin-zowe-explorer": "2.9.1", "event-stream": "^4.0.1", "expect": "^24.8.0", "geckodriver": "^1.19.1", @@ -1971,7 +1971,7 @@ "webpack-cli": "^3.3.11" }, "dependencies": { - "@zowe/zowe-explorer-api": "2.9.1-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.9.1", "fs-extra": "8.0.1", "isbinaryfile": "4.0.4", "js-yaml": "3.13.1", From 6ae3d57634dca4b9611825570a0cb303d6d41841 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Thu, 29 Jun 2023 15:14:51 +0000 Subject: [PATCH 35/80] Bump version to 2.9.2-SNAPSHOT [ci skip] Signed-off-by: zowe-robot --- lerna.json | 2 +- packages/eslint-plugin-zowe-explorer/CHANGELOG.md | 6 ++++++ packages/eslint-plugin-zowe-explorer/package.json | 2 +- packages/zowe-explorer-api/CHANGELOG.md | 6 ++++++ packages/zowe-explorer-api/package.json | 2 +- packages/zowe-explorer-ftp-extension/CHANGELOG.md | 6 ++++++ packages/zowe-explorer-ftp-extension/package.json | 4 ++-- packages/zowe-explorer/CHANGELOG.md | 6 ++++++ packages/zowe-explorer/package.json | 6 +++--- 9 files changed, 32 insertions(+), 8 deletions(-) diff --git a/lerna.json b/lerna.json index fc406a7038..88a298e020 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.1", + "version": "2.9.2-SNAPSHOT", "command": { "version": { "forcePublish": true, diff --git a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md index 29a2d420a1..1a78767e6c 100644 --- a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md +++ b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md @@ -1,5 +1,11 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.1` ### New features and enhancements diff --git a/packages/eslint-plugin-zowe-explorer/package.json b/packages/eslint-plugin-zowe-explorer/package.json index eef299c3f7..8c805189dd 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.9.1", + "version": "2.9.2-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 fe11461800..4638bf18d0 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the "zowe-explorer-api" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.1` ### New features and enhancements diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index 178dc2e979..6e72d576cd 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.9.1", + "version": "2.9.2-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 5420271a58..9ab573ba38 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -1,5 +1,11 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.1` ### Bug fixes diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index 521607fcc1..e98237782a 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.9.1", + "version": "2.9.2-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.9.1", + "@zowe/zowe-explorer-api": "2.9.2-SNAPSHOT", "tmp": "0.2.1" }, "devDependencies": { diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 4149615786..83a86c20c5 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.1` ### Bug fixes diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index a464d5a2af..17530712cc 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.9.1", + "version": "2.9.2-SNAPSHOT", "publisher": "Zowe", "author": "Zowe", "license": "EPL-2.0", @@ -1945,7 +1945,7 @@ "chalk": "^2.4.1", "cross-env": "^5.2.0", "del": "^4.1.1", - "eslint-plugin-zowe-explorer": "2.9.1", + "eslint-plugin-zowe-explorer": "2.9.2-SNAPSHOT", "event-stream": "^4.0.1", "expect": "^24.8.0", "geckodriver": "^1.19.1", @@ -1971,7 +1971,7 @@ "webpack-cli": "^3.3.11" }, "dependencies": { - "@zowe/zowe-explorer-api": "2.9.1", + "@zowe/zowe-explorer-api": "2.9.2-SNAPSHOT", "fs-extra": "8.0.1", "isbinaryfile": "4.0.4", "js-yaml": "3.13.1", From 5018545c1ee5ba50c4a003dff7c596658f743c28 Mon Sep 17 00:00:00 2001 From: Rudy Flores <68666202+rudyflores@users.noreply.github.com> Date: Wed, 28 Jun 2023 16:58:31 -0400 Subject: [PATCH 36/80] add jobs not found message Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com> --- .../__unit__/job/ZoweJobNode.unit.test.ts | 14 ++++++++++++++ .../i18n/sample/src/job/ZoweJobNode.i18n.json | 1 + packages/zowe-explorer/src/job/ZoweJobNode.ts | 15 ++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) 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 fcaf7377aa..f00e5151fa 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -368,6 +368,20 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { jest.spyOn(contextually, "isSession").mockReturnValueOnce(true); await expect(globalMocks.testJobNode.getChildren()).resolves.toEqual([expectedJob]); }); + + it("should return 'No jobs found' if no children is found", async () => { + const globalMocks = await createGlobalMocks(); + const expectedJob = [ + new Job("No jobs found", vscode.TreeItemCollapsibleState.None, globalMocks.testJobsProvider.mSessionNodes[1], null, null, null), + ]; + expectedJob[0].iconPath = null; + expectedJob[0].contextValue = "information"; + await globalMocks.testJobsProvider.addSession("fake"); + globalMocks.testJobsProvider.mSessionNodes[1].filtered = true; + jest.spyOn(globalMocks.testJobsProvider.mSessionNodes[1], "getJobs").mockResolvedValue([]); + const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); + expect(jobs).toEqual(expectedJob); + }); }); describe("ZoweJobNode unit tests - Function flipState", () => { 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 1c9d853632..569bf3852e 100644 --- a/packages/zowe-explorer/i18n/sample/src/job/ZoweJobNode.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/job/ZoweJobNode.i18n.json @@ -1,6 +1,7 @@ { "getChildren.search": "Use the search button to display jobs", "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.", "getChildren.error.response": "Retrieving response from " } diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 9ccbde432c..6514fe1d2c 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -206,7 +206,6 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } }); } - // Child nodes already exist and every node was updated. // Return cached list of child nodes if (this.children.length && unmodifiedCount === 0) { @@ -219,6 +218,20 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { .filter((c) => this.children.find((ch) => ch.label === c.label) == null); // Remove any children that are no longer present in the built record this.children = this.children.concat(newChildren).filter((ch) => ch.label in elementChildren); + + if (!this.children.length) { + const noJobsNode = new Job( + localize("getChildren.noJobs", "No jobs found"), + vscode.TreeItemCollapsibleState.None, + this, + null, + null, + null + ); + noJobsNode.contextValue = globals.INFORMATION_CONTEXT; + noJobsNode.iconPath = null; + this.children = [noJobsNode]; + } } this.dirty = false; return this.children; From 3158b43de0e945f54d3a279c903f5b35961ece82 Mon Sep 17 00:00:00 2001 From: Rudy Flores <68666202+rudyflores@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:16:11 -0400 Subject: [PATCH 37/80] add changelog Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com> --- packages/zowe-explorer/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 124f32b8f3..4e46f8663d 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Optimized fetching and caching of child nodes across the primary tree views (Data Sets, Unix System Services, Jobs). [#2347](https://github.com/zowe/vscode-extension-for-zowe/issues/2347) - Fixed issue where profiles with authentication tokens were breaking functionality for direct-to-service profiles after user interaction. [#2330](https://github.com/zowe/vscode-extension-for-zowe/issues/2330) - Fixed profile watcher for browser based environments. [#2211](https://github.com/zowe/vscode-extension-for-zowe/issues/2211) +- Added jobs not found message when no results are returned from filter [#2362](https://github.com/zowe/vscode-extension-for-zowe/issues/2362) ## `2.9.0` From afbdc66d60374696dbbff4180a0f0aea6fc63f86 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Mon, 12 Jun 2023 14:50:38 -0400 Subject: [PATCH 38/80] Handle control characters in ds member names Signed-off-by: Timothy Johnson --- packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts index 36f38f8da8..013e25374b 100644 --- a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts +++ b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts @@ -216,16 +216,23 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod elementChildren[temp.label.toString()] = temp; } else { // Creates a ZoweDatasetNode for a PDS member + const memberInvalid = item.member?.includes("\ufffd"); const temp = new ZoweDatasetNode( item.member, vscode.TreeItemCollapsibleState.None, this, null, - undefined, + memberInvalid ? globals.DS_FILE_ERROR_CONTEXT : undefined, undefined, this.getProfile() ); - temp.command = { command: "zowe.ds.ZoweNode.openPS", title: "", arguments: [temp] }; + if (!memberInvalid) { + temp.command = { command: "zowe.ds.ZoweNode.openPS", title: "", arguments: [temp] }; + } else { + temp.errorDetails = new zowe.imperative.ImperativeError({ + msg: localize("getChildren.invalidMember", "Member cannot be opened because name contains special characters") + }); + } elementChildren[temp.label.toString()] = temp; } } From b1ef08a4cfad3cb2ab352d627a59232a1786653c Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Fri, 30 Jun 2023 09:06:32 -0400 Subject: [PATCH 39/80] Improve error message for invalid members Signed-off-by: Timothy Johnson --- .../i18n/sample/src/dataset/ZoweDatasetNode.i18n.json | 1 + packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 5eab50b035..3e6ee3e001 100644 --- a/packages/zowe-explorer/i18n/sample/src/dataset/ZoweDatasetNode.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/dataset/ZoweDatasetNode.i18n.json @@ -2,6 +2,7 @@ "getChildren.search": "Use the search button to display data sets", "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.error.response": "Retrieving response from " } diff --git a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts index 013e25374b..e4fcc32d45 100644 --- a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts +++ b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts @@ -230,7 +230,7 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod temp.command = { command: "zowe.ds.ZoweNode.openPS", title: "", arguments: [temp] }; } else { temp.errorDetails = new zowe.imperative.ImperativeError({ - msg: localize("getChildren.invalidMember", "Member cannot be opened because name contains special characters") + msg: localize("getChildren.invalidMember", "Cannot access member with control characters in the name: {0}", item.member) }); } elementChildren[temp.label.toString()] = temp; From 33f231820bca266644cfedf3d13db055aacef505 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 7 Jul 2023 11:23:50 -0400 Subject: [PATCH 40/80] fix: job tree not creating new nodes Signed-off-by: Trae Yelovich --- packages/zowe-explorer/CHANGELOG.md | 2 ++ .../i18n/sample/src/job/ZoweJobNode.i18n.json | 1 + .../zowe-explorer/src/job/ZosJobsProvider.ts | 2 -- packages/zowe-explorer/src/job/ZoweJobNode.ts | 33 +++++++++++++------ 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 83a86c20c5..e671eb863e 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes +- Fixed issue where job session nodes were not adding new job nodes when refreshed. [#2370](https://github.com/zowe/vscode-extension-for-zowe/issues/2370) + ## `2.9.1` ### Bug fixes 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 1c9d853632..355db7b747 100644 --- a/packages/zowe-explorer/i18n/sample/src/job/ZoweJobNode.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/job/ZoweJobNode.i18n.json @@ -1,6 +1,7 @@ { "getChildren.search": "Use the search button to display jobs", "getChildren.noSpoolFiles": "There are no JES spool messages to display", + "getChildren.noJobs": "There are no jobs to display", "getJobs.status.not.supported": "Filtering by job status is not yet supported with this profile type. Will show jobs with all statuses.", "getChildren.error.response": "Retrieving response from " } diff --git a/packages/zowe-explorer/src/job/ZosJobsProvider.ts b/packages/zowe-explorer/src/job/ZosJobsProvider.ts index 05978d76b1..e0b9f7df7d 100644 --- a/packages/zowe-explorer/src/job/ZosJobsProvider.ts +++ b/packages/zowe-explorer/src/job/ZosJobsProvider.ts @@ -821,8 +821,6 @@ export class ZosJobsProvider extends ZoweTreeProvider implements IZoweTree = {}; - let unmodifiedCount = this.children.length; if (contextually.isJob(this)) { // Fetch spool files under job node const cachedProfile = Profiles.getInstance().loadNamedProfile(this.getProfileName()); @@ -159,7 +158,6 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { const existing = this.children.find((element) => element.label?.includes(`${spool.stepname}:${spool.ddname}${spoolSuffix}`)); if (existing) { existing.label = newLabel; - unmodifiedCount--; } else { const spoolNode = new Spool(newLabel, vscode.TreeItemCollapsibleState.None, this, this.session, spool, this.job, this); const icon = getIconByNode(spoolNode); @@ -177,6 +175,19 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } else { // Fetch jobs under session node const jobs = await this.getJobs(this._owner, this._prefix, this._searchId, this._jobStatus); + if (!jobs.length) { + const noJobsNode = new Spool( + localize("getChildren.noJobs", "There are no jobs to display"), + vscode.TreeItemCollapsibleState.None, + this, + null, + null, + null, + this + ); + noJobsNode.iconPath = null; + return [noJobsNode]; + } jobs.forEach((job) => { let nodeTitle: string; if (job.retcode) { @@ -189,7 +200,6 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { if (existing) { // If matched, update the label to reflect latest retcode/status existing.label = nodeTitle; - unmodifiedCount--; } else { const jobNode = new Job(nodeTitle, vscode.TreeItemCollapsibleState.Collapsed, this, this.session, job, this.getProfile()); jobNode.contextValue = globals.JOBS_JOB_CONTEXT; @@ -207,18 +217,21 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { }); } - // Child nodes already exist and every node was updated. - // Return cached list of child nodes - if (this.children.length && unmodifiedCount === 0) { - return this.children; - } - // Only add new children that are not in the list of existing child nodes const newChildren = Object.values(elementChildren) .sort((a, b) => a.job.jobid - b.job.jobid) .filter((c) => this.children.find((ch) => ch.label === c.label) == null); + + // If there are no new children to add, return the cached list + if (Object.keys(elementChildren).length > 0 && newChildren.length == 0) { + this.dirty = false; + return this.children; + } + // Remove any children that are no longer present in the built record - this.children = this.children.concat(newChildren).filter((ch) => ch.label in elementChildren); + this.children = this.children + .concat(newChildren) + .filter((ch) => Object.values(elementChildren).find((recordCh) => recordCh.jobid === ch.job.jobid) == null); } this.dirty = false; return this.children; From c1a456eb552e0febecf80d76f9fd877354681c3a Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 7 Jul 2023 12:01:08 -0400 Subject: [PATCH 41/80] fix: remove refreshElement check in unit test Signed-off-by: Trae Yelovich --- .../__tests__/__unit__/job/ZoweJobNode.unit.test.ts | 2 -- 1 file changed, 2 deletions(-) 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 fcaf7377aa..5a7e3455bc 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -561,11 +561,9 @@ describe("ZosJobsProvider - Function searchPrompt", () => { const globalMocks = await createGlobalMocks(); jest.spyOn(globalMocks.testJobsProvider, "applyRegularSessionSearchLabel").mockReturnValue("Owner:kristina Prefix:* Status:*"); const addSearchHistory = jest.spyOn(globalMocks.testJobsProvider, "addSearchHistory"); - const refreshElement = jest.spyOn(globalMocks.testJobsProvider, "refreshElement"); await globalMocks.testJobsProvider.searchPrompt(globalMocks.testJobsProvider.mSessionNodes[1]); expect(globalMocks.testJobsProvider); expect(addSearchHistory).toHaveBeenCalled(); - expect(refreshElement).toHaveBeenCalled(); }); it("testing fav node to call applySearchLabelToNode", async () => { const globalMocks = await createGlobalMocks(); From 2be5c4c33346689eaac2d2c375477036306fd54d Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 7 Jul 2023 12:27:29 -0400 Subject: [PATCH 42/80] fix: remove temp fix for desync w/ dirty flag Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 4d5e7c9e5c..11dc1d8c12 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -222,12 +222,6 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { .sort((a, b) => a.job.jobid - b.job.jobid) .filter((c) => this.children.find((ch) => ch.label === c.label) == null); - // If there are no new children to add, return the cached list - if (Object.keys(elementChildren).length > 0 && newChildren.length == 0) { - this.dirty = false; - return this.children; - } - // Remove any children that are no longer present in the built record this.children = this.children .concat(newChildren) From afd5d8c509bda701acaa00e5fd40d232a303111e Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 7 Jul 2023 13:03:16 -0400 Subject: [PATCH 43/80] fix: change noJobsNode declaration to Job class Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 11dc1d8c12..912a1549ae 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -176,14 +176,13 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { // Fetch jobs under session node const jobs = await this.getJobs(this._owner, this._prefix, this._searchId, this._jobStatus); if (!jobs.length) { - const noJobsNode = new Spool( + const noJobsNode = new Job( localize("getChildren.noJobs", "There are no jobs to display"), vscode.TreeItemCollapsibleState.None, this, null, null, - null, - this + null ); noJobsNode.iconPath = null; return [noJobsNode]; From a72091c675b01f6473637514a1f60014f7dfc344 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 7 Jul 2023 13:15:15 -0400 Subject: [PATCH 44/80] fix: update sorting to match 2.9.0 behavior Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 912a1549ae..60abbcf1ff 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -217,14 +217,23 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } // Only add new children that are not in the list of existing child nodes - const newChildren = Object.values(elementChildren) - .sort((a, b) => a.job.jobid - b.job.jobid) - .filter((c) => this.children.find((ch) => ch.label === c.label) == null); + const newChildren = Object.values(elementChildren).filter((c) => this.children.find((ch) => ch.label === c.label) == null); // Remove any children that are no longer present in the built record this.children = this.children .concat(newChildren) - .filter((ch) => Object.values(elementChildren).find((recordCh) => recordCh.jobid === ch.job.jobid) == null); + .filter((ch) => Object.values(elementChildren).find((recordCh) => recordCh.jobid === ch.job.jobid) == null) + .sort((a, b) => { + if (a.job.jobid > b.job.jobid) { + return 1; + } + + if (a.job.jobid < b.job.jobid) { + return -1; + } + + return 0; + }); } this.dirty = false; return this.children; From d1009a21383aebd586dec737beebe457c9e53d75 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Fri, 30 Jun 2023 10:09:21 +0000 Subject: [PATCH 45/80] fix audit Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- package.json | 1 + yarn.lock | 56 +++++++++++----------------------------------------- 2 files changed, 13 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index db000897f1..28c2cf9387 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ }, "resolutions": { "**/json5": "^2.2.2", + "**/optionator": "^0.9.3", "**/semver": "^7.5.2" }, "scripts": { diff --git a/yarn.lock b/yarn.lock index f23885eddd..22efcae2a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + "@ampproject/remapping@^2.1.0": version "2.2.0" resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" @@ -4116,7 +4121,7 @@ deep-extend@^0.6.0: resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@^0.1.3, deep-is@~0.1.3: +deep-is@^0.1.3: version "0.1.4" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== @@ -4977,7 +4982,7 @@ fast-levenshtein@^1.0.0: resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" integrity sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: +fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= @@ -7249,14 +7254,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - lie@~3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" @@ -8381,29 +8378,17 @@ opener@1.5.2: resolved "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== +optionator@^0.8.1, optionator@^0.9.1, optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" - word-wrap "^1.2.3" ordered-read-streams@^1.0.0: version "1.0.1" @@ -8872,11 +8857,6 @@ prelude-ls@^1.2.1: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -10540,13 +10520,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -11145,11 +11118,6 @@ wontache@0.1.0: dependencies: underscore "^1.13.0-2" -word-wrap@^1.2.3, word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - worker-farm@^1.7.0: version "1.7.0" resolved "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" From 4697f131f19d247e1feb8032c8dcd59a979c828d Mon Sep 17 00:00:00 2001 From: Rudy Flores <68666202+rudyflores@users.noreply.github.com> Date: Fri, 7 Jul 2023 14:49:59 -0400 Subject: [PATCH 46/80] address traeok's comments Signed-off-by: Rudy Flores <68666202+rudyflores@users.noreply.github.com> --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 6514fe1d2c..99dc28e93b 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -177,6 +177,21 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } else { // Fetch jobs under session node const jobs = await this.getJobs(this._owner, this._prefix, this._searchId, this._jobStatus); + + if (!jobs.length) { + const noJobsNode = new Job( + localize("getChildren.noJobs", "No jobs found"), + vscode.TreeItemCollapsibleState.None, + this, + null, + null, + null + ); + noJobsNode.contextValue = globals.INFORMATION_CONTEXT; + noJobsNode.iconPath = null; + return [noJobsNode]; + } + jobs.forEach((job) => { let nodeTitle: string; if (job.retcode) { @@ -218,20 +233,6 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { .filter((c) => this.children.find((ch) => ch.label === c.label) == null); // Remove any children that are no longer present in the built record this.children = this.children.concat(newChildren).filter((ch) => ch.label in elementChildren); - - if (!this.children.length) { - const noJobsNode = new Job( - localize("getChildren.noJobs", "No jobs found"), - vscode.TreeItemCollapsibleState.None, - this, - null, - null, - null - ); - noJobsNode.contextValue = globals.INFORMATION_CONTEXT; - noJobsNode.iconPath = null; - this.children = [noJobsNode]; - } } this.dirty = false; return this.children; From bcb1fa1287443c2f2bb53ae1be7a65d219c248fe Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Mon, 10 Jul 2023 15:41:42 -0400 Subject: [PATCH 47/80] Add unit test for 'no spool files' Signed-off-by: Trae Yelovich --- .../__tests__/__unit__/job/ZoweJobNode.unit.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 9ac889f67a..8618dcd74a 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -340,6 +340,18 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { expect(spoolFilesAfter[0].owner).toEqual("fake"); }); + it("Tests that getChildren returns a placeholder node if no spool files are available", async () => { + const globalMocks = await createGlobalMocks(); + + jest.spyOn(ZoweExplorerApiRegister, "getJesApi").mockReturnValueOnce({ + getSpoolFiles: jest.fn().mockReturnValueOnce([]), + } as any); + globalMocks.testJobNode.dirty = true; + const spoolFilesAfter = await globalMocks.testJobNode.getChildren(); + expect(spoolFilesAfter.length).toBe(1); + expect(spoolFilesAfter[0].label).toEqual("There are no JES spool messages to display"); + }); + it("Tests that getChildren returns the spool files if user/owner is not defined", async () => { const globalMocks = await createGlobalMocks(); From 3c12eba360284cb843024ceee97662a4237f2f48 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Mon, 10 Jul 2023 16:00:10 -0400 Subject: [PATCH 48/80] test: add unit test for sorting jobs Signed-off-by: Trae Yelovich --- .../__unit__/job/ZoweJobNode.unit.test.ts | 27 +++++++++++++++++++ .../zowe-explorer/src/job/ZosJobsProvider.ts | 1 + packages/zowe-explorer/src/job/ZoweJobNode.ts | 24 +++++++++-------- 3 files changed, 41 insertions(+), 11 deletions(-) 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 8618dcd74a..094507d2e9 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -808,3 +808,30 @@ describe("ZosJobsProvider - getJobs", () => { await expect(globalMocks.testJobNode.getJobs("test", "test", "test", "test")).resolves.not.toThrow(); }); }); + +describe("Job - sortJobs", () => { + it("should sort jobs based on job ID", () => { + const jobs = [ + { + job: { + jobid: "JOBID123", + }, + } as IZoweJobTreeNode, + { + job: { + jobid: "JOBID124", + }, + } as IZoweJobTreeNode, + { + job: { + jobid: "JOBID120", + }, + } as IZoweJobTreeNode, + ]; + + const sorted = jobs.sort((a, b) => Job.sortJobs(a, b)); + expect(sorted[0].job.jobid).toBe("JOBID120"); + expect(sorted[1].job.jobid).toBe("JOBID123"); + expect(sorted[2].job.jobid).toBe("JOBID124"); + }); +}); diff --git a/packages/zowe-explorer/src/job/ZosJobsProvider.ts b/packages/zowe-explorer/src/job/ZosJobsProvider.ts index e0b9f7df7d..aad8e421c1 100644 --- a/packages/zowe-explorer/src/job/ZosJobsProvider.ts +++ b/packages/zowe-explorer/src/job/ZosJobsProvider.ts @@ -820,6 +820,7 @@ export class ZosJobsProvider extends ZoweTreeProvider implements IZoweTree Object.values(elementChildren).find((recordCh) => recordCh.jobid === ch.job.jobid) == null) - .sort((a, b) => { - if (a.job.jobid > b.job.jobid) { - return 1; - } - - if (a.job.jobid < b.job.jobid) { - return -1; - } - - return 0; - }); + .sort((a, b) => Job.sortJobs(a, b)); } this.dirty = false; return this.children; } + public static sortJobs(a: IZoweJobTreeNode, b: IZoweJobTreeNode): number { + if (a.job.jobid > b.job.jobid) { + return 1; + } + + if (a.job.jobid < b.job.jobid) { + return -1; + } + + return 0; + } + public getSessionNode(): IZoweJobTreeNode { ZoweLogger.trace("ZoweJobNode.getSessionNode called."); return this.getParent() ? this.getParent().getSessionNode() : this; From a6f0cd99533e463c720bb221262513f71a5c4705 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 11 Jul 2023 09:30:02 -0400 Subject: [PATCH 49/80] test: add test case for equal job IDs Signed-off-by: Trae Yelovich --- .../__unit__/job/ZoweJobNode.unit.test.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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 094507d2e9..fcc88b1923 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -811,27 +811,32 @@ describe("ZosJobsProvider - getJobs", () => { describe("Job - sortJobs", () => { it("should sort jobs based on job ID", () => { - const jobs = [ + const sorted = [ { job: { jobid: "JOBID123", }, } as IZoweJobTreeNode, + { + job: { + jobid: "JOBID120", + }, + } as IZoweJobTreeNode, { job: { jobid: "JOBID124", }, } as IZoweJobTreeNode, + // In most cases, there won't be two identical job IDs. In case of overflow, this covers the case for equal job IDs. { job: { jobid: "JOBID120", }, } as IZoweJobTreeNode, - ]; - - const sorted = jobs.sort((a, b) => Job.sortJobs(a, b)); + ].sort((a, b) => Job.sortJobs(a, b)); expect(sorted[0].job.jobid).toBe("JOBID120"); - expect(sorted[1].job.jobid).toBe("JOBID123"); - expect(sorted[2].job.jobid).toBe("JOBID124"); + expect(sorted[1].job.jobid).toBe("JOBID120"); + expect(sorted[2].job.jobid).toBe("JOBID123"); + expect(sorted[3].job.jobid).toBe("JOBID124"); }); }); From fe3e8b2de6166ed7a144e5b5240ceaae7efc4a1f Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Wed, 12 Jul 2023 09:25:59 -0400 Subject: [PATCH 50/80] fix: prevent cancelled search from fetching jobs Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/job/ZosJobsProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/src/job/ZosJobsProvider.ts b/packages/zowe-explorer/src/job/ZosJobsProvider.ts index aad8e421c1..2ab16ec358 100644 --- a/packages/zowe-explorer/src/job/ZosJobsProvider.ts +++ b/packages/zowe-explorer/src/job/ZosJobsProvider.ts @@ -815,9 +815,9 @@ export class ZosJobsProvider extends ZoweTreeProvider implements IZoweTree Date: Wed, 12 Jul 2023 10:20:46 -0400 Subject: [PATCH 51/80] fix: prevent early search execution due to filtered flag Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/job/ZosJobsProvider.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZosJobsProvider.ts b/packages/zowe-explorer/src/job/ZosJobsProvider.ts index 2ab16ec358..1f210b81d6 100644 --- a/packages/zowe-explorer/src/job/ZosJobsProvider.ts +++ b/packages/zowe-explorer/src/job/ZosJobsProvider.ts @@ -806,8 +806,6 @@ export class ZosJobsProvider extends ZoweTreeProvider implements IZoweTree Date: Wed, 12 Jul 2023 17:36:45 -0400 Subject: [PATCH 52/80] Add unit test and update changelog Signed-off-by: Timothy Johnson --- package.json | 3 +- packages/zowe-explorer/CHANGELOG.md | 1 + .../__tests__/__unit__/ZoweNode.unit.test.ts | 45 ++++++++++++++++++- .../__unit__/dataset/DatasetTree.unit.test.ts | 2 +- yarn.lock | 8 ++-- 5 files changed, 52 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 28c2cf9387..70ab2e57a4 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "resolutions": { "**/json5": "^2.2.2", "**/optionator": "^0.9.3", - "**/semver": "^7.5.2" + "**/semver": "^7.5.2", + "**/@zowe/zos-files-for-zowe-sdk": "7.16.6" }, "scripts": { "clean": "yarn workspaces run clean", diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 4038dda466..c10de1d5f4 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes - Added jobs not found message when no results are returned from filter [#2362](https://github.com/zowe/vscode-extension-for-zowe/issues/2362) +- Fixed error when listing data set members that include control characters in the name. ## `2.9.1` diff --git a/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts index 2c9b678a91..12ef9d356d 100644 --- a/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts @@ -372,10 +372,53 @@ describe("Unit Tests (Jest)", () => { expect((await pds.getChildren())[0].label).toEqual("BRTVS99"); }); + /************************************************************************************************************* + * Multiple member names returned + *************************************************************************************************************/ + it("Testing what happens when response has multiple members", async () => { + Object.defineProperty(Profiles, "getInstance", { + value: jest.fn(() => { + return { + loadNamedProfile: jest.fn().mockReturnValue(profileOne), + }; + }), + }); + // Creating a rootNode + const pds = new ZoweDatasetNode( + "[root]: something", + vscode.TreeItemCollapsibleState.Collapsed, + { getSessionNode: jest.fn() } as unknown as ZoweDatasetNode, + session, + undefined, + undefined, + profileOne + ); + pds.dirty = true; + pds.contextValue = globals.DS_PDS_CONTEXT; + const allMembers = jest.fn(); + allMembers.mockImplementationOnce(() => { + return { + success: true, + apiResponse: { + items: [ + { member: "BADMEM\ufffd" }, + { member: "GOODMEM1" } + ] + }, + }; + }); + Object.defineProperty(List, "allMembers", { value: allMembers }); + const pdsChildren = await pds.getChildren(); + expect(pdsChildren[0].label).toEqual("BADMEM\ufffd"); + expect(pdsChildren[0].contextValue).toEqual(globals.DS_FILE_ERROR_CONTEXT); + expect(pdsChildren[1].label).toEqual("GOODMEM1"); + expect(pdsChildren[1].contextValue).toEqual(globals.DS_MEMBER_CONTEXT); + }); + /************************************************************************************************************* * No values returned *************************************************************************************************************/ - it("Testing what happens when response is zero", async () => { + it("Testing what happens when response has no members", async () => { Object.defineProperty(Profiles, "getInstance", { value: jest.fn(() => { return { diff --git a/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts index aca159784a..927b3a00b0 100644 --- a/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts @@ -427,7 +427,7 @@ describe("Dataset Tree Unit Tests - Function getChildren", () => { expect(children).toEqual(sampleChildren); spyOnDataSetsMatchingPattern.mockRestore(); }); - it("Checking that we fallback to old dataSet API if newer dataSetsMattchingPattern does not exist", async () => { + it("Checking that we fallback to old dataSet API if newer dataSetsMatchingPattern does not exist", async () => { createGlobalMocks(); const blockMocks = createBlockMocks(); diff --git a/yarn.lock b/yarn.lock index 22efcae2a2..e23c46f471 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2335,10 +2335,10 @@ resolved "https://registry.npmjs.org/@zowe/zos-console-for-zowe-sdk/-/zos-console-for-zowe-sdk-7.16.1.tgz#a793daa0d93d9323127a2e844b0cb425bcb3c023" integrity sha512-Yu9sKPjwYL1+3OAAxql1iJ0wMhn+lnnCw1B1WMXDDaY4kDV8pNKCOG/plbbXhEeUJ/UtUYh9Srr+S0Z0wKQWPA== -"@zowe/zos-files-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/zos-files-for-zowe-sdk/-/zos-files-for-zowe-sdk-7.16.1.tgz#39405d4ea13e1501a52fb039be046ad7c1a5b10d" - integrity sha512-lFVWpLTkjtbd6Xw7OGsfMmNqhYVZYK+iSVXNW3w+qoJGVeC0GtzFlZBqD/a4SzjLSBK00tAc3SEaiiqiprHJIA== +"@zowe/zos-files-for-zowe-sdk@7.16.1", "@zowe/zos-files-for-zowe-sdk@7.16.6": + version "7.16.6" + resolved "https://registry.npmjs.org/@zowe/zos-files-for-zowe-sdk/-/zos-files-for-zowe-sdk-7.16.6.tgz#7de7268ef9360da1aba03f7b83cb5b83eb091823" + integrity sha512-+BT3vPFkX0WfEi7hu+HtJs0QnkXt5YbqxfAIE2VwTMELRoOdQCOIFsoe9cGVtZrJ3zluzlqbXbqpX8ymEKcevQ== dependencies: minimatch "5.0.1" From 11b9f45736ddd9b9ddce41c16e5ed1f188d4647f Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Wed, 12 Jul 2023 17:59:04 -0400 Subject: [PATCH 53/80] Forgot to run prettier Signed-off-by: Timothy Johnson --- .../zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts | 5 +---- packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts index 12ef9d356d..5fa1ec54d8 100644 --- a/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts @@ -400,10 +400,7 @@ describe("Unit Tests (Jest)", () => { return { success: true, apiResponse: { - items: [ - { member: "BADMEM\ufffd" }, - { member: "GOODMEM1" } - ] + items: [{ member: "BADMEM\ufffd" }, { member: "GOODMEM1" }], }, }; }); diff --git a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts index e4fcc32d45..11a2796474 100644 --- a/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts +++ b/packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts @@ -230,7 +230,7 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod temp.command = { command: "zowe.ds.ZoweNode.openPS", title: "", arguments: [temp] }; } else { temp.errorDetails = new zowe.imperative.ImperativeError({ - msg: localize("getChildren.invalidMember", "Cannot access member with control characters in the name: {0}", item.member) + msg: localize("getChildren.invalidMember", "Cannot access member with control characters in the name: {0}", item.member), }); } elementChildren[temp.label.toString()] = temp; From d39538c3d153eab0eb292e02b0e10306e9e20bb3 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 13 Jul 2023 10:58:42 -0400 Subject: [PATCH 54/80] Fix integration tests for Theia 1.37 Signed-off-by: Timothy Johnson --- .../__theia__/extension.theia.test.ts | 8 ++-- .../__tests__/__theia__/theia/Locators.ts | 38 +++++++--------- .../__theia__/theia/extension.theiaChrome.ts | 44 +++++++++---------- .../__theia__/theia/extension.theiaFirefox.ts | 8 ++-- 4 files changed, 43 insertions(+), 55 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__theia__/extension.theia.test.ts b/packages/zowe-explorer/__tests__/__theia__/extension.theia.test.ts index fbd286c785..de6bb911cf 100644 --- a/packages/zowe-explorer/__tests__/__theia__/extension.theia.test.ts +++ b/packages/zowe-explorer/__tests__/__theia__/extension.theia.test.ts @@ -49,7 +49,7 @@ describe("Locate Tree Nodes", () => { afterEach(screenshotIfFailed(driverFirefox)); it("should open Zowe Explorer and find the Favorites node", async () => { - const favoriteLink = await driverFirefox.getFavouritesNode(); + const favoriteLink = await driverFirefox.getFavoritesNode(); expect(favoriteLink).to.equal("Favorites"); }).timeout(TIMEOUT); @@ -186,7 +186,7 @@ describe("Test Adding and Removing Favorites", () => { await driverChrome.sleepTime(SHORTSLEEPTIME); await driverChrome.clickOnFavoriteTabInDatasets(); await driverChrome.sleepTime(SHORTSLEEPTIME); - const favoriteProfile = await driverChrome.getFavoritePrfileNameFromDatasets(); + const favoriteProfile = await driverChrome.getFavoriteProfileNameFromDatasets(); expect(favoriteProfile).to.equal("TestSeleniumProfile"); }); @@ -206,7 +206,7 @@ describe("Test Adding and Removing Favorites", () => { await driverChrome.sleepTime(SHORTSLEEPTIME); await driverChrome.clickOnFavoriteTabInUss(); await driverChrome.sleepTime(SHORTSLEEPTIME); - const favoriteProfile = await driverChrome.getFavoritePrfileNameFromUss(); + const favoriteProfile = await driverChrome.getFavoriteProfileNameFromUss(); expect(favoriteProfile).to.equal("TestSeleniumProfile"); }); @@ -226,7 +226,7 @@ describe("Test Adding and Removing Favorites", () => { await driverChrome.sleepTime(SHORTSLEEPTIME); await driverChrome.clickOnFavoriteTabInJobs(); await driverChrome.sleepTime(SHORTSLEEPTIME); - const favoriteProfile = await driverChrome.getFavoritePrfileNameFromJobs(); + const favoriteProfile = await driverChrome.getFavoriteProfileNameFromJobs(); expect(favoriteProfile).to.equal("TestSeleniumProfile"); }); diff --git a/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts b/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts index 27f9cafb76..875faa4863 100644 --- a/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts +++ b/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts @@ -11,7 +11,6 @@ export const TheiaLocator = { theiaUrl: "http://localhost:3000", - zoweExplorerxId: "shell-tab-plugin-view-container:zowe", }; @@ -21,16 +20,14 @@ export const DatasetsLocators = { datasetsPanelId: "plugin-view:zowe.ds.explorer", datasetsAddSessionId: "zowe.ds.addSession-as-tabbar-toolbar-item", emptyInputBoxXpath: "//*[@class='input empty']", - createNewConnectionListXpath: "//*[@class='monaco-list-row'][1]", + createNewConnectionListXpath: "//*[@class='monaco-list-row focused'][1]", inputBoxXpath: "//*[@class='input']", - defaultDatasetsProfileId: "/iDefaultProfile", - secondDatasetProfileId: "/iTestSeleniumProfile", - favoriteTabId: "/iFavorites", - favoriteProfileInDatasetId: "/iFavorites/iTestSeleniumProfile", + defaultDatasetsProfileXpath: "(//div[contains(@id,'DefaultProfile')])[1]", + secondDatasetProfileXpath: "(//div[contains(@id,'TestSeleniumProfile')])[1]", + favoriteTabXpath: "(//div[contains(@id,'Favorites')])[1]", + favoriteProfileInDatasetXpath: "(//div[contains(@id,'Favorites') and contains(@id,'TestSeleniumProfile')])", addToFavoriteOptionXpath: "//li[@data-command='zowe.ds.saveSearch']", - searchSymbolInFavoriteXpath: "//*[@id='/iFavorites/iTestSeleniumProfile/i']", removeFavoriteProfileFromDatasetsOptionXpath: "//li[@data-command='zowe.ds.removeFavProfile']", - secondDatasetProfileBeforeDeletingId: "/iTestSeleniumProfile", deleteProfileFromDatasetsXpath: "(//li[@data-command='zowe.ds.deleteProfile'])", }; @@ -40,15 +37,14 @@ export const UssLocators = { ussPanelId: "plugin-view:zowe.uss.explorer", ussAddSessionId: "zowe.uss.addSession-as-tabbar-toolbar-item", emptyInputBoxXpath: "//*[@class='input empty']", - defaultUssProfileXpath: "(//div[@id='/iDefaultProfile'])[2]", - secondUssProfileXpath: "(//div[@id='/iTestSeleniumProfile'])[2]", - favoriteTabXpath: "(//div[@id='/iFavorites'])[2]", - favoriteProfileInUssXpath: "(//div[@id='/iFavorites/iTestSeleniumProfile'])", + defaultUssProfileXpath: "(//div[contains(@id,'DefaultProfile')])[2]", + secondUssProfileXpath: "(//div[contains(@id,'TestSeleniumProfile')])[2]", + favoriteTabXpath: "(//div[contains(@id,'Favorites')])[2]", + favoriteProfileInUssXpath: "(//div[contains(@id,'Favorites') and contains(@id,'TestSeleniumProfile')])", addToFavoriteOptionXpath: "//li[@data-command='zowe.uss.addFavorite']", - favoriteProfileInUssBeforeRemovingXpath: "(//div[@id='/iFavorites/iTestSeleniumProfile'])", removeFavoriteProfileFromUssOptionXpath: "//li[@data-command='zowe.uss.removeFavProfile']", hideProfileFromUssOptionXpath: "//li[@data-command='zowe.uss.removeSession']", - searchSymbolInFavoriteXpath: "//*[@id='/iFavorites/iTestSeleniumProfile/i']", + secondUssProfileBeforeHidingXpath: "(//div[contains(@id,'TestSeleniumProfile')])[1]", }; export const JobsLocators = { @@ -57,18 +53,14 @@ export const JobsLocators = { jobsPanelId: "zowe.jobs.explorer", jobsAddSessionId: "zowe.jobs.addJobsSession-as-tabbar-toolbar-item", emptyInputBoxXpath: "//*[@class='input empty']", - defaultJobsProfileXpath: "(//div[@id='/iDefaultProfile'])[3]", - secondJobsProfileXpath: "(//div[@id='/iTestSeleniumProfile'])[3]", - favoriteTabXpath: "(//div[@id='/iFavorites'])[3]", - favoriteTabAfterRefreshXpath: "(//div[@id='/iFavorites'])[2]", - favoriteProfileInJobsXpath: "(//div[@id='/iFavorites/iTestSeleniumProfile'])", - favoriteprofile: "(//div[@id='/iFavorites/iTestSeleniumProfile'])", + defaultJobsProfileXpath: "(//div[contains(@id,'DefaultProfile')])[3]", + secondJobsProfileXpath: "(//div[contains(@id,'TestSeleniumProfile')])[3]", + favoriteTabXpath: "(//div[contains(@id,'Favorites')])[3]", + favoriteProfileInJobsXpath: "(//div[contains(@id,'Favorites') and contains(@id,'TestSeleniumProfile')])", addToFavoriteOptionXpath: "//li[@data-command='zowe.jobs.addFavorite']", - favoriteProfileInJobsBeforeRemovingXpath: "//div[@id='/iFavorites/iTestSeleniumProfile/iPrefix:*']", removeFavoriteProfileFromJobsOptionXpath: "//li[@data-command='zowe.jobs.removeFavProfile']", hideProfileFromJobsOptionXpath: "//li[@data-command='zowe.jobs.removeJobsSession']", - secondJobsProfileIdBeforeHidingXpath: "(//div[@id='/iTestSeleniumProfile'])[2]", - favoriteprofilexpath: "//div[@id='/iFavorites/iTestSeleniumProfile']", + secondJobsProfileBeforeHidingXpath: "(//div[contains(@id,'TestSeleniumProfile')])[1]", }; export const TheiaNotificationMessages = { diff --git a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts index 17796e37d8..3687cd27e9 100644 --- a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts +++ b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts @@ -43,7 +43,7 @@ export async function clickOnZoweExplorer() { } export async function clickOnFavoriteTabInDatasets() { - await driverChrome.wait(until.elementLocated(By.id(DatasetsLocators.favoriteTabId)), WAITTIME).click(); + await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.favoriteTabXpath)), WAITTIME).click(); } export async function clickOnFavoriteTabInUss() { @@ -54,10 +54,6 @@ export async function clickOnFavoriteTabInJobs() { await driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.favoriteTabXpath)), WAITTIME).click(); } -export async function clickOnFavoriteTabInJobsAfterRefresh() { - await driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.favoriteTabAfterRefreshXpath)), WAITTIME).click(); -} - export async function clickOnDatasetsTab() { await driverChrome.findElement(By.xpath(DatasetsLocators.datasetTabXpath)).click(); } @@ -74,22 +70,24 @@ export async function clickOnJobsTab() { await driverChrome.findElement(By.id(JobsLocators.jobTabId)).click(); } -export async function getFavoritePrfileNameFromDatasets() { - const favoriteProfile = await driverChrome.wait(until.elementLocated(By.id(DatasetsLocators.favoriteProfileInDatasetId)), WAITTIME).getText(); +export async function getFavoriteProfileNameFromDatasets() { + const favoriteProfile = await driverChrome + .wait(until.elementLocated(By.xpath(DatasetsLocators.favoriteProfileInDatasetXpath)), WAITTIME) + .getText(); return favoriteProfile; } -export async function getFavoritePrfileNameFromUss() { +export async function getFavoriteProfileNameFromUss() { const favoriteProfile = await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.favoriteProfileInUssXpath)), WAITTIME).getText(); return favoriteProfile; } -export async function getFavoritePrfileNameFromJobs() { +export async function getFavoriteProfileNameFromJobs() { return driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.favoriteProfileInJobsXpath)), WAITTIME).getText(); } export async function removeFavoriteProfileFromDatasets() { - const removeFromFavorite = await driverChrome.wait(until.elementLocated(By.id(DatasetsLocators.favoriteProfileInDatasetId)), WAITTIME); + const removeFromFavorite = await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.favoriteProfileInDatasetXpath)), WAITTIME); await driverChrome.actions().click(removeFromFavorite, Button.RIGHT).perform(); await driverChrome.sleep(SHORTSLEEPTIME); await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.removeFavoriteProfileFromDatasetsOptionXpath)), WAITTIME).click(); @@ -98,7 +96,7 @@ export async function removeFavoriteProfileFromDatasets() { } export async function removeFavoriteProfileFromUss() { - const removeFromFavorite = await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.favoriteProfileInUssBeforeRemovingXpath)), WAITTIME); + const removeFromFavorite = await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.favoriteProfileInUssXpath)), WAITTIME); await driverChrome.actions().click(removeFromFavorite, Button.RIGHT).perform(); await driverChrome.sleep(SHORTSLEEPTIME); await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.removeFavoriteProfileFromUssOptionXpath)), WAITTIME).click(); @@ -107,7 +105,7 @@ export async function removeFavoriteProfileFromUss() { } export async function removeFavoriteProfileFromJobs() { - const removeFromFavorite = await driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.favoriteprofile)), WAITTIME); + const removeFromFavorite = await driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.favoriteProfileInJobsXpath)), WAITTIME); await driverChrome.actions().click(removeFromFavorite, Button.RIGHT).perform(); await driverChrome.sleep(SHORTSLEEPTIME); await driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.removeFavoriteProfileFromJobsOptionXpath)), WAITTIME).click(); @@ -116,7 +114,7 @@ export async function removeFavoriteProfileFromJobs() { } export async function addProfileToFavoritesInDatasets() { - const addTofavorite = await driverChrome.wait(until.elementLocated(By.id(DatasetsLocators.secondDatasetProfileId)), WAITTIME); + const addTofavorite = await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.secondDatasetProfileXpath)), WAITTIME); await driverChrome.actions().click(addTofavorite, Button.RIGHT).perform(); await driverChrome.sleep(SHORTSLEEPTIME); await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.addToFavoriteOptionXpath)), WAITTIME).click(); @@ -138,13 +136,13 @@ export async function addProfileToFavoritesInJobs() { } export async function hideProfileInUss() { - const hideProfileFromUss = await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.secondUssProfileXpath)), WAITTIME); + const hideProfileFromUss = await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.secondUssProfileBeforeHidingXpath)), WAITTIME); await driverChrome.actions().click(hideProfileFromUss, Button.RIGHT).perform(); await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.hideProfileFromUssOptionXpath)), WAITTIME).click(); } export async function hideProfileInJobs() { - const hideProfileFromJobs = await driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.secondJobsProfileIdBeforeHidingXpath)), WAITTIME); + const hideProfileFromJobs = await driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.secondJobsProfileBeforeHidingXpath)), WAITTIME); await driverChrome.actions().click(hideProfileFromJobs, Button.RIGHT).perform(); await driverChrome.wait(until.elementLocated(By.xpath(JobsLocators.hideProfileFromJobsOptionXpath)), WAITTIME).click(); } @@ -160,7 +158,7 @@ export async function verifyProfileIsHideInUss() { export async function verifyProfileIsHideInJobs() { const hideProfileFromJobs = await driverChrome - .findElements(By.xpath(JobsLocators.secondJobsProfileIdBeforeHidingXpath)) + .findElements(By.xpath(JobsLocators.secondJobsProfileBeforeHidingXpath)) .then((found) => !!found.length); if (!hideProfileFromJobs) { return true; @@ -170,7 +168,7 @@ export async function verifyProfileIsHideInJobs() { } export async function deleteDefaultProfileInDatasets() { - const profileName = await driverChrome.wait(until.elementLocated(By.id(DatasetsLocators.defaultDatasetsProfileId)), WAITTIME); + const profileName = await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.defaultDatasetsProfileXpath)), WAITTIME); await driverChrome.actions().click(profileName, Button.RIGHT).perform(); await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.deleteProfileFromDatasetsXpath)), WAITTIME).click(); await driverChrome.sleep(SHORTSLEEPTIME); @@ -181,7 +179,7 @@ export async function deleteDefaultProfileInDatasets() { } export async function deleteProfileInDatasets() { - const favprofile = await driverChrome.wait(until.elementLocated(By.id(DatasetsLocators.secondDatasetProfileBeforeDeletingId)), WAITTIME); + const favprofile = await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.secondDatasetProfileXpath)), WAITTIME); await driverChrome.actions().click(favprofile, Button.RIGHT).perform(); await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.deleteProfileFromDatasetsXpath)), WAITTIME).click(); await driverChrome.sleep(SHORTSLEEPTIME); @@ -192,7 +190,7 @@ export async function deleteProfileInDatasets() { } export async function verifyRemovedFavoriteProfileInDatasets() { - const favoriteProfile = await driverChrome.findElements(By.id(DatasetsLocators.favoriteProfileInDatasetId)).then((found) => !!found.length); + const favoriteProfile = await driverChrome.findElements(By.xpath(DatasetsLocators.favoriteProfileInDatasetXpath)).then((found) => !!found.length); if (!favoriteProfile) { return true; } else { @@ -219,7 +217,7 @@ export async function verifyRemovedFavoriteProfileInJobs() { } export async function verifyRemovedDefaultProfileInDataSet() { - const defaultProfile = await driverChrome.findElements(By.id(DatasetsLocators.defaultDatasetsProfileId)).then((found) => !!found.length); + const defaultProfile = await driverChrome.findElements(By.xpath(DatasetsLocators.defaultDatasetsProfileXpath)).then((found) => !!found.length); if (!defaultProfile) { return true; } else { @@ -228,7 +226,7 @@ export async function verifyRemovedDefaultProfileInDataSet() { } export async function verifyRemovedOtherProfileInDataSet() { - const defaultProfile = await driverChrome.findElements(By.id(DatasetsLocators.secondDatasetProfileId)).then((found) => !!found.length); + const defaultProfile = await driverChrome.findElements(By.xpath(DatasetsLocators.secondDatasetProfileXpath)).then((found) => !!found.length); if (!defaultProfile) { return true; } else { @@ -319,11 +317,11 @@ export async function clickOnAddSessionInDatasets() { } export async function getDatasetsDefaultProfilename() { - const datasetProfile = await driverChrome.wait(until.elementLocated(By.id(DatasetsLocators.defaultDatasetsProfileId)), WAITTIME).getText(); + const datasetProfile = await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.defaultDatasetsProfileXpath)), WAITTIME).getText(); return datasetProfile; } export async function getDatasetsProfilename() { - const datasetProfile = await driverChrome.wait(until.elementLocated(By.id(DatasetsLocators.secondDatasetProfileId)), WAITTIME).getText(); + const datasetProfile = await driverChrome.wait(until.elementLocated(By.xpath(DatasetsLocators.secondDatasetProfileXpath)), WAITTIME).getText(); return datasetProfile; } diff --git a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaFirefox.ts b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaFirefox.ts index 677ca9e12b..1f52bc1851 100644 --- a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaFirefox.ts +++ b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaFirefox.ts @@ -10,13 +10,11 @@ */ import { writeFileSync } from "fs"; -import { Builder, By, Key, until, Button } from "selenium-webdriver"; +import { Builder, By, Key, until } from "selenium-webdriver"; import * as firefox from "selenium-webdriver/firefox"; import { TheiaLocator, DatasetsLocators, UssLocators, JobsLocators } from "./Locators"; const WAITTIME = 30000; -const SHORTSLEEPTIME = 2000; -const wait5sec = 5000; let driverFirefox: any; export async function openBrowser() { @@ -102,8 +100,8 @@ export async function getJobsProfilename() { return jobsProfile; } -export async function getFavouritesNode() { - const favoriteLink = await driverFirefox.wait(until.elementLocated(By.id(DatasetsLocators.favoriteTabId)), WAITTIME).getAttribute("title"); +export async function getFavoritesNode() { + const favoriteLink = await driverFirefox.wait(until.elementLocated(By.xpath(DatasetsLocators.favoriteTabXpath)), WAITTIME).getAttribute("title"); return favoriteLink; } From 8ee98f4ebbc6e8ff37e550e0d29f750541370e97 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 13 Jul 2023 11:30:04 -0400 Subject: [PATCH 55/80] Try to fix Hide Profile tests Signed-off-by: Timothy Johnson --- packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts | 3 +-- .../__tests__/__theia__/theia/extension.theiaChrome.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts b/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts index 875faa4863..089c6386bc 100644 --- a/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts +++ b/packages/zowe-explorer/__tests__/__theia__/theia/Locators.ts @@ -44,7 +44,6 @@ export const UssLocators = { addToFavoriteOptionXpath: "//li[@data-command='zowe.uss.addFavorite']", removeFavoriteProfileFromUssOptionXpath: "//li[@data-command='zowe.uss.removeFavProfile']", hideProfileFromUssOptionXpath: "//li[@data-command='zowe.uss.removeSession']", - secondUssProfileBeforeHidingXpath: "(//div[contains(@id,'TestSeleniumProfile')])[1]", }; export const JobsLocators = { @@ -60,7 +59,7 @@ export const JobsLocators = { addToFavoriteOptionXpath: "//li[@data-command='zowe.jobs.addFavorite']", removeFavoriteProfileFromJobsOptionXpath: "//li[@data-command='zowe.jobs.removeFavProfile']", hideProfileFromJobsOptionXpath: "//li[@data-command='zowe.jobs.removeJobsSession']", - secondJobsProfileBeforeHidingXpath: "(//div[contains(@id,'TestSeleniumProfile')])[1]", + secondJobsProfileBeforeHidingXpath: "(//div[contains(@id,'TestSeleniumProfile')])[2]", }; export const TheiaNotificationMessages = { diff --git a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts index 3687cd27e9..d9bd97df36 100644 --- a/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts +++ b/packages/zowe-explorer/__tests__/__theia__/theia/extension.theiaChrome.ts @@ -136,7 +136,7 @@ export async function addProfileToFavoritesInJobs() { } export async function hideProfileInUss() { - const hideProfileFromUss = await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.secondUssProfileBeforeHidingXpath)), WAITTIME); + const hideProfileFromUss = await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.secondUssProfileXpath)), WAITTIME); await driverChrome.actions().click(hideProfileFromUss, Button.RIGHT).perform(); await driverChrome.wait(until.elementLocated(By.xpath(UssLocators.hideProfileFromUssOptionXpath)), WAITTIME).click(); } From 149d163e78ecb5109a17e6717b7b0268ddb11fab Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Fri, 14 Jul 2023 11:43:22 -0400 Subject: [PATCH 56/80] Update Zowe CLI and try removing resolutions Signed-off-by: Timothy Johnson --- package.json | 8 +- packages/zowe-explorer-api/package.json | 2 +- yarn.lock | 202 ++++++++++++++++-------- 3 files changed, 136 insertions(+), 76 deletions(-) diff --git a/package.json b/package.json index 70ab2e57a4..c01d96e7a9 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "vscode": "^1.53.2" }, "dependencies": { - "@zowe/cli": "7.16.2", + "@zowe/cli": "7.16.6", "vscode-nls": "4.1.2" }, "devDependencies": { @@ -45,12 +45,6 @@ "vscode-test": "^1.4.0", "yarn": "1.22.19" }, - "resolutions": { - "**/json5": "^2.2.2", - "**/optionator": "^0.9.3", - "**/semver": "^7.5.2", - "**/@zowe/zos-files-for-zowe-sdk": "7.16.6" - }, "scripts": { "clean": "yarn workspaces run clean", "fresh-clone": "yarn workspaces run fresh-clone && rimraf node_modules", diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index 6e72d576cd..2eb1ee956e 100644 --- a/packages/zowe-explorer-api/package.json +++ b/packages/zowe-explorer-api/package.json @@ -16,7 +16,7 @@ "@types/semver": "^7.5.0" }, "dependencies": { - "@zowe/cli": "^7.16.2", + "@zowe/cli": "^7.16.6", "semver": "^7.5.3" }, "scripts": { diff --git a/yarn.lock b/yarn.lock index e23c46f471..0a1321d4df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2239,23 +2239,23 @@ resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -"@zowe/cli@7.16.2", "@zowe/cli@^7.16.2": - version "7.16.2" - resolved "https://registry.npmjs.org/@zowe/cli/-/cli-7.16.2.tgz#a0f92c51043a77dc7c401b50d3cdb88150ff2ee5" - integrity sha512-AHw92hRhWTEhRLZYCjSiQLb0+v3QvqzMo0U1WeZf9Ou9vYNKpR4I5B3VCG6+dmfxKRAz9o6V/kHA1sMDARLUdQ== +"@zowe/cli@7.16.6", "@zowe/cli@^7.16.6": + version "7.16.6" + resolved "https://registry.npmjs.org/@zowe/cli/-/cli-7.16.6.tgz#6f6a15ce88fb3b3a66a1027712d50289afd81d45" + integrity sha512-7hadi0qJ5z34peKNi0d3NlWljoEdQY6EiQQBxlLjP0/Gzegj40plgPXFyqVowRXOmHnfqDZTKrOH2ssqJY2+PA== dependencies: - "@zowe/core-for-zowe-sdk" "7.16.1" - "@zowe/imperative" "5.13.2" + "@zowe/core-for-zowe-sdk" "7.16.5" + "@zowe/imperative" "5.15.1" "@zowe/perf-timing" "1.0.7" - "@zowe/provisioning-for-zowe-sdk" "7.16.1" - "@zowe/zos-console-for-zowe-sdk" "7.16.1" - "@zowe/zos-files-for-zowe-sdk" "7.16.1" - "@zowe/zos-jobs-for-zowe-sdk" "7.16.1" - "@zowe/zos-logs-for-zowe-sdk" "7.16.1" - "@zowe/zos-tso-for-zowe-sdk" "7.16.1" - "@zowe/zos-uss-for-zowe-sdk" "7.16.1" - "@zowe/zos-workflows-for-zowe-sdk" "7.16.1" - "@zowe/zosmf-for-zowe-sdk" "7.16.1" + "@zowe/provisioning-for-zowe-sdk" "7.16.5" + "@zowe/zos-console-for-zowe-sdk" "7.16.5" + "@zowe/zos-files-for-zowe-sdk" "7.16.6" + "@zowe/zos-jobs-for-zowe-sdk" "7.16.6" + "@zowe/zos-logs-for-zowe-sdk" "7.16.5" + "@zowe/zos-tso-for-zowe-sdk" "7.16.5" + "@zowe/zos-uss-for-zowe-sdk" "7.16.5" + "@zowe/zos-workflows-for-zowe-sdk" "7.16.6" + "@zowe/zosmf-for-zowe-sdk" "7.16.5" find-process "1.4.7" get-stream "6.0.1" lodash "4.17.21" @@ -2264,18 +2264,18 @@ optionalDependencies: keytar "7.9.0" -"@zowe/core-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/core-for-zowe-sdk/-/core-for-zowe-sdk-7.16.1.tgz#3631108ac8bd5ce6cab1dadfa73b41d612646a6c" - integrity sha512-MYeA5B56F9fFnltFuLelfvLLbt1pgXV7mtqC8ZYScjgbVq3HNdlysbXAOIXvSNtn/Em7JbWK2KVy2I4Me900Ww== +"@zowe/core-for-zowe-sdk@7.16.5": + version "7.16.5" + resolved "https://registry.npmjs.org/@zowe/core-for-zowe-sdk/-/core-for-zowe-sdk-7.16.5.tgz#b8a559858a8feb7b9108647080a3c9e9745480f5" + integrity sha512-CRFIZXHY4BnV4e0fmT8//wkZA/dXNiJ10mHqCjZtiDzzVtT/qUm2/mX+8D2jHjLkWoQpkucVdYc9eLaKAwewPw== dependencies: comment-json "4.1.1" string-width "4.2.3" -"@zowe/imperative@5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@zowe/imperative/-/imperative-5.13.2.tgz#2019292140ebf67da03144f315e0be4ab17ed481" - integrity sha512-doA7KcmKm/VW9ZtVSRbSFBknfyzoGawuiV//+q6vBb08qiIPXn1Gg1Mn/6ECpEouBxXqRJGuXj28f+HZX9YZCA== +"@zowe/imperative@5.15.1": + version "5.15.1" + resolved "https://registry.npmjs.org/@zowe/imperative/-/imperative-5.15.1.tgz#a5ff3fdafda93a37c67f36801b8f94e98fbd7d4e" + integrity sha512-T/TGh9WGFgwpWh80cj3mRLGKoUW2CT+W56Da2uXTAsSqVBz25i4iLcfl2w/G7Q+WVa0udXQfCVBCLlAG/WqvyA== dependencies: "@types/yargs" "13.0.4" "@zowe/perf-timing" "1.0.7" @@ -2307,7 +2307,7 @@ progress "2.0.3" read "1.0.7" readline-sync "1.4.10" - semver "5.7.0" + semver "7.5.2" stack-trace "0.0.10" strip-ansi "6.0.1" which "3.0.0" @@ -2323,19 +2323,19 @@ fs-extra "8.1.0" pkg-up "2.0.0" -"@zowe/provisioning-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/provisioning-for-zowe-sdk/-/provisioning-for-zowe-sdk-7.16.1.tgz#75e08763f93a92be5152c72ed578f4936ef71503" - integrity sha512-8R9Wah76/0inDnbX7lO2K/o2cPnzlfX7y8AoRrJCmla7bwfCGWInuDi5Wey0DGGS08GfyRscd8y0VEopzAwdXA== +"@zowe/provisioning-for-zowe-sdk@7.16.5": + version "7.16.5" + resolved "https://registry.npmjs.org/@zowe/provisioning-for-zowe-sdk/-/provisioning-for-zowe-sdk-7.16.5.tgz#f98561f46cb1844025b3df5e991f9a51131932c6" + integrity sha512-FTn29mGvLac2dMYgw1yXMqmocBS9cX6vHyUIQiWjPDLlKTlb2QcQ27Y79gHt/xaT1gkyelx7HP78Aq5J4poCaA== dependencies: js-yaml "4.1.0" -"@zowe/zos-console-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/zos-console-for-zowe-sdk/-/zos-console-for-zowe-sdk-7.16.1.tgz#a793daa0d93d9323127a2e844b0cb425bcb3c023" - integrity sha512-Yu9sKPjwYL1+3OAAxql1iJ0wMhn+lnnCw1B1WMXDDaY4kDV8pNKCOG/plbbXhEeUJ/UtUYh9Srr+S0Z0wKQWPA== +"@zowe/zos-console-for-zowe-sdk@7.16.5": + version "7.16.5" + resolved "https://registry.npmjs.org/@zowe/zos-console-for-zowe-sdk/-/zos-console-for-zowe-sdk-7.16.5.tgz#ab6b08ec456a1d2435d6d6718424495405a2a575" + integrity sha512-Mup/GpK2vmTmq4OtRY8q4m+Lul2NIZLoqDNFRWuQbazJ03Bqud3hEav+Yv+heP3afU+nsXpb+yxg+PvJJyJbsA== -"@zowe/zos-files-for-zowe-sdk@7.16.1", "@zowe/zos-files-for-zowe-sdk@7.16.6": +"@zowe/zos-files-for-zowe-sdk@7.16.6": version "7.16.6" resolved "https://registry.npmjs.org/@zowe/zos-files-for-zowe-sdk/-/zos-files-for-zowe-sdk-7.16.6.tgz#7de7268ef9360da1aba03f7b83cb5b83eb091823" integrity sha512-+BT3vPFkX0WfEi7hu+HtJs0QnkXt5YbqxfAIE2VwTMELRoOdQCOIFsoe9cGVtZrJ3zluzlqbXbqpX8ymEKcevQ== @@ -2349,43 +2349,43 @@ dependencies: zos-node-accessor "1.0.14" -"@zowe/zos-jobs-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/zos-jobs-for-zowe-sdk/-/zos-jobs-for-zowe-sdk-7.16.1.tgz#b5868a884564863074c9a96ea792fd0dcab07693" - integrity sha512-inU+MHkr/bOBUMT/jYyzlhXBMPe3xeuYaAAiOdzCTad83ECmVPMcV+ycrvvpBc0gV57Yibke8FkrJs+O4ZtBkQ== +"@zowe/zos-jobs-for-zowe-sdk@7.16.6": + version "7.16.6" + resolved "https://registry.npmjs.org/@zowe/zos-jobs-for-zowe-sdk/-/zos-jobs-for-zowe-sdk-7.16.6.tgz#2a9abba84152962796db8ae046a250c18600ec72" + integrity sha512-qjhJy6kjQlf99S3PFXxWmhiC0Jt8tvbBJiW75KJ/d0UK6P/LMqxXMGIHdtsd2bBcbByrzy9kmFYsDziOsnAhtQ== dependencies: - "@zowe/zos-files-for-zowe-sdk" "7.16.1" + "@zowe/zos-files-for-zowe-sdk" "7.16.6" -"@zowe/zos-logs-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/zos-logs-for-zowe-sdk/-/zos-logs-for-zowe-sdk-7.16.1.tgz#d516d73136ba9d61f94bba78e03a1a7c399abfcd" - integrity sha512-Fkma+Lkjcm5zjooQRMJByPi8Zdb0FyU9f+8uVNwkb0a+4Fwxe/AMZIYoT82FkQfBjlq7gVu7ntPcEP3Y02yl7w== +"@zowe/zos-logs-for-zowe-sdk@7.16.5": + version "7.16.5" + resolved "https://registry.npmjs.org/@zowe/zos-logs-for-zowe-sdk/-/zos-logs-for-zowe-sdk-7.16.5.tgz#ceff7fb5d5cae222bffbbfcf016d8630f2e90e69" + integrity sha512-ZW8ysfHEsOzxoH1+wnzSlL+bkR3A8k9HNefX6ZmsWBcQ8mU9PssdjwNq7CMDYZktTR6K3nHRFGQf015/DcyQ0Q== -"@zowe/zos-tso-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/zos-tso-for-zowe-sdk/-/zos-tso-for-zowe-sdk-7.16.1.tgz#be1a9748ef4e67f8993da37478fdf1699d7a7fd7" - integrity sha512-yhc97iNhmBtOxGy9CcaeJi8AbcItlz/mW5dVAT4WlyMrpLr1hbtj0iVXIEuDBlfeXnvbTYpBNdsqlRP2IaCKhg== +"@zowe/zos-tso-for-zowe-sdk@7.16.5": + version "7.16.5" + resolved "https://registry.npmjs.org/@zowe/zos-tso-for-zowe-sdk/-/zos-tso-for-zowe-sdk-7.16.5.tgz#ac130fac945a88adc38efcb86a65397ee193973d" + integrity sha512-ao4QY7BMJ/NhNbfyD2LaacErC8gUFhuyuXemWRSyxbmxaL/YzVPzOwYC/m6mLEttM7zmuFeby2He8qemcD/AqA== dependencies: - "@zowe/zosmf-for-zowe-sdk" "7.16.1" + "@zowe/zosmf-for-zowe-sdk" "7.16.5" -"@zowe/zos-uss-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/zos-uss-for-zowe-sdk/-/zos-uss-for-zowe-sdk-7.16.1.tgz#69b4b1ac79c33058f37e720c4516cf0b74915422" - integrity sha512-8rAOjPR803gKm1um8YpTNd0OySlLilw9twT6N03KVT+I+hhKi3ztvDtJWzejptifHQl0E+YRFKDOj14UkqRmbA== +"@zowe/zos-uss-for-zowe-sdk@7.16.5": + version "7.16.5" + resolved "https://registry.npmjs.org/@zowe/zos-uss-for-zowe-sdk/-/zos-uss-for-zowe-sdk-7.16.5.tgz#2186dec61b7f2cba52a5174d83078f1a19f427b4" + integrity sha512-I+50cbYD6OqbzRR2OtCNoAsIZn55hv3K016wt29Z+G1bi15+kW+i2jvmWbBbA2CHXEmqxFN7yNeFDqoi9342ow== dependencies: ssh2 "1.11.0" -"@zowe/zos-workflows-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/zos-workflows-for-zowe-sdk/-/zos-workflows-for-zowe-sdk-7.16.1.tgz#f782358cda4e22d356c639f4f88be4eebf976b2b" - integrity sha512-EncI38qyFK0Ib6gERXVqNj9OMk0hSHekwf2GT4oY6ECaRG5WO5nlRZs7tamTowJXmrG7PJ1rRbmiigzeuQZj6w== +"@zowe/zos-workflows-for-zowe-sdk@7.16.6": + version "7.16.6" + resolved "https://registry.npmjs.org/@zowe/zos-workflows-for-zowe-sdk/-/zos-workflows-for-zowe-sdk-7.16.6.tgz#e00222a861e3031024b0a61a329aa8143b8a1a81" + integrity sha512-h0EEK/tgwjJtfN1T7oYove6hr7MsuSJFwHHvp2M5fdQiubme4MXf2XTeNBO8ScxMthoHPzm3Ef6wHEedPGkQfA== dependencies: - "@zowe/zos-files-for-zowe-sdk" "7.16.1" + "@zowe/zos-files-for-zowe-sdk" "7.16.6" -"@zowe/zosmf-for-zowe-sdk@7.16.1": - version "7.16.1" - resolved "https://registry.npmjs.org/@zowe/zosmf-for-zowe-sdk/-/zosmf-for-zowe-sdk-7.16.1.tgz#6bc0b08e30ffcaedd6670b5de3196233c603a041" - integrity sha512-K4ZKVpgfJ5Th8qjZqcHnE36zOvkjUuRITybejxjDxwtary+jKy6ZBFsNbRTWtboc4Zx8S1fm+0RdJS/3X1yW/Q== +"@zowe/zosmf-for-zowe-sdk@7.16.5": + version "7.16.5" + resolved "https://registry.npmjs.org/@zowe/zosmf-for-zowe-sdk/-/zosmf-for-zowe-sdk-7.16.5.tgz#7423cd173f70b7696829d450bee1c4832687fbc1" + integrity sha512-ieT79IrplPgOkSc51LB8A4FDRokqP0Q5oomHsIFnm5/HnjD1I/UaLTuSs0ZuI2H2zlPnc4sZ3per+cFxv/mX1w== abab@^2.0.3, abab@^2.0.5: version "2.0.6" @@ -4121,7 +4121,7 @@ deep-extend@^0.6.0: resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@^0.1.3: +deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== @@ -4982,7 +4982,7 @@ fast-levenshtein@^1.0.0: resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" integrity sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= -fast-levenshtein@^2.0.6: +fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= @@ -7109,7 +7109,14 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json5@^1.0.1, json5@^2.2.1, json5@^2.2.2: +json5@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + +json5@^2.2.1: version "2.2.3" resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -7254,6 +7261,14 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + lie@~3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" @@ -8378,7 +8393,19 @@ opener@1.5.2: resolved "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -optionator@^0.8.1, optionator@^0.9.1, optionator@^0.9.3: +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + +optionator@^0.9.1: version "0.9.3" resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== @@ -8857,6 +8884,11 @@ prelude-ls@^1.2.1: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -9563,13 +9595,35 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", semver@5.7.0, semver@7.0.0, semver@7.x, semver@^5.1.0, semver@^5.5.0, semver@^5.6.0, semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3: - version "7.5.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== +"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.5.0, semver@^5.6.0: + version "5.7.2" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" + integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== + +semver@7.5.2: + version "7.5.2" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz#5b851e66d1be07c1cdaf37dfc856f543325a2beb" + integrity sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ== + dependencies: + lru-cache "^6.0.0" + +semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.2.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.3: + version "7.5.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: + version "6.3.1" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" @@ -10520,6 +10574,13 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -11118,6 +11179,11 @@ wontache@0.1.0: dependencies: underscore "^1.13.0-2" +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + worker-farm@^1.7.0: version "1.7.0" resolved "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" From 419aa5daba36c468ea0e5aafb542b0f8d6306b44 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 14 Jul 2023 14:37:26 -0400 Subject: [PATCH 57/80] fix: update filtering logic to remove old nodes Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 6da5ebeded..6f3f7a8ce7 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -158,6 +158,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { const existing = this.children.find((element) => element.label?.includes(`${spool.stepname}:${spool.ddname}${spoolSuffix}`)); if (existing) { existing.label = newLabel; + elementChildren[newLabel] = existing; } else { const spoolNode = new Spool(newLabel, vscode.TreeItemCollapsibleState.None, this, this.session, spool, this.job, this); const icon = getIconByNode(spoolNode); @@ -202,6 +203,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { if (existing) { // If matched, update the label to reflect latest retcode/status existing.label = nodeTitle; + elementChildren[nodeTitle] = existing; } else { const jobNode = new Job(nodeTitle, vscode.TreeItemCollapsibleState.Collapsed, this, this.session, job, this.getProfile()); jobNode.contextValue = globals.JOBS_JOB_CONTEXT; @@ -225,7 +227,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { // Remove any children that are no longer present in the built record this.children = this.children .concat(newChildren) - .filter((ch) => Object.values(elementChildren).find((recordCh) => recordCh.jobid === ch.job.jobid) == null) + .filter((ch) => Object.values(elementChildren).find((recordCh) => recordCh.label === ch.label) != null) .sort((a, b) => Job.sortJobs(a, b)); } this.dirty = false; From 266e1ff592fe04bf5bc3a3ed6fd05993b5f39e50 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Mon, 17 Jul 2023 09:12:07 -0400 Subject: [PATCH 58/80] test: add test for updating job statuses Signed-off-by: Trae Yelovich --- .../__unit__/job/ZoweJobNode.unit.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 fcc88b1923..9191013f51 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -298,6 +298,23 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { expect(jobs[1].tooltip).toEqual("TESTJOB(JOB1235) - 0"); }); + it("Tests that getChildren updates existing job nodes with new statuses", async () => { + const globalMocks = await createGlobalMocks(); + + await globalMocks.testJobsProvider.addSession("fake"); + globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234"; + globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; + globalMocks.testJobsProvider.mSessionNodes[1].filtered = true; + const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); + expect(jobs[0].label).toEqual("TESTJOB(JOB1234) - ACTIVE"); + + globalMocks.mockGetJob.mockReturnValueOnce({ ...globalMocks.testIJob, retcode: "CC 0000" }); + globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; + const newJobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); + + expect(newJobs[0].label).toEqual("TESTJOB(JOB1234) - CC 0000"); + }); + it("Tests that getChildren retrieves only child jobs which match a provided searchId", async () => { const globalMocks = await createGlobalMocks(); From e2a267244dc45d11a56f433140fe1b7342104178 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 17 Jul 2023 11:13:32 -0400 Subject: [PATCH 59/80] update branch with simple important fixes and label update Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- .../__tests__/__unit__/ZoweNode.unit.test.ts | 27 --- .../__unit__/job/ZoweJobNode.unit.test.ts | 2 - .../__tests__/__unit__/utils.unit.test.ts | 6 +- .../src/dataset/ZoweDatasetNode.i18n.json | 3 +- .../sample/src/utils/ProfilesUtils.i18n.json | 2 +- .../src/abstract/ZoweTreeProvider.ts | 1 - .../zowe-explorer/src/dataset/DatasetTree.ts | 159 +++++++++--------- .../src/dataset/ZoweDatasetNode.ts | 62 +++---- .../zowe-explorer/src/job/ZosJobsProvider.ts | 1 - .../zowe-explorer/src/utils/ProfilesUtils.ts | 2 +- 10 files changed, 117 insertions(+), 148 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts index 2c9b678a91..a20893a505 100644 --- a/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts @@ -183,33 +183,6 @@ describe("Unit Tests (Jest)", () => { expect(subChildren).toEqual(sampleChildren); }); - /************************************************************************************************************* - * Checks that the catch block is reached when an error is thrown - *************************************************************************************************************/ - it( - "Checks that when bright.List.dataSet/allMembers() causes an error on the zowe call, " + "it throws an error and the catch block is reached", - async () => { - Object.defineProperty(Profiles, "getInstance", { - value: jest.fn(() => { - return { - loadNamedProfile: jest.fn().mockReturnValue(profileOne), - }; - }), - }); - showErrorMessage.mockReset(); - // Creating a rootNode - const rootNode = new ZoweDatasetNode("root", vscode.TreeItemCollapsibleState.Collapsed, null, session, undefined, undefined, profileOne); - rootNode.contextValue = globals.DS_SESSION_CONTEXT; - rootNode.pattern = "THROW ERROR"; - rootNode.dirty = true; - await rootNode.getChildren(); - expect(showErrorMessage.mock.calls.length).toEqual(1); - expect(showErrorMessage.mock.calls[0][0]).toEqual( - "Retrieving response from zowe.List Error: Throwing an error to check error handling for unit tests!" - ); - } - ); - /************************************************************************************************************* * Checks that returning an unsuccessful response results in an error being thrown and caught *************************************************************************************************************/ 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 f00e5151fa..9ac889f67a 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -575,11 +575,9 @@ describe("ZosJobsProvider - Function searchPrompt", () => { const globalMocks = await createGlobalMocks(); jest.spyOn(globalMocks.testJobsProvider, "applyRegularSessionSearchLabel").mockReturnValue("Owner:kristina Prefix:* Status:*"); const addSearchHistory = jest.spyOn(globalMocks.testJobsProvider, "addSearchHistory"); - const refreshElement = jest.spyOn(globalMocks.testJobsProvider, "refreshElement"); await globalMocks.testJobsProvider.searchPrompt(globalMocks.testJobsProvider.mSessionNodes[1]); expect(globalMocks.testJobsProvider); expect(addSearchHistory).toHaveBeenCalled(); - expect(refreshElement).toHaveBeenCalled(); }); it("testing fav node to call applySearchLabelToNode", async () => { const globalMocks = await createGlobalMocks(); diff --git a/packages/zowe-explorer/__tests__/__unit__/utils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils.unit.test.ts index ac1ed5d406..a1cad69290 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils.unit.test.ts @@ -88,7 +88,7 @@ describe("Utils Unit Tests - Function errorHandling", () => { expect(vscode.window.showErrorMessage).toHaveBeenCalledWith( `Invalid Credentials. Please ensure the username and password for ${label} are valid or this may lead to a lock-out.`, { modal: true }, - "Check Credentials" + "Update Credentials" ); }); it("Checking USS error handling", async () => { @@ -106,7 +106,7 @@ describe("Utils Unit Tests - Function errorHandling", () => { expect(vscode.window.showErrorMessage).toHaveBeenCalledWith( `Invalid Credentials. Please ensure the username and password for ${label} are valid or this may lead to a lock-out.`, { modal: true }, - "Check Credentials" + "Update Credentials" ); }); it("Checking common error handling - Theia", async () => { @@ -127,7 +127,7 @@ describe("Utils Unit Tests - Function errorHandling", () => { expect(vscode.window.showErrorMessage).toHaveBeenCalledWith( `Invalid Credentials. Please ensure the username and password for ${label} are valid or this may lead to a lock-out.`, { modal: true }, - "Check Credentials" + "Update Credentials" ); }); }); 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 5eab50b035..09bc31ab37 100644 --- a/packages/zowe-explorer/i18n/sample/src/dataset/ZoweDatasetNode.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/dataset/ZoweDatasetNode.i18n.json @@ -2,6 +2,5 @@ "getChildren.search": "Use the search button to display data sets", "getChildren.error.invalidNode": "Invalid node", "getChildren.responses.error": "The response from Zowe CLI was not successful", - "getChildren.noDataset": "No data sets found", - "getChildren.error.response": "Retrieving response from " + "getChildren.noDataset": "No data sets found" } 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 962e21ca78..db62def29c 100644 --- a/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json @@ -3,7 +3,7 @@ "errorHandling.invalid.credentials": "Invalid Credentials. Please ensure the username and password for {0} 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.authentication.login": "Log in to Authentication Service", - "errorHandling.checkCredentials.button": "Check Credentials", + "errorHandling.checkCredentials.button": "Update Credentials", "errorHandling.checkCredentials.cancelled": "Operation Cancelled", "activateCredentialManagerOverride.failedToActivate": "Custom credential manager failed to activate", "ProfilesUtils.getProfileInfo.usingCustom": "Custom credential manager found, attempting to activate.", diff --git a/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts b/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts index 2843b5766a..5cb01d1fe1 100644 --- a/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts +++ b/packages/zowe-explorer/src/abstract/ZoweTreeProvider.ts @@ -151,7 +151,6 @@ export class ZoweTreeProvider { ZoweLogger.trace("ZoweTreeProvider.addSearchHistory called."); if (criteria) { this.mHistory.addSearchHistory(criteria); - this.refresh(); } } diff --git a/packages/zowe-explorer/src/dataset/DatasetTree.ts b/packages/zowe-explorer/src/dataset/DatasetTree.ts index dfae99181e..020c580247 100644 --- a/packages/zowe-explorer/src/dataset/DatasetTree.ts +++ b/packages/zowe-explorer/src/dataset/DatasetTree.ts @@ -161,7 +161,7 @@ export class DatasetTree extends ZoweTreeProvider implements IZoweTree { ZoweLogger.trace("ZoweDatasetNode.getDatasets called."); - const sessNode = this.getSessionNode(); const responses: zowe.IZosFilesResponse[] = []; - try { - const cachedProfile = Profiles.getInstance().loadNamedProfile(this.getProfileName()); - const options: zowe.IListOptions = { - attributes: true, - responseTimeout: cachedProfile.profile.responseTimeout, - }; - if (contextually.isSessionNotFav(this)) { - const dsPatterns = [ - ...new Set( - this.pattern - .toUpperCase() - .split(",") - .map((p) => p.trim()) - ), - ]; - const mvsApi = ZoweExplorerApiRegister.getMvsApi(cachedProfile); - if (mvsApi.dataSetsMatchingPattern) { - responses.push(await mvsApi.dataSetsMatchingPattern(dsPatterns)); - } else { - for (const dsp of dsPatterns) { - responses.push(await mvsApi.dataSet(dsp)); - } - } - } else if (this.memberPattern) { - this.memberPattern = this.memberPattern.toUpperCase(); - for (const memPattern of this.memberPattern.split(",")) { - options.pattern = memPattern; - responses.push(await ZoweExplorerApiRegister.getMvsApi(cachedProfile).allMembers(this.label as string, options)); - } + const cachedProfile = Profiles.getInstance().loadNamedProfile(this.getProfileName()); + const options: zowe.IListOptions = { + attributes: true, + responseTimeout: cachedProfile.profile.responseTimeout, + }; + if (contextually.isSessionNotFav(this)) { + const dsPatterns = [ + ...new Set( + this.pattern + .toUpperCase() + .split(",") + .map((p) => p.trim()) + ), + ]; + const mvsApi = ZoweExplorerApiRegister.getMvsApi(cachedProfile); + if (mvsApi.dataSetsMatchingPattern) { + responses.push(await mvsApi.dataSetsMatchingPattern(dsPatterns)); } else { + for (const dsp of dsPatterns) { + responses.push(await mvsApi.dataSet(dsp)); + } + } + } else if (this.memberPattern) { + this.memberPattern = this.memberPattern.toUpperCase(); + for (const memPattern of this.memberPattern.split(",")) { + options.pattern = memPattern; responses.push(await ZoweExplorerApiRegister.getMvsApi(cachedProfile).allMembers(this.label as string, options)); } - } catch (err) { - await errorHandling(err, this.label.toString(), localize("getChildren.error.response", "Retrieving response from ") + `zowe.List`); - syncSessionNode(Profiles.getInstance())((profileValue) => ZoweExplorerApiRegister.getMvsApi(profileValue).getSession())(sessNode); + } else { + responses.push(await ZoweExplorerApiRegister.getMvsApi(cachedProfile).allMembers(this.label as string, options)); } return responses; } diff --git a/packages/zowe-explorer/src/job/ZosJobsProvider.ts b/packages/zowe-explorer/src/job/ZosJobsProvider.ts index 05978d76b1..8899d376c0 100644 --- a/packages/zowe-explorer/src/job/ZosJobsProvider.ts +++ b/packages/zowe-explorer/src/job/ZosJobsProvider.ts @@ -822,7 +822,6 @@ export class ZosJobsProvider extends ZoweTreeProvider implements IZoweTree Date: Mon, 17 Jul 2023 11:30:43 -0400 Subject: [PATCH 60/80] add unit tests & fix lint error Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- .../__unit__/dataset/DatasetTree.unit.test.ts | 129 ++++++++++++++++-- .../zowe-explorer/src/dataset/DatasetTree.ts | 2 +- 2 files changed, 118 insertions(+), 13 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts index aca159784a..2591e1b29c 100644 --- a/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts @@ -548,6 +548,22 @@ describe("Dataset Tree Unit Tests - Function getChildren", () => { expect(children).toEqual(sampleChildren); }); + it("Checking function for return if element.getChildren is undefined", async () => { + createGlobalMocks(); + const blockMocks = createBlockMocks(); + + mocked(Profiles.getInstance).mockReturnValue(blockMocks.profile); + mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); + const testTree = new DatasetTree(); + testTree.mSessionNodes.push(blockMocks.datasetSessionNode); + const parent = new ZoweDatasetNode("BRTVS99.PUBLIC", vscode.TreeItemCollapsibleState.Collapsed, testTree.mSessionNodes[1], null); + parent.dirty = true; + jest.spyOn(parent, "getChildren").mockResolvedValueOnce(undefined as any); + + const children = await testTree.getChildren(parent); + + expect(children).not.toBeDefined(); + }); }); describe("Dataset Tree Unit Tests - Function loadProfilesForFavorites", () => { function createBlockMocks() { @@ -1422,7 +1438,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { } it("Checking adding of new filter - Theia", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); globalMocks.isTheia.mockReturnValue(true); @@ -1438,7 +1454,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(testTree.mSessionNodes[1].pattern).toEqual("HLQ.PROD1.STUFF"); }); it("Checking cancelled attempt to add a filter - Theia", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); globalMocks.isTheia.mockReturnValue(true); @@ -1453,7 +1469,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(mocked(Gui.showMessage)).toBeCalledWith("You must enter a pattern."); }); it("Checking usage of existing filter - Theia", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); globalMocks.isTheia.mockReturnValue(true); @@ -1469,7 +1485,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(testTree.mSessionNodes[1].pattern).toEqual("HLQ.PROD1.STUFF"); }); it("Checking cancelling of filter prompt with available filters - Theia", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); globalMocks.isTheia.mockReturnValue(true); @@ -1484,7 +1500,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(mocked(Gui.showMessage)).toBeCalledWith("No selection made. Operation cancelled."); }); it("Checking function on favorites", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); @@ -1507,7 +1523,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(addSessionSpy).toHaveBeenLastCalledWith(blockMocks.datasetSessionNode.label.trim()); }); it("Checking adding of new filter", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new utils.FilterDescriptor("\uFF0B " + "Create a new filter")); @@ -1522,7 +1538,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(testTree.mSessionNodes[1].pattern).toEqual("HLQ.PROD1.STUFF"); }); it("Checking adding of new filter with data set member", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new utils.FilterDescriptor("\uFF0B " + "Create a new filter")); @@ -1535,7 +1551,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(testTree.mSessionNodes[1].pattern).toEqual("HLQ.PROD1"); }); it("Checking adding of new filter with Unverified profile", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); Object.defineProperty(Profiles, "getInstance", { value: jest.fn(() => { @@ -1563,7 +1579,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(testTree.mSessionNodes[1].pattern).toEqual("HLQ.PROD1.STUFF"); }); it("Checking cancelled attempt to add a filter", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new utils.FilterDescriptor("\uFF0B " + "Create a new filter")); @@ -1577,7 +1593,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(mocked(Gui.showMessage)).toBeCalledWith("You must enter a pattern."); }); it("Checking usage of existing filter", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); const quickPickItem = new utils.FilterDescriptor("HLQ.PROD1.STUFF"); @@ -1598,7 +1614,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(testTree.mSessionNodes[1].pattern).toEqual("HLQ.PROD1.STUFF"); }); it("Checking cancelling of filter prompt with available filters", async () => { - const globalMocks = await createGlobalMocks(); + const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); const quickPickItem = undefined; @@ -1615,6 +1631,95 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { expect(mocked(Gui.showMessage)).toBeCalledWith("No selection made. Operation cancelled."); }); + it("Checking adding of new filter error is caught on getChildren", async () => { + const globalMocks = createGlobalMocks(); + const blockMocks = await createBlockMocks(globalMocks); + + mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new utils.FilterDescriptor("\uFF0B " + "Create a new filter")); + mocked(vscode.window.showInputBox).mockResolvedValueOnce("HLQ.PROD1.STUFF"); + mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); + const testTree = new DatasetTree(); + testTree.mSessionNodes.push(blockMocks.datasetSessionNode); + Object.defineProperty(testTree.mSessionNodes[1], "getChildren", { + value: jest.fn(() => { + throw new Error("test error"); + }), + configurable: true, + }); + const errorSpy = jest.spyOn(utils, "errorHandling"); + + await testTree.datasetFilterPrompt(testTree.mSessionNodes[1]); + + expect(errorSpy).toBeCalled(); + errorSpy.mockClear(); + }); + it("Checking function for return if getChildren is undefined", async () => { + const globalMocks = createGlobalMocks(); + const blockMocks = await createBlockMocks(globalMocks); + + mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new utils.FilterDescriptor("\uFF0B " + "Create a new filter")); + mocked(vscode.window.showInputBox).mockResolvedValueOnce("HLQ.PROD1.STUFF"); + mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); + const testTree = new DatasetTree(); + testTree.mSessionNodes.push(blockMocks.datasetSessionNode); + Object.defineProperty(testTree.mSessionNodes[1], "getChildren", { + value: jest.fn(() => { + return; + }), + configurable: true, + }); + const errorSpy = jest.spyOn(utils, "errorHandling"); + + expect(await testTree.datasetFilterPrompt(testTree.mSessionNodes[1])).not.toBeDefined(); + + expect(errorSpy).not.toBeCalled(); + errorSpy.mockClear(); + }); + it("Checking function for return if element.getChildren calls error handling for success: false", async () => { + const globalMocks = createGlobalMocks(); + const blockMocks = await createBlockMocks(globalMocks); + + const errorSpy = jest.spyOn(utils, "errorHandling"); + const debugSpy = jest.spyOn(ZoweLogger, "debug"); + + mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new utils.FilterDescriptor("\uFF0B " + "Create a new filter")); + mocked(vscode.window.showInputBox).mockResolvedValueOnce("HLQ.PROD1.STUFF"); + mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); + const testTree = new DatasetTree(); + testTree.mSessionNodes.push(blockMocks.datasetSessionNode); + Object.defineProperty(testTree.mSessionNodes[1], "getDatasets", { + value: jest.fn().mockResolvedValueOnce([ + { + success: false, + commandResponse: null, + apiResponse: "Error: test error", + }, + ]), + configurable: true, + }); + + expect(await testTree.datasetFilterPrompt(testTree.mSessionNodes[1])).not.toBeDefined(); + expect(debugSpy).toBeCalled(); + expect(errorSpy).toBeCalled(); + debugSpy.mockClear(); + errorSpy.mockClear(); + }); + it("Checking function for return if element.getChildren returns undefined", async () => { + const globalMocks = createGlobalMocks(); + const blockMocks = await createBlockMocks(globalMocks); + + mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new utils.FilterDescriptor("\uFF0B " + "Create a new filter")); + mocked(vscode.window.showInputBox).mockResolvedValueOnce("HLQ.PROD1.STUFF"); + mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); + const testTree = new DatasetTree(); + testTree.mSessionNodes.push(blockMocks.datasetSessionNode); + Object.defineProperty(testTree.mSessionNodes[1], "getDatasets", { + value: jest.fn().mockResolvedValueOnce(undefined), + configurable: true, + }); + + expect(await testTree.datasetFilterPrompt(testTree.mSessionNodes[1])).not.toBeDefined(); + }); }); describe("Dataset Tree Unit Tests - Function editSession", () => { async function createBlockMocks() { @@ -1658,7 +1763,7 @@ describe("Dataset Tree Unit Tests - Function editSession", () => { } it("Checking common run of function", async () => { - const globalMocks = await createGlobalMocks(); + createGlobalMocks(); const blockMocks = await createBlockMocks(); mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); diff --git a/packages/zowe-explorer/src/dataset/DatasetTree.ts b/packages/zowe-explorer/src/dataset/DatasetTree.ts index 020c580247..8cda06dd4f 100644 --- a/packages/zowe-explorer/src/dataset/DatasetTree.ts +++ b/packages/zowe-explorer/src/dataset/DatasetTree.ts @@ -1051,7 +1051,7 @@ export class DatasetTree extends ZoweTreeProvider implements IZoweTree Date: Mon, 17 Jul 2023 13:09:28 -0400 Subject: [PATCH 61/80] add more unit tests & cleanup Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- .../__tests__/__unit__/utils.unit.test.ts | 11 +- .../__unit__/utils/ProfilesUtils.unit.test.ts | 103 +++++++++++++++++- .../zowe-explorer/src/utils/ProfilesUtils.ts | 42 +++---- 3 files changed, 128 insertions(+), 28 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/utils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils.unit.test.ts index a1cad69290..631d04fcf7 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils.unit.test.ts @@ -76,7 +76,7 @@ describe("Utils Unit Tests - Function errorHandling", () => { it("Checking common error handling", async () => { createGlobalMocks(); - mocked(vscode.window.showErrorMessage).mockResolvedValueOnce({ title: "Check Credentials" }); + mocked(vscode.window.showErrorMessage).mockResolvedValueOnce({ title: "Update Credentials" }); const errorDetails = new imperative.ImperativeError({ msg: "Invalid credentials", errorCode: 401 as unknown as string, @@ -94,12 +94,13 @@ describe("Utils Unit Tests - Function errorHandling", () => { it("Checking USS error handling", async () => { createGlobalMocks(); - mocked(vscode.window.showErrorMessage).mockResolvedValueOnce({ title: "Check Credentials" }); + mocked(vscode.window.showErrorMessage).mockResolvedValueOnce({ title: "Update Credentials" }); const errorDetails = new imperative.ImperativeError({ msg: "Invalid credentials", errorCode: 401 as unknown as string, }); - const label = "invalidCred [/tmp]"; + let label = "invalidCred [/tmp]"; + label = label.substring(0, label.indexOf(" [")).trim(); await utils.errorHandling(errorDetails, label); @@ -113,8 +114,8 @@ describe("Utils Unit Tests - Function errorHandling", () => { const blockMocks = createBlockMocks(); mocked(Profiles.getInstance).mockReturnValue(blockMocks.profile); - mocked(vscode.window.showErrorMessage).mockResolvedValueOnce({ title: "Check Credentials" }); - mocked(utils.isTheia).mockReturnValue(true); + mocked(vscode.window.showErrorMessage).mockResolvedValueOnce({ title: "Update Credentials" }); + jest.spyOn(utils, "isTheia").mockReturnValue(true); const errorDetails = new imperative.ImperativeError({ msg: "Invalid credentials", errorCode: 401 as unknown as string, diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts index b6c52a3d46..3e016239e0 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts @@ -118,7 +118,29 @@ describe("ProfilesUtils unit tests", () => { expect(spyOpenConfigFile).toBeCalledTimes(1); }); - it("should handle error and prompt for authentication", async () => { + it("should handle error for invalid credentials and prompt for authentication", async () => { + const errorDetails = new zowe.imperative.ImperativeError({ + msg: "Invalid credentials", + errorCode: 401 as unknown as string, + additionalDetails: "Authentication is not valid or expired.", + }); + const label = "test"; + const moreInfo = "Task failed successfully"; + jest.spyOn(profUtils, "isTheia").mockReturnValue(false); + const showMessageSpy = jest.spyOn(Gui, "errorMessage").mockImplementation(() => Promise.resolve("Update Credentials")); + const promptCredsSpy = jest.fn(); + Object.defineProperty(Profiles, "getInstance", { + value: () => ({ + promptCredentials: promptCredsSpy, + }), + }); + await profUtils.errorHandling(errorDetails, label, moreInfo); + expect(showMessageSpy).toBeCalledTimes(1); + expect(promptCredsSpy).toBeCalledTimes(1); + showMessageSpy.mockClear(); + promptCredsSpy.mockClear(); + }); + it("should handle token error and procede to login", async () => { const errorDetails = new zowe.imperative.ImperativeError({ msg: "Invalid credentials", errorCode: 401 as unknown as string, @@ -127,7 +149,8 @@ describe("ProfilesUtils unit tests", () => { const label = "test"; const moreInfo = "Task failed successfully"; jest.spyOn(profUtils, "isTheia").mockReturnValue(false); - const showMessageSpy = jest.spyOn(Gui, "showMessage").mockResolvedValue("selection"); + const showErrorSpy = jest.spyOn(Gui, "errorMessage"); + const showMessageSpy = jest.spyOn(Gui, "showMessage").mockImplementation(() => Promise.resolve("selection")); const ssoLoginSpy = jest.fn(); Object.defineProperty(Profiles, "getInstance", { value: () => ({ @@ -137,6 +160,82 @@ describe("ProfilesUtils unit tests", () => { await profUtils.errorHandling(errorDetails, label, moreInfo); expect(showMessageSpy).toBeCalledTimes(1); expect(ssoLoginSpy).toBeCalledTimes(1); + expect(showErrorSpy).not.toBeCalled(); + showErrorSpy.mockClear(); + showMessageSpy.mockClear(); + ssoLoginSpy.mockClear(); + }); + it("should handle token error and procede to login - Theia", async () => { + const errorDetails = new zowe.imperative.ImperativeError({ + msg: "Invalid credentials", + errorCode: 401 as unknown as string, + additionalDetails: "Token is not valid or expired.", + }); + const label = "test"; + const moreInfo = "Task failed successfully"; + jest.spyOn(profUtils, "isTheia").mockReturnValue(true); + const showErrorSpy = jest.spyOn(Gui, "errorMessage").mockImplementation(() => Promise.resolve(undefined)); + const showMessageSpy = jest.spyOn(Gui, "showMessage"); + const ssoLoginSpy = jest.fn(); + Object.defineProperty(Profiles, "getInstance", { + value: () => ({ + ssoLogin: ssoLoginSpy, + }), + }); + await profUtils.errorHandling(errorDetails, label, moreInfo); + expect(showErrorSpy).toBeCalledTimes(1); + expect(ssoLoginSpy).toBeCalledTimes(1); + expect(showMessageSpy).not.toBeCalled(); + showErrorSpy.mockClear(); + showMessageSpy.mockClear(); + ssoLoginSpy.mockClear(); + }); + it("should handle credential error and no selection made for update", async () => { + const errorDetails = new zowe.imperative.ImperativeError({ + msg: "Invalid credentials", + errorCode: 401 as unknown as string, + additionalDetails: "Authentication failed.", + }); + const label = "test"; + const moreInfo = "Task failed successfully"; + jest.spyOn(profUtils, "isTheia").mockReturnValue(false); + const showErrorSpy = jest.spyOn(Gui, "errorMessage").mockResolvedValue(undefined); + const showMsgSpy = jest.spyOn(Gui, "showMessage"); + const promptCredentialsSpy = jest.fn(); + Object.defineProperty(Profiles, "getInstance", { + value: () => ({ + promptCredentials: promptCredentialsSpy, + }), + }); + await profUtils.errorHandling(errorDetails, label, moreInfo); + expect(showErrorSpy).toBeCalledTimes(1); + expect(promptCredentialsSpy).not.toBeCalled(); + expect(showMsgSpy).toBeCalledWith("Operation Cancelled"); + showErrorSpy.mockClear(); + showMsgSpy.mockClear(); + promptCredentialsSpy.mockClear(); + }); + it("should handle credential error with error message - Theia", async () => { + const errorDetails = new zowe.imperative.ImperativeError({ + msg: "Invalid credentials", + errorCode: 401 as unknown as string, + additionalDetails: "Authentication failed.", + }); + const label = "test"; + const moreInfo = "Task failed successfully"; + jest.spyOn(profUtils, "isTheia").mockReturnValue(true); + const showErrorSpy = jest.spyOn(Gui, "errorMessage"); + const promptCredentialsSpy = jest.fn(); + Object.defineProperty(Profiles, "getInstance", { + value: () => ({ + promptCredentials: promptCredentialsSpy, + }), + }); + await profUtils.errorHandling(errorDetails, label, moreInfo); + expect(showErrorSpy).toBeCalledTimes(1); + expect(promptCredentialsSpy).not.toBeCalled(); + showErrorSpy.mockClear(); + promptCredentialsSpy.mockClear(); }); }); diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index 4dc03ce93b..46f4fbcf09 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -75,37 +75,37 @@ export async function errorHandling(errorDetails: Error | string, label?: string if (imperativeError.mDetails.additionalDetails) { const tokenError: string = imperativeError.mDetails.additionalDetails; if (tokenError.includes("Token is not valid or expired.")) { - if (isTheia()) { + if (this.isTheia()) { Gui.errorMessage(errToken).then(async () => { await Profiles.getInstance().ssoLogin(null, label); }); - } else { - const message = localize("errorHandling.authentication.login", "Log in to Authentication Service"); - Gui.showMessage(errToken, { items: [message] }).then(async (selection) => { - if (selection) { - await Profiles.getInstance().ssoLogin(null, label); - } - }); + return; } + const message = localize("errorHandling.authentication.login", "Log in to Authentication Service"); + Gui.showMessage(errToken, { items: [message] }).then(async (selection) => { + if (selection) { + await Profiles.getInstance().ssoLogin(null, label); + } + }); return; } } - if (isTheia()) { + if (this.isTheia()) { Gui.errorMessage(errMsg); - } else { - const checkCredsButton = localize("errorHandling.checkCredentials.button", "Update Credentials"); - await Gui.errorMessage(errMsg, { - items: [checkCredsButton], - vsCodeOpts: { modal: true }, - }).then(async (selection) => { - if (selection === checkCredsButton) { - await Profiles.getInstance().promptCredentials(label.trim(), true); - } else { - Gui.showMessage(localize("errorHandling.checkCredentials.cancelled", "Operation Cancelled")); - } - }); + return; } + const checkCredsButton = localize("errorHandling.checkCredentials.button", "Update Credentials"); + await Gui.errorMessage(errMsg, { + items: [checkCredsButton], + vsCodeOpts: { modal: true }, + }).then(async (selection) => { + if (selection !== checkCredsButton) { + Gui.showMessage(localize("errorHandling.checkCredentials.cancelled", "Operation Cancelled")); + return; + } + await Profiles.getInstance().promptCredentials(label.trim(), true); + }); return; } } From 3e27186c1d612f230d220a2f636ab35a47e522b1 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 17 Jul 2023 13:21:59 -0400 Subject: [PATCH 62/80] update CHANGELOG run prepublish Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/CHANGELOG.md | 1 + .../i18n/sample/src/utils/ProfilesUtils.i18n.json | 4 ++-- packages/zowe-explorer/src/utils/ProfilesUtils.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 4038dda466..6f954cdd86 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen ### Bug fixes - Added jobs not found message when no results are returned from filter [#2362](https://github.com/zowe/vscode-extension-for-zowe/issues/2362) +- Fixed loop when user selects Cancel on the Check Credentials message. [#2262](https://github.com/zowe/vscode-extension-for-zowe/issues/2262) ## `2.9.1` 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 db62def29c..8df476187f 100644 --- a/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json @@ -3,8 +3,8 @@ "errorHandling.invalid.credentials": "Invalid Credentials. Please ensure the username and password for {0} 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.authentication.login": "Log in to Authentication Service", - "errorHandling.checkCredentials.button": "Update Credentials", - "errorHandling.checkCredentials.cancelled": "Operation Cancelled", + "errorHandling.updateCredentials.button": "Update Credentials", + "errorHandling.updateCredentials.cancelled": "Operation Cancelled", "activateCredentialManagerOverride.failedToActivate": "Custom credential manager failed to activate", "ProfilesUtils.getProfileInfo.usingCustom": "Custom credential manager found, attempting to activate.", "ProfilesUtils.getProfileInfo.usingDefault": "No custom credential managers found, using the default instead.", diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index 46f4fbcf09..051f61523f 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -95,13 +95,13 @@ export async function errorHandling(errorDetails: Error | string, label?: string Gui.errorMessage(errMsg); return; } - const checkCredsButton = localize("errorHandling.checkCredentials.button", "Update Credentials"); + const checkCredsButton = localize("errorHandling.updateCredentials.button", "Update Credentials"); await Gui.errorMessage(errMsg, { items: [checkCredsButton], vsCodeOpts: { modal: true }, }).then(async (selection) => { if (selection !== checkCredsButton) { - Gui.showMessage(localize("errorHandling.checkCredentials.cancelled", "Operation Cancelled")); + Gui.showMessage(localize("errorHandling.updateCredentials.cancelled", "Operation Cancelled")); return; } await Profiles.getInstance().promptCredentials(label.trim(), true); From d542518493d00e96c3a3efc1f4e4d25c7331e3c3 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 17 Jul 2023 13:44:47 -0400 Subject: [PATCH 63/80] revert i18 naming updates, check if affects coverage Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- .../i18n/sample/src/utils/ProfilesUtils.i18n.json | 4 ++-- packages/zowe-explorer/src/utils/ProfilesUtils.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 8df476187f..db62def29c 100644 --- a/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json +++ b/packages/zowe-explorer/i18n/sample/src/utils/ProfilesUtils.i18n.json @@ -3,8 +3,8 @@ "errorHandling.invalid.credentials": "Invalid Credentials. Please ensure the username and password for {0} 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.authentication.login": "Log in to Authentication Service", - "errorHandling.updateCredentials.button": "Update Credentials", - "errorHandling.updateCredentials.cancelled": "Operation Cancelled", + "errorHandling.checkCredentials.button": "Update Credentials", + "errorHandling.checkCredentials.cancelled": "Operation Cancelled", "activateCredentialManagerOverride.failedToActivate": "Custom credential manager failed to activate", "ProfilesUtils.getProfileInfo.usingCustom": "Custom credential manager found, attempting to activate.", "ProfilesUtils.getProfileInfo.usingDefault": "No custom credential managers found, using the default instead.", diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index 051f61523f..46f4fbcf09 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -95,13 +95,13 @@ export async function errorHandling(errorDetails: Error | string, label?: string Gui.errorMessage(errMsg); return; } - const checkCredsButton = localize("errorHandling.updateCredentials.button", "Update Credentials"); + const checkCredsButton = localize("errorHandling.checkCredentials.button", "Update Credentials"); await Gui.errorMessage(errMsg, { items: [checkCredsButton], vsCodeOpts: { modal: true }, }).then(async (selection) => { if (selection !== checkCredsButton) { - Gui.showMessage(localize("errorHandling.updateCredentials.cancelled", "Operation Cancelled")); + Gui.showMessage(localize("errorHandling.checkCredentials.cancelled", "Operation Cancelled")); return; } await Profiles.getInstance().promptCredentials(label.trim(), true); From 4591f809d6aa3f470e432ff69a0c440a609110ad Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:21:10 -0400 Subject: [PATCH 64/80] add more unit tests for DatasetTree Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- .../__unit__/dataset/DatasetTree.unit.test.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts index 2591e1b29c..1cf9cec5c6 100644 --- a/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts @@ -1531,12 +1531,48 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); const testTree = new DatasetTree(); testTree.mSessionNodes.push(blockMocks.datasetSessionNode); + const node = new ZoweDatasetNode( + "HLQ.PROD2.STUFF", + vscode.TreeItemCollapsibleState.Collapsed, + testTree.mSessionNodes[1], + blockMocks.session, + globals.DS_DS_CONTEXT + ); + node.collapsibleState = vscode.TreeItemCollapsibleState.Expanded; + node.contextValue = globals.FILTER_SEARCH; + jest.spyOn(testTree.mSessionNodes[1], "getChildren").mockResolvedValueOnce([node]); await testTree.datasetFilterPrompt(testTree.mSessionNodes[1]); expect(testTree.mSessionNodes[1].contextValue).toEqual(globals.DS_SESSION_CONTEXT + globals.ACTIVE_CONTEXT); expect(testTree.mSessionNodes[1].pattern).toEqual("HLQ.PROD1.STUFF"); }); + it("Checking adding of new filter of multiple ds search", async () => { + const globalMocks = createGlobalMocks(); + const blockMocks = await createBlockMocks(globalMocks); + + mocked(vscode.window.showQuickPick).mockResolvedValueOnce(new utils.FilterDescriptor("\uFF0B " + "Create a new filter")); + mocked(vscode.window.showInputBox).mockResolvedValueOnce("HLQ.PROD(STUF*),HLQ.PROD1*"); + mocked(vscode.window.createTreeView).mockReturnValueOnce(blockMocks.treeView); + const testTree = new DatasetTree(); + testTree.mSessionNodes.push(blockMocks.datasetSessionNode); + testTree.mSessionNodes[1].collapsibleState = vscode.TreeItemCollapsibleState.Expanded; + const node = new ZoweDatasetNode( + "STUFF", + vscode.TreeItemCollapsibleState.Collapsed, + testTree.mSessionNodes[1], + blockMocks.session, + globals.DS_DS_CONTEXT + ); + + jest.spyOn(testTree.mSessionNodes[1], "getChildren").mockReturnValueOnce([node] as any); + jest.spyOn(testTree, "checkFilterPattern").mockReturnValue(true); + + await testTree.datasetFilterPrompt(testTree.mSessionNodes[1]); + + expect(testTree.mSessionNodes[1].contextValue).toEqual(globals.DS_SESSION_CONTEXT + globals.ACTIVE_CONTEXT); + expect(testTree.mSessionNodes[1].pattern).toEqual("HLQ.PROD, HLQ.PROD1*"); + }); it("Checking adding of new filter with data set member", async () => { const globalMocks = createGlobalMocks(); const blockMocks = await createBlockMocks(globalMocks); From aa365b16b7872ed41369bf3551e1ed21eb1dddf9 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Wed, 19 Jul 2023 08:20:35 -0400 Subject: [PATCH 65/80] add more coverage to DatasetTree Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- .../__tests__/__unit__/dataset/DatasetTree.unit.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts index 1cf9cec5c6..c3d313df5a 100644 --- a/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/dataset/DatasetTree.unit.test.ts @@ -1419,9 +1419,10 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { mockResetValidationSettings: jest.fn(), qpPlaceholder: 'Choose "Create new..." to define a new profile or select an existing profile to add to the Data Set Explorer', mockEnableValidationContext: jest.fn(), + testTree: new DatasetTree(), }; - newMocks.datasetSessionNode = await createDatasetSessionNode(newMocks.session, newMocks.imperativeProfile); + newMocks.datasetSessionNode = createDatasetSessionNode(newMocks.session, newMocks.imperativeProfile); globalMocks.mockProfileInstance.allProfiles = [newMocks.imperativeProfile, { name: "firstName" }, { name: "secondName" }]; globalMocks.mockProfileInstance.loadNamedProfile.mockReturnValueOnce(newMocks.imperativeProfile); globalMocks.mockProfileInstance.resetValidationSettings.mockReturnValue(newMocks.datasetSessionNode); @@ -1433,6 +1434,7 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { name: newMocks.imperativeProfile.name, status: "active", }); + newMocks.testTree.mSessionNodes.push(newMocks.datasetSessionNode); return newMocks; } @@ -1564,6 +1566,8 @@ describe("Dataset Tree Unit Tests - Function datasetFilterPrompt", () => { blockMocks.session, globals.DS_DS_CONTEXT ); + node.pattern = undefined as any; + node.contextValue += "pds"; jest.spyOn(testTree.mSessionNodes[1], "getChildren").mockReturnValueOnce([node] as any); jest.spyOn(testTree, "checkFilterPattern").mockReturnValue(true); From 0e9f9178d17bdcdbe311f3e9b589a955192db819 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Thu, 20 Jul 2023 12:14:17 -0400 Subject: [PATCH 66/80] address feedback Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/dataset/DatasetTree.ts | 1 - packages/zowe-explorer/src/utils/ProfilesUtils.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/zowe-explorer/src/dataset/DatasetTree.ts b/packages/zowe-explorer/src/dataset/DatasetTree.ts index 8cda06dd4f..420e028b7a 100644 --- a/packages/zowe-explorer/src/dataset/DatasetTree.ts +++ b/packages/zowe-explorer/src/dataset/DatasetTree.ts @@ -988,7 +988,6 @@ export class DatasetTree extends ZoweTreeProvider implements IZoweTree Date: Thu, 20 Jul 2023 13:03:42 -0400 Subject: [PATCH 67/80] Merge remote-tracking branch 'origin/maintenance' into check-creds-bug Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/CHANGELOG.md | 1 + .../__unit__/job/ZoweJobNode.unit.test.ts | 61 +++++++++++++++++++ .../zowe-explorer/src/job/ZosJobsProvider.ts | 7 +-- packages/zowe-explorer/src/job/ZoweJobNode.ts | 32 ++++++---- 4 files changed, 85 insertions(+), 16 deletions(-) diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index 6f954cdd86..cb66eae454 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen - Added jobs not found message when no results are returned from filter [#2362](https://github.com/zowe/vscode-extension-for-zowe/issues/2362) - Fixed loop when user selects Cancel on the Check Credentials message. [#2262](https://github.com/zowe/vscode-extension-for-zowe/issues/2262) +- Fixed issue where job session nodes were not adding new job nodes when refreshed. [#2370](https://github.com/zowe/vscode-extension-for-zowe/issues/2370) ## `2.9.1` 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 9ac889f67a..9191013f51 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -298,6 +298,23 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { expect(jobs[1].tooltip).toEqual("TESTJOB(JOB1235) - 0"); }); + it("Tests that getChildren updates existing job nodes with new statuses", async () => { + const globalMocks = await createGlobalMocks(); + + await globalMocks.testJobsProvider.addSession("fake"); + globalMocks.testJobsProvider.mSessionNodes[1].searchId = "JOB1234"; + globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; + globalMocks.testJobsProvider.mSessionNodes[1].filtered = true; + const jobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); + expect(jobs[0].label).toEqual("TESTJOB(JOB1234) - ACTIVE"); + + globalMocks.mockGetJob.mockReturnValueOnce({ ...globalMocks.testIJob, retcode: "CC 0000" }); + globalMocks.testJobsProvider.mSessionNodes[1].dirty = true; + const newJobs = await globalMocks.testJobsProvider.mSessionNodes[1].getChildren(); + + expect(newJobs[0].label).toEqual("TESTJOB(JOB1234) - CC 0000"); + }); + it("Tests that getChildren retrieves only child jobs which match a provided searchId", async () => { const globalMocks = await createGlobalMocks(); @@ -340,6 +357,18 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { expect(spoolFilesAfter[0].owner).toEqual("fake"); }); + it("Tests that getChildren returns a placeholder node if no spool files are available", async () => { + const globalMocks = await createGlobalMocks(); + + jest.spyOn(ZoweExplorerApiRegister, "getJesApi").mockReturnValueOnce({ + getSpoolFiles: jest.fn().mockReturnValueOnce([]), + } as any); + globalMocks.testJobNode.dirty = true; + const spoolFilesAfter = await globalMocks.testJobNode.getChildren(); + expect(spoolFilesAfter.length).toBe(1); + expect(spoolFilesAfter[0].label).toEqual("There are no JES spool messages to display"); + }); + it("Tests that getChildren returns the spool files if user/owner is not defined", async () => { const globalMocks = await createGlobalMocks(); @@ -796,3 +825,35 @@ describe("ZosJobsProvider - getJobs", () => { await expect(globalMocks.testJobNode.getJobs("test", "test", "test", "test")).resolves.not.toThrow(); }); }); + +describe("Job - sortJobs", () => { + it("should sort jobs based on job ID", () => { + const sorted = [ + { + job: { + jobid: "JOBID123", + }, + } as IZoweJobTreeNode, + { + job: { + jobid: "JOBID120", + }, + } as IZoweJobTreeNode, + { + job: { + jobid: "JOBID124", + }, + } as IZoweJobTreeNode, + // In most cases, there won't be two identical job IDs. In case of overflow, this covers the case for equal job IDs. + { + job: { + jobid: "JOBID120", + }, + } as IZoweJobTreeNode, + ].sort((a, b) => Job.sortJobs(a, b)); + expect(sorted[0].job.jobid).toBe("JOBID120"); + expect(sorted[1].job.jobid).toBe("JOBID120"); + expect(sorted[2].job.jobid).toBe("JOBID123"); + expect(sorted[3].job.jobid).toBe("JOBID124"); + }); +}); diff --git a/packages/zowe-explorer/src/job/ZosJobsProvider.ts b/packages/zowe-explorer/src/job/ZosJobsProvider.ts index 8899d376c0..1f210b81d6 100644 --- a/packages/zowe-explorer/src/job/ZosJobsProvider.ts +++ b/packages/zowe-explorer/src/job/ZosJobsProvider.ts @@ -806,8 +806,6 @@ export class ZosJobsProvider extends ZoweTreeProvider implements IZoweTree = {}; - let unmodifiedCount = this.children.length; if (contextually.isJob(this)) { // Fetch spool files under job node const cachedProfile = Profiles.getInstance().loadNamedProfile(this.getProfileName()); @@ -159,7 +158,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { const existing = this.children.find((element) => element.label?.includes(`${spool.stepname}:${spool.ddname}${spoolSuffix}`)); if (existing) { existing.label = newLabel; - unmodifiedCount--; + elementChildren[newLabel] = existing; } else { const spoolNode = new Spool(newLabel, vscode.TreeItemCollapsibleState.None, this, this.session, spool, this.job, this); const icon = getIconByNode(spoolNode); @@ -204,7 +203,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { if (existing) { // If matched, update the label to reflect latest retcode/status existing.label = nodeTitle; - unmodifiedCount--; + elementChildren[nodeTitle] = existing; } else { const jobNode = new Job(nodeTitle, vscode.TreeItemCollapsibleState.Collapsed, this, this.session, job, this.getProfile()); jobNode.contextValue = globals.JOBS_JOB_CONTEXT; @@ -221,23 +220,32 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } }); } - // Child nodes already exist and every node was updated. - // Return cached list of child nodes - if (this.children.length && unmodifiedCount === 0) { - return this.children; - } // Only add new children that are not in the list of existing child nodes - const newChildren = Object.values(elementChildren) - .sort((a, b) => a.job.jobid - b.job.jobid) - .filter((c) => this.children.find((ch) => ch.label === c.label) == null); + const newChildren = Object.values(elementChildren).filter((c) => this.children.find((ch) => ch.label === c.label) == null); + // Remove any children that are no longer present in the built record - this.children = this.children.concat(newChildren).filter((ch) => ch.label in elementChildren); + this.children = this.children + .concat(newChildren) + .filter((ch) => Object.values(elementChildren).find((recordCh) => recordCh.label === ch.label) != null) + .sort((a, b) => Job.sortJobs(a, b)); } this.dirty = false; return this.children; } + public static sortJobs(a: IZoweJobTreeNode, b: IZoweJobTreeNode): number { + if (a.job.jobid > b.job.jobid) { + return 1; + } + + if (a.job.jobid < b.job.jobid) { + return -1; + } + + return 0; + } + public getSessionNode(): IZoweJobTreeNode { ZoweLogger.trace("ZoweJobNode.getSessionNode called."); return this.getParent() ? this.getParent().getSessionNode() : this; From af633efdcc31a61e4c58b89955cdb12d9622c718 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Thu, 20 Jul 2023 17:28:44 -0400 Subject: [PATCH 68/80] move the call to expandNode for all trees Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/dataset/DatasetTree.ts | 10 +++++++--- packages/zowe-explorer/src/job/ZosJobsProvider.ts | 2 +- packages/zowe-explorer/src/uss/USSTree.ts | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/zowe-explorer/src/dataset/DatasetTree.ts b/packages/zowe-explorer/src/dataset/DatasetTree.ts index 420e028b7a..8ff4ed1553 100644 --- a/packages/zowe-explorer/src/dataset/DatasetTree.ts +++ b/packages/zowe-explorer/src/dataset/DatasetTree.ts @@ -159,7 +159,12 @@ export class DatasetTree extends ZoweTreeProvider implements IZoweTree Date: Thu, 20 Jul 2023 17:52:21 -0400 Subject: [PATCH 69/80] config file watcher isn't noticing changes for secure fields Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/utils/ProfilesUtils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index e3af1aff1d..34a82ee8e0 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -340,6 +340,8 @@ export class ProfilesUtils { ); ZoweLogger.info(successMsg); Gui.showMessage(successMsg); + // config file watcher isn't noticing changes for secure fields + await vscode.commands.executeCommand("zowe.extRefresh"); } } From 00770cb3380be3f7982e5321172c631e7bf0720a Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Fri, 21 Jul 2023 16:51:32 -0400 Subject: [PATCH 70/80] fix for ds tree Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/dataset/DatasetTree.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zowe-explorer/src/dataset/DatasetTree.ts b/packages/zowe-explorer/src/dataset/DatasetTree.ts index 8ff4ed1553..44839a72af 100644 --- a/packages/zowe-explorer/src/dataset/DatasetTree.ts +++ b/packages/zowe-explorer/src/dataset/DatasetTree.ts @@ -993,6 +993,7 @@ export class DatasetTree extends ZoweTreeProvider implements IZoweTree Date: Mon, 24 Jul 2023 09:03:21 -0400 Subject: [PATCH 71/80] prepare patch release 2.9.2 Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 88a298e020..0f4e5d84d1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.2-SNAPSHOT", + "version": "2.9.2", "command": { "version": { "forcePublish": true, From 8314be9f5d46b9e3b6870362ee7a61c916552791 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:04:42 -0400 Subject: [PATCH 72/80] fix jobs tree extra server call Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 6f3f7a8ce7..be4221a672 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -369,7 +369,6 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { }, []); } catch (error) { await errorHandling(error, this.label, localize("getChildren.error.response", "Retrieving response from ") + `zowe.GetJobs`); - syncSessionNode(Profiles.getInstance())((profileValue) => ZoweExplorerApiRegister.getJesApi(profileValue).getSession())(sessNode); } } return jobsInternal; From 255f4986afa714e8d0d52bdb30c0dab5c66c4a36 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 25 Jul 2023 13:42:39 -0400 Subject: [PATCH 73/80] update try/catch Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index be4221a672..8eafd0b9da 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -100,7 +100,8 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { * @returns {Promise} */ public async getChildren(): Promise { - ZoweLogger.trace("ZoweJobNode.getChildren called."); + const thisSessionNode = this.getSessionNode(); + ZoweLogger.trace(`ZoweJobNode.getChildren called for ${String(thisSessionNode.label)}.`); if (contextually.isSession(this) && !this.filtered) { return [ new Job( @@ -177,7 +178,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { // Fetch jobs under session node const jobs = await this.getJobs(this._owner, this._prefix, this._searchId, this._jobStatus); - if (!jobs.length) { + if (!jobs || !jobs.length > 0) { const noJobsNode = new Job( localize("getChildren.noJobs", "No jobs found"), vscode.TreeItemCollapsibleState.None, @@ -335,12 +336,11 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { private async getJobs(owner: string, prefix: string, searchId: string, status: string): Promise { ZoweLogger.trace("ZoweJobNode.getJobs called."); let jobsInternal: zowe.IJob[] = []; - const sessNode = this.getSessionNode(); const cachedProfile = Profiles.getInstance().loadNamedProfile(this.getProfileName()); - if (this.searchId.length > 0) { - jobsInternal.push(await ZoweExplorerApiRegister.getJesApi(cachedProfile).getJob(searchId)); - } else { - try { + try { + if (this.searchId.length > 0) { + jobsInternal.push(await ZoweExplorerApiRegister.getJesApi(cachedProfile).getJob(searchId)); + } else { if (ZoweExplorerApiRegister.getJesApi(cachedProfile).getJobsByParameters) { jobsInternal = await ZoweExplorerApiRegister.getJesApi(cachedProfile).getJobsByParameters({ owner, @@ -367,11 +367,15 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { return acc; } }, []); - } catch (error) { - await errorHandling(error, this.label, localize("getChildren.error.response", "Retrieving response from ") + `zowe.GetJobs`); } + return jobsInternal; + } catch (error) { + ZoweLogger.trace("Error getting jobs from Rest API."); + await errorHandling(error, this.label, localize("getChildren.error.response", "Retrieving response from ") + `zowe.GetJobs`); + syncSessionNode(Profiles.getInstance())((profileValue) => ZoweExplorerApiRegister.getJesApi(profileValue).getSession())( + this.getSessionNode() + ); } - return jobsInternal; } } From 767fcea607ec096ea9ea6cb9437d97f8512fd5c4 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 31 Jul 2023 13:25:08 -0400 Subject: [PATCH 74/80] add notes to users about keytar update and v3 pre-release Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/zowe-explorer/README.md b/packages/zowe-explorer/README.md index 4b5f5e6d55..54449d124d 100644 --- a/packages/zowe-explorer/README.md +++ b/packages/zowe-explorer/README.md @@ -5,6 +5,10 @@ [![codecov](https://codecov.io/gh/zowe/vscode-extension-for-zowe/branch/main/graph/badge.svg)](https://codecov.io/gh/zowe/vscode-extension-for-zowe) [![slack](https://img.shields.io/badge/chat-on%20Slack-blue)](https://slack.openmainframeproject.org/) +> ## :rotating_light: With the removal of keytar shim from VS Code we will be replacing `node-keytar` with `keytar-rs` in our v2.10.0 release to avoid user interuptions + +> ## :rotating_light: v3 Pre-release coming soon with the removal of v1 profile support. Extenders, keep an eye on [changes affecting extenders](https://github.com/zowe/vscode-extension-for-zowe/wiki/Changes-Affecting-Extenders) for the full list of changes + ## Introduction [Zowe Explorer](https://github.com/zowe/community#zowe-explorer) is a sub-project of Zowe, focusing on modernizing mainframe experience. [Zowe](https://www.zowe.org/) is a project hosted by the [Open Mainframe Project](https://www.openmainframeproject.org/), a [Linux Foundation](https://www.linuxfoundation.org/) project. From c7e24d13fb3f5040d93ee258d2b67b714e792dfc Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 31 Jul 2023 13:37:00 -0400 Subject: [PATCH 75/80] fix linter error Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/README.md b/packages/zowe-explorer/README.md index 54449d124d..24d62fe3be 100644 --- a/packages/zowe-explorer/README.md +++ b/packages/zowe-explorer/README.md @@ -6,7 +6,7 @@ [![slack](https://img.shields.io/badge/chat-on%20Slack-blue)](https://slack.openmainframeproject.org/) > ## :rotating_light: With the removal of keytar shim from VS Code we will be replacing `node-keytar` with `keytar-rs` in our v2.10.0 release to avoid user interuptions - +> > ## :rotating_light: v3 Pre-release coming soon with the removal of v1 profile support. Extenders, keep an eye on [changes affecting extenders](https://github.com/zowe/vscode-extension-for-zowe/wiki/Changes-Affecting-Extenders) for the full list of changes ## Introduction From 0af3ba8a5190fd5d5ef001b0a56673ede4289f2e Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Mon, 31 Jul 2023 14:56:09 -0400 Subject: [PATCH 76/80] copy edits Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/README.md b/packages/zowe-explorer/README.md index 24d62fe3be..39da5ebbe0 100644 --- a/packages/zowe-explorer/README.md +++ b/packages/zowe-explorer/README.md @@ -5,7 +5,7 @@ [![codecov](https://codecov.io/gh/zowe/vscode-extension-for-zowe/branch/main/graph/badge.svg)](https://codecov.io/gh/zowe/vscode-extension-for-zowe) [![slack](https://img.shields.io/badge/chat-on%20Slack-blue)](https://slack.openmainframeproject.org/) -> ## :rotating_light: With the removal of keytar shim from VS Code we will be replacing `node-keytar` with `keytar-rs` in our v2.10.0 release to avoid user interuptions +> ## :rotating_light: With the removal of keytar shim from VS Code we will be replacing `node-keytar` with `@zowe/secrets-for-zowe-sdk` in our v2.10.0 release to avoid user interruptions > > ## :rotating_light: v3 Pre-release coming soon with the removal of v1 profile support. Extenders, keep an eye on [changes affecting extenders](https://github.com/zowe/vscode-extension-for-zowe/wiki/Changes-Affecting-Extenders) for the full list of changes From 25dedfe12422c96cd6c83b529d7b97cd2d1f3c9d Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Tue, 1 Aug 2023 15:06:58 +0000 Subject: [PATCH 77/80] Bump version to 2.9.2 [ci skip] Signed-off-by: zowe-robot --- packages/eslint-plugin-zowe-explorer/CHANGELOG.md | 2 +- packages/eslint-plugin-zowe-explorer/package.json | 2 +- packages/zowe-explorer-api/CHANGELOG.md | 2 +- packages/zowe-explorer-api/package.json | 2 +- packages/zowe-explorer-ftp-extension/CHANGELOG.md | 2 +- packages/zowe-explorer-ftp-extension/package.json | 4 ++-- packages/zowe-explorer/CHANGELOG.md | 2 +- packages/zowe-explorer/package.json | 6 +++--- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md index 1a78767e6c..9d5d659a46 100644 --- a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md +++ b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md @@ -1,6 +1,6 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documented in this file. -## TBD Release +## `2.9.2` ### New features and enhancements diff --git a/packages/eslint-plugin-zowe-explorer/package.json b/packages/eslint-plugin-zowe-explorer/package.json index 8c805189dd..ad2e694967 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.9.2-SNAPSHOT", + "version": "2.9.2", "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 4638bf18d0..8b638b84df 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in this file. -## TBD Release +## `2.9.2` ### New features and enhancements diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index 2eb1ee956e..7fa8941202 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.9.2-SNAPSHOT", + "version": "2.9.2", "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 9ab573ba38..0a2f52af97 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -1,6 +1,6 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be documented in this file. -## TBD Release +## `2.9.2` ### New features and enhancements diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index e98237782a..67e9a36253 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.9.2-SNAPSHOT", + "version": "2.9.2", "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.9.2-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.9.2", "tmp": "0.2.1" }, "devDependencies": { diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index a89802e84e..c0650b5832 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documented in this file. -## TBD Release +## `2.9.2` ### New features and enhancements diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index 17530712cc..f84a50fb8d 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.9.2-SNAPSHOT", + "version": "2.9.2", "publisher": "Zowe", "author": "Zowe", "license": "EPL-2.0", @@ -1945,7 +1945,7 @@ "chalk": "^2.4.1", "cross-env": "^5.2.0", "del": "^4.1.1", - "eslint-plugin-zowe-explorer": "2.9.2-SNAPSHOT", + "eslint-plugin-zowe-explorer": "2.9.2", "event-stream": "^4.0.1", "expect": "^24.8.0", "geckodriver": "^1.19.1", @@ -1971,7 +1971,7 @@ "webpack-cli": "^3.3.11" }, "dependencies": { - "@zowe/zowe-explorer-api": "2.9.2-SNAPSHOT", + "@zowe/zowe-explorer-api": "2.9.2", "fs-extra": "8.0.1", "isbinaryfile": "4.0.4", "js-yaml": "3.13.1", From 42ad3dff641635938d8d4e25de3407f0a1027a14 Mon Sep 17 00:00:00 2001 From: zowe-robot Date: Tue, 1 Aug 2023 15:09:40 +0000 Subject: [PATCH 78/80] Bump version to 2.9.3-SNAPSHOT [ci skip] Signed-off-by: zowe-robot --- lerna.json | 2 +- packages/eslint-plugin-zowe-explorer/CHANGELOG.md | 6 ++++++ packages/eslint-plugin-zowe-explorer/package.json | 2 +- packages/zowe-explorer-api/CHANGELOG.md | 6 ++++++ packages/zowe-explorer-api/package.json | 2 +- packages/zowe-explorer-ftp-extension/CHANGELOG.md | 6 ++++++ packages/zowe-explorer-ftp-extension/package.json | 4 ++-- packages/zowe-explorer/CHANGELOG.md | 6 ++++++ packages/zowe-explorer/package.json | 6 +++--- 9 files changed, 32 insertions(+), 8 deletions(-) diff --git a/lerna.json b/lerna.json index 0f4e5d84d1..12ec1bdf8f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.2", + "version": "2.9.3-SNAPSHOT", "command": { "version": { "forcePublish": true, diff --git a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md index 9d5d659a46..a5c6472965 100644 --- a/packages/eslint-plugin-zowe-explorer/CHANGELOG.md +++ b/packages/eslint-plugin-zowe-explorer/CHANGELOG.md @@ -1,5 +1,11 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.2` ### New features and enhancements diff --git a/packages/eslint-plugin-zowe-explorer/package.json b/packages/eslint-plugin-zowe-explorer/package.json index ad2e694967..2fa10a61d4 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.9.2", + "version": "2.9.3-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 8b638b84df..b19ca84f4b 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the "zowe-explorer-api" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.2` ### New features and enhancements diff --git a/packages/zowe-explorer-api/package.json b/packages/zowe-explorer-api/package.json index 7fa8941202..ce480e7a8f 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.9.2", + "version": "2.9.3-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 0a2f52af97..f36ba79cd8 100644 --- a/packages/zowe-explorer-ftp-extension/CHANGELOG.md +++ b/packages/zowe-explorer-ftp-extension/CHANGELOG.md @@ -1,5 +1,11 @@ All notable changes to the "zowe-explorer-ftp-extension" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.2` ### New features and enhancements diff --git a/packages/zowe-explorer-ftp-extension/package.json b/packages/zowe-explorer-ftp-extension/package.json index 67e9a36253..ab272d1567 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.9.2", + "version": "2.9.3-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.9.2", + "@zowe/zowe-explorer-api": "2.9.3-SNAPSHOT", "tmp": "0.2.1" }, "devDependencies": { diff --git a/packages/zowe-explorer/CHANGELOG.md b/packages/zowe-explorer/CHANGELOG.md index c0650b5832..c115a7fb3d 100644 --- a/packages/zowe-explorer/CHANGELOG.md +++ b/packages/zowe-explorer/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documented in this file. +## TBD Release + +### New features and enhancements + +### Bug fixes + ## `2.9.2` ### New features and enhancements diff --git a/packages/zowe-explorer/package.json b/packages/zowe-explorer/package.json index f84a50fb8d..f79f6ca062 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.9.2", + "version": "2.9.3-SNAPSHOT", "publisher": "Zowe", "author": "Zowe", "license": "EPL-2.0", @@ -1945,7 +1945,7 @@ "chalk": "^2.4.1", "cross-env": "^5.2.0", "del": "^4.1.1", - "eslint-plugin-zowe-explorer": "2.9.2", + "eslint-plugin-zowe-explorer": "2.9.3-SNAPSHOT", "event-stream": "^4.0.1", "expect": "^24.8.0", "geckodriver": "^1.19.1", @@ -1971,7 +1971,7 @@ "webpack-cli": "^3.3.11" }, "dependencies": { - "@zowe/zowe-explorer-api": "2.9.2", + "@zowe/zowe-explorer-api": "2.9.3-SNAPSHOT", "fs-extra": "8.0.1", "isbinaryfile": "4.0.4", "js-yaml": "3.13.1", From b2dde9dc65ba73f0706815df09874598a97ea49f Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Tue, 15 Aug 2023 12:22:45 -0400 Subject: [PATCH 79/80] Fix isTheia call to remove undefined reference to "this" Signed-off-by: Timothy Johnson --- packages/zowe-explorer/src/utils/ProfilesUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index 155cadbe73..cd78d44121 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -72,7 +72,7 @@ export async function errorHandling(errorDetails: Error | string, label?: string if (imperativeError.mDetails.additionalDetails) { const tokenError: string = imperativeError.mDetails.additionalDetails; if (tokenError.includes("Token is not valid or expired.")) { - if (this.isTheia()) { + if (isTheia()) { Gui.errorMessage(errToken).then(async () => { await Profiles.getInstance().ssoLogin(null, label); }); From d4c6eef41e7397166e2918446ffefc1cd8985bc2 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Wed, 2 Aug 2023 09:21:41 -0400 Subject: [PATCH 80/80] fix unit tests Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- .../__unit__/utils/ProfilesUtils.unit.test.ts | 18 ++++++++++++++---- .../zowe-explorer/src/utils/ProfilesUtils.ts | 5 ++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts index b42045568d..d99c650853 100644 --- a/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/utils/ProfilesUtils.unit.test.ts @@ -162,12 +162,17 @@ describe("ProfilesUtils unit tests", () => { it("should handle token error and procede to login - Theia", async () => { const errorDetails = new zowe.imperative.ImperativeError({ msg: "Invalid credentials", - errorCode: 401 as unknown as string, + errorCode: String(401), additionalDetails: "Token is not valid or expired.", }); const label = "test"; const moreInfo = "Task failed successfully"; - jest.spyOn(profUtils, "isTheia").mockReturnValue(true); + Object.defineProperty(vscode, "env", { + value: { + appName: "Theia", + }, + configurable: true, + }); const showErrorSpy = jest.spyOn(Gui, "errorMessage").mockImplementation(() => Promise.resolve(undefined)); const showMessageSpy = jest.spyOn(Gui, "showMessage"); const ssoLoginSpy = jest.fn(); @@ -187,12 +192,17 @@ describe("ProfilesUtils unit tests", () => { it("should handle credential error and no selection made for update", async () => { const errorDetails = new zowe.imperative.ImperativeError({ msg: "Invalid credentials", - errorCode: 401 as unknown as string, + errorCode: String(401), additionalDetails: "Authentication failed.", }); const label = "test"; const moreInfo = "Task failed successfully"; - jest.spyOn(profUtils, "isTheia").mockReturnValue(false); + Object.defineProperty(vscode, "env", { + value: { + appName: "Visual Studio Code", + }, + configurable: true, + }); const showErrorSpy = jest.spyOn(Gui, "errorMessage").mockResolvedValue(undefined); const showMsgSpy = jest.spyOn(Gui, "showMessage"); const promptCredentialsSpy = jest.fn(); diff --git a/packages/zowe-explorer/src/utils/ProfilesUtils.ts b/packages/zowe-explorer/src/utils/ProfilesUtils.ts index cd78d44121..80b3facc82 100644 --- a/packages/zowe-explorer/src/utils/ProfilesUtils.ts +++ b/packages/zowe-explorer/src/utils/ProfilesUtils.ts @@ -73,9 +73,8 @@ export async function errorHandling(errorDetails: Error | string, label?: string const tokenError: string = imperativeError.mDetails.additionalDetails; if (tokenError.includes("Token is not valid or expired.")) { if (isTheia()) { - Gui.errorMessage(errToken).then(async () => { - await Profiles.getInstance().ssoLogin(null, label); - }); + Gui.errorMessage(errToken); + await Profiles.getInstance().ssoLogin(null, label); return; } const message = localize("errorHandling.authentication.login", "Log in to Authentication Service");