Skip to content

Commit

Permalink
Merge pull request #183 from zowe/sitMenuEnablement
Browse files Browse the repository at this point in the history
Remove the sit param menu option when a region is inactive
  • Loading branch information
zFernand0 authored Jan 6, 2025
2 parents 179da6b + 40e861b commit e911a64
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/vsce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/vsce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
},
Expand Down
5 changes: 5 additions & 0 deletions packages/vsce/src/commands/showParameterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export function getShowRegionSITParametersCommand(treeview: TreeView<any>) {
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,
Expand Down
2 changes: 2 additions & 0 deletions packages/vsce/src/trees/CICSRegionTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit e911a64

Please sign in to comment.