Skip to content

Commit

Permalink
Now greying out the sit param menu item of region is inactive
Browse files Browse the repository at this point in the history
Signed-off-by: EKhan <[email protected]>
  • Loading branch information
enamkhan committed Dec 20, 2024
1 parent 39222b3 commit d768295
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/vsce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
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 d768295

Please sign in to comment.