Skip to content

Commit

Permalink
lint warning fixes - not complete
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Twydell <[email protected]>
  • Loading branch information
AndrewTwydell committed Jan 7, 2025
1 parent 9eb3621 commit bda99b5
Show file tree
Hide file tree
Showing 40 changed files with 458 additions and 500 deletions.
3 changes: 2 additions & 1 deletion packages/sdk/__tests__/__unit__/utils/Utils.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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*))");
});
});
Expand Down
10 changes: 4 additions & 6 deletions packages/vsce/src/commands/clearResourceFilterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
return commands.registerCommand("cics-extension-for-zowe.clearFilter", async (node) => {
Expand Down Expand Up @@ -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);
}
Expand Down
24 changes: 11 additions & 13 deletions packages/vsce/src/commands/closeLocalFileCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
return commands.registerCommand("cics-extension-for-zowe.closeLocalFile", async (clickedNode) => {
Expand All @@ -42,13 +43,11 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView<any>
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)];

Expand All @@ -73,11 +72,10 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView<any>
// @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 {
Expand Down Expand Up @@ -122,9 +120,9 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView<any>
});
}

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<ICMCIApiResponse> {
const requestBody: any = {
Expand Down Expand Up @@ -156,5 +154,5 @@ async function closeLocalFile(
parms.name +
")";

return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
return commands.registerCommand("cics-extension-for-zowe.disableLocalFile", async (clickedNode) => {
Expand All @@ -42,13 +43,11 @@ export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView<an
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)];

Expand Down Expand Up @@ -110,9 +109,9 @@ export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView<an
});
}

async function disableLocalFile(
function disableLocalFile(
session: imperative.AbstractSession,
parms: { name: string; regionName: string; cicsPlex: string },
parms: { name: string; regionName: string; cicsPlex: string; },
busyDecision: string
): Promise<ICMCIApiResponse> {
const requestBody: any = {
Expand Down Expand Up @@ -145,5 +144,5 @@ async function disableLocalFile(
")"; //+
//"&PARAMETER=('BUSY(WAIT).')";

return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -40,13 +41,11 @@ export function getDisableProgramCommand(tree: CICSTree, treeview: TreeView<any>
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)];

Expand Down Expand Up @@ -105,7 +104,9 @@ export function getDisableProgramCommand(tree: CICSTree, treeview: TreeView<any>
});
}

function disableProgram(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise<ICMCIApiResponse> {
function disableProgram(
session: imperative.AbstractSession,
parms: { name: string; regionName: string; cicsPlex: string; }): Promise<ICMCIApiResponse> {
const requestBody: any = {
request: {
action: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
return commands.registerCommand("cics-extension-for-zowe.disableTransaction", async (clickedNode) => {
Expand All @@ -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)];

Expand All @@ -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 {
Expand Down Expand Up @@ -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<ICMCIApiResponse> {
const requestBody: any = {
request: {
Expand All @@ -136,5 +134,5 @@ async function disableTransaction(
"?CRITERIA=(TRANID=" +
parms.name +
")";
return await CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
return CicsCmciRestClient.putExpectParsedXml(session, cmciResource, [], requestBody);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
return commands.registerCommand("cics-extension-for-zowe.enableLocalFile", async (clickedNode) => {
Expand All @@ -35,13 +36,11 @@ export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView<any
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)];

Expand Down Expand Up @@ -99,7 +98,9 @@ export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView<any
});
}

async function enableLocalFile(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise<ICMCIApiResponse> {
function enableLocalFile(
session: imperative.AbstractSession,
parms: { name: string; regionName: string; cicsPlex: string; }): Promise<ICMCIApiResponse> {
const requestBody: any = {
request: {
action: {
Expand All @@ -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);
}
19 changes: 10 additions & 9 deletions packages/vsce/src/commands/enableCommands/enableProgramCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -40,13 +41,11 @@ export function getEnableProgramCommand(tree: CICSTree, treeview: TreeView<any>)
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)];

Expand Down Expand Up @@ -104,7 +103,9 @@ export function getEnableProgramCommand(tree: CICSTree, treeview: TreeView<any>)
});
}

async function enableProgram(session: imperative.AbstractSession, parms: { name: string; regionName: string; cicsPlex: string }): Promise<ICMCIApiResponse> {
function enableProgram(
session: imperative.AbstractSession,
parms: { name: string; regionName: string; cicsPlex: string; }): Promise<ICMCIApiResponse> {
const requestBody: any = {
request: {
action: {
Expand All @@ -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);
}
Loading

0 comments on commit bda99b5

Please sign in to comment.