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

Commit

Permalink
Update plex icon
Browse files Browse the repository at this point in the history
Signed-off-by: JeffinSiby <[email protected]>
  • Loading branch information
JeffinSiby committed Dec 13, 2021
1 parent 807d4b3 commit c27d08d
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 33 deletions.
12 changes: 12 additions & 0 deletions resources/imgs/cics-plex-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions resources/imgs/cics-plex-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 39 additions & 33 deletions src/trees/CICSPlexTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class CICSPlexTree extends TreeItem {
plexName: string,
profile: IProfileLoaded,
sessionTree: CICSSessionTree,
public readonly iconPath = getIconPathInResources("list-dark.svg", "list-light.svg")
public readonly iconPath = getIconPathInResources("cics-plex-dark.svg", "cics-plex-light.svg")
) {
super(plexName, TreeItemCollapsibleState.Collapsed);
this.plexName = plexName;
Expand Down Expand Up @@ -63,38 +63,44 @@ export class CICSPlexTree extends TreeItem {
this.addRegion(newRegionTree);
}

// Store all filters on children resources
public findResourceFilters() {
for (const region of this.children) {
if (region instanceof CICSRegionTree) {
if (region.children) {
for (const resourceTree of region.children) {
const filter = resourceTree.getFilter();
if (filter) {
this.resourceFilters[region.getRegionName()] = {[resourceTree.label!.toString().split(' ')[0]]: filter};
}
}
}
}
}
}

public async reapplyFilter() {/////////////////
for (const region of this.children) {
if (region instanceof CICSRegionTree) {
const resourceFilters = this.getResourceFilter(region.getRegionName());
if (resourceFilters) {
for (const resourceTree of region.children!) {
if (resourceFilters[resourceTree.label!.toString().split(' ')[0]]) {
resourceTree.setFilter(resourceFilters[resourceTree.label!.toString()]);
await resourceTree.loadContents();
resourceTree.collapsibleState = TreeItemCollapsibleState.Expanded;
}
}
}
}
}
}
// // Store all filters on children resources
// public findResourceFilters() {
// const regionsContainer = this.children.filter(child => child instanceof CICSRegionsContainer)[0];
// if (regionsContainer){
// for (const region of regionsContainer.getChildren()!) {
// if (region instanceof CICSRegionTree) {
// if (region.children) {
// for (const resourceTree of region.children) {
// const filter = resourceTree.getFilter();
// if (filter) {
// this.resourceFilters[region.getRegionName()] = {[resourceTree.label!.toString().split(' ')[0]]: filter};
// } else {
// this.resourceFilters[region.getRegionName()] = {[resourceTree.label!.toString().split(' ')[0]]: undefined};
// }
// }
// }
// }
// }
// }
// }

// public async reapplyFilter() {
// const regionsContainer = this.children.filter(child => child instanceof CICSRegionsContainer)[0];
// for (const region of regionsContainer.getChildren()!) {
// if (region instanceof CICSRegionTree) {
// const resourceFilters = this.getResourceFilter(region.getRegionName());
// if (resourceFilters) {
// for (const resourceTree of region.children!) {
// if (resourceFilters[resourceTree.label!.toString().split(' ')[0]]) {
// resourceTree.setFilter(resourceFilters[resourceTree.label!.toString()]);
// await resourceTree.loadContents();
// resourceTree.collapsibleState = TreeItemCollapsibleState.Expanded;
// }
// }
// }
// }
// }
// }

public getResourceFilter(regionName: string) {
return this.resourceFilters[regionName];
Expand Down

0 comments on commit c27d08d

Please sign in to comment.