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 01/43] 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 02/43] 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 03/43] 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 04/43] 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 05/43] 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 06/43] 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 07/43] 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 08/43] 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 09/43] 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 10/43] 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 11/43] 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 12/43] 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 13/43] 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 14/43] 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 15/43] 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 16/43] 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 17/43] 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 18/43] 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 19/43] 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 20/43] 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 21/43] 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 22/43] 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 23/43] 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 24/43] 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 25/43] 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 26/43] 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 27/43] 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 28/43] 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 29/43] 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 30/43] 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 31/43] 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 32/43] 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 33/43] 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 34/43] 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 35/43] 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 36/43] 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 37/43] 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 38/43] 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 39/43] 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 40/43] 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 41/43] 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 42/43] 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 43/43] 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",