Skip to content

Commit

Permalink
feat: add refresh to the WU context menu
Browse files Browse the repository at this point in the history
Signed-off-by: David de Hilster <[email protected]>
  • Loading branch information
dehilsterlexis committed Feb 28, 2024
1 parent bd3f656 commit 47c8ba8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@
"title": "%Front%"
},
{
"command": "hpccPlatform.refresh",
"command": "hpccPlatform.userRefresh",
"category": "ECL",
"title": "%Refresh%",
"description": "%Refresh Tree%",
Expand Down Expand Up @@ -949,7 +949,7 @@
"group": "navigation@20"
},
{
"command": "hpccPlatform.refresh",
"command": "hpccPlatform.userRefresh",
"when": "view == hpccPlatform",
"group": "navigation@40"
},
Expand Down Expand Up @@ -1060,6 +1060,11 @@
"submenu": "setPriority",
"group": "5action@900"
},
{
"when": "view == hpccPlatform && viewItem =~ /ECLWUNode/",
"command": "hpccPlatform.userRefresh",
"group": "6action@900"
},
{
"command": "hpccResources.bundles.homepage",
"when": "view == hpccResources.bundles && viewItem =~ /^BundlesItem/",
Expand Down
8 changes: 8 additions & 0 deletions src/ecl/eclWatchTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export class ECLWatchTree extends Tree {
this.refresh();
});

vscode.commands.registerCommand("hpccPlatform.userRefresh", () => {
this.userRefresh();
});

vscode.commands.registerCommand("hpccPlatform.refresh", (element?: Item) => {
this.refresh(element);
});
Expand Down Expand Up @@ -182,6 +186,10 @@ export class ECLWatchTree extends Tree {
vscode.commands.executeCommand("setContext", "hpccPlatform.isAllWorkunits", !this._myWorkunits);
}

userRefresh(): void {
this.refresh();
}

refresh(element?: Item): void {
this.updateMenu();
super.refresh(element);
Expand Down

0 comments on commit 47c8ba8

Please sign in to comment.