Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #138 from zowe/all-resource-under-plex-updated
Browse files Browse the repository at this point in the history
All resource under plex updated
  • Loading branch information
JeffinSiby committed Dec 7, 2021
2 parents a23cd22 + 8b24b9b commit 66b5d0b
Show file tree
Hide file tree
Showing 36 changed files with 1,259 additions and 108 deletions.
66 changes: 66 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,33 @@
"dark": "resources/imgs/filter-light.svg"
}
},
{
"command": "cics-extension-for-zowe.filterAllPrograms",
"title": "Filter All Programs",
"category": "Zowe Explorer for IBM CICS",
"icon": {
"light": "resources/imgs/filter-dark.svg",
"dark": "resources/imgs/filter-light.svg"
}
},
{
"command": "cics-extension-for-zowe.filterAllTransactions",
"title": "Filter All Transactions",
"category": "Zowe Explorer for IBM CICS",
"icon": {
"light": "resources/imgs/filter-dark.svg",
"dark": "resources/imgs/filter-light.svg"
}
},
{
"command": "cics-extension-for-zowe.filterAllLocalFiles",
"title": "Filter All Local Files",
"category": "Zowe Explorer for IBM CICS",
"icon": {
"light": "resources/imgs/filter-dark.svg",
"dark": "resources/imgs/filter-light.svg"
}
},
{
"command": "cics-extension-for-zowe.clearFilter",
"title": "Clear Filter",
Expand All @@ -115,6 +142,15 @@
"dark": "resources/imgs/clear-filter-light.svg"
}
},
{
"command": "cics-extension-for-zowe.clearCombinedResourcesFilter",
"title": "Clear Combined tree Filter",
"category": "Zowe Explorer for IBM CICS",
"icon": {
"light": "resources/imgs/clear-filter-dark.svg",
"dark": "resources/imgs/clear-filter-light.svg"
}
},
{
"command": "cics-extension-for-zowe.clearPlexFilter",
"title": "Clear Plex Filter",
Expand Down Expand Up @@ -268,6 +304,21 @@
"command": "cics-extension-for-zowe.clearFilter",
"group": "inline"
},
{
"when": "view == cics-view && viewItem =~ /^cicscombinedlocalfiletree.filtered.*/",
"command": "cics-extension-for-zowe.clearCombinedResourcesFilter",
"group": "inline"
},
{
"when": "view == cics-view && viewItem =~ /^cicscombinedprogramtree.filtered.*/",
"command": "cics-extension-for-zowe.clearCombinedResourcesFilter",
"group": "inline"
},
{
"when": "view == cics-view && viewItem =~ /^cicscombinedtransactiontree.filtered.*/",
"command": "cics-extension-for-zowe.clearCombinedResourcesFilter",
"group": "inline"
},
{
"when": "view == cics-view && viewItem =~ /^cicstreetransaction.*/",
"command": "cics-extension-for-zowe.filterTransactions",
Expand All @@ -283,6 +334,21 @@
"command": "cics-extension-for-zowe.filterPlexResources",
"group": "inline"
},
{
"when": "view == cics-view && viewItem =~ /^cicscombinedprogramtree.*/",
"command": "cics-extension-for-zowe.filterAllPrograms",
"group": "inline"
},
{
"when": "view == cics-view && viewItem =~ /^cicscombinedtransactiontree.*/",
"command": "cics-extension-for-zowe.filterAllTransactions",
"group": "inline"
},
{
"when": "view == cics-view && viewItem =~ /^cicscombinedlocalfiletree.*/",
"command": "cics-extension-for-zowe.filterAllLocalFiles",
"group": "inline"
},
{
"when": "view == cics-view && viewItem =~ /^cicsplex.*/",
"command": "cics-extension-for-zowe.clearPlexFilter",
Expand Down
29 changes: 29 additions & 0 deletions src/commands/clearCombinedResourcesFilterCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/

import { commands, window } from "vscode";
import { CICSTree } from "../trees/CICSTree";

export function getClearCombinedResourcesFilterCommand(tree: CICSTree) {
return commands.registerCommand(
"cics-extension-for-zowe.clearCombinedResourcesFilter",
async (node) => {
if (node) {
node.clearFilter();
await node.loadContents(tree);
tree._onDidChangeTreeData.fire(undefined);

} else {
window.showErrorMessage("No CICS tree selected");
}
}
);
}
45 changes: 25 additions & 20 deletions src/commands/clearPlexFilterCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

import { commands, window } from "vscode";
import { CICSRegionTree } from "../trees/CICSRegionTree";
import { CICSTree } from "../trees/CICSTree";

export function getClearPlexFilterCommand(tree: CICSTree) {
Expand All @@ -28,28 +29,32 @@ export function getClearPlexFilterCommand(tree: CICSTree) {
node.filterRegions("*", tree);
}
if (resourceToClear !== "Regions") {
for (const region of node.children){
if (region.getIsActive()){
let treeToClear;
if (resourceToClear === "Programs"){
treeToClear = region.children.filter((child: any) => child.contextValue.includes("cicstreeprogram."))[0];
treeToClear.clearFilter();
await treeToClear.loadContents();
} else if (resourceToClear === "Local Transactions"){
treeToClear = region.children.filter((child: any) => child.contextValue.includes("cicstreetransaction."))[0];
treeToClear.clearFilter();
await treeToClear.loadContents();
} else if (resourceToClear === "Local Files"){
treeToClear = region.children.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0];
treeToClear.clearFilter();
await treeToClear.loadContents();
} else if (resourceToClear === "All"){
for (const child of region.children){
child.clearFilter();
await child.loadContents();
for (const region of node.children) {
if (region instanceof CICSRegionTree) {
if (region.getIsActive()){
if (region.children) {
let treeToClear;
if (resourceToClear === "Programs"){
treeToClear = region.children.filter((child: any) => child.contextValue.includes("cicstreeprogram."))[0];
treeToClear.clearFilter();
await treeToClear.loadContents();
} else if (resourceToClear === "Local Transactions"){
treeToClear = region.children.filter((child: any) => child.contextValue.includes("cicstreetransaction."))[0];
treeToClear.clearFilter();
await treeToClear.loadContents();
} else if (resourceToClear === "Local Files"){
treeToClear = region.children.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0];
treeToClear.clearFilter();
await treeToClear.loadContents();
} else if (resourceToClear === "All"){
for (const child of region.children){
child.clearFilter();
await child.loadContents();
}
}
}
}
}
}

}
}
Expand Down
14 changes: 12 additions & 2 deletions src/commands/closeLocalFileCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,18 @@ export function getCloseLocalFileCommand(tree: CICSTree, treeview: TreeView<any>
}
}
for (const parentRegion of parentRegions) {
const programTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0];
await programTree.loadContents();
const localFileTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0];
// Only load contents if the tree is expanded
if (localFileTree.collapsibleState === 2) {
await localFileTree.loadContents();
}
if (parentRegion.parentPlex) {
const allLocalFileTreeTree = parentRegion.parentPlex.children!.filter((child: any) => child.contextValue.includes("cicscombinedlocalfiletree."))[0];
if (allLocalFileTreeTree.collapsibleState === 2) {
//@ts-ignore
await allLocalFileTreeTree.loadContents(tree);
}
}
}
tree._onDidChangeTreeData.fire(undefined);
});
Expand Down
14 changes: 12 additions & 2 deletions src/commands/disableLocalFileCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,18 @@ export function getDisableLocalFileCommand(tree: CICSTree, treeview: TreeView<an
}
}
for (const parentRegion of parentRegions) {
const programTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0];
await programTree.loadContents();
const localFileTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0];
// Only load contents if the tree is expanded
if (localFileTree.collapsibleState === 2) {
await localFileTree.loadContents();
}
if (parentRegion.parentPlex) {
const allLocalFileTreeTree = parentRegion.parentPlex.children!.filter((child: any) => child.contextValue.includes("cicscombinedlocalfiletree."))[0];
if (allLocalFileTreeTree.collapsibleState === 2) {
//@ts-ignore
await allLocalFileTreeTree.loadContents(tree);
}
}
}
tree._onDidChangeTreeData.fire(undefined);
});
Expand Down
12 changes: 11 additions & 1 deletion src/commands/disableProgramCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ export function getDisableProgramCommand(tree: CICSTree, treeview: TreeView<any>
}
for (const parentRegion of parentRegions) {
const programTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreeprogram."))[0];
await programTree.loadContents();
// Only load contents if the tree is expanded
if (programTree.collapsibleState === 2) {
await programTree.loadContents();
}
if (parentRegion.parentPlex) {
const allProgramsTree = parentRegion.parentPlex!.children!.filter((child: any) => child.contextValue.includes("cicscombinedprogramtree."))[0];
if (allProgramsTree.collapsibleState === 2) {
//@ts-ignore
await allProgramsTree.loadContents(tree);
}
}
}
tree._onDidChangeTreeData.fire(undefined);
});
Expand Down
14 changes: 12 additions & 2 deletions src/commands/disableTransactionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,18 @@ export function getDisableTransactionCommand(tree: CICSTree, treeview: TreeView<
}
}
for (const parentRegion of parentRegions) {
const programTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreetransaction."))[0];
await programTree.loadContents();
const transactionTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreetransaction."))[0];
// Only load contents if the tree is expanded
if (transactionTree.collapsibleState === 2) {
await transactionTree.loadContents();
}
if (parentRegion.parentPlex) {
const allTransactionTree = parentRegion.parentPlex.children!.filter((child: any) => child.contextValue.includes("cicscombinedtransactiontree."))[0];
if (allTransactionTree.collapsibleState === 2) {
//@ts-ignore
await allTransactionTree.loadContents(tree);
}
}
}
tree._onDidChangeTreeData.fire(undefined);
});
Expand Down
14 changes: 12 additions & 2 deletions src/commands/enableLocalFileCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,18 @@ export function getEnableLocalFileCommand(tree: CICSTree, treeview: TreeView<any
}
}
for (const parentRegion of parentRegions) {
const programTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0];
await programTree.loadContents();
const localFileTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreelocalfile."))[0];
// Only load contents if the tree is expanded
if (localFileTree.collapsibleState === 2) {
await localFileTree.loadContents();
}
if (parentRegion.parentPlex) {
const allLocalFileTreeTree = parentRegion.parentPlex.children!.filter((child: any) => child.contextValue.includes("cicscombinedlocalfiletree."))[0];
if (allLocalFileTreeTree.collapsibleState === 2) {
//@ts-ignore
await allLocalFileTreeTree.loadContents(tree);
}
}
}
tree._onDidChangeTreeData.fire(undefined);
});
Expand Down
12 changes: 11 additions & 1 deletion src/commands/enableProgramCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ export function getEnableProgramCommand(tree: CICSTree, treeview: TreeView<any>)
}
for (const parentRegion of parentRegions) {
const programTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreeprogram."))[0];
await programTree.loadContents();
// Only load contents if the tree is expanded
if (programTree.collapsibleState === 2) {
await programTree.loadContents();
}
if (parentRegion.parentPlex) {
const allProgramsTree = parentRegion.parentPlex!.children!.filter((child: any) => child.contextValue.includes("cicscombinedprogramtree."))[0];
if (allProgramsTree.collapsibleState === 2) {
//@ts-ignore
await allProgramsTree.loadContents(tree);
}
}
}
tree._onDidChangeTreeData.fire(undefined);
});
Expand Down
14 changes: 12 additions & 2 deletions src/commands/enableTransactionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,18 @@ export function getEnableTransactionCommand(tree: CICSTree, treeview: TreeView<a
}
}
for (const parentRegion of parentRegions) {
const programTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreetransaction."))[0];
await programTree.loadContents();
const transactionTree = parentRegion.children!.filter((child: any) => child.contextValue.includes("cicstreetransaction."))[0];
// Only load contents if the tree is expanded
if (transactionTree.collapsibleState === 2) {
await transactionTree.loadContents();
}
if (parentRegion.parentPlex) {
const allTransactionTree = parentRegion.parentPlex.children!.filter((child: any) => child.contextValue.includes("cicscombinedtransactiontree."))[0];
if (allTransactionTree.collapsibleState === 2) {
//@ts-ignore
await allTransactionTree.loadContents(tree);
}
}
}
tree._onDidChangeTreeData.fire(undefined);
});
Expand Down

0 comments on commit 66b5d0b

Please sign in to comment.