From bda99b5865b33587504d3a8c5de299e0c05e4784 Mon Sep 17 00:00:00 2001 From: Andrew Twydell Date: Mon, 6 Jan 2025 16:55:41 +0000 Subject: [PATCH] lint warning fixes - not complete Signed-off-by: Andrew Twydell --- .../__unit__/utils/Utils.unit.test.ts | 3 +- .../commands/clearResourceFilterCommand.ts | 10 +- .../src/commands/closeLocalFileCommand.ts | 24 ++- .../disableLocalFileCommand.ts | 21 ++- .../disableCommands/disableProgramCommand.ts | 19 +-- .../disableTransactionCommand.ts | 26 ++-- .../enableCommands/enableLocalFileCommand.ts | 19 +-- .../enableCommands/enableProgramCommand.ts | 19 +-- .../enableTransactionCommand.ts | 21 +-- .../src/commands/filterResourceCommands.ts | 52 ++----- .../src/commands/getFilterPlexResources.ts | 4 +- .../vsce/src/commands/inquireTransaction.ts | 2 +- packages/vsce/src/commands/newCopyCommand.ts | 18 +-- .../vsce/src/commands/openLocalFileCommand.ts | 24 +-- packages/vsce/src/commands/phaseInCommand.ts | 20 ++- .../vsce/src/commands/purgeTaskCommand.ts | 26 ++-- packages/vsce/src/commands/refreshCommand.ts | 3 - .../vsce/src/commands/removeSessionCommand.ts | 7 +- .../src/commands/showAttributesCommand.ts | 49 +++--- .../vsce/src/commands/showParameterCommand.ts | 9 +- packages/vsce/src/commands/viewMoreCommand.ts | 2 +- packages/vsce/src/extension.ts | 143 ++++++++---------- .../CICSCombinedLibraryTree.ts | 18 +-- .../CICSCombinedLocalFileTree.ts | 16 +- .../CICSCombinedPipelineTree.ts | 16 +- .../CICSCombinedProgramTree.ts | 20 ++- .../CICSCombinedTCPIPServiceTree.ts | 18 +-- .../CICSCombinedTrees/CICSCombinedTaskTree.ts | 18 +-- .../CICSCombinedTransactionTree.ts | 18 +-- .../CICSCombinedURIMapTree.ts | 18 +-- .../CICSCombinedWebServiceTree.ts | 16 +- .../vsce/src/trees/CICSRegionsContainer.ts | 17 +-- packages/vsce/src/trees/CICSTree.ts | 35 ++--- packages/vsce/src/trees/CICSWebTree.ts | 2 +- packages/vsce/src/utils/PersistentStorage.ts | 21 +-- packages/vsce/src/utils/constants.ts | 48 ++++++ packages/vsce/src/utils/expansionHandler.ts | 12 +- packages/vsce/src/utils/filterUtils.ts | 4 +- packages/vsce/src/utils/profileManagement.ts | 136 ++++++++--------- packages/vsce/tsup.config.json | 4 +- 40 files changed, 458 insertions(+), 500 deletions(-) create mode 100644 packages/vsce/src/utils/constants.ts diff --git a/packages/sdk/__tests__/__unit__/utils/Utils.unit.test.ts b/packages/sdk/__tests__/__unit__/utils/Utils.unit.test.ts index 07e7fcd7..bd05fa27 100644 --- a/packages/sdk/__tests__/__unit__/utils/Utils.unit.test.ts +++ b/packages/sdk/__tests__/__unit__/utils/Utils.unit.test.ts @@ -417,7 +417,8 @@ describe('Utils - enforceParentheses', () => { }); it("should add appropriate brackets", () => { - const output = Utils.enforceParentheses("NOT (PROGRAM=CEE* OR PROGRAM=DFH* OR PROGRAM=CJ* OR PROGRAM=EYU* OR PROGRAM=CSQ* OR PROGRAM=CEL* OR PROGRAM=IGZ*)"); + const output = Utils.enforceParentheses( + "NOT (PROGRAM=CEE* OR PROGRAM=DFH* OR PROGRAM=CJ* OR PROGRAM=EYU* OR PROGRAM=CSQ* OR PROGRAM=CEL* OR PROGRAM=IGZ*)"); expect(output).toEqual("(NOT (PROGRAM=CEE* OR PROGRAM=DFH* OR PROGRAM=CJ* OR PROGRAM=EYU* OR PROGRAM=CSQ* OR PROGRAM=CEL* OR PROGRAM=IGZ*))"); }); }); diff --git a/packages/vsce/src/commands/clearResourceFilterCommand.ts b/packages/vsce/src/commands/clearResourceFilterCommand.ts index 4ed59ec7..6742397f 100644 --- a/packages/vsce/src/commands/clearResourceFilterCommand.ts +++ b/packages/vsce/src/commands/clearResourceFilterCommand.ts @@ -10,19 +10,19 @@ */ import { commands, ProgressLocation, TreeView, window } from "vscode"; -import { CICSLibraryDatasets } from "../trees/treeItems/CICSLibraryDatasets"; import { CICSLibraryTree } from "../trees/CICSLibraryTree"; import { CICSLocalFileTree } from "../trees/CICSLocalFileTree"; import { CICSProgramTree } from "../trees/CICSProgramTree"; import { CICSTaskTree } from "../trees/CICSTaskTree"; import { CICSTransactionTree } from "../trees/CICSTransactionTree"; import { CICSTree } from "../trees/CICSTree"; -import { findSelectedNodes } from "../utils/commandUtils"; +import { CICSLibraryDatasets } from "../trees/treeItems/CICSLibraryDatasets"; import { CICSLibraryTreeItem } from "../trees/treeItems/CICSLibraryTreeItem"; +import { CICSPipelineTree } from "../trees/treeItems/web/CICSPipelineTree"; import { CICSTCPIPServiceTree } from "../trees/treeItems/web/CICSTCPIPServiceTree"; import { CICSURIMapTree } from "../trees/treeItems/web/CICSURIMapTree"; import { CICSWebServiceTree } from "../trees/treeItems/web/CICSWebServiceTree"; -import { CICSPipelineTree } from "../trees/treeItems/web/CICSPipelineTree"; +import { findSelectedNodes } from "../utils/commandUtils"; export function getClearResourceFilterCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.clearFilter", async (node) => { @@ -63,9 +63,7 @@ export function getClearResourceFilterCommand(tree: CICSTree, treeview: TreeView cancellable: false, }, async (_, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of resources"); - }); + token.onCancellationRequested(() => { }); await selectedNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } diff --git a/packages/vsce/src/commands/closeLocalFileCommand.ts b/packages/vsce/src/commands/closeLocalFileCommand.ts index 1e613013..bf794d40 100644 --- a/packages/vsce/src/commands/closeLocalFileCommand.ts +++ b/packages/vsce/src/commands/closeLocalFileCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedLocalFileTree } from "../trees/CICSCombinedTrees/CICSCombinedLocalFileTree"; +import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSLocalFileTreeItem } from "../trees/treeItems/CICSLocalFileTreeItem"; import { findSelectedNodes, splitCmciErrorMessage } from "../utils/commandUtils"; -import { CICSCombinedLocalFileTree } from "../trees/CICSCombinedTrees/CICSCombinedLocalFileTree"; +import constants from "../utils/constants"; export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.closeLocalFile", async (clickedNode) => { @@ -42,13 +43,11 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the Close"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Closing ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -73,11 +72,10 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView // @ts-ignore if (error.mMessage) { // @ts-ignore - const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); + const [_resp, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( - `Perform CLOSE on local file "${ - allSelectedNodes[parseInt(index)].localFile.file + `Perform CLOSE on local file "${allSelectedNodes[parseInt(index)].localFile.file }" failed: EXEC CICS command (${eibfnAlt}) RESP(${respAlt}) RESP2(${resp2})` ); } else { @@ -122,9 +120,9 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView }); } -async function closeLocalFile( +function closeLocalFile( session: imperative.AbstractSession, - parms: { name: string; regionName: string; cicsPlex: string }, + parms: { name: string; regionName: string; cicsPlex: string; }, busyDecision: string ): Promise { const requestBody: any = { @@ -156,5 +154,5 @@ async function closeLocalFile( parms.name + ")"; - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/vsce/src/commands/disableCommands/disableLocalFileCommand.ts b/packages/vsce/src/commands/disableCommands/disableLocalFileCommand.ts index 21ce7aa6..909a670b 100644 --- a/packages/vsce/src/commands/disableCommands/disableLocalFileCommand.ts +++ b/packages/vsce/src/commands/disableCommands/disableLocalFileCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedLocalFileTree } from "../../trees/CICSCombinedTrees/CICSCombinedLocalFileTree"; +import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../../trees/CICSRegionTree"; import { CICSTree } from "../../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; -import { findSelectedNodes } from "../../utils/commandUtils"; import { CICSLocalFileTreeItem } from "../../trees/treeItems/CICSLocalFileTreeItem"; -import { CICSCombinedLocalFileTree } from "../../trees/CICSCombinedTrees/CICSCombinedLocalFileTree"; +import { findSelectedNodes } from "../../utils/commandUtils"; +import constants from "../../utils/constants"; export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.disableLocalFile", async (clickedNode) => { @@ -42,13 +43,11 @@ export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView { - token.onCancellationRequested(() => { - console.log("Cancelling the Disable"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Disabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -110,9 +109,9 @@ export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView { const requestBody: any = { @@ -145,5 +144,5 @@ async function disableLocalFile( ")"; //+ //"&PARAMETER=('BUSY(WAIT).')"; - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/vsce/src/commands/disableCommands/disableProgramCommand.ts b/packages/vsce/src/commands/disableCommands/disableProgramCommand.ts index 2d606838..7b2038f4 100644 --- a/packages/vsce/src/commands/disableCommands/disableProgramCommand.ts +++ b/packages/vsce/src/commands/disableCommands/disableProgramCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedProgramTree } from "../../trees/CICSCombinedTrees/CICSCombinedProgramTree"; +import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../../trees/CICSRegionTree"; import { CICSTree } from "../../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; -import { findSelectedNodes } from "../../utils/commandUtils"; import { CICSProgramTreeItem } from "../../trees/treeItems/CICSProgramTreeItem"; -import { CICSCombinedProgramTree } from "../../trees/CICSCombinedTrees/CICSCombinedProgramTree"; +import { findSelectedNodes } from "../../utils/commandUtils"; +import constants from "../../utils/constants"; /** * Performs disable on selected CICSProgram nodes. @@ -40,13 +41,11 @@ export function getDisableProgramCommand(tree: CICSTree, treeview: TreeView cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the Disable"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Disabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -105,7 +104,9 @@ export function getDisableProgramCommand(tree: CICSTree, treeview: TreeView }); } -function disableProgram(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise { +function disableProgram( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string; }): Promise { const requestBody: any = { request: { action: { diff --git a/packages/vsce/src/commands/disableCommands/disableTransactionCommand.ts b/packages/vsce/src/commands/disableCommands/disableTransactionCommand.ts index 3a1ffa1f..7924a40d 100644 --- a/packages/vsce/src/commands/disableCommands/disableTransactionCommand.ts +++ b/packages/vsce/src/commands/disableCommands/disableTransactionCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree"; +import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../../trees/CICSRegionTree"; import { CICSTree } from "../../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; -import { findSelectedNodes, splitCmciErrorMessage } from "../../utils/commandUtils"; import { CICSTransactionTreeItem } from "../../trees/treeItems/CICSTransactionTreeItem"; -import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree"; +import { findSelectedNodes, splitCmciErrorMessage } from "../../utils/commandUtils"; +import constants from "../../utils/constants"; export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.disableTransaction", async (clickedNode) => { @@ -35,13 +36,11 @@ export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView< cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the Disable"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Disabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -62,10 +61,9 @@ export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView< // @ts-ignore if (error.mMessage) { // @ts-ignore - const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); + const [_resp, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( - `Perform DISABLE on Transaction "${ - allSelectedNodes[parseInt(index)].transaction.tranid + `Perform DISABLE on Transaction "${allSelectedNodes[parseInt(index)].transaction.tranid }" failed: EXEC CICS command (${eibfnAlt}) RESP(${respAlt}) RESP2(${resp2})` ); } else { @@ -110,9 +108,9 @@ export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView< }); } -async function disableTransaction( +function disableTransaction( session: imperative.AbstractSession, - parms: { name: string; regionName: string; cicsPlex: string } + parms: { name: string; regionName: string; cicsPlex: string; } ): Promise { const requestBody: any = { request: { @@ -136,5 +134,5 @@ async function disableTransaction( "?CRITERIA=(TRANID=" + parms.name + ")"; - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/vsce/src/commands/enableCommands/enableLocalFileCommand.ts b/packages/vsce/src/commands/enableCommands/enableLocalFileCommand.ts index aa718227..c2ecf659 100644 --- a/packages/vsce/src/commands/enableCommands/enableLocalFileCommand.ts +++ b/packages/vsce/src/commands/enableCommands/enableLocalFileCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedLocalFileTree } from "../../trees/CICSCombinedTrees/CICSCombinedLocalFileTree"; +import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../../trees/CICSRegionTree"; import { CICSTree } from "../../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { CICSLocalFileTreeItem } from "../../trees/treeItems/CICSLocalFileTreeItem"; import { findSelectedNodes } from "../../utils/commandUtils"; -import { CICSCombinedLocalFileTree } from "../../trees/CICSCombinedTrees/CICSCombinedLocalFileTree"; +import constants from "../../utils/constants"; export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.enableLocalFile", async (clickedNode) => { @@ -35,13 +36,11 @@ export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView { - token.onCancellationRequested(() => { - console.log("Cancelling the Enable"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Enabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -99,7 +98,9 @@ export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView { +function enableLocalFile( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string; }): Promise { const requestBody: any = { request: { action: { @@ -123,5 +124,5 @@ async function enableLocalFile(session: imperative.AbstractSession, parms: { nam parms.name + ")"; - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/vsce/src/commands/enableCommands/enableProgramCommand.ts b/packages/vsce/src/commands/enableCommands/enableProgramCommand.ts index 9882bd86..3c0b4b67 100644 --- a/packages/vsce/src/commands/enableCommands/enableProgramCommand.ts +++ b/packages/vsce/src/commands/enableCommands/enableProgramCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedProgramTree } from "../../trees/CICSCombinedTrees/CICSCombinedProgramTree"; +import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../../trees/CICSRegionTree"; import { CICSTree } from "../../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { CICSProgramTreeItem } from "../../trees/treeItems/CICSProgramTreeItem"; import { findSelectedNodes } from "../../utils/commandUtils"; -import { CICSCombinedProgramTree } from "../../trees/CICSCombinedTrees/CICSCombinedProgramTree"; +import constants from "../../utils/constants"; /** * Performs enable on selected CICSProgram nodes. @@ -40,13 +41,11 @@ export function getEnableProgramCommand(tree: CICSTree, treeview: TreeView) cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the Enable"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Enabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -104,7 +103,9 @@ export function getEnableProgramCommand(tree: CICSTree, treeview: TreeView) }); } -async function enableProgram(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise { +function enableProgram( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string; }): Promise { const requestBody: any = { request: { action: { @@ -128,5 +129,5 @@ async function enableProgram(session: imperative.AbstractSession, parms: { name: parms.name + ")"; - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts b/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts index b1509c0f..00939568 100644 --- a/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts +++ b/packages/vsce/src/commands/enableCommands/enableTransactionCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree"; +import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../../trees/CICSRegionTree"; import { CICSTree } from "../../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../../trees/CICSRegionsContainer"; -import { findSelectedNodes } from "../../utils/commandUtils"; import { CICSTransactionTreeItem } from "../../trees/treeItems/CICSTransactionTreeItem"; -import { CICSCombinedTransactionsTree } from "../../trees/CICSCombinedTrees/CICSCombinedTransactionTree"; +import { findSelectedNodes } from "../../utils/commandUtils"; +import constants from "../../utils/constants"; export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.enableTransaction", async (clickedNode) => { @@ -36,13 +37,11 @@ export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView { - token.onCancellationRequested(() => { - console.log("Cancelling the Enable"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Enabling ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -99,7 +98,9 @@ export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView { +function enableTransaction( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string; }): Promise { const requestBody: any = { request: { action: { @@ -123,5 +124,5 @@ async function enableTransaction(session: imperative.AbstractSession, parms: { n parms.name + ")"; - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/vsce/src/commands/filterResourceCommands.ts b/packages/vsce/src/commands/filterResourceCommands.ts index 29e613d1..8d0e4d39 100644 --- a/packages/vsce/src/commands/filterResourceCommands.ts +++ b/packages/vsce/src/commands/filterResourceCommands.ts @@ -16,14 +16,14 @@ import { CICSProgramTree } from "../trees/CICSProgramTree"; import { CICSTaskTree } from "../trees/CICSTaskTree"; import { CICSTransactionTree } from "../trees/CICSTransactionTree"; import { CICSTree } from "../trees/CICSTree"; -import { CICSTCPIPServiceTree } from "../trees/treeItems/web/CICSTCPIPServiceTree"; import { CICSLibraryDatasets } from "../trees/treeItems/CICSLibraryDatasets"; import { CICSLibraryTreeItem } from "../trees/treeItems/CICSLibraryTreeItem"; -import { getPatternFromFilter } from "../utils/filterUtils"; -import { PersistentStorage } from "../utils/PersistentStorage"; -import { CICSURIMapTree } from "../trees/treeItems/web/CICSURIMapTree"; import { CICSPipelineTree } from "../trees/treeItems/web/CICSPipelineTree"; +import { CICSTCPIPServiceTree } from "../trees/treeItems/web/CICSTCPIPServiceTree"; +import { CICSURIMapTree } from "../trees/treeItems/web/CICSURIMapTree"; import { CICSWebServiceTree } from "../trees/treeItems/web/CICSWebServiceTree"; +import { getPatternFromFilter } from "../utils/filterUtils"; +import { PersistentStorage } from "../utils/PersistentStorage"; export function getFilterLibrariesCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.filterLibraries", async (node) => { @@ -51,9 +51,7 @@ export function getFilterLibrariesCommand(tree: CICSTree, treeview: TreeView { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of libraries"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -87,9 +85,7 @@ export function getFilterDatasetsCommand(tree: CICSTree, treeview: TreeView cancellable: false, }, async (_, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of datasets"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -123,9 +119,7 @@ export function getFilterProgramsCommand(tree: CICSTree, treeview: TreeView cancellable: false, }, async (_, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of programs"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -159,9 +153,7 @@ export function getFilterDatasetProgramsCommand(tree: CICSTree, treeview: TreeVi cancellable: false, }, async (_, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of programs"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -195,9 +187,7 @@ export function getFilterLocalFilesCommand(tree: CICSTree, treeview: TreeView { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of local files"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -231,9 +221,7 @@ export function getFilterTasksCommand(tree: CICSTree, treeview: TreeView) { cancellable: false, }, async (_, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of tasks"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -267,9 +255,7 @@ export function getFilterTransactionCommand(tree: CICSTree, treeview: TreeView { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of transactions"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -303,9 +289,7 @@ export function getFilterTCPIPSCommand(tree: CICSTree, treeview: TreeView) cancellable: false, }, async (_, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of TCPIP Services"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -339,9 +323,7 @@ export function getFilterURIMapsCommand(tree: CICSTree, treeview: TreeView) cancellable: false, }, async (_, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of URI Maps"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -375,9 +357,7 @@ export function getFilterPipelinesCommand(tree: CICSTree, treeview: TreeView { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of Pipelines"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } @@ -411,9 +391,7 @@ export function getFilterWebServicesCommand(tree: CICSTree, treeview: TreeView { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of Web Services"); - }); + token.onCancellationRequested(() => { }); await chosenNode.loadContents(); tree._onDidChangeTreeData.fire(undefined); } diff --git a/packages/vsce/src/commands/getFilterPlexResources.ts b/packages/vsce/src/commands/getFilterPlexResources.ts index f474bc6e..1c5b668d 100644 --- a/packages/vsce/src/commands/getFilterPlexResources.ts +++ b/packages/vsce/src/commands/getFilterPlexResources.ts @@ -88,9 +88,7 @@ export function getFilterPlexResources(tree: CICSTree, treeview: TreeView) cancellable: true, }, async (_, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the loading of resources"); - }); + token.onCancellationRequested(() => { }); for (const region of chosenNode.children) { if (region instanceof CICSRegionTree) { if (region.getIsActive()) { diff --git a/packages/vsce/src/commands/inquireTransaction.ts b/packages/vsce/src/commands/inquireTransaction.ts index 7bf0fc6a..26b90931 100644 --- a/packages/vsce/src/commands/inquireTransaction.ts +++ b/packages/vsce/src/commands/inquireTransaction.ts @@ -9,7 +9,7 @@ * */ -import { commands, TreeItemCollapsibleState, TreeView, window } from "vscode"; +import { commands, TreeView, window } from "vscode"; import { CICSCombinedTaskTree } from "../trees/CICSCombinedTrees/CICSCombinedTaskTree"; import { CICSPlexTree } from "../trees/CICSPlexTree"; import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; diff --git a/packages/vsce/src/commands/newCopyCommand.ts b/packages/vsce/src/commands/newCopyCommand.ts index e0482650..ebe3bb45 100644 --- a/packages/vsce/src/commands/newCopyCommand.ts +++ b/packages/vsce/src/commands/newCopyCommand.ts @@ -10,14 +10,15 @@ */ import { programNewcopy } from "@zowe/cics-for-zowe-sdk"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedProgramTree } from "../trees/CICSCombinedTrees/CICSCombinedProgramTree"; +import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSProgramTreeItem } from "../trees/treeItems/CICSProgramTreeItem"; import { findSelectedNodes, splitCmciErrorMessage } from "../utils/commandUtils"; -import { CICSCombinedProgramTree } from "../trees/CICSCombinedTrees/CICSCombinedProgramTree"; +import constants from "../utils/constants"; /** * Performs new copy on selected CICSProgram nodes. @@ -39,13 +40,11 @@ export function getNewCopyCommand(tree: CICSTree, treeview: TreeView) { cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the New Copy"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `New Copying ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -67,10 +66,9 @@ export function getNewCopyCommand(tree: CICSTree, treeview: TreeView) { // @ts-ignore if (error.mMessage) { // @ts-ignore - const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); + const [_resp, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( - `Perform NEWCOPY on Program "${ - allSelectedNodes[parseInt(index)].program.program + `Perform NEWCOPY on Program "${allSelectedNodes[parseInt(index)].program.program }" failed: EXEC CICS command (${eibfnAlt}) RESP(${respAlt}) RESP2(${resp2})` ); } else { diff --git a/packages/vsce/src/commands/openLocalFileCommand.ts b/packages/vsce/src/commands/openLocalFileCommand.ts index b59a06f9..7f193f9d 100644 --- a/packages/vsce/src/commands/openLocalFileCommand.ts +++ b/packages/vsce/src/commands/openLocalFileCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedLocalFileTree } from "../trees/CICSCombinedTrees/CICSCombinedLocalFileTree"; +import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSLocalFileTreeItem } from "../trees/treeItems/CICSLocalFileTreeItem"; import { findSelectedNodes, splitCmciErrorMessage } from "../utils/commandUtils"; -import { CICSCombinedLocalFileTree } from "../trees/CICSCombinedTrees/CICSCombinedLocalFileTree"; +import constants from "../utils/constants"; export function getOpenLocalFileCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.openLocalFile", async (clickedNode) => { @@ -35,13 +36,11 @@ export function getOpenLocalFileCommand(tree: CICSTree, treeview: TreeView) cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the Open"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Opening ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -62,10 +61,9 @@ export function getOpenLocalFileCommand(tree: CICSTree, treeview: TreeView) // @ts-ignore if (error.mMessage) { // @ts-ignore - const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); + const [_resp, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( - `Perform OPEN on local file "${ - allSelectedNodes[parseInt(index)].localFile.file + `Perform OPEN on local file "${allSelectedNodes[parseInt(index)].localFile.file }" failed: EXEC CICS command (${eibfnAlt}) RESP(${respAlt}) RESP2(${resp2})` ); } else { @@ -109,7 +107,9 @@ export function getOpenLocalFileCommand(tree: CICSTree, treeview: TreeView) }); } -async function openLocalFile(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise { +function openLocalFile( + session: imperative.AbstractSession, + parms: { name: string; regionName: string; cicsPlex: string; }): Promise { const requestBody: any = { request: { action: { @@ -133,5 +133,5 @@ async function openLocalFile(session: imperative.AbstractSession, parms: { name: parms.name + ")"; - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/vsce/src/commands/phaseInCommand.ts b/packages/vsce/src/commands/phaseInCommand.ts index b77d1073..bd22438b 100644 --- a/packages/vsce/src/commands/phaseInCommand.ts +++ b/packages/vsce/src/commands/phaseInCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedProgramTree } from "../trees/CICSCombinedTrees/CICSCombinedProgramTree"; +import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; -import * as https from "https"; -import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSProgramTreeItem } from "../trees/treeItems/CICSProgramTreeItem"; import { findSelectedNodes, splitCmciErrorMessage } from "../utils/commandUtils"; -import { CICSCombinedProgramTree } from "../trees/CICSCombinedTrees/CICSCombinedProgramTree"; +import constants from "../utils/constants"; /** * Performs PHASE IN on selected CICSProgram nodes. @@ -40,13 +41,11 @@ export function getPhaseInCommand(tree: CICSTree, treeview: TreeView) { cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the Phase In"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Phase In ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -68,10 +67,9 @@ export function getPhaseInCommand(tree: CICSTree, treeview: TreeView) { // @ts-ignore if (error.mMessage) { // @ts-ignore - const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); + const [_resp, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( - `Perform PHASEIN on Program "${ - allSelectedNodes[parseInt(index)].program.program + `Perform PHASEIN on Program "${allSelectedNodes[parseInt(index)].program.program }" failed: EXEC CICS command (${eibfnAlt}) RESP(${respAlt}) RESP2(${resp2})` ); } else { @@ -116,7 +114,7 @@ export function getPhaseInCommand(tree: CICSTree, treeview: TreeView) { }); } -async function performPhaseIn(session: imperative.AbstractSession, parms: { cicsPlex: string | null; regionName: string; name: string }) { +async function performPhaseIn(session: imperative.AbstractSession, parms: { cicsPlex: string | null; regionName: string; name: string; }) { const requestBody: any = { request: { action: { diff --git a/packages/vsce/src/commands/purgeTaskCommand.ts b/packages/vsce/src/commands/purgeTaskCommand.ts index 128782c1..03579e73 100644 --- a/packages/vsce/src/commands/purgeTaskCommand.ts +++ b/packages/vsce/src/commands/purgeTaskCommand.ts @@ -11,14 +11,15 @@ import { CicsCmciConstants, CicsCmciRestClient, ICMCIApiResponse } from "@zowe/cics-for-zowe-sdk"; import { imperative } from "@zowe/zowe-explorer-api"; +import * as https from "https"; import { commands, ProgressLocation, TreeView, window } from "vscode"; +import { CICSCombinedTaskTree } from "../trees/CICSCombinedTrees/CICSCombinedTaskTree"; +import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSTree } from "../trees/CICSTree"; -import * as https from "https"; -import { findSelectedNodes, splitCmciErrorMessage } from "../utils/commandUtils"; import { CICSTaskTreeItem } from "../trees/treeItems/CICSTaskTreeItem"; -import { CICSRegionsContainer } from "../trees/CICSRegionsContainer"; -import { CICSCombinedTaskTree } from "../trees/CICSCombinedTrees/CICSCombinedTaskTree"; +import { findSelectedNodes, splitCmciErrorMessage } from "../utils/commandUtils"; +import constants from "../utils/constants"; /** * Purge a CICS Task and reload the CICS Task tree contents and the combined Task tree contents @@ -45,13 +46,11 @@ export function getPurgeTaskCommand(tree: CICSTree, treeview: TreeView) { cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the Purge"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Purging ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); const currentNode = allSelectedNodes[parseInt(index)]; @@ -76,10 +75,9 @@ export function getPurgeTaskCommand(tree: CICSTree, treeview: TreeView) { // @ts-ignore if (error.mMessage) { // @ts-ignore - const [_, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); + const [_resp, resp2, respAlt, eibfnAlt] = splitCmciErrorMessage(error.mMessage); window.showErrorMessage( - `Perform ${purgeType?.toUpperCase()} on CICSTask "${ - allSelectedNodes[parseInt(index)].task.task + `Perform ${purgeType?.toUpperCase()} on CICSTask "${allSelectedNodes[parseInt(index)].task.task }" failed: EXEC CICS command (${eibfnAlt}) RESP(${respAlt}) RESP2(${resp2})` ); } else { @@ -134,9 +132,9 @@ export function getPurgeTaskCommand(tree: CICSTree, treeview: TreeView) { * @param purgeType * @returns */ -async function purgeTask( +function purgeTask( session: imperative.AbstractSession, - parms: { name: string; regionName: string; cicsPlex: string }, + parms: { name: string; regionName: string; cicsPlex: string; }, purgeType: string ): Promise { const requestBody: any = { @@ -158,5 +156,5 @@ async function purgeTask( const cicsPlex = parms.cicsPlex === undefined ? "" : parms.cicsPlex + "/"; const cmciResource = "/" + CicsCmciConstants.CICS_SYSTEM_MANAGEMENT + "/" + "CICSTask" + "/" + cicsPlex + parms.regionName + "?CRITERIA=(TASK=" + parms.name + ")"; - return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); + return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody); } diff --git a/packages/vsce/src/commands/refreshCommand.ts b/packages/vsce/src/commands/refreshCommand.ts index 6f8f58f5..65952c7d 100644 --- a/packages/vsce/src/commands/refreshCommand.ts +++ b/packages/vsce/src/commands/refreshCommand.ts @@ -11,7 +11,6 @@ import { commands, ProgressLocation, window } from "vscode"; import { CICSTree } from "../trees/CICSTree"; -import { ProfileManagement } from "../utils/profileManagement"; export function getRefreshCommand(tree: CICSTree) { return commands.registerCommand("cics-extension-for-zowe.refreshTree", async () => { @@ -26,8 +25,6 @@ export function getRefreshCommand(tree: CICSTree) { await tree.refreshLoadedProfiles(); } ); - } catch (error) { - console.log(error); } finally { // window.withProgress({ // title: 'Refresh', diff --git a/packages/vsce/src/commands/removeSessionCommand.ts b/packages/vsce/src/commands/removeSessionCommand.ts index ce4542f4..f8a53e45 100644 --- a/packages/vsce/src/commands/removeSessionCommand.ts +++ b/packages/vsce/src/commands/removeSessionCommand.ts @@ -13,6 +13,7 @@ import { commands, ProgressLocation, TreeView, window } from "vscode"; import { CICSSessionTree } from "../trees/CICSSessionTree"; import { CICSTree } from "../trees/CICSTree"; import { findSelectedNodes } from "../utils/commandUtils"; +import constants from "../utils/constants"; export function getRemoveSessionCommand(tree: CICSTree, treeview: TreeView) { return commands.registerCommand("cics-extension-for-zowe.removeSession", async (node) => { @@ -28,13 +29,11 @@ export function getRemoveSessionCommand(tree: CICSTree, treeview: TreeView) cancellable: true, }, async (progress, token) => { - token.onCancellationRequested(() => { - console.log("Cancelling the hide command"); - }); + token.onCancellationRequested(() => { }); for (const index in allSelectedNodes) { progress.report({ message: `Hiding ${parseInt(index) + 1} of ${allSelectedNodes.length}`, - increment: (parseInt(index) / allSelectedNodes.length) * 100, + increment: (parseInt(index) / allSelectedNodes.length) * constants.PERCENTAGE_MAX, }); try { const currentNode = allSelectedNodes[parseInt(index)]; diff --git a/packages/vsce/src/commands/showAttributesCommand.ts b/packages/vsce/src/commands/showAttributesCommand.ts index 78d284c3..11f17670 100644 --- a/packages/vsce/src/commands/showAttributesCommand.ts +++ b/packages/vsce/src/commands/showAttributesCommand.ts @@ -9,7 +9,7 @@ * */ -import { commands, window, WebviewPanel, TreeView } from "vscode"; +import { commands, TreeView, WebviewPanel, window } from "vscode"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { CICSLibraryDatasets } from "../trees/treeItems/CICSLibraryDatasets"; import { CICSLibraryTreeItem } from "../trees/treeItems/CICSLibraryTreeItem"; @@ -17,7 +17,6 @@ import { CICSLocalFileTreeItem } from "../trees/treeItems/CICSLocalFileTreeItem" import { CICSProgramTreeItem } from "../trees/treeItems/CICSProgramTreeItem"; import { CICSTaskTreeItem } from "../trees/treeItems/CICSTaskTreeItem"; import { CICSTransactionTreeItem } from "../trees/treeItems/CICSTransactionTreeItem"; -import { CICSTCPIPServiceTree } from "../trees/treeItems/web/CICSTCPIPServiceTree"; import { CICSPipelineTreeItem } from "../trees/treeItems/web/treeItems/CICSPipelineTreeItem"; import { CICSTCPIPServiceTreeItem } from "../trees/treeItems/web/treeItems/CICSTCPIPServiceTreeItem"; import { CICSURIMapTreeItem } from "../trees/treeItems/web/treeItems/CICSURIMapTreeItem"; @@ -35,8 +34,10 @@ export function getShowProgramAttributesCommand(treeview: TreeView) { for (const programTreeItem of allSelectedNodes) { const program = programTreeItem.program; const attributeHeadings = Object.keys(program); - let webText = `Attribute Value`; - webText += ""; + let webText = ``; + webText += `Attribute `; + webText += `Value`; + webText += ``; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${program[heading]}`; } @@ -65,8 +66,8 @@ export function getShowRegionAttributes(treeview: TreeView) { for (const regionTree of allSelectedNodes) { const region = regionTree.region; const attributeHeadings = Object.keys(region); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${region[heading]}`; } @@ -93,8 +94,8 @@ export function getShowLocalFileAttributesCommand(treeview: TreeView) { for (const localFileTreeItem of allSelectedNodes) { const localFile = localFileTreeItem.localFile; const attributeHeadings = Object.keys(localFile); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${localFile[heading]}`; } @@ -124,8 +125,8 @@ export function getShowTransactionAttributesCommand(treeview: TreeView) { for (const localTransactionTreeItem of allSelectedNodes) { const transaction = localTransactionTreeItem.transaction; const attributeHeadings = Object.keys(transaction); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${transaction[heading]}`; } @@ -156,8 +157,8 @@ export function getShowTaskAttributesCommand(treeview: TreeView) { for (const localTaskTreeItem of allSelectedNodes) { const task = localTaskTreeItem.task; const attributeHeadings = Object.keys(task); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${task[heading]}`; } @@ -184,8 +185,8 @@ export function getShowLibraryAttributesCommand(treeview: TreeView) { for (const libraryTreeItem of allSelectedNodes) { const library = libraryTreeItem.library; const attributeHeadings = Object.keys(library); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${library[heading]}`; } @@ -214,8 +215,8 @@ export function getShowLibraryDatasetsAttributesCommand(treeview: TreeView) for (const datasetTreeItem of allSelectedNodes) { const dataset = datasetTreeItem.dataset; const attributeHeadings = Object.keys(dataset); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${dataset[heading]}`; } @@ -244,8 +245,8 @@ export function getShowTCPIPServiceAttributesCommand(treeview: TreeView) { for (const tcpipsTreeItem of allSelectedNodes) { const tcpips = tcpipsTreeItem.tcpips; const attributeHeadings = Object.keys(tcpips); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${tcpips[heading]}`; } @@ -271,8 +272,8 @@ export function getShowURIMapAttributesCommand(treeview: TreeView) { for (const urimapTreeItem of allSelectedNodes) { const urimap = urimapTreeItem.urimap; const attributeHeadings = Object.keys(urimap); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${urimap[heading]}`; } @@ -298,8 +299,8 @@ export function getShowPipelineAttributesCommand(treeview: TreeView) { for (const pipelineTreeItem of allSelectedNodes) { const pipeline = pipelineTreeItem.pipeline; const attributeHeadings = Object.keys(pipeline); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${pipeline[heading]}`; } @@ -328,8 +329,8 @@ export function getShowWebServiceAttributesCommand(treeview: TreeView) { for (const webServiceTreeItem of allSelectedNodes) { const webService = webServiceTreeItem.webservice; const attributeHeadings = Object.keys(webService); - let webText = `Attribute Value`; - webText += ""; + let webText = `Attribute `; + webText += `Value`; for (const heading of attributeHeadings) { webText += `${heading.toUpperCase()}${webService[heading]}`; } diff --git a/packages/vsce/src/commands/showParameterCommand.ts b/packages/vsce/src/commands/showParameterCommand.ts index 9b53baa0..5baab075 100644 --- a/packages/vsce/src/commands/showParameterCommand.ts +++ b/packages/vsce/src/commands/showParameterCommand.ts @@ -9,10 +9,10 @@ * */ -import { commands, window, WebviewPanel, TreeView } from "vscode"; +import { getResource } from "@zowe/cics-for-zowe-sdk"; +import { commands, TreeView, WebviewPanel, window } from "vscode"; import { CICSRegionTree } from "../trees/CICSRegionTree"; import { findSelectedNodes } from "../utils/commandUtils"; -import { getResource } from "@zowe/cics-for-zowe-sdk"; import { getParametersHtml } from "../utils/webviewHTML"; export function getShowRegionSITParametersCommand(treeview: TreeView) { @@ -34,7 +34,6 @@ export function getShowRegionSITParametersCommand(treeview: TreeView) { cicsPlex: regionTree.parentPlex ? regionTree.parentPlex!.getPlexName() : undefined, parameter: "PARMSRCE(COMBINED) PARMTYPE(SIT)", }); - // let webText = `CICS Name SourceValue`; let webText = `CICS Name Source