diff --git a/packages/vsce/CHANGELOG.md b/packages/vsce/CHANGELOG.md index 514af355..abea6a28 100644 --- a/packages/vsce/CHANGELOG.md +++ b/packages/vsce/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to the "cics-extension-for-zowe" extension will be documented in this file. +## Recent Changes +- BugFix: Remove the 'Show SIT Parameters' menu option when a region is inactive. [#167](https://github.com/zowe/cics-for-zowe-client/issues/167) + ## `3.2.0` - BugFix: Initializing new Team Configuration File. [#33](https://github.com/zowe/cics-for-zowe-client/issues/33) diff --git a/packages/vsce/package.json b/packages/vsce/package.json index 36005821..fd560ab0 100644 --- a/packages/vsce/package.json +++ b/packages/vsce/package.json @@ -464,7 +464,7 @@ "group": "" }, { - "when": "view == cics-view && viewItem =~ /^cicsregion\\./", + "when": "view == cics-view && viewItem =~ /cicsregion.*\\.active/", "command": "cics-extension-for-zowe.showRegionParameters", "group": "" }, diff --git a/packages/vsce/src/commands/showParameterCommand.ts b/packages/vsce/src/commands/showParameterCommand.ts index a4f9fb82..9b53baa0 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 b6741f1b..5889871e 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),