Skip to content

Commit daf1aab

Browse files
committed
show program library
Signed-off-by: Andrew Twydell <[email protected]>
1 parent 2e6769b commit daf1aab

File tree

1 file changed

+10
-32
lines changed

1 file changed

+10
-32
lines changed

packages/vsce/src/commands/showLibraryCommand.ts

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -86,42 +86,20 @@ export function showLibraryCommand(tree: CICSTree, treeview: TreeView<any>) {
8686
await treeview.reveal(regionTree, { expand: true });
8787

8888
const libraryTree: CICSResourceContainerNode<ILibrary> = regionTree.children.filter(
89-
(resourceTree: CICSResourceContainerNode<IResource>) => resourceTree.getChildResource().meta === LibraryMeta
89+
(resourceTree: CICSResourceContainerNode<IResource>) => resourceTree.resourceTypes.includes(LibraryMeta)
9090
)[0] as CICSResourceContainerNode<ILibrary>;
9191

92-
//clearing the previous filter and description
93-
libraryTree.clearFilter();
94-
libraryTree.description = "";
95-
libraryTree.children = [];
96-
libraryTree.refreshingDescription = false;
97-
libraryTree.getChildResource().resources.resetCriteria();
98-
libraryTree.getChildResource().resources.resources = [];
99-
92+
libraryTree.clearCriteria();
93+
libraryTree.getFetcher().reset();
94+
libraryTree.setCriteria([...libraries.keys()]);
10095
await treeview.reveal(libraryTree, { expand: true });
10196

102-
libraryTree.setFilter([...libraries.keys()]);
103-
libraryTree.description = [...libraries.keys()].join(" OR ");
104-
libraryTree.refreshingDescription = false;
105-
const libraryNodes = await libraryTree.getChildren();
106-
107-
const libArray: CICSResourceContainerNode<IResource>[] = [];
108-
//setting the filter and description for each library node
109-
for (const child of libraryNodes) {
110-
111-
const libNode = child as CICSResourceContainerNode<ILibraryDataset>;
112-
if (
113-
libNode.getChildResource().meta.resourceName === CicsCmciConstants.CICS_LIBRARY_DATASET_RESOURCE &&
114-
libraries.has(libNode.getContainedResourceName()) &&
115-
libraries.get(libNode.getContainedResourceName())!.size > 0
116-
) {
117-
libNode.setFilter([...libraries.get(libNode.getContainedResourceName())]);
118-
libNode.description = [...libraries.get(libNode.getContainedResourceName())].join(" OR ");
119-
libArray.push(libNode);
120-
libNode.refreshingDescription = false;
121-
}
122-
}
123-
for (const lib of libArray) {
124-
await treeview.reveal(lib, { expand: true });
97+
for (const child of libraryTree.children) {
98+
const crit = [...libraries.get((child as CICSResourceContainerNode<ILibrary>).getContainedResourceName())];
99+
(child as CICSResourceContainerNode<ILibrary>).clearCriteria();
100+
(child as CICSResourceContainerNode<ILibrary>).getFetcher().reset();
101+
(child as CICSResourceContainerNode<ILibrary>).setCriteria(crit);
102+
await treeview.reveal(child, { expand: true });
125103
}
126104
}
127105
});

0 commit comments

Comments
 (0)