diff --git a/packages/vsce/package.json b/packages/vsce/package.json index 3600582..dad7972 100644 --- a/packages/vsce/package.json +++ b/packages/vsce/package.json @@ -337,7 +337,14 @@ { "command": "cics-extension-for-zowe.showRegionParameters", "title": "Show SIT Parameters", - "category": "IBM CICS for Zowe Explorer" + "category": "IBM CICS for Zowe Explorer", + "enablement": "true" + }, + { + "command": "cics-extension-for-zowe.showRegionParametersInactive", + "title": "Show SIT Parameters", + "category": "IBM CICS for Zowe Explorer", + "enablement": "false" }, { "command": "cics-extension-for-zowe.enableProgram", @@ -464,10 +471,15 @@ "group": "" }, { - "when": "view == cics-view && viewItem =~ /^cicsregion\\./", + "when": "view == cics-view && viewItem =~ /^cicsregion\\..*\\.active/", "command": "cics-extension-for-zowe.showRegionParameters", "group": "" }, + { + "when": "view == cics-view && viewItem =~ /^cicsregion\\..*\\.inactive.*/", + "command": "cics-extension-for-zowe.showRegionParametersInactive", + "group": "" + }, { "when": "view == cics-view && viewItem =~ /^cicstreeprogram.*/", "command": "cics-extension-for-zowe.filterPrograms", diff --git a/packages/vsce/src/commands/showParameterCommand.ts b/packages/vsce/src/commands/showParameterCommand.ts index a4f9fb8..9b53baa 100644 --- a/packages/vsce/src/commands/showParameterCommand.ts +++ b/packages/vsce/src/commands/showParameterCommand.ts @@ -23,6 +23,11 @@ export function getShowRegionSITParametersCommand(treeview: TreeView) { return; } for (const regionTree of allSelectedNodes) { + if (regionTree.contextValue.includes(".inactive")) { + // Ignore region if not active - required for the command palette. + continue; + } + const db2transactionResponse = await getResource(regionTree.parentSession.session, { name: "CICSSystemParameter", regionName: regionTree.label, diff --git a/packages/vsce/src/trees/CICSRegionTree.ts b/packages/vsce/src/trees/CICSRegionTree.ts index b6741f1..5889871 100644 --- a/packages/vsce/src/trees/CICSRegionTree.ts +++ b/packages/vsce/src/trees/CICSRegionTree.ts @@ -55,7 +55,9 @@ export class CICSRegionTree extends TreeItem { this.children = null; this.collapsibleState = TreeItemCollapsibleState.None; this.iconPath = getIconPathInResources("region-dark-disabled.svg", "region-light-disabled.svg"); + this.contextValue += ".inactive"; } else { + this.contextValue += ".active"; this.children = [ new CICSProgramTree(this), new CICSTransactionTree(this),