Skip to content

Commit

Permalink
region icons update when expanded, global getIconOpen method
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Twydell <[email protected]>
  • Loading branch information
AndrewTwydell committed Jan 7, 2025
1 parent 0cdc45d commit 82041af
Show file tree
Hide file tree
Showing 25 changed files with 129 additions and 124 deletions.
9 changes: 5 additions & 4 deletions packages/vsce/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Change Log

All notable changes to the "cics-extension-for-zowe" extension will be documented in this file.
## `3.2.3`

- Changed icons for: folder, local file, local transaction, program and task. Updated 16 icons for different status and themes. [#182](https://github.com/zowe/cics-for-zowe-client/pull/182)


## Recent Changes

- BugFix: Updated commands to use Utils.getResourceURI. [#178](https://github.com/zowe/cics-for-zowe-client/issues/178)
- BugFix: Regions icon updates when plex tree is expanded. [#194](https://github.com/zowe/cics-for-zowe-client/issues/194)

## `3.2.3`

- Changed icons for: folder, local file, local transaction, program and task. Updated 16 icons for different status and themes. [#182](https://github.com/zowe/cics-for-zowe-client/pull/182)

## `3.2.2`

Expand Down
74 changes: 30 additions & 44 deletions packages/vsce/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import {
getFilterAllPipelinesCommand,
getFilterAllWebServicesCommand,
} from "./commands/filterAllResourceCommand";
import { getIconPathInResources, setIconClosed } from "./utils/profileUtils";
import { getIconOpen, getIconPathInResources } from "./utils/profileUtils";
import { plexExpansionHandler, sessionExpansionHandler, regionContainerExpansionHandler } from "./utils/expansionHandler";
import { getZoweExplorerVersion } from "./utils/workspaceUtils";

Expand Down Expand Up @@ -425,57 +425,43 @@ export async function activate(context: ExtensionContext) {

// Regions container folder node expanded
} else if (node.element.contextValue.includes("cicsregionscontainer.")) {
node.element.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
node.element.iconPath = getIconOpen(true);
await regionContainerExpansionHandler(node.element, treeDataProv);
treeDataProv._onDidChangeTreeData.fire(undefined);
}
});

treeview.onDidCollapseElement((node) => {
if (node.element.contextValue.includes("cicsregionscontainer.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedprogramtree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedtransactiontree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedlocalfiletree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedtasktree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedlibrarytree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedtcpipstree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedurimapstree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedpipelinetree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicscombinedwebservicetree.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreeprogram.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreetransaction.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreelocalfile.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreetask.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreelibrary.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicslibrary.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreeweb.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreetcpips.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreepipeline.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreewebservice.")) {
setIconClosed(node, treeDataProv);
} else if (node.element.contextValue.includes("cicstreeurimaps.")) {
setIconClosed(node, treeDataProv);

const interestedContextValues = [
"cicsregionscontainer.",
"cicscombinedprogramtree.",
"cicscombinedtransactiontree.",
"cicscombinedlocalfiletree.",
"cicscombinedtasktree.",
"cicscombinedlibrarytree.",
"cicscombinedtcpipstree.",
"cicscombinedurimapstree.",
"cicscombinedpipelinetree.",
"cicscombinedwebservicetree.",
"cicstreeprogram.",
"cicstreetransaction.",
"cicstreelocalfile.",
"cicstreetask.",
"cicstreelibrary.",
"cicslibrary.",
"cicstreeweb.",
"cicstreetcpips.",
"cicstreepipeline.",
"cicstreewebservice.",
"cicstreeurimaps.",
];

if (interestedContextValues.some(item => node.element.contextValue.includes(item))) {
node.element.iconPath = getIconOpen(false);
}
node.element.collapsibleState = TreeItemCollapsibleState.Collapsed;
treeDataProv._onDidChangeTreeData.fire(undefined);
});

context.subscriptions.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ViewMore } from "../treeItems/utils/ViewMore";
import { toEscapedCriteriaString } from "../../utils/filterUtils";
import { CICSRegionsContainer } from "../CICSRegionsContainer";
import { TextTreeItem } from "../treeItems/utils/TextTreeItem";
import { getIconPathInResources } from "../../utils/profileUtils";
import { getIconOpen } from "../../utils/profileUtils";

export class CICSCombinedLibraryTree extends TreeItem {
children: (CICSLibraryTreeItem | ViewMore)[] | [TextTreeItem] | null;
Expand All @@ -29,7 +29,7 @@ export class CICSCombinedLibraryTree extends TreeItem {
incrementCount: number;
constant: string;

constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) {
constructor(parentPlex: CICSPlexTree, public iconPath = getIconOpen(false)) {
super("All Libraries", TreeItemCollapsibleState.Collapsed);
this.contextValue = `cicscombinedlibrarytree.`;
this.parentPlex = parentPlex;
Expand Down Expand Up @@ -87,11 +87,11 @@ export class CICSCombinedLibraryTree extends TreeItem {
count = parseInt(recordsCount);
}
this.addLibrariesUtil([], allLibraries, count);
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
} else {
this.children = [];
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
window.showInformationMessage(`No libraries found`);
this.label = `All Libraries${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${recordsCount}]`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { CICSLocalFileTreeItem } from "../treeItems/CICSLocalFileTreeItem";
import { toEscapedCriteriaString } from "../../utils/filterUtils";
import { CICSRegionsContainer } from "../CICSRegionsContainer";
import { TextTreeItem } from "../treeItems/utils/TextTreeItem";
import { getIconPathInResources } from "../../utils/profileUtils";
import { getIconOpen } from "../../utils/profileUtils";

export class CICSCombinedLocalFileTree extends TreeItem {
children: (CICSLocalFileTreeItem | ViewMore)[] | [TextTreeItem] | null;
Expand All @@ -29,7 +29,7 @@ export class CICSCombinedLocalFileTree extends TreeItem {
incrementCount: number;
constant: string;

constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) {
constructor(parentPlex: CICSPlexTree, public iconPath = getIconOpen(false)) {
super("All Local Files", TreeItemCollapsibleState.Collapsed);
this.contextValue = `cicscombinedlocalfiletree.`;
this.parentPlex = parentPlex;
Expand Down Expand Up @@ -87,11 +87,11 @@ export class CICSCombinedLocalFileTree extends TreeItem {
count = parseInt(recordsCount);
}
this.addLocalFilesUtil([], allLocalFiles, count);
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
} else {
this.children = [];
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
window.showInformationMessage(`No local files found`);
this.label = `All Local Files${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${recordsCount}]`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ViewMore } from "../treeItems/utils/ViewMore";
import { toEscapedCriteriaString } from "../../utils/filterUtils";
import { CICSRegionsContainer } from "../CICSRegionsContainer";
import { TextTreeItem } from "../treeItems/utils/TextTreeItem";
import { getIconPathInResources } from "../../utils/profileUtils";
import { getIconOpen } from "../../utils/profileUtils";
import { CICSPipelineTreeItem } from "../treeItems/web/treeItems/CICSPipelineTreeItem";

export class CICSCombinedPipelineTree extends TreeItem {
Expand All @@ -29,7 +29,7 @@ export class CICSCombinedPipelineTree extends TreeItem {
incrementCount: number;
constant: string;

constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) {
constructor(parentPlex: CICSPlexTree, public iconPath = getIconOpen(false)) {
super("All Pipelines", TreeItemCollapsibleState.Collapsed);
this.contextValue = `cicscombinedpipelinetree.`;
this.parentPlex = parentPlex;
Expand Down Expand Up @@ -87,11 +87,11 @@ export class CICSCombinedPipelineTree extends TreeItem {
count = parseInt(recordsCount);
}
this.addPipelinesUtil([], allPipelines, count);
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
} else {
this.children = [];
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
window.showInformationMessage(`No pipelines found`);
this.label = `All Pipelines${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${recordsCount}]`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { CicsCmciConstants } from "@zowe/cics-for-zowe-sdk";
import { toEscapedCriteriaString } from "../../utils/filterUtils";
import { CICSRegionsContainer } from "../CICSRegionsContainer";
import { TextTreeItem } from "../treeItems/utils/TextTreeItem";
import { getIconPathInResources } from "../../utils/profileUtils";
import { getIconOpen } from "../../utils/profileUtils";

export class CICSCombinedProgramTree extends TreeItem {
children: (CICSProgramTreeItem | ViewMore)[] | [TextTreeItem] | null;
Expand All @@ -30,7 +30,7 @@ export class CICSCombinedProgramTree extends TreeItem {
incrementCount: number;
constant: string;

constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) {
constructor(parentPlex: CICSPlexTree, public iconPath = getIconOpen(false)) {
super("All Programs", TreeItemCollapsibleState.Collapsed);
this.contextValue = `cicscombinedprogramtree.`;
this.parentPlex = parentPlex;
Expand Down Expand Up @@ -88,11 +88,11 @@ export class CICSCombinedProgramTree extends TreeItem {
count = parseInt(recordsCount);
}
this.addProgramsUtil([], allPrograms, count);
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
} else {
this.children = [];
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
window.showInformationMessage(`No programs found`);
this.label = `All Programs${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${recordsCount}]`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ViewMore } from "../treeItems/utils/ViewMore";
import { toEscapedCriteriaString } from "../../utils/filterUtils";
import { CICSRegionsContainer } from "../CICSRegionsContainer";
import { TextTreeItem } from "../treeItems/utils/TextTreeItem";
import { getIconPathInResources } from "../../utils/profileUtils";
import { getIconOpen } from "../../utils/profileUtils";

export class CICSCombinedTCPIPServiceTree extends TreeItem {
children: (CICSTCPIPServiceTreeItem | ViewMore)[] | [TextTreeItem] | null;
Expand All @@ -29,7 +29,7 @@ export class CICSCombinedTCPIPServiceTree extends TreeItem {
incrementCount: number;
constant: string;

constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) {
constructor(parentPlex: CICSPlexTree, public iconPath = getIconOpen(false)) {
super("All TCPIP Services", TreeItemCollapsibleState.Collapsed);
this.contextValue = `cicscombinedtcpipstree.`;
this.parentPlex = parentPlex;
Expand Down Expand Up @@ -87,11 +87,11 @@ export class CICSCombinedTCPIPServiceTree extends TreeItem {
count = parseInt(recordsCount);
}
this.addTCPIPSUtil([], allTCPIPS, count);
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
} else {
this.children = [];
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
window.showInformationMessage(`No TCPIP Services found`);
this.label = `All TCPIP Services${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${recordsCount}]`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ViewMore } from "../treeItems/utils/ViewMore";
import { toEscapedCriteriaString } from "../../utils/filterUtils";
import { CICSRegionsContainer } from "../CICSRegionsContainer";
import { TextTreeItem } from "../treeItems/utils/TextTreeItem";
import { getIconPathInResources } from "../../utils/profileUtils";
import { getIconOpen } from "../../utils/profileUtils";
import { CICSTaskTreeItem } from "../treeItems/CICSTaskTreeItem";

export class CICSCombinedTaskTree extends TreeItem {
Expand All @@ -29,7 +29,7 @@ export class CICSCombinedTaskTree extends TreeItem {
incrementCount: number;
constant: string;

constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) {
constructor(parentPlex: CICSPlexTree, public iconPath = getIconOpen(false)) {
super("All Tasks", TreeItemCollapsibleState.Collapsed);
this.contextValue = `cicscombinedtasktree.`;
this.parentPlex = parentPlex;
Expand Down Expand Up @@ -87,11 +87,11 @@ export class CICSCombinedTaskTree extends TreeItem {
count = parseInt(recordsCount);
}
this.addTasksUtil([], allTasks, count);
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
} else {
this.children = [];
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
window.showInformationMessage(`No tasks found`);
this.label = `All Tasks${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${recordsCount}]`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { CICSTransactionTreeItem } from "../treeItems/CICSTransactionTreeItem";
import { toEscapedCriteriaString } from "../../utils/filterUtils";
import { CICSRegionsContainer } from "../CICSRegionsContainer";
import { TextTreeItem } from "../treeItems/utils/TextTreeItem";
import { getIconPathInResources } from "../../utils/profileUtils";
import { getIconOpen } from "../../utils/profileUtils";

export class CICSCombinedTransactionsTree extends TreeItem {
children: (CICSTransactionTreeItem | ViewMore)[] | [TextTreeItem] | null;
Expand All @@ -30,7 +30,7 @@ export class CICSCombinedTransactionsTree extends TreeItem {
incrementCount: number;
constant: string;

constructor(parentPlex: CICSPlexTree, public iconPath = getIconPathInResources("folder-closed-dark.svg", "folder-closed-light.svg")) {
constructor(parentPlex: CICSPlexTree, public iconPath = getIconOpen(false)) {
super("All Local Transactions", TreeItemCollapsibleState.Collapsed);
this.contextValue = `cicscombinedtransactiontree.`;
this.parentPlex = parentPlex;
Expand Down Expand Up @@ -88,11 +88,11 @@ export class CICSCombinedTransactionsTree extends TreeItem {
count = parseInt(recordsCount);
}
this.addLocalTransactionsUtil([], allLocalTransactions, count);
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
} else {
this.children = [];
this.iconPath = getIconPathInResources("folder-open-dark.svg", "folder-open-light.svg");
this.iconPath = getIconOpen(true);
tree._onDidChangeTreeData.fire(undefined);
window.showInformationMessage(`No local transactions found`);
this.label = `All Local Transactions${this.activeFilter ? ` (${this.activeFilter}) ` : " "}[${recordsCount}]`;
Expand Down
Loading

0 comments on commit 82041af

Please sign in to comment.