From 4e9ac1cae709df36d98530462a9f52453aeff9f9 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:31:04 -0400 Subject: [PATCH 1/7] add procstep to spool in tree Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- 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 b69ca4278b..36f4fe4c2d 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -122,14 +122,16 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { return [noSpoolNode]; } const refreshTimestamp = Date.now(); + console.log(spools); spools.forEach((spool) => { let prefix = spool.stepname; if (prefix === undefined) { prefix = spool.procstep; } const sessionName = this.getProfileName(); + const procstep = spool.procstep ? spool.procstep : ""; const spoolNode = new Spool( - `${spool.stepname}:${spool.ddname}(${spool.id})`, + `${spool.stepname}:${spool.ddname} ${procstep}`, vscode.TreeItemCollapsibleState.None, this, this.session, From 201dfba42b27ec6a8e80df8aff4967b8b37e4582 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:54:18 -0400 Subject: [PATCH 2/7] update job tree view and hover over spool file Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 36f4fe4c2d..39d9cc6920 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -42,6 +42,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { private _prefix: string; // tslint:disable-next-line: variable-name private _searchId: string; + private _tooltip: any; constructor( label: string, @@ -122,16 +123,21 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { return [noSpoolNode]; } const refreshTimestamp = Date.now(); - console.log(spools); spools.forEach((spool) => { let prefix = spool.stepname; if (prefix === undefined) { prefix = spool.procstep; } const sessionName = this.getProfileName(); - const procstep = spool.procstep ? spool.procstep : ""; + const procstep = spool.procstep ? spool.procstep : undefined; + let newLabel: string; + if (procstep) { + newLabel = `${spool.stepname}:${spool.ddname} - ${procstep}`; + } else { + newLabel = `${spool.stepname}:${spool.ddname} - ${spool["record-count"]}`; + } const spoolNode = new Spool( - `${spool.stepname}:${spool.ddname} ${procstep}`, + newLabel, vscode.TreeItemCollapsibleState.None, this, this.session, @@ -143,6 +149,17 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { if (icon) { spoolNode.iconPath = icon.path; } + let arr = []; + Object.keys(spool).map((key) => { + if (key !== "records-url") { + arr.push({ [key]: spool[key] }); + } + }); + let newTooltip = ""; + arr.forEach((item) => { + newTooltip = newTooltip + `${JSON.stringify(item).replace(/({|})/g, "")}\n`; + }); + spoolNode.tooltip = newTooltip; spoolNode.command = { command: "zowe.jobs.zosJobsOpenspool", title: "", @@ -213,7 +230,16 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { return this.getParent() ? this.getParent().getSessionNode() : this; } + set tooltip(newTooltip: string) { + if (newTooltip !== undefined) { + this._tooltip = newTooltip; + } + } + get tooltip(): string { + if (this._tooltip !== undefined) { + return this._tooltip; + } if (this.job !== null) { if (this.job.retcode) { return `${this.job.jobname}(${this.job.jobid}) - ${this.job.retcode}`; From d86dde8f900c02b4388da4d139f2d3706bd8db98 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 23 Aug 2022 10:56:06 -0400 Subject: [PATCH 3/7] fix unit test Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- .../__tests__/__unit__/job/ZoweJobNode.unit.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 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 3896fb388e..10cadf38ae 100644 --- a/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/job/ZoweJobNode.unit.test.ts @@ -306,7 +306,7 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { const spoolFiles = await globalMocks.testJobNode.getChildren(); expect(spoolFiles.length).toBe(1); - expect(spoolFiles[0].label).toEqual("STEP:STDOUT(101)"); + expect(spoolFiles[0].label).toEqual("STEP:STDOUT - 1"); expect(spoolFiles[0].owner).toEqual("fake"); }); @@ -319,7 +319,7 @@ describe("ZoweJobNode unit tests - Function getChildren", () => { globalMocks.testJobNode.session.ISession = globalMocks.testSessionNoCred; const spoolFiles = await globalMocks.testJobNode.getChildren(); expect(spoolFiles.length).toBe(1); - expect(spoolFiles[0].label).toEqual("STEP:STDOUT(101)"); + expect(spoolFiles[0].label).toEqual("STEP:STDOUT - 1"); expect(spoolFiles[0].owner).toEqual("*"); }); }); From 24dc22ebb19323e21abd493fda117760a6103b83 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 23 Aug 2022 11:08:44 -0400 Subject: [PATCH 4/7] lint issue fix Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 39d9cc6920..eae29b9038 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -149,7 +149,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { if (icon) { spoolNode.iconPath = icon.path; } - let arr = []; + const arr = []; Object.keys(spool).map((key) => { if (key !== "records-url") { arr.push({ [key]: spool[key] }); From def4c6f4322d50f198921eacb079ddcc2085e345 Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 23 Aug 2022 11:14:25 -0400 Subject: [PATCH 5/7] lint issue Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index eae29b9038..1bafe55e7b 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -42,6 +42,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { private _prefix: string; // tslint:disable-next-line: variable-name private _searchId: string; + // tslint:disable-next-line: variable-name private _tooltip: any; constructor( From 139332afba7f5022df9ed2335c067e5857dc4cce Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 23 Aug 2022 11:49:00 -0400 Subject: [PATCH 6/7] cleanup Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index 1bafe55e7b..efb5b4db6a 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -43,7 +43,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { // tslint:disable-next-line: variable-name private _searchId: string; // tslint:disable-next-line: variable-name - private _tooltip: any; + private _tooltip: string; constructor( label: string, @@ -158,7 +158,7 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { }); let newTooltip = ""; arr.forEach((item) => { - newTooltip = newTooltip + `${JSON.stringify(item).replace(/({|})/g, "")}\n`; + newTooltip += `${JSON.stringify(item).replace(/({|})/g, "")}\n`; }); spoolNode.tooltip = newTooltip; spoolNode.command = { From 1889233360272455accc66bbba7c913a16d6a1aa Mon Sep 17 00:00:00 2001 From: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> Date: Tue, 23 Aug 2022 17:12:40 -0400 Subject: [PATCH 7/7] address comments Signed-off-by: Billie Simmons <49491949+JillieBeanSim@users.noreply.github.com> --- packages/zowe-explorer/src/job/ZoweJobNode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/zowe-explorer/src/job/ZoweJobNode.ts b/packages/zowe-explorer/src/job/ZoweJobNode.ts index efb5b4db6a..67225ece7f 100644 --- a/packages/zowe-explorer/src/job/ZoweJobNode.ts +++ b/packages/zowe-explorer/src/job/ZoweJobNode.ts @@ -232,13 +232,13 @@ export class Job extends ZoweTreeNode implements IZoweJobTreeNode { } set tooltip(newTooltip: string) { - if (newTooltip !== undefined) { + if (newTooltip) { this._tooltip = newTooltip; } } get tooltip(): string { - if (this._tooltip !== undefined) { + if (this._tooltip) { return this._tooltip; } if (this.job !== null) {